Compare commits

..

318 Commits

Author SHA1 Message Date
rdubois
318b2e55cd TDI-22354 fixed: replace the poi-3.8-20120326.jar by poi-3.8-20120913_modified_talend.jar
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@90673 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-09-13 11:11:13 +00:00
wliu
6952d67b63 Fix Bug TDI-21748 : revert the code to the previous version before the modification by jyhu
https://jira.talendforge.org/browse/TDI-21748

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@90661 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-09-13 10:21:18 +00:00
rdubois
fe7d5fb1b2 TDI-22738 & TDI-22805 fixed
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@90612 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-09-12 13:06:44 +00:00
ycbai
67b8734846 bug TDI-22766 fixed : Job cannot run again after update the rule which used in job
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@90583 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-09-12 07:29:04 +00:00
rdubois
24d9dc57d9 TDI-22738 fixed: Upgrade from Hive 0.8.1 to 0.9
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@90337 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-09-07 15:08:53 +00:00
rdubois
8973fe3d80 TDI-22738 fixed: Upgrade from Hive 0.8.1 to 0.9
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@90336 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-09-07 15:07:16 +00:00
rdubois
3382845dea merge r84645 from trunk to branch 5.1
TDI-21332 fixed: set a hive property in the code to fix the UGI context issue


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@90333 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-09-07 13:46:31 +00:00
jzhao
34780e383a Fix Bug TDI-22583: Unexpect result of tNormalize
https://jira.talendforge.org/browse/TDI-22583

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@90329 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-09-07 11:21:45 +00:00
wwang
56ccdc3a1d fix Bug TDI-22354 : add the cid
https://jira.talendforge.org/browse/TDI-22354

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@90328 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-09-07 10:23:53 +00:00
wwang
771b22c5ea fix Bug TDI-22354 : tFileInputExcel is not able to handle Date format "yyyy-MM-ddTHH:mm:ss" in Talend v5.1.1
https://jira.talendforge.org/browse/TDI-22354

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@90326 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-09-07 10:13:46 +00:00
jjzhou
8c2c8378c7 fix Bug TDI-22555:tPostgresqlOutputBuk and tPostgresqlOutputBukExec don't handle TEXT_ENCLOSURE
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@90317 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-09-07 07:25:25 +00:00
jzhao
0b16e773b0 Fix Bug TDI-22285 : Slowly Changing Dimensions (SCDs) & Source Keys that are NULL
https://jira.talendforge.org/browse/TDI-22285
Note: Remove unused code

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@90314 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-09-07 06:27:17 +00:00
bchen
909ee24e6a Fix Bug TDI-22088 : tMap NPE using multiple lookup with the "All rows" option
https://jira.talendforge.org/browse/TDI-22088

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@90311 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-09-07 03:44:10 +00:00
jzhao
d492dc9019 Fix Bug TDI-22285: Slowly Changing Dimensions (SCDs) & Source Keys that are NULL
https://jira.talendforge.org/browse/TDI-22285

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@90310 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-09-07 02:58:38 +00:00
scorreia
3a6a2134c3 i18n: synchronize Babili strings exported on 2012-09-06-14-23-32
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@90304 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-09-06 12:33:03 +00:00
wwang
2b9fa412a8 fix Bug TDI-22361 : Locked file throws NPE if using CSV options
https://jira.talendforge.org/browse/TDI-22361

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@90292 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-09-06 09:24:26 +00:00
wwang
7f63c512a0 fix Bug TDI-22150 : tMysqlOutputBulk treats backslashes in data wrong
https://jira.talendforge.org/browse/TDI-22150

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@90282 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-09-06 07:16:45 +00:00
wchen
1858912816 bug TDI-21950 fixed: Lots of columns crashes Studio
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@90278 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-09-06 06:39:07 +00:00
hwang
d994a62da3 merge r90270 from trunk to branch 5.1
TDI-22709:Could not save job after export items


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@90271 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-09-06 06:11:27 +00:00
cli
91d5f5dd10 USV-29: add the property for exchange.
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@90268 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-09-06 05:19:32 +00:00
nrousseau
6026d4693f merge r90266 from trunk to branch 5.1
USV-40 : Changed to make most of the actions more general and not only for jobs / joblets.


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@90267 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-09-06 04:33:45 +00:00
hwang
ca74b8305a merge r90264 from trunk to branch 5.1
TDI-22709:Could not save job after export items


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@90265 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-09-06 03:46:18 +00:00
wwang
072ab2d624 fix Bug TDI-22503 : merge to branch5.1
https://jira.talendforge.org/browse/TDI-22503

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@90262 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-09-06 03:03:12 +00:00
hcyi
60941241c1 bug TDI-20594 fixed : Everytime drag&drop File positional to a job, it will pop up a Confirm dialog .
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@90260 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-09-06 02:06:56 +00:00
sgandon
e63e207d0e merge r90257 from trunk to branch 5.1
Fix New Feature USV-32 : Remove context-menu for top level nodes 
https://jira.talendforge.org/browse/USV-32
updated all tis action provider so that they have an id.


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@90259 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-09-05 16:07:33 +00:00
ycbai
a8f6e80b77 bug TDI-22661 fixed : Undo the action which you did, NPE error
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@90225 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-09-05 09:46:38 +00:00
hcyi
162a04721e bug TDI-22665 fixed : the output link of tELTGreenPlumInput doesn't work anymore .
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@90199 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-09-05 03:37:50 +00:00
hcyi
96e72e81dd bug TDI-22671 fixed : Sandbox project creation allow to select "perl" in generation language .
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@90117 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-09-04 09:15:03 +00:00
hwang
f84b11f054 merge r90009 from trunk to branch 5.1
TDI-22620:Compare joblet_exception thrown when compare same name joblet between main and reference project or between trunk and branch project


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@90094 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-09-04 08:47:55 +00:00
hcyi
cbcada0dd4 bug TDI-22649 fixed : When joblet changed,"Update Detection",there is an error .
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@90079 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-09-04 07:34:54 +00:00
fwang
e88d0bef06 bug TDI-21747 fixed:Business model:assignment:r-click the service in assignment list, many function lost
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@90072 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-09-04 07:24:40 +00:00
ycbai
b9b33711c4 bug TDI-22661 fixed : Undo the action which you did, NPE error
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@90067 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-09-04 06:45:39 +00:00
ilazebny
a541b3867e Update version in poms to 5.1.2
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@90038 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-09-03 11:46:02 +00:00
ilazebny
f51ab4a86c Update version in poms to 5.1.2-SNAPSHOT
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@90030 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-09-03 11:14:13 +00:00
plv
fb3bb857af bug TDI-22296:tMap_duplicate error message display when there is no output schema for tMap component
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@90025 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-09-03 10:11:39 +00:00
hcyi
bc66ed653b merge r89975 from trunk to branch 5.1
bug TDI-22550 fixed : Remain compile error in old job which has been delete . 


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89986 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-09-03 06:43:27 +00:00
jyhu
ba469d89aa Fix Bug TDI-22498 : error when executing sybase IQ store proc whith 4.2.3 +patch 17.07.20(revert to last version)
https://jira.talendforge.org/browse/TDI-22498 


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89932 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-31 09:45:00 +00:00
jyhu
0c9b357307 Fix Bug TDI-22498 : error when executing sybase IQ store proc whith 4.2.3 +patch 17.07.20
https://jira.talendforge.org/browse/TDI-22498 

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89912 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-31 06:11:44 +00:00
fwang
b8ad95763f bug TDI-22516 fixed:Can't save the order when I change the element order in tFileOutputMSXML
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89893 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-31 01:50:21 +00:00
jjzhou
c9d2c70b29 fix Bug TDI-22211:org.courtine can't be resolved
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89879 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-30 10:32:47 +00:00
wchen
b5be75e74d merge r88848 from trunk to branch 5.1
bug  TDI-21871 fixed : tXMLMap doesn't allow to set multiple nodes with the same name = unable to use xsi derived complex types


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89861 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-30 08:18:31 +00:00
nrousseau
f67dc9439c merge r89835 from trunk to branch 5.1
Fix Bug TDI-22608 : Create a job should not ask for logs 
https://jira.talendforge.org/browse/TDI-22608


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89838 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-30 05:45:05 +00:00
wchen
1340a5149f merge r89828 from trunk to branch 5.1
bug TDI-21950 fixed :Lots of columns crashes Studio


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89831 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-30 04:59:21 +00:00
jyhu
966e665563 Fix Bug TDI-22498 : error when executing sybase IQ store proc whith 4.2.3 +patch 17.07.20
https://jira.talendforge.org/browse/TDI-22498 

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89821 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-30 03:20:29 +00:00
plv
d069fb6d48 bug TDI-20511:when compare jobs with tParallelize component, it will show difference even if the jobs are same
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89819 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-30 03:17:43 +00:00
nrousseau
d117428729 merge r89803 from trunk to branch 5.1
TDI-22602 : fix problem when no selection done when create another version


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89805 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-29 10:51:27 +00:00
hcyi
7d3cf48ee0 merge r89765 from trunk to branch 5.1
bug TDI-22550 fixed : Remain compile error in old job which has been delete .


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89766 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-29 01:44:17 +00:00
jjzhou
37644bd3a7 fix Bug TDI-22281:Related to Bug http://www.talendforge.org/bugs/view.php?id=18916
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89744 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-28 05:26:05 +00:00
hcyi
61eb0a6e24 merge r89737 from trunk to branch 5.1
bug TDI-22098 fixed : Incorrect compilation error mark on job .


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89738 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-28 03:33:01 +00:00
zwzhao
a7797b6a56 bug TDI-21814 fixed : the exported job file doesn't contain *.screenshot file
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89708 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-27 09:45:40 +00:00
fwang
44d4ff2836 bug TDI-22516 fixed:Can't save the order when I change the element order in tFileOutputMSXML
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89701 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-27 08:59:04 +00:00
hwang
6abe61d003 merge r89692 from trunk to branch 5.1
TDI-22350:For 503 file transfer from one svn to another, reopen the new project ,anaysis lose items.


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89694 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-27 08:34:17 +00:00
jyhu
f3ba4b9e1f fix Bug TDI-21875 : When using the Vertica Output component with the copy method and the batch option turned on, the component always fails as soon as the second batch begins
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89687 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-27 07:50:31 +00:00
fwang
55d0c8cf7a bug TDI-22493 fixed:Business model:assignment:update the name of assignment items, switch to BM component, cannt detect the update
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89638 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-24 07:20:46 +00:00
wchen
5d6a9da6c1 merge r89621 from trunk to branch 5.1
bug   TDI-22335 fixed Deactivating subjob stops at already deactivated component


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89628 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-24 05:58:28 +00:00
hwang
27e4d6887a merge r89626 from trunk to branch 5.1
TDI-22496:Error show in error log when move the components of the joblet in job


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89627 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-24 05:54:52 +00:00
jjzhou
8baae08e1a fix Bug TDI-22445:tMDMBulkLoad throws NPE when has empty input
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89600 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-23 10:25:17 +00:00
nrousseau
025ae75cfe TDI-22369: fix family for Data_Quality
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89575 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-23 08:21:33 +00:00
plv
96372ee9c8 bug TDI-20511:when compare jobs with tParallelize component, it will show difference even if the jobs are same
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89574 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-23 08:20:22 +00:00
hwang
adf63b4581 merge r89560 from trunk to branch 5.1
TDI-22079:Need to review the display of the background of joblets


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89564 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-23 07:10:03 +00:00
wchen
7d16e466ca bug TDI-22430 fixed: Duplicate the name of "Column"
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89552 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-23 06:27:23 +00:00
nrousseau
0b0e47f90e merge r89545 from trunk to branch 5.1
bug TDI-22196: re-enable the import to specified folder.


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89546 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-23 04:48:41 +00:00
zwzhao
3fa1b64557 bug TDI-6568 fixed : tSetGlovarVar and tFlowToIterate : the outline view doesnt refresh when a variable is added into those components
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89515 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-22 10:39:38 +00:00
hwang
4ff9121327 merge r89510 from trunk to branch 5.1
TDI-21879:Collapse joblets before saving job


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89511 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-22 10:11:12 +00:00
hwang
8b22997e89 merge r89488 from trunk to branch 5.1
TDI-22295:DI and ESB :Function menu mixed 


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89494 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-22 07:16:45 +00:00
wchen
27f079de90 bug TDI-22383 TDI-22407 fixed : tRowGenerator function select and display problems
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89493 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-22 07:12:53 +00:00
nrousseau
dff41d0ca1 merge r89424 from trunk to branch 5.1
Fix Bug TDI-19255 : Opening old version of job and create new version opens latest version instead 
https://jira.talendforge.org/browse/TDI-19255


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89438 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-21 09:45:39 +00:00
ldong
3bf6c024a9 bug TDI-20584 fixed:backport this issue on 511.
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89422 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-21 09:01:50 +00:00
zwzhao
dda51a6c4d bug TDI-22114 fixed : Error message should be displayed if the tns file is not valid
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89416 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-21 08:11:56 +00:00
hwang
ba700675dc TDI-21917:Expanding/collapsing non-linear joblet
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89382 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-21 01:59:09 +00:00
hwang
ac24c606b2 TDI-21879:Collapse joblets before saving job
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89381 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-21 01:48:57 +00:00
wchen
92f0d904e0 merge r89350 from trunk to branch 5.1
bug  TDI-20155 fixed :Fail to use tRules in a job


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89351 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-20 06:51:58 +00:00
wchen
5580c4f746 merge r89319 from trunk to branch 5.1
bug   TDI-22335 fixed Deactivating subjob stops at already deactivated component


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89321 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-20 02:02:44 +00:00
nrousseau
5dc9434446 merge r89308 from trunk to branch 5.1
Fix Bug TDI-22435 : preview file connection get error 
https://jira.talendforge.org/browse/TDI-22435


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89309 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-20 00:58:49 +00:00
plv
d327510dbb bug TDI-22305:Function name of schema changed after import from xml file to tRowGenerator
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89281 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-17 07:53:09 +00:00
hcyi
8b1f10b6f0 bug TDI-22413 fixed : Running job fail after export a job which has compile error .
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89277 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-17 05:59:31 +00:00
hwang
1d43d196fa TDI-21939:Make joblet in job red if locked or dirty
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89276 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-17 05:57:07 +00:00
wliu
79f959f6ba Fix Bug TDI-22318 : tHashInput/tHashOutput don't have its own resource
https://jira.talendforge.org/browse/TDI-22318

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89273 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-17 04:29:22 +00:00
wchen
671552768d merge r89241 from trunk to branch 5.1
bug TDI-8282 fixed: Connection properties should not be editable


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89243 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-16 10:19:03 +00:00
plv
6b3db7d520 bug TDI-22305:Function name of schema changed after import from xml file to tRowGenerator
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89233 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-16 08:29:01 +00:00
nrousseau
48d823e701 merge r89218 from trunk to branch 5.1
bug TDI-22250: fix problem of classpath, will reinitialize the classpath when needed, and avoid to rebuild the code if no change required.


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89219 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-16 06:36:22 +00:00
jjzhou
4e331b6435 fix Bug TDI-22398:Can not create context with type "int | Integer" in talend studio during create route in Mediation perspective
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89204 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-15 10:45:33 +00:00
wliu
1c48f80336 fix Bug TDI-21875 : When using the Vertica Output component with the copy method and the batch option turned on, the component always fails as soon as the second batch begins
https://jira.talendforge.org/browse/TDI-21875

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89198 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-15 10:19:22 +00:00
plv
f9a2fec665 bug TDI-21402:Database connection in job will failed if use the connection in joblet
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89185 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-15 09:13:34 +00:00
bchen
b307495787 Fix Bug TDI-22104 : SAP connection still use sapjco2.jar when sapjco3.jar configured in joblet that causes compile error
http://jira.talendforge.org/browse/TDI-22104
merge r89168 into branch5.1

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89169 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-15 07:39:01 +00:00
nrousseau
fc18cd9826 merge r89159 from trunk to branch 5.1
bug TDI-22340: if value was null, there was no error message.


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89162 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-15 06:53:40 +00:00
wchen
bfa79a2c7d merge r89154 from trunk to branch 5.1
bug TDI-22389 fixed:Get wrong export file when export job to type 'Petals ESB' with a new name


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89156 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-15 06:44:34 +00:00
fwang
3fe6b7072f bug TDI-22379 fixed:Version management:Business model:Assign a job to BM,can not detect the dependencies
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89150 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-15 06:26:14 +00:00
zwzhao
3fc8772d98 bug TDI-22198 fixed : Read-only job:Change Property Type:Job turn to dirty
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89137 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-15 02:22:51 +00:00
wliu
4b4fe8254c fix Bug TDI-21875 : When using the Vertica Output component with the copy method and the batch option turned on, the component always fails as soon as the second batch begins
https://jira.talendforge.org/browse/TDI-21875

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89134 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-15 02:13:59 +00:00
rdubois
4a274ce551 merge r89118 from trunk to branch 5.1
TDI-22368 fixed: Get the correct metadata table in the tUnite


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89122 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-14 12:07:41 +00:00
wliu
67e7c1e360 fix Bug TDI-21875 : When using the Vertica Output component with the copy method and the batch option turned on, the component always fails as soon as the second batch begins
https://jira.talendforge.org/browse/TDI-21875

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89120 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-14 11:52:12 +00:00
jjzhou
11c0b50642 fix Bug TDI-22283:revert code to last vestion.
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89101 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-14 09:16:32 +00:00
hcyi
dc7f98170f bug TDI-22087 fixed : in txmlmap editor main connector had setting and expression icon ,but when click it,it no use .
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89099 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-14 08:54:09 +00:00
jjzhou
c2e19faf31 fix Bug TDI-22367:investigate to replace "slf4j-api-1.5.8.jar" with "slf4j-api-1.6.1.jar" with Bonita 5.6.1
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89093 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-14 08:00:38 +00:00
nrousseau
14fa9b9ab4 merge r89082 from trunk to branch 5.1
bug TDI-22372: fix problem with previous commit


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89088 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-14 07:21:08 +00:00
mzhao
20ade70c18 merge r89069 from trunk to branch 5.1
TDQ-4275 Reoganize TDQ component family.


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89081 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-14 06:33:14 +00:00
nrousseau
8f47ca06bf merge r89064 from trunk to branch 5.1
bug TDI-22262: fix problem of display of error mark


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89066 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-14 04:10:20 +00:00
nrousseau
89af574ae3 merge r89059 from trunk to branch 5.1
bug TDI-22369: fix wrong family name


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89060 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-14 03:11:03 +00:00
nrousseau
04868f33dd merge r89055 from trunk to branch 5.1
bug TDI-22372: avoid any warning if the module name is not with any extension.


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89056 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-14 02:04:35 +00:00
plv
476a47f6d7 bug TDI-21402:Database connection in job will failed if use the connection in joblet
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@89021 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-13 09:17:38 +00:00
wchen
12d5738edb merge r88996 from trunk to branch 5.1
bug TDI-8282 fixed: Connection properties should not be editable


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88998 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-13 08:08:21 +00:00
jjzhou
b37dcdad6d fix Bug TDI-22283:Path having backslash not handled, escaping not handled
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88989 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-13 05:35:49 +00:00
fwang
791bb97f68 bug TDI-21904 fixed:Context: Add to repository context doesn't show existing context group
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88974 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-13 02:01:31 +00:00
plv
837e018058 bug TDI-8512 fixed:Job description does not word wrap in Job tab
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88952 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-10 09:18:52 +00:00
rdubois
5477fb511b merge r88939 from trunk to branch 5.1
Add a missing message in the tSystem properies


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88940 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-10 09:02:42 +00:00
fwang
a1676262b1 bug TDI-22292 fixed:D-click the blank area of a component, NPE error
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88918 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-10 05:58:50 +00:00
wchen
1e97bfebd7 merge r88909 from trunk to branch 5.1
bug  TDI-20705 fixed :Filter link in txmlmap is not correct 


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88910 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-10 03:35:56 +00:00
fwang
6cdca170c1 bug TDI-22052 fixed:Wrong confirmation after import as local
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88895 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-10 01:23:31 +00:00
hwang
ce7ea8f587 TDI-21917:Expanding/collapsing non-linear joblet
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88869 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-09 08:52:37 +00:00
hcyi
998a94ef86 merge r88865 from trunk to branch 5.1
bug TDI-22179 fixed : Apply button do not work in tMap for many cases .


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88866 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-09 08:24:43 +00:00
jjzhou
57133af940 fix Bug TDI-15344: Duplicate and unnecessary code generated by tReplace
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88840 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-09 03:31:51 +00:00
fwang
346699c965 bug TDI-21904 fixed:Context: Add to repository context doesn't show existing context group
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88833 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-09 03:19:56 +00:00
jjzhou
179bc4ca41 fix Bug TDI-15344: Duplicate and unnecessary code generated by tReplace
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88805 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-08 09:10:48 +00:00
hwang
51a7845fe4 TDI-21940:Do not allow joblet to be edited in job if joblet is dirty
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88796 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-08 07:41:06 +00:00
hwang
c2c9f9c0c1 TDI-22001:Exanded joblets not read-only
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88793 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-08 07:24:31 +00:00
wwang
ba32f5ba0f fix Bug TDI-22266: merge to branch5.1
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88787 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-08 06:31:27 +00:00
jjzhou
c9e6815ea0 fix Bug TDI-15344: Duplicate and unnecessary code generated by tReplace
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88783 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-08 05:50:35 +00:00
zwzhao
481ee969fc bug TDI-19103 fixed : When importing job and canceling in the middle the created workspace dir is not deleted.
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88780 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-08 05:42:29 +00:00
hcyi
62ff41ca2c merge r88770 from trunk to branch 5.1
bug TDI-22146 fixed : Warning/error icon popups still empty .


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88772 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-08 04:02:34 +00:00
ldong
5db0dddacf bug TDI-22055 fixed:Copybook wizard - rename schema doesn't refresh to job.
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88751 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-07 09:45:40 +00:00
plv
f406122851 bug TDI-6754 fixed:Moving of flow names not undone properly
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88744 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-07 09:23:36 +00:00
zwzhao
d70fddc07d bug TDI-22256 fixed : Switch from designer->code->jobscript, name of component disappear
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88735 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-07 09:07:38 +00:00
fwang
1bd12dde38 bug TDI-22052 fixed:Wrong confirmation after import as local
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88732 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-07 08:53:06 +00:00
hwang
9390a6f16e TDI-22216:joblet nodeFigure hide CollapseFigure
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88730 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-07 08:04:58 +00:00
jjzhou
c3e59b7662 fix Bug TDI-22156: Job does not compile with backslash in tFilterRow conditions
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88716 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-07 06:15:34 +00:00
wchen
0dc20c334f merge r88701 from trunk to branch 5.1
bug TDI-20155 fixed:Fail to use tRules in a job


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88709 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-07 05:52:07 +00:00
zwzhao
a41fbfbe58 bug TDI-6977 fixed : progress bar is full when import is not finished during import of project from login dialog box
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88670 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-06 09:17:44 +00:00
fwang
d141c1f29c bug TDI-8476 fixed:Dynamic settings view displays in Camel components
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88666 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-06 08:51:52 +00:00
plv
54e632c861 bug TDI-21402:Database connection in job will failed if use the connection in joblet
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88663 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-06 08:49:33 +00:00
zwzhao
af7043807b bug TDI-21154 fixed : Export Job:Export job with folder , drop down list of "Context scripts" is empty
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88657 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-06 07:51:43 +00:00
bchen
8ef5277bfb Fix Bug TDI-22104 : SAP connection still use sapjco2.jar when sapjco3.jar configured in joblet that causes compile error
http://jira.talendforge.org/browse/TDI-22104
merge r88632 into branch5.1

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88639 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-06 05:41:01 +00:00
zwzhao
a76cb33d21 bug TDI-22198 fixed : Read-only job:Change Property Type:Job turn to dirty
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88637 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-06 05:38:54 +00:00
fwang
04a2084555 bug TDI-20206 fixed:Can't copy all the components and the links when expand the joblet
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88635 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-06 05:20:16 +00:00
sgandon
b277e6dd13 merge r88554 from trunk to branch 5.1
Repo View Action items now have the Id set in the extension points.
This help remove them if necessary.
Example use for repo has been updated.


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88616 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-03 14:58:18 +00:00
wchen
9aa7d8d28f merge r88596 from trunk to branch 5.1
bug  TDI-8507 fixed: Setting element status via project settings -> status management does not affect filters


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88597 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-03 09:42:32 +00:00
hwang
629f23b5ef TDI-22216:joblet nodeFigure hide CollapseFigure
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88591 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-03 09:12:12 +00:00
wliu
cc5c5bbd22 Fix Bug TDI-19575 : Problems related with escape character in the component tMysqlOutputBulkExec
http://jira.talendforge.org/browse/TDI-19575

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88562 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-03 02:29:44 +00:00
plv
956cb457be bug TDI-8512 fixed:Job description does not word wrap in Job tab
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88538 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-02 10:05:22 +00:00
zwzhao
cbf14e35a0 bug TDI-7993 fixed : "Modification" label not fully displayed on Job tab
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88531 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-02 09:52:50 +00:00
zwzhao
2f7d35f24c bug TDI-5510 fixed : Missing translations
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88518 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-02 09:15:41 +00:00
plv
0731a48ecb bug TDI-21880 fixed:Auto Generated doc of job/joblet:if import a new job/joblet, this function not work
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88515 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-02 09:06:15 +00:00
zwzhao
a57259815e bug TDI-7161 fixed : Variable in component view not update after update the corresponding metedata
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88498 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-02 07:45:50 +00:00
fwang
2d32eef25f bug TDI-8443 fixed:Can not create techincal status with more than three letters..
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88476 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-02 03:06:19 +00:00
plv
3f534c2ece bug TDI-21880 fixed:Auto Generated doc of job/joblet:if import a new job/joblet, this function not work
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88472 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-02 02:20:41 +00:00
zwzhao
4eda2aef8e bug TDI-7993 fixed : "Modification" label not fully displayed on Job tab
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88469 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-02 02:09:53 +00:00
wchen
c6d4fdb890 merge r88436 from trunk to branch 5.1
bug  TDI-8338 fixed: Changing lookup globalMap Keys does not dirty tMap


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88439 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-01 10:09:01 +00:00
plv
6b254e23ad bug TDI-21880 fixed:Auto Generated doc of job/joblet:if import a new job/joblet, this function not work
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88437 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-01 10:05:42 +00:00
fwang
13b418de87 bug TDI-8601 fixed:Clear button does not delete job execution information
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88433 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-01 09:54:29 +00:00
jzhao
fba08078fe Fix Backlog Task TDI-22173: tOleDbRow with reject but can't catch reject.
http://jira.talendforge.org/browse/TDI-22173

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88415 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-01 07:59:37 +00:00
fwang
7f9b93f650 bug TDI-18078 fixed:The action "Manage Dependencies"/"Detecte Dependencies" shouldn't display on Job, SQL template, Business Model, Routines, etc.
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88410 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-01 07:42:55 +00:00
zwzhao
86729d7ea6 bug TDI-22115 fixed : if want to a guess schema and some jars are missing, a dialog should tell the user directly
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88405 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-01 07:33:25 +00:00
jzhao
27169ab3e3 Fix Bug TDI-21822: Catch rejects from tJDBCRow without inputRow
http://jira.talendforge.org/browse/TDI-21822

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88397 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-01 06:29:28 +00:00
jjzhou
de6f004ab7 fix Bug TDI-21775: bug by naming a column "commonByteArray" in schemas
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88379 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-08-01 01:52:19 +00:00
jzhao
cdfda37cc4 TDI-21809: tFileInputXML doesn't handle UNC path correctly
http://jira.talendforge.org/browse/TDI-21809

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88360 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-31 10:35:57 +00:00
ycbai
55896a35bc bug TDI-22125 fixed : Unable to edit routine dependencies : NPE in error log
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88352 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-31 09:21:52 +00:00
zwzhao
1aeda8fd97 bug TDI-22114 fixed : Error message should be displayed if the tns file is not valid
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88334 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-31 06:56:58 +00:00
mwang
477ce66633 For bug TDI-21898
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88327 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-31 06:29:10 +00:00
zwzhao
69b410a73c bug TDI-22121 fixed : need backport on 5.1
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88320 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-31 03:16:54 +00:00
jyhu
b46fffad4b fix bug TDI-21946 : Unable to get RecordSet of MySQL database with tDBSQLRow
http://jira.talendforge.org/browse/TDI-21946 

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88293 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-30 10:46:03 +00:00
hwang
a1a0b8c53c TDI-22058:Could not get the parameter value when we add an new row on the table for the first time
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88289 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-30 10:18:02 +00:00
fwang
84e8d16f61 bug TDI-8265 fixed:Unable to view test schema in read-only mode
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88267 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-30 09:12:33 +00:00
wwang
131a060979 fix Bug TDI-21876: merge to branch5.1
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88261 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-30 08:58:10 +00:00
plv
d49fc79aff bug TDI-21880 fixed:Auto Generated doc of job/joblet:if import a new job/joblet, this function not work
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88259 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-30 08:54:32 +00:00
wchen
93c45f90fc merge r88237 from trunk to branch 5.1
bug     TDI-8325 fixed:Disable right-click options


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88242 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-30 07:39:05 +00:00
jzhao
a8f0e499d2 Fix Bug TDI-22059:The code of method tFileInputEBCDIC_1Process(Map<String,Object>) is exceeding the 65535 bytes limit
http://jira.talendforge.org/browse/TDI-22059

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88231 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-30 06:11:50 +00:00
ycbai
a9b59e25bf bug TDQ-5900 fixed : When Get Patterns ETL job ,the job can't run after right click the menu "Run job"
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88227 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-30 03:42:56 +00:00
jyhu
824ee2144d fix bug TDI-21730 : Ingers data bulk loading, concurrency issue. (Component:tIngresOutputBulkExec)
http://jira.talendforge.org/browse/TDI-21730 

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88164 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-27 05:54:51 +00:00
hwang
ef1a9bc0c9 TDI-21808 :Could not save as a new version of joblet
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88154 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-27 03:24:08 +00:00
hwang
71fc8e661b TDI-22079:Need to review the display of the background of joblets
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88103 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-26 04:15:45 +00:00
plv
0527978183 TDI-22086:Import item into tis V5.2NB-88009,but I can't find the job in the workspace
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88089 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-26 01:42:09 +00:00
fwang
ecb6131c67 bug TDI-22040 fixed:Check box table column in read-only mode can still be edited
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88056 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-25 07:07:45 +00:00
rdubois
b790f27629 Update dome hadoop components documentation
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88052 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-25 06:25:51 +00:00
fwang
ac46e57615 bug TDI-21604 fixed:tAggregareRow_the layout is not good of set Column Default Value.
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88027 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-25 02:35:24 +00:00
fwang
1e52d915a6 bug TDI-21027 fixed:Component Creation: Missing a scrollbar in the creation Wizzard
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@88018 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-25 01:53:01 +00:00
mwang
d0be52e8f3 For bug TDI-21244.
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@87991 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-24 10:01:31 +00:00
plv
dcdc6f9de1 bug TDI-21880 fixed:Auto Generated doc of job/joblet:if import a new job/joblet, this function not work
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@87969 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-24 08:03:44 +00:00
jyhu
ae58ffb1db fix bug TDI-21975 : tCombinedSQLAggregate - Input/Output Column in Group By
http://jira.talendforge.org/browse/TDI-21975 

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@87960 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-24 06:27:28 +00:00
fwang
3c9597ef56 bug TDI-21027 fixed:Component Creation: Missing a scrollbar in the creation Wizzard
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@87927 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-23 10:00:49 +00:00
fwang
4fbd95a69e bug TDI-21835 fixed:Prompt to lock subjob in a reference project after opening in read only
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@87919 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-23 08:54:50 +00:00
zwzhao
a667abd7d3 bug TDI-21701 fixed : Unable to use repository XML schema populated from customer WSDL. Error "Import from repository fail, please check your repository connection" returned.
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@87916 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-23 08:51:30 +00:00
jjzhou
124ccf6d08 fix Bug TDI-21877: NullPointerException when selecting NTEXT fields from MSSql database connection
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@87901 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-23 07:39:58 +00:00
nrousseau
cb8e9dc1c5 merge r87821 from trunk to branch 5.1
[TDI-21993] Fixed: [cMessagingEndpoint]The code can not be generated when using amqp Camel component


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@87847 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-20 10:38:33 +00:00
jyhu
a7d84f6631 fix bug TDI-21875 : When using the Vertica Output component with the copy method and the batch option turned on, the component always fails as soon as the second batch begins
http://jira.talendforge.org/browse/TDI-21875 

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@87829 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-20 06:58:53 +00:00
jzhao
9c2cc27fed Fix Bug TDI-21606:Method exceeding 65535 bytes limit while using tFileInputDelimited and tFileOutputMSXML
http://jira.talendforge.org/browse/TDI-21606

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@87812 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-20 03:44:08 +00:00
jjzhou
de68301f94 fix Bug TDI-21765: EBCDIC component ecoding for Cp1141
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@87786 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-19 10:23:17 +00:00
jzhao
f6265f728c Fix Bug TDI-21606:Method exceeding 65535 bytes limit while using tFileInputDelimited and tFileOutputMSXML
http://jira.talendforge.org/browse/TDI-21606

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@87779 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-19 09:16:30 +00:00
plv
c05245c97d bug TDI-21926:When 'Generate Doc as HTML' the path is exist,it should give a dialog to show if overwrite it.
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@87775 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-19 08:46:41 +00:00
plv
c4ab265d5e bug TDI-21815:When 'Generate Doc as HTML' the path is not the present job path ,and dropdown list is empty .
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@87774 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-19 08:42:57 +00:00
plv
8d1fb2b5e9 bug TDI-21402:Database connection in job will failed if use the connection in joblet
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@87768 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-19 08:24:30 +00:00
ldong
f487848efa bug TDI-21997 fixed:ESB SE Studio failed to started on version 87721.
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@87761 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-19 08:12:26 +00:00
rdubois
7dfd9eb5f2 merge r87719 from trunk to branch 5.1
TDI-21974 fixed: format hexadecimal md5 code


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@87721 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-18 16:12:11 +00:00
rdubois
8bc6cb3514 merge r87713 from branch 5.0 to branch 5.1
TDI-21912: The detail of the error is interesting even if the job doesn't die.


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@87714 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-18 13:09:48 +00:00
rdubois
88bb955b12 merge r87710 from branch 5.0 to branch 5.1
TDI-21912: The detail of the error is interesting even if the job doesn't die.


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@87711 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-18 12:55:37 +00:00
jyhu
88bb63dbec fix bug TDI-21912 : The tTeradataOutput component doesn't detect errors
http://jira.talendforge.org/browse/TDI-21912 

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@87703 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-18 10:21:04 +00:00
jyhu
9451097465 fix bug TDI-21912 : The tTeradataOutput component doesn't detect errors
http://jira.talendforge.org/browse/TDI-21912 

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@87679 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-18 07:54:24 +00:00
ldong
85203d3488 bug TDI-12901 fixed:Increase size of project drop-down in login dialog.
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@87656 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-18 05:38:46 +00:00
wliu
33ca3cd4c6 Fix Bug TDI-21912 : The tTeradataOutput component doesn't detect errors
http://jira.talendforge.org/browse/TDI-21912

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@87635 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-18 02:16:07 +00:00
mwang
b042706b78 For bug TDI-21918
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@87575 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-17 06:08:13 +00:00
nrousseau
d5023ee2d0 merge r87363 from trunk to branch 5.1
Fix Backlog Task TDI-21869 : transfer value of PARALLELIZE_KEEP_EMPTY to tAsyncIn/Out components 
http://jira.talendforge.org/browse/TDI-21869


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@87558 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-17 04:10:22 +00:00
wliu
425f8c74e3 fix Bug TDI-21571 : Exception handling
http://jira.talendforge.org/browse/TDI-21571

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@87551 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-17 03:13:36 +00:00
bchen
eed50f4acc Fix Bug TDI-21708 : tDb2Output with parallel exceution enable cannot insert null value in db
http://jira.talendforge.org/browse/TDI-21708
modify migration task to set "PARALLELIZE_KEEP_EMPTY" with true for old job.
merge r87527 into branch5.1

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@87528 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-16 10:22:15 +00:00
jyhu
8070f0337c Fix Bug TDI-21816 : missing a not(!) for all the tELT***Output components.
http://jira.talendforge.org/browse/TDI-21816 

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@87488 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-16 06:17:24 +00:00
jyhu
be7cc36fe1 Fix Bug TDI-21782 : Null Pointer Exception with dynamic data type and empty table of Oracle component.
http://jira.talendforge.org/browse/TDI-21782 

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@87471 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-16 03:29:51 +00:00
fwang
091b43aa8c bug TDI-17359 fixed:tRowGenerator might remove some parenthesis
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@87463 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-16 02:42:50 +00:00
mwang
b2be8f45e1 for bug TDI-21546
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@87385 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-13 06:48:30 +00:00
fwang
67084b33f1 bug TDI-21027 fixed:Component Creation: Missing a scrollbar in the creation Wizzard
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@87358 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-13 02:39:54 +00:00
bchen
431d2295f1 Fix Bug TDI-21708 : tDb2Output with parallel exceution enable cannot insert null value in db
http://jira.talendforge.org/browse/TDI-21708
add migration task to set "PARALLELIZE_KEEP_EMPTY" with true for old job.
merge r87305 into branch5.1

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@87322 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-12 09:55:09 +00:00
nrousseau
664cbda6f5 merge r87286 from trunk to branch 5.1
Bug TDI-20521 : enhance previous fix, fix in fact the point 1 of the bug TDI-8308


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@87291 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-12 07:58:17 +00:00
jjzhou
946d99935b fix Bug TDI-21765: EBCDIC component ecoding for Cp1141
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@87260 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-12 03:33:58 +00:00
hcyi
c3f231717c merge r87253 from trunk to branch 5.1
bug TDI-21601 fixed :  The wizard of tFileOutputMSXML can't display the columns of schema .


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@87256 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-12 03:17:56 +00:00
nrousseau
984496b2cd merge r87240 from trunk to branch 5.1
Fix Bug TDI-21776 : Wrong accents 
http://jira.talendforge.org/browse/TDI-21776


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@87242 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-12 02:22:29 +00:00
fwang
23a374ee96 bug TDI-21719 fixed:Create routine from top menu, NPE error
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@87237 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-12 01:58:08 +00:00
jyhu
f7ca748efc Fix Bug TDI-21748 : Display of String truncation option in tSchemaComplianceCheck.
http://jira.talendforge.org/browse/TDI-21748

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@87209 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-11 10:56:40 +00:00
ldong
6c28e8797d bug TDI-21733 fixed:Joblet:swith from designer to code tab, NPE error.
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@87195 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-11 09:13:45 +00:00
hcyi
e391ce6f04 merge r87178 from trunk to branch 5.1
bug TDI-21313 fixed : Job will be modified just when select a tFileOutputDelimited with CSV mode .


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@87181 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-11 08:30:57 +00:00
nrousseau
88e2fd5f88 merge r87149 from trunk to branch 5.1
bug TDI-20521: change the size of the NodeContainer, this avoids to have a too big invisible figure which hide the button from expand/collapse.


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@87150 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-11 06:18:37 +00:00
fwang
720a0a9166 bug TDI-20207 fixed:user should be not able to copy joblet to itself
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@87093 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-10 07:02:25 +00:00
wwang
ebd07a17bf fix Bug TDI-7865: merge to branch5.1
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@87038 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-09 09:05:18 +00:00
nrousseau
2bc92157ec bug TDI-21754: simply force a reload of the item if this one is unloaded when export
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@87027 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-09 08:05:29 +00:00
wwang
654a2165cf fix Bug TDI-21715: merge to branch5.1
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@87010 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-09 05:26:01 +00:00
jyhu
9e830d4a4c Fix Bug TDI-21748 : Display of String truncation option in tSchemaComplianceCheck.
http://jira.talendforge.org/browse/TDI-21748

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@86952 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-06 09:46:28 +00:00
wchen
2f506a8564 merge r86899 from trunk to branch 5.1
bug TDI-21668 fixed:Remove User Routine Dependency from Job not working 


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@86905 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-06 05:57:35 +00:00
wliu
016f4d3162 fix Bug TDI-21606:Method exceeding 65535 bytes limit while using tFileInputDelimited and tFileOutputMSXML
http://jira.talendforge.org/browse/TDI-21606

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@86844 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-05 10:37:58 +00:00
zwzhao
438209d786 bug TDI-20110 fixed : Studio shreddered my Rest DataService and persistently prevents repairs
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@86836 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-05 09:51:35 +00:00
ycbai
06b65fa196 bug TDQ-4974 fixed : When Get Patterns ETL job ,the job can't run and the job run button can't be used
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@86819 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-05 08:13:47 +00:00
wliu
0c1f4de4fd fix Bug TDI-21606:Method exceeding 65535 bytes limit while using tFileInputDelimited and tFileOutputMSXML
http://jira.talendforge.org/browse/TDI-21606

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@86811 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-05 07:37:12 +00:00
fwang
7b8b4a4803 bug TDI-15281 fixed:Changes in expression builder lost when tMap closed
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@86797 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-05 05:56:01 +00:00
wchen
5c40e48b57 merge r86775 from trunk to branch 5.1
bug TDI-21411 fixed:the modification in Jobscript panel not effect on the job


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@86776 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-05 02:59:36 +00:00
wliu
09467cbda1 fix workitem TDI-21739 : remove the unnecessary code in tMDMReadConf
http://jira.talendforge.org/browse/TDI-21739

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@86743 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-04 09:38:51 +00:00
wchen
11a1146f02 merge r86696 from trunk to branch 5.1
bug TDI-21623 fixed:Using CTRL+SPACE in tXMLMap expressions does not generate global variables list


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@86701 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-04 03:21:56 +00:00
wchen
903b935a83 merge r86656 from trunk to branch 5.1
bug TDI-21623 fixed: Using CTRL+SPACE in tXMLMap expressions does not generate global variables list


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@86700 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-04 03:16:42 +00:00
ldong
c990d6704a bug TDI-8394 fixed:Error when undo output links order change.
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@86694 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-04 02:35:06 +00:00
ycbai
6d80f9d129 bug TDI-21296 fixed: No error message when selecting all Jobs&Routes and exporting as OSGI bundles
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@86578 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-02 08:17:42 +00:00
jyhu
7a544a1330 Fix Bug TDI-21568 : tPop filter settings doesn't work.
http://jira.talendforge.org/browse/TDI-21568 

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@86561 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-02 04:00:03 +00:00
ldong
3be7686641 bug TDI-13124 fixed:Action not disabled when changing workspace.
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@86558 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-02 03:35:05 +00:00
fwang
274e29ef71 bug TDI-21604 fixed:tAggregareRow_the layout is not good of set Column Default Value.
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@86553 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-07-02 03:07:04 +00:00
bchen
fc643f11e3 Fix Bug TDI-21573 : tFileOutputMSXML cannot work with output of tUnite
http://jira.talendforge.org/browse/TDI-21573
when the last merge component don't have output connections, the prior merge component should be the start component
merge r86502 into branch5.1

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@86513 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-29 09:34:58 +00:00
ycbai
a54c5f2031 bug TDI-20486 fixed: the component is not preconfigured with the chosen rule after drag and drop the validation rules to the component
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@86496 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-29 06:32:38 +00:00
fwang
5e5e9b8357 bug TDI-21604 fixed:tAggregareRow_the layout is not good of set Column Default Value.
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@86494 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-29 06:24:25 +00:00
ldong
9a8fc1d90b bug TDI-13124 fixed:Action not disabled when changing workspace.
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@86481 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-29 03:27:35 +00:00
wchen
fe38139f9c merge r86382 from trunk to branch 5.1
bug TDI-21499 fixed: tXMLMap : drag & drop is possible but has no effect


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@86387 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-27 09:46:03 +00:00
wchen
73a808043b merge r86367 from trunk to branch 5.1
bug TDI-21499 fixed: tXMLMap : drag & drop is possible but has no effect


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@86384 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-27 09:41:42 +00:00
jjzhou
fba4b0e14d fix Bug TDI-21520: a bug with the EBCDIC datatype PIC S9
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@86378 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-27 09:12:03 +00:00
wchen
89583c76b6 merge r86329 from trunk to branch 5.1
bug TDI-20299 fixed:tXMLMap: Replacing inbound schema does not purge outbound map links leads to Errors although schema and map are ok


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@86331 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-26 09:10:21 +00:00
zwzhao
2c92949a89 bug TDI-21413 fixed : tELTOracleMap : incorrect enclosing occurs when a column name contains other column name in generated sql
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@86325 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-26 08:45:57 +00:00
ldong
4bba82799f bug TDI-21525 fixed:backport on 5.1.
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@86292 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-26 02:49:03 +00:00
wchen
b675bbfe69 merge r86235 from trunk to branch 5.1
bug TDI-20733 fixed:Postgres ELT and ETL components act differently


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@86236 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-25 05:48:32 +00:00
jjzhou
c03bc2546c fix Bug TDI-21347: It's a feature , revert code to last version.
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@86130 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-21 06:51:24 +00:00
jjzhou
6e9f84e0a1 fix Bug TDI-21578: Delete function in tLADAPOutput not working
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@86125 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-21 06:16:50 +00:00
rdubois
7e79551faf merge r85605 from trunk to branch 5.1
Fix for TDI-20023


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@86085 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-20 12:58:08 +00:00
rdubois
0becd5225e merge r86075 from branch 5.0 to branch 5.1
TDI-21420 fixed: change the default value for METHODNAME parameter


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@86077 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-20 12:07:28 +00:00
hwang
cc79fb20b8 TDI-21464:Export Petals ESB:Export successfully but with many error logs
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@86044 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-20 08:45:15 +00:00
jzhao
5534b3c0df Fix Bug TDI-21370: tfileoutputexcel component loses format cells in append mode
http://jira.talendforge.org/browse/TDI-21370
Note:1.Use default column style when cell is null but keep cell format
     2.Remove needless blank row when append empty sheet.

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@86020 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-20 06:51:14 +00:00
hcyi
aa001743a4 merge r85939 from trunk to branch 5.1
bug TDI-6803 fixed : tFileInputMSDelimited did not fetch separator "\\" . 


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@85941 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-19 09:58:27 +00:00
bchen
3bf83faa59 Fix Bug TDI-21516 : Bad rejected inner join on linked output
http://jira.talendforge.org/browse/TDI-21516
merge r85925 into branch5.1

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@85926 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-19 08:51:18 +00:00
dlin
73cf44b806 merge r85887 from trunk to branch 5.1
bug TDI-21062 fixed: tFileInputMSDelimited_no columns display after click "Edit columns" 


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@85905 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-19 06:13:41 +00:00
dlin
0e27da60a8 merge r85896 from trunk to branch 5.1
bug TDI-21072 fixed: tFileInputMSDelimited:error message pop up when check or uncheck "Use multiple separators"


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@85904 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-19 06:10:16 +00:00
wwang
f425577f6c fix Bug TDI-21513: merge to branch5.1
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@85890 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-19 03:27:25 +00:00
wchen
b2a7c8175d merge r85811 from trunk to branch 5.1
bug TDI-21478 fixed:tXMLMap:Deleted ouput,column which belong to output can not be deleted together 


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@85865 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-19 02:09:37 +00:00
hcyi
3d5d5eb52c merge r85766 from trunk to branch 5.1
bug TDI-21324 fixed : Revert the #TDI-19844 fix , Multiple identical XPaths should be possible within tAdvancedFileOutputXML after applying #TDI-19844 . 


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@85790 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-18 08:56:49 +00:00
nrousseau
c122bd6863 merge r85730 from branch 5.0 to branch 5.1
bug TDI-21534 fixed: allow to use greenplum component  as dbmap


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@85731 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-18 02:19:49 +00:00
hcyi
c3cf28ac39 merge r85648 from trunk to branch 5.1
bug TDQ-3684 fixed : Register via Proxy doesn't work .


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@85651 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-15 07:30:25 +00:00
jzhao
8debb7852f Fix Backlog Task TDI-21412:Postgres ELT and ETL components act differently ,need additional work form component team
http://jira.talendforge.org/browse/TDI-21412
Note:Rollback part of the changes

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@85628 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-15 04:04:56 +00:00
dlin
d4e8e0e49c merge r85612 from trunk to branch 5.1
bug TDI-6611 fixed: tFileInputMSDelimited use context variable as file name,dont supply checkbox "Use multiple separators"


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@85615 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-15 03:05:32 +00:00
zwzhao
f5d33f99bf bug TDI-21413 fixed : tELTOracleMap : incorrect enclosing occurs when a column name contains other column name in generated sql
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@85546 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-14 03:28:43 +00:00
jzhao
7dee5ea298 Fix Backlog Task TDI-21412:Postgres ELT and ETL components act differently ,need additional work form component team
http://jira.talendforge.org/browse/TDI-21412

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@85523 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-14 01:58:13 +00:00
jjzhou
8241a44867 fix Bug TDI-21347: Ingres bulk component-tIngresOutputBulkExec. The orginal value spaces ' ' (The value only has spaces) is changed to '' in the result.
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@85472 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-13 08:43:24 +00:00
bchen
337e92b9fe Fix Bug TDI-21381 : Sybase ASE Store procedure with multiple row insert issue
http://jira.talendforge.org/browse/TDI-21381
use execute method when the procedure return resultset
use executeUpadte method when the procedure don't have return value or have out type return value
use executeQuery method when the procedure return resultset and the procedure have multiple select method
merge r85447 into branch5.1

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@85458 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-13 07:42:43 +00:00
zwzhao
3e3d20c775 bug TDI-21444 fixed : context disable after swith between jobscript->code->jobeditor
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@85355 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-12 08:18:03 +00:00
jyhu
a48fe71712 Fix Bug TDI-21422 : tFileUnarchive Does not work with uppercase filenames and password protected files on case sensitive OS .
http://jira.talendforge.org/browse/TDI-21422 

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@85341 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-12 07:39:15 +00:00
wwang
16a06fb61b fix Bug TDI-19355: merge to branch5.1
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@85306 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-12 06:05:54 +00:00
jzhao
778c88e5d1 Fix Bug TDI-21251 : Cannot create advanced xml file with Hive
http://jira.talendforge.org/browse/TDI-21251
Note:1.revert tAdvancedFileOutputXML add try { at the begin part and } finally {...} at the end part.
     2.Catch Exception in tParseRecordSet component.

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@85303 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-12 05:57:41 +00:00
jjzhou
4da509065b fix Bug TDI-20886: tMSSqlInput removes some characters
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@85294 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-12 05:28:21 +00:00
hcyi
af0866d3c7 merge r85278 from trunk to branch 5.1
bug TDI-19883 fixed : Artifacts imported to a SVN controlled project are not committed to SVN and are lost after restart . 


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@85279 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-12 03:47:36 +00:00
sizhaoliu
972204e54c merge r85226 from trunk to branch 5.1
TDQ-5570 fixed: exclude project name part from generated routine for tStandardizeRow


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@85232 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-11 13:17:09 +00:00
zwzhao
5e8adf6be7 bug TDI-21413 fixed : tELTOracleMap : incorrect enclosing occurs when a column name contains other column name in generated sql
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@85161 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-11 07:38:22 +00:00
mwang
472859a371 For bug TDI-21396, just remove the filter and make the "element" can be dragged to "Related Column".
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@85098 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-08 10:02:20 +00:00
bchen
2fe371c609 Fix Bug TDI-21416 : tFlowToIterate & tSoap error
http://jira.talendforge.org/browse/TDI-21416
merge r85093 into branch5.1

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@85096 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-08 09:56:48 +00:00
fwang
d535e09cae merge r85084 from trunk to branch 5.1
bug TDI-21189 fixed:A document can be opened many times in studio. 


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@85090 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-08 09:32:50 +00:00
wwang
b831da367d fix Bug TDI-21341: merge to branch5.1
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@85052 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-08 07:15:20 +00:00
wchen
d144e3ab7b merge r85045 from trunk to branch 5.1
bug  TDI-21411 fixed: the modification in Jobscript panel not effect on the job


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@85046 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-08 06:30:40 +00:00
jjzhou
356d226b28 fix Bug TDI-21323: Problems downloading email from IMAP-Lotus Notes server with tPop
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@85039 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-08 03:21:57 +00:00
rdubois
1565ca19b9 merge r85021 from trunk to branch 5.1
TDI-21435 fixed: add the cid after the isURL variable


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@85022 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-07 14:38:19 +00:00
zwzhao
0945eccf9e bug TDI-7445 fixed : wrong name for the "open another version" dialog box
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@84995 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-07 10:04:58 +00:00
zwzhao
7a68b88b96 bug TDI-7445 fixed : wrong name for the "open another version" dialog box
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@84991 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-07 09:57:29 +00:00
zwzhao
7204185af1 bug TDI-21250 fixed : Even you add new library with Edit routine Libraries, the routine class will lost the dependency when you restart the studio
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@84970 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-07 09:22:58 +00:00
hcyi
ffbc900692 merge r84958 from trunk to branch 5.1
bug TDI-21401 fixed : Same name job/joblet exist in Job Designs/Joblet Designs . 


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@84964 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-07 09:05:00 +00:00
bchen
10ab6ca310 Fix Bug TDI-21381 : Sybase ASE Store procedure with multiple row insert issue
http://jira.talendforge.org/browse/TDI-21381
CallableStatement.executeUpdate instead of execute methods
merge r84948 into branch5.1

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@84962 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-07 09:02:58 +00:00
fwang
4f22cdc3c5 bug TDI-20630 fixed:update repository connection wizard can't launched for project setting
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@84930 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-07 07:36:00 +00:00
ycbai
c4333b8e97 bug TDI-21387 modified: CommandLine exportItems command may produce empty file or no file at all
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@84920 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-07 06:57:15 +00:00
fwang
e2c552e965 bug TDI-20142 fixed:Job are not refreshing Implicit ContextLoad from project settings
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@84896 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-07 03:55:05 +00:00
jzhao
9cb9727798 Fix Bug TDI-20347 : tJasperOutput[Exec] creates only blank page on Linux
http://jira.talendforge.org/browse/TDI-20347

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@84888 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-07 02:43:13 +00:00
jzhao
0a05b20a52 Fix Bug TDI-21251 : Cannot create advanced xml file with Hive
http://jira.talendforge.org/browse/TDI-21251
Note:add try { at the begin part and } finally {...} at the end part.

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@84835 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-06 09:57:31 +00:00
ycbai
12f9ef0cf5 bug TDI-21387 fixed: CommandLine exportItems command may produce empty file or no file at all
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@84806 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-06 07:17:52 +00:00
zwzhao
aefdc66221 bug TDI-7996 fixed : Esc will not close Expression Editor immediately after open
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@84801 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-06 06:59:43 +00:00
fwang
66a8975e48 merge r84367 from trunk to branch 5.1
bug TDI-21232 fixed:error will show when "View documentation" for job or joblet with name "Jobs" or "Joblets" 


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@84796 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-06 06:28:46 +00:00
fwang
0816d975c2 merge r84373 from trunk to branch 5.1
bug TDI-20733 fixed:Postgres ELT and ETL components act differently,but it also needs component team's help 


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@84794 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-06 06:23:46 +00:00
zwzhao
c5e7eae92b bug TDI-7996 fixed : Esc will not close Expression Editor immediately after open
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@84788 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-06 05:57:02 +00:00
hcyi
320c295952 merge r84763 from trunk to branch 5.1
bug TDI-21298 fixed : Different processing order of two tPrejob between studio code and exported code . 


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@84766 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-06 03:26:06 +00:00
jjzhou
e28ef8ef92 fix Bug TDI-20886: tMSSqlInput removes some characters
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@84753 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-06 02:26:14 +00:00
nrousseau
a1fd73eccb merge r84360 from trunk to branch 5.1
bug TDI-21214 fixed: add several optimization


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@84752 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-06 02:17:53 +00:00
jjzhou
bd49b9c4fb fix Bug TDI-20886: tMSSqlInput removes some characters
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@84707 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-05 09:36:22 +00:00
qiongli
842d53771c merge r84586 from trunk to branch 5.1
TDQ-5497 org.eclipse.jface error while opening the job: fixed on trunk
add some judgement for connection before use it(null or not). 


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@84670 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-05 03:50:34 +00:00
jyhu
00f2ca59ef Fix Bug TDI-5796 : General JDBC DB connection.
http://jira.talendforge.org/browse/TDI-5796 

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@84620 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-04 10:17:31 +00:00
jyhu
60a868a56e Fix Bug TDI-20595 : tSetProxy(HTTP) does not work against tFTPConnection(SFTP) .
http://jira.talendforge.org/browse/TDI-20595 

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@84618 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-04 10:15:37 +00:00
hcyi
008cad994c merge r84602 from trunk to branch 5.1
bug TDI-21099 fixed : Undo after autolink doesn't return to original state . 


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@84615 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-04 09:59:20 +00:00
jzhao
83fc90b319 Fix Bug TDI-21180: tHashOutput with KeyManagement=KEEP_FIRST Allows Duplicates
http://jira.talendforge.org/browse/TDI-21180

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@84612 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-04 09:56:19 +00:00
jzhao
fd5671b6cc Fix Bug TDI-20905: tSalesforceOutputBulkExec fails to handle fields with a newline value correctly
http://jira.talendforge.org/browse/TDI-20905

git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@84607 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-04 09:45:34 +00:00
jjzhou
afd3184f20 fix Bug TDI-21323: Problems downloading email from IMAP-Lotus Notes server with tPop
git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@84550 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-04 06:17:24 +00:00
zwzhao
4f05eb9c72 merge r84494 from trunk to branch 5.1
bug TDI-21045 fixed : tMap editor doesn't appear for read-only jobs on Mac


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@84544 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-04 05:43:58 +00:00
hcyi
eeba280121 merge r84520 from trunk to branch 5.1
bug TDI-21099 fixed : Undo after autolink doesn't return to original state . 


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@84521 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-01 10:38:15 +00:00
hcyi
47b22e5da1 merge r84381 from trunk to branch 5.1
bug TDI-21298 fixed : Different processing order of two tPrejob between studio code and exported code . 


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@84472 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-01 08:49:49 +00:00
hcyi
ee8bbe2ff3 merge r84372 from trunk to branch 5.1
bug TDI-21099 fixed : Undo after autolink doesn't return to original state . 


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@84468 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-01 08:43:10 +00:00
hcyi
fad295b2c0 merge r84364 from trunk to branch 5.1
bug TDI-21257 fixed : tSAPOutput : Cannot edit map table after execution . 


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@84464 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-01 08:30:18 +00:00
wchen
52769aca2f merge r84455 from trunk to branch 5.1
bug  TDI-20781 fixed: Joblet code generation problem


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@84460 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-01 08:17:10 +00:00
zwzhao
4b16b2a5e1 merge r84391 from trunk to branch 5.1
bug TDI-21188 fixed : A job unlocked can be edited.


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@84458 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-01 08:00:51 +00:00
zwzhao
544b6acc29 merge r84403 from trunk to branch 5.1
bug TDI-14179 fixed : The old version of jobscript is editable


git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@84450 f6f1c999-d317-4740-80b0-e6d1abc6f99e
2012-06-01 07:39:19 +00:00
5247 changed files with 153449 additions and 244160 deletions

View File

@@ -740,7 +740,7 @@
download-size="0"
install-size="0"
version="0.0.0"
unpack="true"/>
unpack="false"/>
<plugin
id="org.eclipse.jet.core"

View File

@@ -1,13 +0,0 @@
PushToPaletteActionProvider.Error2=Fout
PushToPaletteActionProvider.Error=Fout
NewActionProvider.New=Nieuw
NewActionProvider.NewComponent=Nieuw Component
AbstractXMLConfigPage.Delete=Verwijderen
WizardJetFilesChoosePage.Directory=Directory:
CreateComponentWizard.NewComponent=Nieuw Component
WizardComponentFolderPage.Name=Naam
WizardComponentFolderPage.Perl=Perl
WizardJetFilesChoosePage.UseDefaultIcon=Gebruik default icon
WizardJetFilesChoosePage.ChoseAIcon=Kies een icon
AbstractXMLConfigPage.New=Nieuw
WizardComponentFolderPage.Java=Java

View File

@@ -1,2 +1,3 @@
PushToPaletteActionProvider.Error2=Gre\u0161ka
PushToPaletteActionProvider.Error=Gre\u0161ka
AbstractXMLConfigPage.Delete=DELETE

View File

@@ -1,87 +0,0 @@
FileCopy.ExceptionMSG=\u6E90\u6587\u4EF6"
EditComponentActionProvider.Edit=\u7F16\u8F91\u7EC4\u4EF6
ImportComponentDialog.ErrorMSG4=\u6CA1\u6709\u9009\u62E9\u7EC4\u4EF6\u5BFC\u5165
AbstractXMLConfigPage.TYPETip=%u8CC7%u6599%u578B%u614B.
PushToPaletteActionProvider.Error2=\u9519\u8BEF
CopyFromPaletteActionProvider.Label2=\u4ECEpalette\u5BFC\u5165\u7EC4\u4EF6
AbstractXMLConfigPage.MAXOUTPUTTip=\u6574\u6570\u503C.\u8FDE\u63A5\u6700\u5927\u503C\u8F93\u51FA
ImportComponentDialog.Browser=\u6D4F\u89C8..
ComponentProjectPreferencePage.WarningMSG=\u8B66\u544A,\u8FD9\u79CD\u4FEE\u6539\u4EC5\u4EC5\u5F71\u54CD\u7EC4\u4EF6\u8BBE\u8BA1\u5668\uFF0C\u4E0D\u5F71\u54CDPalette.
AbstractXMLConfigPage.MAXINPUTTip=\u6574\u6570\u503C.\u8FDE\u63A5\u6700\u5927\u503C\u8F93\u5165.
PushToPaletteActionProvider.ErrorMSG2=\u7528\u6237\u7EC4\u4EF6\u6587\u4EF6\u5939\u4E0D\u5B58\u5728\u3002
ComponentProjectManager.CreationProblems=\u95ee\u9898\u521b\u5efa
CopyComponentActionProvider.InputName=\u8F93\u5165\u65B0\u7684\u7EC4\u4EF6\u540D
CreateComponentWizard.SpecifyRes=\u6307\u5B9A\u8D44\u6E90
AbstractXMLConfigPage.REPOSITORYVALUETip=%u9078%u64C7 Metadata %u5132%u85CF%u5EAB.
PushToPaletteActionProvider.ErrorMSG=\u7528\u6237\u7EC4\u4EF6\u6587\u4EF6\u5939\u672A\u8BBE\u7F6E\u3002
AbstractXMLConfigPage.NUMROWTip=\u6574\u6570\u503C.\u6B64\u53C2\u6570\u5217\u4F4D\u7F6E\u5728\u7EC4\u4EF6\u89C6\u56FE
PushToPaletteActionProvider.Error=\u9519\u8BEF
ComponentProjectManager.InternalErrorMsg=\u5185\u90E8\u9519\u8BEF\uFF1A{0}
AbstractXMLConfigPage.IntValue=%u6574%u6578%u503C
ImportComponentDialog.ImportCanceled=\u5BFC\u5165\u7EC4\u4EF6\u5DF2\u53D6\u6D88
PushToPaletteActionProvider.OK=\u786E\u5B9A
WizardJetFilesChoosePage.BeginFile=\u5F00\u59CB\u6587\u4EF6
AbstractXMLConfigPage.COLORTip=RGB\u5341\u516D\u8FDB\u5236.\u4F8B\u5982:"00FF00"
CreateComponentWizard.CreateXMLPerl=\u521B\u5EFAPERL\u7EC4\u4EF6\u7684XML\u914D\u7F6E\u6587\u4EF6
ImportComponentDialog.SelectDirectoryLabel=\u9009\u62E9\u4E00\u4E2A\u8DEF\u5F84\uFF1A
PushToPaletteActionProvider.Information=\u4FE1\u606F
PluginConstant.Borwser=\u6D4F\u89C8..
NewActionProvider.New=\u65b0
AbstractXMLConfigPage.EXTENSIONTip=\u63D2\u4EF6\u540D\u79F0\u5B57\u7B26\u4E32\u503C.\u6B64\u9009\u9879\u7528\u4E8E\u5916\u90E8\u7EC4\u4EF6.
ImportComponentDialog.ShowPaletteComponents=\u663E\u793A\u7EC4\u4EF6\u8C03\u8272\u677F
ComponentProjectPreferencePage.ChooseProject=\u9009\u62E9\u7EC4\u4EF6\u8BBE\u8BA1\u5DE5\u7A0B\u6587\u4EF6\u5939
WizardComponentFolderPage.ErrMSG5=\u7EC4\u4EF6\u65CF\u65E0\u5185\u5BB9
AbstractXMLConfigPage.BooleanTip=Boolean\u503C(\u771F\u6216\u5047).
AbstractXMLConfigPage.Delete=\u5220\u9664
WizardComponentFolderPage.ErrMSG3=\u7EC4\u4EF6\u5DF2\u5B58\u5728
WizardComponentFolderPage.ErrMSG2=\u7EC4\u4EF6\u540D\u4E3A\u7A7A
WizardComponentFolderPage.ErrMSG1=\u6CA1\u6709\u9009\u62E9\u7EC4\u4EF6\u7684\u8BED\u8A00
CreateComponentWizard.FillIn=\u586B\u5199\u7EC4\u4EF6\u5C5E\u6027
ImportComponentDialog.ImportCanceledMSG=\u5DF2\u53D6\u6D88\u4ECEPalette\u4E0A\u5BFC\u5165\u7EC4\u4EF6
ComponentProjectPreferencePage.Warning=\u8B66\u544A
AbstractXMLConfigPage.VERSIONTip=%u8ACB%u7528%u4E00%u500B%u5341%u9032%u4F4D%u6578%u503C%u4F86%u6A19%u8A18%u60A8%u7684%u65B0%u5143%u4EF6%u7248%u672C.
WizardJetFilesChoosePage.Directory=\u76EE\u5F55
WizardComponentFolderPage.Name=\u8fde\u63a5\u540d
RemoveResourceAction.Remove=\u5220\u9664
WizardJetFilesChoosePage.UseIconFrom=\u9009\u62E9\u56FE\u6807\uFF1A
ImportComponentDialog.ImportFinished=\u5BFC\u5165\u7EC4\u4EF6\u5B8C\u6210
AbstractXMLConfigPage.SetProperties=\u8BBE\u7F6E\u9009\u62E9\u5143\u7D20\u5C5E\u6027
ProjectSelectionDialog.ChooseFolder=\u5728\u6B64\u4F1A\u8BDD\u4E2D\u9009\u62E9\u4E00\u4E2A\u5DE5\u7A0B\u6587\u4EF6\u5939
ComponentProjectPreferencePage.ComponentProject=\u7EC4\u4EF6\u5DE5\u7A0B
ImportComponentDialog.ImportFinishedMSG=\u7EC4\u4EF6\u5BFC\u5165\u6210\u529F
AddExternalResourceAction.ErrorTitle=\u5916\u90E8\u6863\u6848\u9519\u8BEF
AbstractXMLConfigPage.MININPUTTip=\u6574\u6570\u503C.\u8FDE\u63A5\u6700\u5C0F\u503C\u8F93\u51FA
WizardJetFilesChoosePage.MainFile=\u4E3B\u6587\u4EF6
CreateComponentWizard.CreateXMLJava=\u521B\u5EFAJava\u7EC4\u4EF6\u7684XML\u914D\u7F6E\u6587\u4EF6
WizardJetFilesChoosePage.UseDefaultIcon=\u4F7F\u7528\u9ED8\u8BA4\u7684\u56FE\u6807
CopyComponentActionProvider.CopyComponent=\u590D\u5236\u8FD9\u4E2A\u7EC4\u4EF6
ImportComponentDialog.ChooseComponentsLabel=\u9009\u62E9\u8981\u5BFC\u5165\u7684\u7EC4\u4EF6\uFF1A
AddExternalResourceAction.ErrorMsg=\u9009\u5B9A\u7684\u5916\u90E8\u6863\u6848\u662F\u4E0D\u53EF\u7528\u6216\u4E0D\u5B58\u5728.
ComponentProjectManager.NewProject=\u65B0\u7EC4\u4EF6\u9879\u76EE
CopyFromPaletteActionProvider.Label=\u4ECEPalette\u590D\u5236\u7EC4\u4EF6
WizardJetFilesChoosePage.ChoseAIcon=\u9009\u62E9\u6309\u94AE
ComponentProjectPreferencePage.SelectPath=\u9009\u62E9\u7EC4\u4EF6\u5DE5\u7A0B\u8DEF\u5F84
AbstractXMLConfigPage.LINESTYLETip=\u6574\u6570\u503C.\u8FDE\u63A5\u7EBF\u98CE\u683C(1: Solid, 2: Dash, 3: Dot, 4: Dashdot)
WizardJetFilesChoosePage.EndFile=\u7ED3\u675F\u6587\u4EF6
PushToPaletteActionProvider.InformationMSG=\u7EC4\u4EF6\u5DF2\u53D1\u5E03\uFF0Cpalette\u5C06\u5237\u65B0\u3002
ProjectSelectionDialog.ComponentProject=\u7EC4\u4EF6\u5DE5\u7A0B
ComponentProjectPreferencePage.ButtonLabel0=\u786E\u5B9A
AbstractXMLConfigPage.New=\u65b0
CopyComponentValidator.ComponentExist=\u6B64\u7EC4\u4EF6\u5DF2\u5B58\u5728
ImportComponentDialog.WarningMSG=\u64CD\u4F5C\u5C06\u8986\u76D6\u5DE5\u4F5C\u533A\u5DF2\u5B58\u5728\u7684\u7EC4\u4EF6\u3002\u60A8\u771F\u7684\u8981\u5BFC\u5165\u5DF2\u9009\u62E9\u7684\u7EC4\u4EF6\u5417\uFF1F
CreateComponentWizard.MainProperties=\u4E3B\u8981\u5C5E\u6027
ComponentProjectManager.WarningMsg=\u5E95\u5C42\u6587\u4EF6\u7CFB\u7EDF\u4E0D\u533A\u5206\u5927\u5C0F\u5199\u3002\u5DF2\u7ECF\u5B58\u5728\u4E00\u4E2A\u9879\u76EE\u4E0E{0}\u51B2\u7A81
WizardComponentFolderPage.Family=\u65cf
PushToPaletteActionProvider.OK3=\u786E\u5B9A
PushToPaletteActionProvider.OK2=\u786E\u5B9A
CopyComponentActionProvider.CopyComponent2=\u590D\u5236\u7EC4\u4EF6
AbstractXMLConfigPage.CTYPETip=\u8FDE\u7ED3\u5668\u7C7B\u578B
AddResourceAction.ChooseResource=&\u9009\u62E9\u6DFB\u52A0jars\u548Czips:
ImportComponentDialog.WarningTitle=\u8B66\u544A
AddExternalResourceAction.AddELibs=\u6DFB\u52A0\u5916\u90E8\u5E93...
ImportComponentDialog.NoComponentsAvailable=\u6CA1\u6709\u53EF\u7528\u7684\u7EC4\u4EF6
AbstractXMLConfigPage.MINOUTPUTTip=\u6574\u6570\u503C\u3002\u8FDE\u63A5\u6700\u5C0F\u503C\u8F93\u51FA
ValidateComponentXMLActionProvider.ok=\u786E\u8BA4
ValidateComponentXMLActionProvider.result=\u9A8C\u8BC1\u7ED3\u679C
ValidateComponentXMLActionProvider.valid=\u7EC4\u4EF6XML\u6587\u4EF6\u5408\u6CD5\uFF01
ValidateComponentXMLActionProvider.validate=\u9A8C\u8BC1\u7EC4\u4EF6XML\u6587\u4EF6

View File

@@ -1,6 +0,0 @@
FileWizard.0=\u6587\u4EF6\u5411\u5BFC
\n
ApplicationActionBarAdvisor.helpMenu=\u5E2E\u52A9(&H)
ApplicationActionBarAdvisor.fileMenu=\u6587\u4EF6(&F)
ShowViewAction.actionLabel=\u663E\u793A\u89C6\u56FE...(&v)
ApplicationActionBarAdvisor.windowMenu=\u7A97\u53E3(&W)

View File

@@ -12,6 +12,10 @@
// ============================================================================
package org.talend.componentdesigner;
import java.io.IOException;
import java.util.Properties;
import org.apache.log4j.PropertyConfigurator;
import org.eclipse.core.resources.IProject;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.widgets.Shell;
@@ -42,10 +46,18 @@ public class ComponentDesigenerPlugin extends AbstractUIPlugin {
*
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
*/
@Override
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
Properties prop = new Properties();
try {
prop.load(ComponentDesigenerPlugin.class.getResourceAsStream("log4j.properties")); //$NON-NLS-1$
} catch (IOException e) {
// e.printStackTrace();
org.talend.componentdesigner.exception.ExceptionHandler.process(e);
}
PropertyConfigurator.configure(prop);
}
/*
@@ -53,7 +65,6 @@ public class ComponentDesigenerPlugin extends AbstractUIPlugin {
*
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
*/
@Override
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);

View File

@@ -0,0 +1,47 @@
### direct log messages to stdout ###
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
### direct messages to file hibernate.log ###
#log4j.appender.file=org.apache.log4j.FileAppender
#log4j.appender.file.File=hibernate.log
#log4j.appender.file.layout=org.apache.log4j.PatternLayout
#log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
### set log levels - for more verbose logging change 'info' to 'debug' ###
log4j.rootLogger=warn, stdout
#log4j.logger.org.hibernate=info
log4j.logger.org.hibernate=debug
### log HQL query parser activity
#log4j.logger.org.hibernate.hql.ast.AST=debug
### log just the SQL
#log4j.logger.org.hibernate.SQL=debug
### log JDBC bind parameters ###
log4j.logger.org.hibernate.type=info
#log4j.logger.org.hibernate.type=debug
### log schema export/update ###
log4j.logger.org.hibernate.tool.hbm2ddl=debug
### log HQL parse trees
#log4j.logger.org.hibernate.hql=debug
### log cache activity ###
#log4j.logger.org.hibernate.cache=debug
### log transaction activity
#log4j.logger.org.hibernate.transaction=debug
### log JDBC resource acquisition
#log4j.logger.org.hibernate.jdbc=debug
### enable the following line if you want to track down connection ###
### leakages when using DriverManagerConnectionProvider ###
#log4j.logger.org.hibernate.connection.DriverManagerConnectionProvider=trace

View File

@@ -39,6 +39,7 @@ public class NewActionProvider extends CommonActionProvider {
private IAction newProjectAction;
@Override
public void init(ICommonActionExtensionSite anExtensionSite) {
if (anExtensionSite.getViewSite() instanceof ICommonViewerWorkbenchSite) {
@@ -49,6 +50,7 @@ public class NewActionProvider extends CommonActionProvider {
/**
* Adds a submenu to the given menu with the name "New Component".
*/
@Override
public void fillContextMenu(IMenuManager menu) {
for (IContributionItem item : menu.getItems()) {
if (item == null || item.getId() == null) {
@@ -82,6 +84,7 @@ public class NewActionProvider extends CommonActionProvider {
/*
* (non-Javadoc) Method declared on IAction.
*/
@Override
public void run() {
CreateComponentWizard wizard = new CreateComponentWizard();
wizard.init(PlatformUI.getWorkbench(), null);

View File

@@ -60,6 +60,7 @@ public class TreeNodeAttrCompsite extends Composite {
nodeText.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
nodeData.getXMLNode().setTextContent(nodeText.getText());
nodeData.setBodayText(nodeText.getText());
@@ -87,6 +88,7 @@ public class TreeNodeAttrCompsite extends Composite {
attrText.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
String attrName = attrLabel.getText().split(MARK)[0];
if (attrText.getText().equals(PluginConstant.EMPTY_STRING)) {
@@ -128,6 +130,7 @@ public class TreeNodeAttrCompsite extends Composite {
attrCombo.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
String attrName = attrLabel.getText().split(MARK)[0];
if (attrCombo.getText().equals(PluginConstant.EMPTY_STRING)) {

View File

@@ -134,6 +134,7 @@ public abstract class AbstractXMLConfigPage extends AbstractComponentPage {
*
* @see org.talend.componentdesigner.ui.wizard.creatcomponent.AbstractComponentPage#initialize()
*/
@Override
protected void initialize() {
availableXmlTree.addSelectionListener(new SelectionAdapter() {
@@ -152,6 +153,7 @@ public abstract class AbstractXMLConfigPage extends AbstractComponentPage {
itemDel.setText(Messages.getString("AbstractXMLConfigPage.Delete")); //$NON-NLS-1$
itemDel.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
TreeNodeData currentNodeData = (TreeNodeData) treeItem[0].getParentItem().getData();
currentNodeData.getXMLNode().removeChild(((TreeNodeData) treeItem[0].getData()).getXMLNode());
@@ -171,6 +173,7 @@ public abstract class AbstractXMLConfigPage extends AbstractComponentPage {
nodeMenuItem.setText(itemName);
nodeMenuItem.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
TreeItem newItem = new TreeItem(treeItem[0], 0);
newItem.setText(itemName);
@@ -226,6 +229,7 @@ public abstract class AbstractXMLConfigPage extends AbstractComponentPage {
*
* @see org.talend.componentdesigner.ui.wizard.creatcomponent.AbstractComponentPage#validatePage()
*/
@Override
protected boolean validatePage() {
return false;
}

View File

@@ -1,3 +0,0 @@
prefs.configuration.LINK_STYLE.AUTO=Automatisch
prefs.configuration.LINK_STYLE.LINE=Lijnen (snel)
prefs.configuration.LINK_STYLE.BEZIER_CURVE=Rondingen

View File

@@ -1,3 +0,0 @@
prefs.configuration.LINK_STYLE.AUTO=\u81EA\u52A8
prefs.configuration.title=\u8fd0\u884c\u6b65\u9aa4\u914d\u7f6e
prefs.configuration.LINK_STYLE=\u9ED8\u8BA4\u94FE\u63A5\u663E\u793A\u4E3A\uFF1A

View File

@@ -12,9 +12,6 @@
// ============================================================================
package org.talend.designer.abstractmap;
import java.util.HashMap;
import java.util.Map;
import org.apache.oro.text.regex.MalformedPatternException;
import org.apache.oro.text.regex.Pattern;
import org.apache.oro.text.regex.PatternCompiler;
@@ -112,34 +109,21 @@ public abstract class AbstractMapComponent extends AbstractExternalNode {
hasOrRenameData(oldName, newName, true);
}
private static Map<String, Pattern> patternsCache = new HashMap<String, Pattern>();
protected final Pattern getRenamePattern(String oldName) {
if (patternsCache.containsKey(oldName)) {
return patternsCache.get(oldName);
}
PatternCompiler compiler = new Perl5Compiler();
Pattern pattern = null;
try {
pattern = compiler.compile("\\b(" + UpdateContextVariablesHelper.replaceSpecialChar(oldName) + ")(\\b|\\_)"); //$NON-NLS-1$ //$NON-NLS-2$
patternsCache.put(oldName, pattern);
return pattern;
} catch (MalformedPatternException e) {
ExceptionHandler.process(e);
return null;
}
}
private static Map<String, Perl5Substitution> substitutionsCache = new HashMap<String, Perl5Substitution>();
protected final Perl5Substitution getRenameSubstitution(String newName) {
if (substitutionsCache.containsKey(newName)) {
return substitutionsCache.get(newName);
}
Perl5Substitution ps = new Perl5Substitution(newName + "$2", Perl5Substitution.INTERPOLATE_ALL); //$NON-NLS-1$
substitutionsCache.put(newName, ps);
return ps;
return new Perl5Substitution(newName + "$2", Perl5Substitution.INTERPOLATE_ALL); //$NON-NLS-1$
}
/**

View File

@@ -1,5 +0,0 @@
AlfrescoModelDialog.modelTable.title=Titel
AlfrescoOutputManager.schemaError.title=Fout in schema
AlfrescoModelDialog.add=Toevoegen
AlfrescoModelDialog.removeModelFailed=Fout bij verwijderen model
AlfrescoModelDialog.modelTable.name=Naam

View File

@@ -1,20 +0,0 @@
AlfrescoModelDialog.missingAspectDefinitions.msg=\u6240\u9009\u62E9\u7684\u65B9\u9762\u6D89\u53CA\u672A\u77E5\u7684Alfresco\u65B9\u9762: ${0}.\u8BF7\u63D0\u4F9Balfresco \u6A21\u578B\u6587\u4EF6\u5B9A\u4E49\u4ED6\u4EEC.
AlfrescoModelDialog.modelTable.title=\u6807\u9898
AlfrescoModelDialog.availableAspects=\u53EF\u7528\u56E0\u7D20
AlfrescoModelDialog.missingAspectDefinitions.title=\u7F3A\u7701\u65B9\u9762\u5B9A\u4E49
AlfrescoOutputManager.schemaError.title=schema\u9519\u8BEF
AlfrescoModelDialog.missingTypeDefinitions.msg=\u6240\u9009\u62E9\u7684\u7C7B\u578B\u6D89\u53CA\u672A\u77E5\u7684Alfresco\u7C7B\u578B\u6216\u65B9\u9762: ${0}.\uFF0C\u8BF7\u63D0\u4F9Balfresco \u6A21\u578B\u6587\u4EF6\u5B9A\u4E49\u4ED6\u4EEC.
AlfrescoModelDialog.missingTypeDefinitions.title=\u7F3A\u7701\u7C7B\u578B\u5B9A\u4E49
AlfrescoModelDialog.add=\u6DFB\u52A0...
AlfrescoOutputModelManager.errorReadingModel=\u8BFB\u53D6Alfresco\u7684\u6A21\u578B\u6587\u4EF6\u9519\u8BEF
AlfrescoModelDialog.aspects=\u65B9\u9762
AlfrescoOutputManager.schemaError.msg=\u8BF7\u5148\u540C\u6B65schema
AlfrescoOutputModelManager.alreadyAdded=\u8BE5\u6A21\u578B\u5DF2\u6DFB\u52A0
AlfrescoModelDialog.removeModelFailed=\u79FB\u9664\u6A21\u578B\u5931\u8D25
AlfrescoOutputModelManager.prefixConflict=\u65E0\u6CD5\u6DFB\u52A0\u6A21\u578B\uFF0C\u524D\u7F00\u4E0E\u4EE5\u524D\u6DFB\u52A0\u6A21\u578B\u51B2\u7A81
AlfrescoOutputModelManager.notYetAdded=\u8BE5\u6A21\u578B\u5C1A\u672A\u6DFB\u52A0
AlfrescoModelDialog.type=\u7C7B\u578B
AlfrescoModelDialog.addModelFailed=\u6DFB\u52A0\u6A21\u578B\u5931\u8D25
AlfrescoModelDialog.modelTable.name=\u8fde\u63a5\u540d
AlfrescoModelDialog.remove=\u5220\u9664
AlfrescoOutputManager.failedLoadModel=\u65E0\u6CD5\u52A0\u8F7D\u7684\u7EC4\u4EF6\u5143\u6570\u636E\u6A21\u578B, \u91CD\u65B0\u521D\u59CB\u5316

View File

@@ -1 +0,0 @@
pluginName=\u7EC4\u4EF6\u6A21\u5757

View File

@@ -1,9 +0,0 @@
AssignmentPropertySection.Name=Naam
BusinessPaletteFactory.ActionComment=Nieuwe Aktie
BusinessInitDiagramFileAction.Error=Fout
AssignmentPropertySection.Comment=Opmerking
BusinessPaletteFactory.Data=Data
BusinessPaletteFactory.Ellipse=Elips
BusinessPaletteFactory.Document=Document
BusinessPaletteFactory.Action=Aktie
BusinessPaletteFactory.DocuemntComment=Nieuw Document

View File

@@ -1,80 +0,0 @@
BusinessInitDiagramFileAction.DiagramFile=\u56FE\u8868\u6587\u4EF6
BusinessAbstractParser.ValueOfLongIsExpected=\u503C\u7684\u7C7B\u578B\u5E94\u8BE5\u4E3ALong
BusinessAbstractParser.ValueOfFloatIsExpected=\u503C\u7684\u7C7B\u578B\u5E94\u8BE5\u4E3AFloat
BusinessPaletteFactory.DataComment=\u521B\u5EFA\u65B0\u7684\u6570\u636E
CreateDiagramAction.CreateBusinessModel=\u521B\u5EFA\u4E1A\u52A1\u6A21\u578B
BusinessCreationWizardPage.CreatenewBusinessDiagram=\u521B\u5EFA\u65B0\u7684\u903B\u8F91\u56FE\u3002
BusinessAbstractParser.StringIntegerConvertError=String\u7C7B\u578B\u7684\u503C\u4E0D\u80FD\u8F6C\u6362\u4E3AInteger\u7C7B\u578B
BusinessPaletteFactory.CreateGear=\u521B\u5EFA\u9F7F\u8F6E
SimpleBusinessCreationWizardPage.Title=\u65B0\u7684\u4E1A\u52A1\u6A21\u578B
BusinessNewDiagramFileWizard.CreateNewDiagram=\u521B\u5EFA\u65B0\u7684\u56FE\u8868
BusinessAbstractParser.UnknownLiteral=\u65E0\u6548\u7684\u6587\u5B57
BusinessAbstractParser.StringLongConverError=String\u7C7B\u578B\u7684\u503C\u4E0D\u80FD\u8F6C\u6362\u4E3ALong\u7C7B\u578B
AssignmentPropertySection.DeleteAssignment=\u5220\u9664\u8D4B\u503C
AssignmentPropertySection.Type=\u7C7B\u578B
BusinessModelingAssistantProvider.AvaiableDomainModelElements=\u65E0\u6548\u7684\u57DF\u6A21\u578B\u5143\u7D20
BusinessPaletteFactory.BidirectionalRelationShip=\u53CC\u5411\u5173\u8054
BusinessPaletteFactory.CreateDirectionalRelationShip=\u521B\u5EFA\u65B9\u5411\u5173\u8054
BusinessPaletteFactory.CreateBidirectionalRelationShip=\u521B\u5EFA\u53CC\u5411\u5173\u8054
AssignmentPropertySection.Name=\u540D\u79F0
CreateAssignmentCommand.CannotAssign=\u4E0D\u80FD\u5206\u914D\u3002
BusinessNewDiagramFileWizard.DiagramRootElement=\u56FE\u8868\u6839\u5143\u7D20
BusinessNewDiagramFileWizard.NoDiagramRootElementSelectedError=\u6CA1\u6709\u56FE\u8868\u6839\u5143\u7D20\u88AB\u9009\u4E2D
BusinessVisualIDRegistry.ParseError=\u4E0D\u80FD\u628A\u89C6\u56FE\u7C7B\u578B\u5F53\u4F5CvisialID\u6570\u5B57\u6765\u8F6C\u6362
OpenDiagramAction.EditBusinessModel=\u7F16\u8F91\u4E1A\u52A1\u6A21\u578B
BusinessAbstractParser.ValueOfTypeByteIsExpected=\u503C\u7684\u7C7B\u578B\u5E94\u8BE5\u4E3AByte
BusinessAbstractParser.ValueOfTypeCharacterIsExpected=\u503C\u7684\u7C7B\u578B\u5E94\u8BE5\u4E3ACharacter
BusinessPaletteFactory.ActionComment=\u521B\u5EFA\u65B0\u7684\u52A8\u4F5C
BusinessAbstractParser.ValueOfTypeStringIsExpected=\u503C\u7684\u7C7B\u578B\u5E94\u8BE5\u4E3AString
BusinessInitDiagramFileAction.Error=\u9519\u8BEF
BusinessNewDiagramFileWizard.SelectRootElement=\u9009\u62E9\u56FE\u8868\u6839\u5143\u7D20
RepositoryFactoryProxyLabelProvider.Deleted=\uFF08\u5220\u9664\uFF09
BusinessPaletteFactory.TerminalComment=\u521B\u5EFA\u65B0\u7684\u4E2D\u65AD\u70B9
BusinessAbstractParser.ValueOfShortIsExpected=\u503C\u7684\u7C7B\u578B\u5E94\u8BE5\u4E3AShort
BusinessPaletteFactory.DatabaseComment=\u521B\u5EFA\u65B0\u7684\u6570\u636E\u5E93
AssignmentPropertySection.Comment=\u6CE8\u91CA
SimpleBusinessCreationWizard.NewBusinessModel=\u65B0\u7684\u4E1A\u52A1\u578B
BusinessNewDiagramFileWizard.InvalidDiagramRootElementSelected=\u9009\u4E2D\u4E86\u65E0\u6548\u7684\u56FE\u8868\u6839\u5143\u7D20
BusinessInitDiagramFileAction.IntialNew=\u521D\u59CB\u5316\u65B0\u7684
FindAssignmentAction.FindAssignments=\u67E5\u627E\u5206\u914D\u4EFB\u52A1
RepositoryFactoryProxyLabelProvider.NotFound=\uFF08\u672A\u53D1\u73B0\uFF09
BusinessPaletteFactory.Terminal=\u4E2D\u65AD\u70B9
BusinessAbstractParser.InvalidInputAt=\u65E0\u6548\u7684\u8F93\u5165\u5728
BusinessPaletteFactory.Gear=\u9F7F\u8F6E
BusinessPaletteFactory.InputComment=\u521B\u5EFA\u65B0\u7684\u8F93\u5165
BusinessPaletteFactory.Data=\u6570\u636E
BusinessPaletteFactory.Ellipse=\u692D\u5706
BusinessPaletteFactory.Input=\u8F93\u5165
BusinessPaletteFactory.List=\u5217\u8868
BusinessPaletteFactory.Relationshop=\u5173\u7CFB
BusinessAbstractParser.ValueOfBooleanIsExpected=\u503C\u7684\u7C7B\u578B\u5E94\u8BE5\u4E3ABoolean
BusinessPaletteFactory.decision=\u51B3\u7B56
BusinessPaletteFactory.Document=\u6587\u6863
BusinessModelingAssistantProvider.SelectDomainModelElement=\u9009\u62E9\u57DF\u6A21\u578B\u5143\u7D20
BusinessPaletteFactory.CreateActor=\u521B\u5EFA\u89D2\u8272
BusinessAbstractParser.StringDoubleConvertError=String\u7C7B\u578B\u7684\u503C\u4E0D\u80FD\u8F6C\u6362\u4E3ADoule\u7C7B\u578B
BusinessPaletteFactory.Actor=\u89D2\u8272
EditAction.Edit=\u7F16\u8F91\u5206\u914D\u4EFB\u52A1
BusinessCreationWizardPage.CreateBusinessDiagram=\u521B\u5EFA\u903B\u8F91\u56FE
BusinessPaletteFactory.Database=\u6570\u636E\u6E90
BusinessPaletteFactory.ListComment=\u521B\u5EFA\u65B0\u7684\u5217\u8868
BusinessPaletteFactory.DirectionalRelationShip=\u65B9\u5411\u5173\u8054
BusinessPaletteFactory.Action=\u52A8\u4F5C
BusinessPaletteFactory.RelationshopComment=\u521B\u5EFA\u65B0\u7684\u5173\u7CFB
BusinessInitDiagramFileAction.LoadFaild=\u6A21\u578B\u6587\u4EF6\u88C5\u8F7D\u5931\u8D25
BusinessPaletteFactory.DecisionComment=\u521B\u5EFA\u65B0\u7684\u51B3\u7B56
BusinessAbstractParser.ValueOfDoubleIsExpected=\u503C\u7684\u7C7B\u578B\u5E94\u8BE5\u4E3ADouble
OpenDiagramAction.ReadBusinessModel=\u8BFB\u53D6\u4E1A\u52A1\u6A21\u578B
BusinessInitDiagramFileAction.UnableToLoadResource=\u4E0D\u80FD\u53BB\u88C5\u8F7D\u8D44\u6E90:
BusinessPaletteFactory.CreateEllipse=\u521B\u5EFA\u692D\u5706
BusinessNewDiagramFileWizard.DiagramFile=\u56FE\u8868\u6587\u4EF6
BusinessAbstractParser.StringShortConverError=String\u7C7B\u578B\u7684\u503C\u4E0D\u80FD\u8F6C\u6362\u4E3AShort\u7C7B\u578B
BusinessPaletteFactory.DocuemntComment=\u521B\u5EFA\u65B0\u7684\u6587\u6863
BusinessAbstractParser.ValueOfIntegerIsExpected=\u503C\u7684\u7C7B\u578B\u5E94\u8BE5\u4E3AInteger
BusinessNewDiagramFileWizard.SelectDiagramRootElement=\u9009\u62E9\u56FE\u8868\u6839\u5143\u7D20\uFF1A
BusinessNewDiagramFileWizard.SelectSemanticModelElement=\u9009\u62E9\u8981\u5728\u56FE\u8868\u4E0A\u63CF\u8FF0\u7684\u8BED\u4E49\u6A21\u578B\u5143\u7D20
BusinessAbstractParser.StringFloatConvertError=String\u7C7B\u578B\u7684\u503C\u4E0D\u80FD\u8F6C\u6362\u4E3AFloat\u7C7B\u578B
BusinessAbstractParser.StringValueDoesNotConvertToByteValue=String\u7C7B\u578B\u7684\u503C\u4E0D\u80FD\u8F6C\u6362\u4E3AByte\u7C7B\u578B
BusinessNewDiagramFileWizard.IntialNewEcoreDiagramFile=\u521D\u59CB\u5316\u65B0\u7684Ecore\u56FE\u8868\u6587\u4EF6
BusinessTooltipFigure.assignedMeta={0}\u5206\u914D\u5143\u6570\u636E
DeleteAssignmentAction.DeleteAssignment=\u5220\u9664\u8D4B\u503C

View File

@@ -557,16 +557,5 @@
level="20"
name="ReadDiagramAction"/>
</extension>
<extension
point="org.eclipse.core.expressions.definitions">
<definition
id="isActiveEditorOfBusinessModelEditor">
<not>
<instanceof
value="org.talend.designer.business.model.business.diagram.part.BusinessDiagramEditor">
</instanceof>
</not>
</definition>
</extension>
</plugin>

View File

@@ -82,5 +82,3 @@ RepositoryFactoryProxyLabelProvider.Deleted=\ (Deleted)
AssignmentPropertySection.Type=Type
AssignmentPropertySection.Name=Name
AssignmentPropertySection.Comment=Comment
BusinessDiagramEditor.canNotSaveTitle=Warning
BusinessDiagramEditor.canNotSaveMessage=Business Model is not locked by user, can not save.

View File

@@ -69,7 +69,6 @@ public class OpenDiagramAction extends AContextualAction implements IIntroAction
*
* @see org.eclipse.jface.action.Action#run()
*/
@Override
protected void doRun() {
ISelection selection = getSelectedObject();
if (selection == null) {
@@ -97,11 +96,10 @@ public class OpenDiagramAction extends AContextualAction implements IIntroAction
if (part instanceof BusinessDiagramEditor) {
((BusinessDiagramEditor) part).setLastVersion(true);
}
// TDI-21143 : Studio repository view : remove all refresh call to repo view
// IRepositoryView view = getViewPart();
// if (view != null) {
// view.refresh(repositoryNode);
// }
IRepositoryView view = getViewPart();
if (view != null) {
view.refresh(repositoryNode);
}
}
}
}

View File

@@ -13,25 +13,14 @@
package org.talend.designer.business.diagram.custom.actions;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.part.EditorPart;
import org.osgi.framework.FrameworkUtil;
import org.talend.commons.exception.PersistenceException;
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
import org.talend.commons.ui.runtime.exception.MessageBoxExceptionHandler;
import org.talend.commons.ui.runtime.image.ECoreImage;
import org.talend.commons.ui.runtime.image.ImageProvider;
import org.talend.core.CorePlugin;
@@ -84,8 +73,8 @@ public class SaveAsBusinessModelWizard extends Wizard {
RepositoryNode repositoryNode = repositoryEditorInput.getRepositoryNode();
// see: RepositoryEditorInput.setRepositoryNode(IRepositoryNode repositoryNode)
if (repositoryNode == null) {
repositoryNode = (RepositoryNode) CorePlugin.getDefault().getRepositoryService()
.getRepositoryNode(repositoryEditorInput.getItem().getProperty().getId(), false);
repositoryNode = (RepositoryNode) CorePlugin.getDefault().getRepositoryService().getRepositoryNode(
repositoryEditorInput.getItem().getProperty().getId(), false);
}
IRepositoryService service = DesignerPlugin.getDefault().getRepositoryService();
@@ -131,7 +120,13 @@ public class SaveAsBusinessModelWizard extends Wizard {
isUpdate = isUpdate();
if (isUpdate) {
update();
assginVlaues(oldProperty, property);
repositoryFactory.save(oldBusinessProcessItem);
// assign value
businessProcessItem = oldBusinessProcessItem;
} else {
property.setId(repositoryFactory.getNextId());
@@ -157,34 +152,6 @@ public class SaveAsBusinessModelWizard extends Wizard {
return ok;
}
private void update() {
IWorkspaceRunnable runnable = new IWorkspaceRunnable() {
@Override
public void run(IProgressMonitor monitor) throws CoreException {
try {
assginVlaues(oldProperty, property);
repositoryFactory.save(oldBusinessProcessItem);
// assign value
businessProcessItem = oldBusinessProcessItem;
} catch (PersistenceException pe) {
throw new CoreException(new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(),
"persistance error", pe)); //$NON-NLS-1$
}
}
};
IWorkspace workspace = ResourcesPlugin.getWorkspace();
try {
ISchedulingRule schedulingRule = workspace.getRoot();
// the update the project files need to be done in the workspace runnable to avoid all notification
// of changes before the end of the modifications.
workspace.run(runnable, schedulingRule, IWorkspace.AVOID_UPDATE, null);
} catch (CoreException e) {
MessageBoxExceptionHandler.process(e.getCause());
}
}
public BusinessProcessItem getBusinessProcessItem() {
return this.businessProcessItem;
}

View File

@@ -213,9 +213,9 @@ public abstract class BusinessItemShapeEditPart extends ShapeNodeEditPart {
private BusinessAlignment getAlignment(String alignment) {
BusinessAlignment[] alignments = BusinessAlignment.values();
BusinessAlignment position = null;
for (int i = 0; i < alignments.length; i++) {
if (alignments[i].toString().equalsIgnoreCase(alignment)) {
position = alignments[i];
for (BusinessAlignment alignment2 : alignments) {
if (alignment2.toString().equalsIgnoreCase(alignment)) {
position = alignment2;
return position;
}

View File

@@ -12,7 +12,7 @@ import org.talend.commons.ui.runtime.image.ECoreImage;
import org.talend.commons.ui.runtime.image.ImageProvider;
import org.talend.commons.ui.runtime.image.OverlayImage;
import org.talend.commons.ui.runtime.image.OverlayImage.EPosition;
import org.talend.core.model.metadata.MetadataToolHelper;
import org.talend.core.model.metadata.MetadataTool;
import org.talend.core.model.metadata.builder.connection.MetadataTable;
import org.talend.core.model.metadata.builder.connection.Query;
import org.talend.core.model.metadata.builder.connection.SAPFunctionUnit;
@@ -42,16 +42,15 @@ public class RepositoryFactoryProxyLabelProvider extends AdapterFactoryLabelProv
if (columnIndex == 0) {
IRepositoryViewObject lastVersion = getLastVersion(object);
if (lastVersion == null) {
MetadataTable table = MetadataToolHelper.getMetadataTableFromRepository(assignment.getTalendItem().getId());
MetadataTable table = MetadataTool.getMetadataTableFromRepository(assignment.getTalendItem().getId());
if (table != null) {
return image;
}
Query query = MetadataToolHelper.getQueryFromRepository(assignment.getTalendItem().getId());
Query query = MetadataTool.getQueryFromRepository(assignment.getTalendItem().getId());
if (query != null) {
return image;
}
SAPFunctionUnit function = MetadataToolHelper
.getSAPFunctionFromRepository(assignment.getTalendItem().getId());
SAPFunctionUnit function = MetadataTool.getSAPFunctionFromRepository(assignment.getTalendItem().getId());
if (function != null) {
return image;
}
@@ -98,26 +97,22 @@ public class RepositoryFactoryProxyLabelProvider extends AdapterFactoryLabelProv
try {
if (columnIndex == 0) {
if (lastVersion == null) {
MetadataTable table = MetadataToolHelper.getMetadataTableFromRepository(assignment.getTalendItem().getId());
MetadataTable table = MetadataTool.getMetadataTableFromRepository(assignment.getTalendItem().getId());
if (table != null) {
if (SubItemHelper.isDeleted(table)) {
if (SubItemHelper.isDeleted(table))
columnText += Messages.getString("RepositoryFactoryProxyLabelProvider.Deleted"); //$NON-NLS-1$
}
return columnText;
}
Query query = MetadataToolHelper.getQueryFromRepository(assignment.getTalendItem().getId());
Query query = MetadataTool.getQueryFromRepository(assignment.getTalendItem().getId());
if (query != null) {
if (SubItemHelper.isDeleted(query)) {
if (SubItemHelper.isDeleted(query))
columnText += Messages.getString("RepositoryFactoryProxyLabelProvider.Deleted"); //$NON-NLS-1$
}
return columnText;
}
SAPFunctionUnit function = MetadataToolHelper
.getSAPFunctionFromRepository(assignment.getTalendItem().getId());
SAPFunctionUnit function = MetadataTool.getSAPFunctionFromRepository(assignment.getTalendItem().getId());
if (function != null) {
if (SubItemHelper.isDeleted(function)) {
if (SubItemHelper.isDeleted(function))
columnText += Messages.getString("RepositoryFactoryProxyLabelProvider.Deleted"); //$NON-NLS-1$
}
return columnText;
}
TalendItem item = assignment.getTalendItem();
@@ -156,8 +151,8 @@ public class RepositoryFactoryProxyLabelProvider extends AdapterFactoryLabelProv
if (lastVersion != null) {
String label = lastVersion.getProperty().getLabel();
if (!label.equals(columnText)) {
ChangeTalendItemLabelCommand command = new ChangeTalendItemLabelCommand(
((BusinessAssignment) object).getTalendItem(), label);
ChangeTalendItemLabelCommand command = new ChangeTalendItemLabelCommand(((BusinessAssignment) object)
.getTalendItem(), label);
try {
command.execute(null, null);
} catch (ExecutionException e) {

View File

@@ -31,7 +31,7 @@ import org.talend.commons.ui.runtime.image.ImageUtils.ICON_SIZE;
import org.talend.commons.ui.runtime.image.OverlayImage;
import org.talend.commons.ui.runtime.image.OverlayImage.EPosition;
import org.talend.core.CorePlugin;
import org.talend.core.model.metadata.MetadataToolHelper;
import org.talend.core.model.metadata.MetadataTool;
import org.talend.core.model.metadata.builder.connection.MetadataTable;
import org.talend.core.model.metadata.builder.connection.Query;
import org.talend.core.model.metadata.builder.connection.SAPFunctionUnit;
@@ -117,9 +117,9 @@ public class ElementHelper {
labels.add(label);
} else {
MetadataTable table = MetadataToolHelper.getMetadataTableFromRepository(talendItem.getId());
Query query = MetadataToolHelper.getQueryFromRepository(talendItem.getId());
SAPFunctionUnit function = MetadataToolHelper.getSAPFunctionFromRepository(talendItem.getId());
MetadataTable table = MetadataTool.getMetadataTableFromRepository(talendItem.getId());
Query query = MetadataTool.getQueryFromRepository(talendItem.getId());
SAPFunctionUnit function = MetadataTool.getSAPFunctionFromRepository(talendItem.getId());
if (table != null) {
img = ImageDescriptor.createFromFile(ECoreImage.class,
ECoreImage.METADATA_TABLE_ICON.getPath()).createImage();

View File

@@ -57,7 +57,7 @@ import org.talend.commons.ui.runtime.exception.ExceptionHandler;
import org.talend.commons.ui.swt.actions.ITreeContextualAction;
import org.talend.core.CorePlugin;
import org.talend.core.model.business.BusinessType;
import org.talend.core.model.metadata.MetadataToolHelper;
import org.talend.core.model.metadata.MetadataTool;
import org.talend.core.model.metadata.builder.connection.MetadataTable;
import org.talend.core.model.metadata.builder.connection.SAPFunctionUnit;
import org.talend.core.model.properties.RoutineItem;
@@ -289,7 +289,7 @@ public class BusinessAssignmentComposite extends AbstractTabComposite {
curNode = RepositoryNodeUtilities.getRepositoryNode(lastVersion);
select(viewer, curNode);
} else if (item instanceof TableMetadata) {
MetadataTable table = MetadataToolHelper.getMetadataTableFromRepository(item.getId());
MetadataTable table = MetadataTool.getMetadataTableFromRepository(item.getId());
if (table != null) {
String id = item.getId().split(" - ")[0]; //$NON-NLS-1$
@@ -303,8 +303,8 @@ public class BusinessAssignmentComposite extends AbstractTabComposite {
}
} else if (item instanceof Query) {
org.talend.core.model.metadata.builder.connection.Query query = MetadataToolHelper
.getQueryFromRepository(item.getId());
org.talend.core.model.metadata.builder.connection.Query query = MetadataTool.getQueryFromRepository(item
.getId());
if (query != null) {
String id = item.getId().split(" - ")[0]; //$NON-NLS-1$
IRepositoryView view = getRepositoryView();
@@ -314,7 +314,7 @@ public class BusinessAssignmentComposite extends AbstractTabComposite {
}
} else if (item instanceof SAPFunction) {
SAPFunctionUnit function = MetadataToolHelper.getSAPFunctionFromRepository(item.getId());
SAPFunctionUnit function = MetadataTool.getSAPFunctionFromRepository(item.getId());
if (function != null) {
IRepositoryView view = getRepositoryView();
RepositoryNode node = RepositoryNodeUtilities.getSAPFunctionFromConnection(item.getId());
@@ -454,19 +454,18 @@ public class BusinessAssignmentComposite extends AbstractTabComposite {
return repositoryNode;
}
} else if (item instanceof TableMetadata) {
MetadataTable table = MetadataToolHelper.getMetadataTableFromRepository(item.getId());
MetadataTable table = MetadataTool.getMetadataTableFromRepository(item.getId());
if (table != null) {
return RepositoryNodeUtilities.getMetadataTableFromConnection(item.getId());
}
} else if (item instanceof Query) {
org.talend.core.model.metadata.builder.connection.Query query = MetadataToolHelper.getQueryFromRepository(item
.getId());
org.talend.core.model.metadata.builder.connection.Query query = MetadataTool.getQueryFromRepository(item.getId());
if (query != null) {
return RepositoryNodeUtilities.getQueryFromConnection(item.getId());
}
} else if (item instanceof SAPFunction) {
SAPFunctionUnit function = MetadataToolHelper.getSAPFunctionFromRepository(item.getId());
SAPFunctionUnit function = MetadataTool.getSAPFunctionFromRepository(item.getId());
if (function != null) {
return RepositoryNodeUtilities.getSAPFunctionFromConnection(item.getId());
}

View File

@@ -24,7 +24,6 @@ import org.eclipse.gmf.runtime.diagram.ui.internal.editparts.NoteAttachmentEditP
import org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramGraphicalViewer;
import org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide.document.StorageDiagramDocumentProvider;
import org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide.editor.FileDiagramEditor;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.IEditorInput;
@@ -58,16 +57,13 @@ import org.talend.designer.business.diagram.custom.dnd.BusinessDiagramDropTarget
import org.talend.designer.business.diagram.custom.edit.parts.BaseBusinessItemRelationShipEditPart;
import org.talend.designer.business.diagram.custom.edit.parts.BusinessItemShapeEditPart;
import org.talend.designer.business.diagram.custom.figures.BusinessItemShapeFigure;
import org.talend.designer.business.diagram.i18n.Messages;
import org.talend.designer.business.model.business.diagram.edit.parts.BusinessEditPartFactory;
import org.talend.designer.business.model.business.diagram.edit.parts.BusinessProcessEditPart;
import org.talend.designer.business.model.business.diagram.providers.BusinessDiagramActionProvider;
import org.talend.designer.core.ui.ActiveProcessTracker;
import org.talend.designer.core.ui.views.jobsettings.JobSettingsView;
import org.talend.repository.editor.RepositoryEditorInput;
import org.talend.repository.model.ERepositoryStatus;
import org.talend.repository.model.IProxyRepositoryFactory;
import org.talend.repository.model.IRepositoryService;
import org.talend.repository.model.RepositoryNode;
/**
@@ -175,29 +171,10 @@ public class BusinessDiagramEditor extends FileDiagramEditor implements IGotoMar
@Override
public void doSave(IProgressMonitor progressMonitor) {
super.doSave(progressMonitor);
if (repositoryEditorInput != null) {
BusinessProcessItem businessProcessItem = (BusinessProcessItem) repositoryEditorInput.getItem();
IRepositoryService service = CorePlugin.getDefault().getRepositoryService();
IProxyRepositoryFactory repFactory = service.getProxyRepositoryFactory();
try {
repFactory.updateLockStatus();
// For TDI-23825, if not lock by user try to lock again.
boolean locked = repFactory.getStatus(businessProcessItem) == ERepositoryStatus.LOCK_BY_USER;
if (!locked) {
repFactory.lock(businessProcessItem);
}
} catch (Exception e) {
ExceptionHandler.process(e);
}
ERepositoryStatus status = repFactory.getStatus(businessProcessItem);
if (!status.equals(ERepositoryStatus.LOCK_BY_USER) && !repFactory.getRepositoryContext().isEditableAsReadOnly()) {
MessageDialog.openWarning(getEditorSite().getShell(),
Messages.getString("BusinessDiagramEditor.canNotSaveTitle"), //$NON-NLS-1$
Messages.getString("BusinessDiagramEditor.canNotSaveMessage")); //$NON-NLS-1$
return;
}
super.doSave(progressMonitor);
DiagramResourceManager diagramResourceManager = new DiagramResourceManager();
BusinessProcessItem businessProcessItem = (BusinessProcessItem) repositoryEditorInput.getItem();
diagramResourceManager.updateFromResource(businessProcessItem, repositoryEditorInput.getFile());
// remove the function of sve SVG file because the imported business model can't save SVG file.
// saveSVG(businessProcessItem);

View File

@@ -1,2 +0,0 @@
pluginName=\u7EC4\u4EF6\u6A21\u5757
format=\u683C\u5F0F

View File

@@ -1,5 +0,0 @@
prefs.configuration.LINK_STYLE.AUTO=Automatisch
prefs.configuration.LINK_STYLE.BEZIER_CURVE=Rondingen
prefs.configuration.LINK_STYLE.LINE=Lijnen (snel)
FAMILY.Access=Toegang
FAMILY.Connections=Verbindingen

View File

@@ -1,45 +0,0 @@
CodeGeneratorEmittersPoolFactory.JETEmitters.NoPresent=JETEmitters\u5DE5\u7A0B\u4E0D\u5B58\u5728\uFF0C\u9700\u8981\u91CD\u65B0\u5B8C\u6574\u521D\u59CB\u5316\u3002
CodeGeneratorEmittersPoolFactory.Class.NotFound=\u6A21\u677F\u4F9D\u7136\u5B58\u5728\uFF0C\u4F46\u662F\u7C7B{0}
CodeGeneratorEmittersPoolFactory.PersitentData.Error=\u6301\u4E45\u5316\u6570\u636E\u4E0D\u80FD\u4FDD\u5B58\uFF1A
CodeGeneratorEmittersPoolFactory.initMessage=\u521D\u59CB\u5316\u4EE3\u7801\u751F\u6210\u5F15\u64CE...
EmfEmittersPersistence.CodeGen.DataMissing=\u4EE3\u7801\u751F\u6210\u6570\u636E\u6D41\u5931\uFF0C\u5F00\u59CB\u91CD\u65B0\u751F\u6210\u4EE3\u7801\u3002
CodeGenerator.JET.TimeOut=JET\u521D\u59CB\u5316\u8D85\u65F6\uFF01
generatedcode.copyright.body4=\u4F60\u53EF\u4EE5\u5728\u5728GNU LGPL \u8BB8\u53EF\u8BC1\u4E0B\u652F\u914D\u8FD9\u4E9B\u4EE3\u7801
CodeGenerator.Node.NotFound=\u5728\u5F53\u524D
generatedcode.copyright.body3=\u4F60\u53EF\u4EE5\u5728www.talend.com\u53D1\u73B0\u66F4\u591A\u5173\u4E8ETalend\u4EA7\u54C1\u4FE1\u606F
generatedcode.copyright.body2=/ \u4F5C\u4E1A\u8BBE\u8BA1 (CodeGenerator version {0}).
generatedcode.copyright.body1=\u6E90\u4EE3\u7801\u88AB{0}\u81EA\u52A8\u751F\u6210
JetSkeletonManager.updateProblem=\u5F53\u66F4\u65B0\u6301\u4E45\u6570\u636E\u65F6\u51FA\u73B0\u9519\u8BEF
CodeGeneratorEmittersPoolFactory.codeThread=\u4EE3\u7801\u751F\u6210\u540E\u53F0\u7EBF\u7A0B
CodeGeneratorEmittersPoolFactory.componentCompiled=\u7EC4\u4EF6\u7F16\u8BD1{0}\u6BEB\u79D2
CodeGeneratorEmittersPoolFactory.failCompail=\u7EC4\u4EF6\u7F16\u8BD1\u5931\u8D25: \r\n
CodeGeneratorEmittersPoolFactory.initialException=\u521D\u59CB\u5316\u5F02\u5E38
CodeGeneratorEmittersPoolFactory.jetEmitterInitialException=\u521D\u59CB\u5316JetEmitter\u51FA\u9519
CodeGeneratorService.invalidLanguage1=\u65E0\u6548\u7684\u8BED\u8A00\u7C7B\u578B.
CodeGeneratorService.invalidLanguage2=\u65E0\u6548\u7684\u8BED\u8A00\u7C7B\u578B.
CodeGenInit.addMarkers=\u5DE5\u4F5C\u533A\u4E2D\u6DFB\u52A0\u6807\u8BB0
CodeGenInit.createProject=\u521B\u5EFA{0} \u5DE5\u7A0B
CodeGenInit.deleteProject=\u5220\u9664{0} \u5DE5\u7A0B
CodeGenInit.initTemplate=\u521D\u59CB\u5316\u6A21\u677F
CodeGenInit.removeLink=\u5220\u9664\u94FE\u63A5\u8D44\u6E90
CodeGenInit.saveWorkspace=\u4FDD\u5B58\u5DE5\u4F5C\u533A
DocumentRootImpl.mixed=\ (\u6DF7\u5408:
ComponentsFactory.afterSystemComponent=\u5728\u7CFB\u7EDF\u7EC4\u4EF6
ComponentsLocalProviderService.componentLoadError=\u7EC4\u4EF6\u52A0\u8F7D\u9519\u8BEF
ComponentsLocalProviderService.talendExchangeError=Talend Exchange\u9519\u8BEF
ComponentsPreferencePage.ButtonLabel0=\u786E\u5B9A
ComponentsPreferencePage.configuration.LINK_STYLE=\u9ED8\u8BA4\u94FE\u63A5\u663E\u793A\u4E3A\uFF1A
ComponentsPreferencePage.rowLimit=\u884c\u9650\u5236
ComponentsPreferencePage.WarningTitle=\u8B66\u544A
ComponenttRunJobPreferencePage.label=\u53CC\u51FBtRunJob\u7EC4\u4EF6\u540E\u4E0D\u663E\u793A\u5BF9\u5E94\u7684JOB
ComponenttRunJobPreferencePage.showCorrespondingJob=\u53CC\u51FBtRunJob\u7EC4\u4EF6\u540E\u663E\u793A\u5BF9\u5E94JOB
XsdValidationCacheManager.unableLoadxsd=\u52A0\u8F7Dxsd\u9A8C\u8BC1\u7F13\u5B58\u6587\u4EF6\u5931\u8D25
XsdValidationCacheManager.unableSavexsd=\u4FDD\u5B58xsd\u9A8C\u8BC1\u7F13\u5B58\u6587\u4EF6\u5931\u8D25
prefs.configuration.LINK_STYLE.AUTO=\u81EA\u52A8
FAMILY.Access=Access
FAMILY.Business=\u4E1A\u52A1
FAMILY.Business_Intelligence=\u5546\u4E1A\u667A\u80FD
FAMILY.File=\u6587\u4ef6
FAMILY.Input=\u8F93\u5165
FAMILY.Output=\u6807\u51c6\u8f93\u51fa
FAMILY.System=\u7CFB\u7EDF

View File

@@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src/main/java"/>
<classpathentry kind="output" path="class"/>
</classpath>

View File

@@ -1,28 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.talend.designer.codegen.test</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View File

@@ -1,7 +0,0 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6

View File

@@ -1,8 +0,0 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Test
Bundle-SymbolicName: org.talend.designer.codegen.test
Bundle-Version: 1.0.0.qualifier
Fragment-Host: org.talend.designer.codegen;bundle-version="2.2.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Require-Bundle: org.junit4

View File

@@ -1,4 +0,0 @@
source.. = src/main/java/
output.. = class/
bin.includes = META-INF/,\
.

View File

@@ -1,53 +0,0 @@
// ============================================================================
//
// Copyright (C) 2006-2012 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.designer.codegen.junit;
import java.text.SimpleDateFormat;
import java.util.Date;
import org.junit.Test;
import org.talend.designer.codegen.model.CodeGeneratorEmittersPoolFactory;
/**
* created by nrousseau on Jul 25, 2012 Detailled comment
*
*/
public class JUnitStudioStartup {
private static final long ONE_MINUTE_IN_MILLISEC = 60000;
private static final long INIT_TIMEOUT = ONE_MINUTE_IN_MILLISEC * 10;
private static final long INIT_PAUSE = 100;
private final SimpleDateFormat format = new SimpleDateFormat("yyyy.MM.dd-HH:mm:ss");
@Test
public void test() throws InterruptedException {
System.out.println("|" + format.format(new Date()) + "| Wait for full generation of jet emitters");
long startTimer = System.currentTimeMillis();
long endTimer = startTimer;
while ((!CodeGeneratorEmittersPoolFactory.isInitialized()) && ((endTimer - startTimer) < INIT_TIMEOUT)) {
Thread.sleep(INIT_PAUSE);
endTimer = System.currentTimeMillis();
}
if ((endTimer - startTimer) > INIT_TIMEOUT) {
System.out.println("|" + format.format(new Date())
+ "| Timeout when generate jet emitters (10 minutes), will just continue with standards junits");
} else {
System.out.println("|" + format.format(new Date())
+ "| Jet emitters initialized successfully, will proceed to standards junits");
}
}
}

View File

@@ -6,10 +6,8 @@
org.talend.core.model.process.EConnectionType
org.talend.core.model.process.ElementParameterParser
org.talend.designer.codegen.config.CodeGeneratorArgument
org.talend.core.model.utils.JavaResourcesHelper
java.util.Vector
java.util.List
java.util.Map
"
%>
<%
@@ -17,107 +15,63 @@
Vector v = (Vector) codeGenArgument.getArgument();
IProcess process = (IProcess)v.get(0);
String jobFolderName = JavaResourcesHelper.getJobFolderName(process.getName(), process.getVersion());
String packageName = codeGenArgument.getCurrentProjectName().toLowerCase() + "." + jobFolderName;
boolean stats = codeGenArgument.isStatistics();
%>
}
};
getCamelContexts().get(0).addRoutes(routeBuilder);
}
/**
* create a fully configured CameContext and add into map
* the Registry of it is #TalendRouteRegistry
* @return
* <code>key: <%=process.getName()%>-ctx<code>
* <code>value: DefaultCamelContext<code>
*
*/
public Map<String, CamelContext> getCamelContextMap() {
Map<String,CamelContext> answer = new HashMap<String, CamelContext>();
DefaultCamelContext camelContext = camelContext();
<%
//process cConfig components first
List<? extends INode> camelContextNodes = process.getNodesOfType("cConfig");
for(INode node: camelContextNodes){
%>
<%=ElementParameterParser.getValue(node, "__CODE__")%>
protected void doStop() throws Exception {
super.doStop();
getCamelContexts().get(0).stop();
}
protected org.apache.camel.ProducerTemplate findOrCreateCamelTemplate() {
return getCamelContexts().get(0).createProducerTemplate();
}
protected java.util.Map<String, org.apache.camel.CamelContext> getCamelContextMap() {
java.util.Map<String, org.apache.camel.CamelContext> answer = new java.util.HashMap<String, org.apache.camel.CamelContext>();
org.apache.camel.impl.DefaultCamelContext camelContext;
org.apache.camel.spi.TypeConverterRegistry typeConverterRegistry;
<%
}
%>
TalendRouteRegistry contextRegister = new TalendRouteRegistry(camelContext.getRegistry());
camelContext.setRegistry(contextRegister);
<%
//then process cBeanRegister components
List<? extends INode> beanRegisterNodes = process.getNodesOfType("cBeanRegister");
if(beanRegisterNodes != null && beanRegisterNodes.size()>0){
for(INode node: beanRegisterNodes){
String id = ElementParameterParser.getValue(node, "__ID__");
String isSimple = ElementParameterParser.getValue(node, "__SIMPLE_CONFIG__");
String classQualifiedName = ElementParameterParser.getValue(node, "__CLASS_QUALIFIED_NAME__");
String hasArguments = ElementParameterParser.getValue(node, "__SPECIFY_ARGUMENTS__");
List<Map<String, String>> arguments = (List<Map<String, String>>) ElementParameterParser.getObjectValue(node, "__ARGUMENTS__");
String code = ElementParameterParser.getValue(node, "__CODE__");
if("true".equals(isSimple)){
StringBuilder sb = new StringBuilder();
if("true".equals(hasArguments)){
for(Map<String, String> s: arguments){
if(sb.length() == 0){
sb.append(s.get("VALUE"));
}else{
sb.append(",");
sb.append(s.get("VALUE"));
}
}
}
%>
contextRegister.register(<%=id%>, new <%=classQualifiedName%>(<%=sb.toString()%>));
<%
}else{
%>
{
Object beanInstance = null;
<%=code%>
if(beanInstance != null){
contextRegister.register(<%=id%>, beanInstance);
}
boolean startable = false;
for (INode node : (List< ? extends INode>)process.getGraphicalNodes()) {
Object value = node.getPropertyValue("STARTABLE");
startable = value == null? false:(Boolean)value;
if(startable){
break;
}
<%
}
}
}
//after, process cDataset
List<? extends INode> datasetNodes = process.getNodesOfType("cDataset");
for(INode n: datasetNodes){
String beanID = ElementParameterParser.getValue(n, "__DATASET_NAME__");
String registerNewBean = ElementParameterParser.getValue(n, "__REGISTER_DATASET_BEAN__");
if(!"true".equals(registerNewBean)){
continue;
}
String beanClass = ElementParameterParser.getValue(n, "__BEAN_CLASS__");
List<Map<String, String>> beanArguments = (List<Map<String, String>>) ElementParameterParser.getObjectValue(n, "__BEAN_ARGUMENTS__");
StringBuilder sb = new StringBuilder();
if(beanArguments != null){
for(Map<String,String> map: beanArguments){
if(sb.length() == 0){
sb.append(map.get("VALUE"));
}else{
sb.append(",");
sb.append(map.get("VALUE"));
}
}
}
if (startable) {
%>
contextRegister.register(<%=beanID%>, new <%=beanClass%>(<%=sb.toString()%>));
if (bundleContext != null) {
org.apache.camel.osgi.CamelContextFactory factory = new org.apache.camel.osgi.CamelContextFactory();
factory.setBundleContext(bundleContext);
camelContext = factory.createContext();
bundleContext.registerService(org.apache.camel.CamelContext.class.getName(), camelContext, null);
} else {
camelContext = new org.apache.camel.impl.DefaultCamelContext();
}
<%
} else {
%>
camelContext = new org.apache.camel.impl.DefaultCamelContext();
<%
}
%>
typeConverterRegistry = camelContext.getTypeConverterRegistry();
<%
//cJMSConnectionFactory http://jira.talendforge.org/browse/TESB-4860
List<? extends INode> jmsCFNodes = process.getNodesOfType("cJMSConnectionFactory");
if(jmsCFNodes.size()>0){
%>
javax.jms.ConnectionFactory jmsConnectionFactory = null;
<% }
for(INode node: jmsCFNodes){
//Use transaction http://jira.talendforge.org/browse/TESB-5160 By LiXiaopeng
String useTransaction = ElementParameterParser.getValue(node, "__USE_TRANSACTION__");
@@ -140,8 +94,7 @@
String amqUri = ElementParameterParser.getValue(node, "__AMQ_BROKER_URI__").trim();
%>
{
javax.jms.ConnectionFactory jmsConnectionFactory = new org.apache.activemq.ActiveMQConnectionFactory(<%=amqUri%>);
jmsConnectionFactory = new org.apache.activemq.ActiveMQConnectionFactory(<%=amqUri%>);
<%
String amqPool = ElementParameterParser.getValue(node, "__AMQ_POOL__").trim();
if("true".equals(amqPool)){
@@ -178,7 +131,7 @@
org.apache.activemq.pool.PooledConnectionFactory pooledConnectionFactory_<%=node.getUniqueName()%>
= new org.apache.activemq.pool.PooledConnectionFactory();
pooledConnectionFactory_<%=node.getUniqueName()%>.setConnectionFactory(jmsConnectionFactory);
pooledConnectionFactory_<%=node.getUniqueName()%>.setExpiryTimeout(<%=amq_pool_expiry_timeout%>L);
pooledConnectionFactory_<%=node.getUniqueName()%>.setExpiryTimeout(<%=amq_pool_expiry_timeout%>);
pooledConnectionFactory_<%=node.getUniqueName()%>.setIdleTimeout(<%=amq_pool_idle_timeout%>);
pooledConnectionFactory_<%=node.getUniqueName()%>.setMaxConnections(<%=amq_pool_max_connections%>);
pooledConnectionFactory_<%=node.getUniqueName()%>.setMaximumActive(<%=amq_pool_max_active%>);
@@ -192,9 +145,6 @@
org.apache.camel.component.jms.JmsComponent.jmsComponent<%=transactedMethodStr%>(jmsConnectionFactory));
<%
}
%>
}
<%
}else if("WebSphere MQ".equals(mqType)){
String wmqServer = ElementParameterParser.getValue(node, "__WQM_SEVER__");
String wmqPort = ElementParameterParser.getValue(node, "__WMQ_PORT__");
@@ -220,8 +170,7 @@
}
%>
{
javax.jms.ConnectionFactory jmsConnectionFactory = new com.ibm.mq.jms.MQQueueConnectionFactory();
jmsConnectionFactory = new com.ibm.mq.jms.MQQueueConnectionFactory();
((com.ibm.mq.jms.MQConnectionFactory) jmsConnectionFactory).setHostName(<%=wmqServer%>);
try {
((com.ibm.mq.jms.MQConnectionFactory) jmsConnectionFactory).setPort(<%=wmqPort%>);
@@ -248,22 +197,23 @@
org.apache.camel.component.jms.JmsComponent.jmsComponent<%=transactedMethodStr%>(connectionFactoryAdapter<%=node.getUniqueName()%>));
<%
}
%>
}
<%
}else if("Other".equals(mqType)){
%>
{
javax.jms.ConnectionFactory jmsConnectionFactory;
<%=ElementParameterParser.getValue(node, "__OTHER_CODE__")%>
camelContext.addComponent(<%=name%>,
org.apache.camel.component.jms.JmsComponent.jmsComponent<%=transactedMethodStr%>(jmsConnectionFactory));
}
<%=ElementParameterParser.getValue(node, "__OTHER_CODE__")%>
camelContext.addComponent(<%=name%>,
org.apache.camel.component.jms.JmsComponent.jmsComponent<%=transactedMethodStr%>(jmsConnectionFactory));
<%
}
}
//cConfig
List<? extends INode> camelContextNodes = process.getNodesOfType("cConfig");
for(INode node: camelContextNodes){
%>
<%=ElementParameterParser.getValue(node, "__CODE__")%>
<%
}
//http://jira.talendforge.org/browse/TESB-4087: Change CamelContext name
%>
//using Route name as CamelContext ID
@@ -271,40 +221,36 @@
camelContext.setName("<%=process.getName() + "-ctx"%>");
return answer;
}
/**
* create a simple DefaultCamelContext
* please use #getCamelContextMap() to get a fully configured CamelContext
* @return DefaultCamelContext
*/
public DefaultCamelContext camelContext() {
DefaultCamelContext camelContext;
<%
boolean startable = false;
for (INode node : (List< ? extends INode>)process.getGraphicalNodes()) {
Object value = node.getPropertyValue("STARTABLE");
startable = value == null? false:(Boolean)value;
if(startable){
break;
}
protected org.apache.camel.view.ModelFileGenerator createModelFileGenerator()
throws javax.xml.bind.JAXBException {
return null;
}
}
final CamelImpl camelImplementation = new CamelImpl();
if(start){
stopDelegate = new TalendESBRoute() {
public int runJobInTOS(String[] args) {
return 0;
}
if (startable) {
%>
if (bundleContext != null) {
CamelContextFactory factory = new CamelContextFactory();
factory.setBundleContext(bundleContext);
camelContext = factory.createContext();
bundleContext.registerService(CamelContext.class.getName(), camelContext, null);
} else {
camelContext = new DefaultCamelContext();
}
<%
} else {
%>
camelContext = new DefaultCamelContext();
<%
public String[][] runJob(String[] args) {
return null;
}
%>
return camelContext;
}
public void stop() throws Exception {
camelImplementation.stop();
}
public void shutdown() throws Exception {
camelImplementation.shutdown();
}
};
camelImplementation.enableHangupSupport();
camelImplementation.run();
}
return routeBuilder;
}

View File

@@ -42,21 +42,101 @@
List< ? extends INode> processNodes = (List< ? extends INode>)process.getGeneratingNodes();
%>
return new RouteBuilder() {
public void configure() throws java.lang.Exception {
class CamelImpl extends org.apache.camel.impl.MainSupport {
protected CamelImpl instance;
public CamelImpl() {
try {
postProcessContext();
initRoute();
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* Returns the currently executing main
*
* @return the current running instance
*/
public CamelImpl getInstance() {
return instance;
}
protected void doStart() throws Exception {
super.doStart();
org.apache.camel.management.JmxNotificationEventNotifier notifier = new org.apache.camel.management.JmxNotificationEventNotifier();
notifier.setSource("MyCamel");
notifier.setIgnoreCamelContextEvents(true);
notifier.setIgnoreRouteEvents(true);
notifier.setIgnoreServiceEvents(true);
getCamelContexts().get(0).getManagementStrategy().addEventNotifier(notifier);
java.net.URLClassLoader sysloader = (java.net.URLClassLoader) ClassLoader.getSystemClassLoader();
java.lang.reflect.Method method = java.net.URLClassLoader.class.getDeclaredMethod("addURL", new Class[] { java.net.URL.class });
method.setAccessible(true);
String[] libPaths = new String[] {
<%
for (INode node : processNodes) {
if (node.isActivate()) {
if (node.getComponent().getName().equals("cMessagingEndpoint")) {
List<Map<String, String>> dependencies = (List<Map<String,String>>) ElementParameterParser.getObjectValue(node, "__HOTLIBS__");
for(Map<String, String> dependencie : dependencies){
String librarieJar = dependencie.get("LIBPATH"); %>
"<%=librarieJar %>",
<% }
}
}
}
%>
};
for (String lib : libPaths) {
String separator = System.getProperty("path.separator");
String[] jarFiles = lib.split(separator);
for (String jarFile : jarFiles) {
method.invoke(sysloader, new Object[] { new java.io.File(jarFile).toURL() });
}
}
getCamelContexts().get(0).start();
<% if(stats) { %>
CamelStat runStat = new CamelStat(getCamelContexts().get(0));
runStat.setParams();
runStat.openSocket(true);
runStat.setAllPID(rootPid, fatherPid, pid, jobName);
runStat.startThreadStat(clientHost, portStats);
runStat.updateStatOnJob(RunStat.JOBSTART, "");
MyStatThread statsThread = new MyStatThread(runStat);
statsThread.run();
<% } //if stats %>
}
public void initRoute() throws Exception {
routeBuilder = new org.apache.camel.builder.RouteBuilder() {
public void configure() throws Exception {
<%
for (INode node : processNodes) {
if (node.getComponent().getName().equals("cCXF")) {
IElementParameter param = node.getElementParameter("LABEL");
String cid = node.getUniqueName();
// http://jira.talendforge.org/browse/TESB-5241
/*
* change to use label + unique to make it unique but readable
*/
if(param != null && !"__UNIQUE_NAME__".equals(param.getValue())){
cid = (String)param.getValue()+"_"+cid;
String cid = "";
if (param != null && !"__UNIQUE_NAME__".equals(param.getValue())) {
cid = (String)param.getValue();
} else {
cid = node.getUniqueName();
}
String endpointVar = "endpoint_" + node.getUniqueName();
String endpointVar = "endpoint" + cid;
String uriRef = "uriMap.get(\"" + cid + "\")";
%>
// CXF endpoint for <%=cid%>
@@ -100,7 +180,7 @@
}
//http://jira.talendforge.org/browse/TESB-3850
String formatType = ElementParameterParser.getValue(node, "__DATAFORMAT__");
if ("true".equals(useSAM) && !"RAW".equals(formatType)) {
if ("true".equals(useSAM) && !"MESSAGE".equals(formatType)) {
%>
// Add Service Activity Monitor Service to <%=endpointVar%>
if (eventFeature != null) {

View File

@@ -32,19 +32,9 @@ INode node = (INode) codeGenArgument.getArgument();
List< ? extends IConnection> connsIf = node.getIncomingConnections();
if(connsIf.size()>0) {
if(connsIf.get(0).getLineStyle()==EConnectionType.ROUTE_WHEN) {
INode sourceNode = connsIf.get(0).getSource();
String languageType = connsIf.get(0).getRouteConnectionType();
String condition = connsIf.get(0).getCondition();
String expression = "none".equals(languageType)?condition:languageType+"("+condition+")";
if("cIntercept".equals(sourceNode.getComponent().getName())){
%>
.when(<%=expression%>)
.when().<%=connsIf.get(0).getRouteConnectionType()%>(<%=connsIf.get(0).getCondition()%>)
<%
}else{
%>
.when().<%=expression%>
<%
}
} else if(connsIf.get(0).getLineStyle()==EConnectionType.ROUTE_OTHER) {
%>
.otherwise()

View File

@@ -144,14 +144,9 @@ currentComponent="<%=node.getUniqueName() %>";
if ((codePart.equals(ECodePart.BEGIN))&&(stat)&&connSet.size()>0) {
for(IConnection con:connSet){
%>
if (execStat) {
java.util.concurrent.ConcurrentHashMap<Object, Object> concurrentHashMap_<%=con.getUniqueName() %> = (java.util.concurrent.ConcurrentHashMap) globalMap.get("concurrentHashMap");
concurrentHashMap_<%=con.getUniqueName() %>.putIfAbsent("<%=con.getUniqueName() %>" + iterateLoop,new java.util.concurrent.atomic.AtomicInteger(0));
java.util.concurrent.atomic.AtomicInteger stats_<%=con.getUniqueName() %> = (java.util.concurrent.atomic.AtomicInteger) concurrentHashMap_<%=con.getUniqueName() %>.get("<%=con.getUniqueName() %>" + iterateLoop);
runStat.updateStatOnConnection("<%=con.getUniqueName() %>" + iterateId, stats_<%=con.getUniqueName() %>.incrementAndGet()<=1?0:1, 0);
}
if(execStat){
runStat.updateStatOnConnection("<%=con.getUniqueName() %>"+iterateId,0, 0);
}
<% }
}

View File

@@ -21,7 +21,7 @@
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try {
context.store(baos, "");
} catch (java.lang.Exception e) {
} catch (Exception e) {
e.printStackTrace();
}
%>

File diff suppressed because it is too large Load Diff

View File

@@ -45,12 +45,7 @@ public class CLASS
// toReturn += createCallProcess(conn.getTarget(), className, isMultiThread);
// }
//}
if(isMultiThread){
toReturn += "\n}catch (Error e_" + rootNode.getUniqueName() + ") {\n";
toReturn += "\ne_" + rootNode.getUniqueName() + ".printStackTrace();\n";
toReturn += "globalMap.put(\""+rootNode.getUniqueName()+ "_SUBPROCESS_STATE\", -1);\n";
}
toReturn += "\n}";
toReturn += "\n}finally {\n}";
return toReturn;
}

View File

@@ -9,8 +9,6 @@
org.talend.core.model.process.IContextParameter
org.talend.core.model.metadata.types.JavaTypesManager
org.talend.core.model.utils.JavaResourcesHelper
java.util.Map
org.talend.core.model.process.ElementParameterParser
"
class="Footer"
skeleton="footer_java.skeleton"
@@ -19,8 +17,7 @@
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
Vector v = (Vector) codeGenArgument.getArgument();
IProcess process = (IProcess)v.get(0);
List<? extends INode> processNodes = (List<? extends INode>) process.getGeneratingNodes();
List<IContextParameter> params = new ArrayList<IContextParameter>();
params=process.getContextManager().getDefaultContext().getContextParameterList();
String jobFolderName = JavaResourcesHelper.getJobFolderName(process.getName(), process.getVersion());
@@ -28,195 +25,6 @@
boolean stats = codeGenArgument.isStatistics();
%>
protected void doStart() throws java.lang.Exception {
// init uriMap first
initUriMap();
//add route
addRouteBuilder(route());
//prepare camel contexts
super.doStart();
postProcessContext();
//add jmx notification
JmxNotificationEventNotifier notifier = new JmxNotificationEventNotifier();
notifier.setSource("MyCamel");
notifier.setIgnoreCamelContextEvents(true);
notifier.setIgnoreRouteEvents(true);
notifier.setIgnoreServiceEvents(true);
getCamelContexts().get(0).getManagementStrategy().addEventNotifier(notifier);
<%
StringBuilder librariesSb = new StringBuilder();
for (INode node : processNodes) {
if (node.isActivate()) {
if (node.getComponent().getName().equals("cMessagingEndpoint")) {
List<Map<String, String>> dependencies = (List<Map<String,String>>) ElementParameterParser.getObjectValue(node, "__HOTLIBS__");
for(Map<String, String> dependencie : dependencies){
String librarieJar = dependencie.get("LIBPATH");
librariesSb.append("\"");
librariesSb.append(librarieJar);
librariesSb.append("\",");
}
}
}
}
if(librariesSb.length()>0){
%>
// add external libraries
java.net.URLClassLoader sysloader = (java.net.URLClassLoader) ClassLoader.getSystemClassLoader();
java.lang.reflect.Method method = java.net.URLClassLoader.class.getDeclaredMethod("addURL", new Class[] { java.net.URL.class });
method.setAccessible(true);
String[] libPaths = new String[] {<%=librariesSb.toString()%>};
for (String lib : libPaths) {
String separator = System.getProperty("path.separator");
String[] jarFiles = lib.split(separator);
for (String jarFile : jarFiles) {
method.invoke(sysloader, new Object[] { new java.io.File(jarFile).toURL() });
}
}
<%
}
%>
//start camel context
getCamelContexts().get(0).start();
<% if(stats) { %>
// add statistics which shows on the connection
routines.system.CamelStat runStat = new routines.system.CamelStat(getCamelContexts().get(0));
runStat.setParams();
runStat.openSocket(true);
runStat.setAllPID(rootPid, fatherPid, pid, jobName);
runStat.startThreadStat(clientHost, portStats);
runStat.updateStatOnJob(routines.system.RunStat.JOBSTART, "");
new Thread(new MyStatThread(runStat)).start();
<% } //if stats %>
}
protected void doStop() throws java.lang.Exception {
super.doStop();
getCamelContexts().get(0).stop();
}
protected ProducerTemplate findOrCreateCamelTemplate() {
return getCamelContexts().get(0).createProducerTemplate();
}
public void stop() throws java.lang.Exception {
super.stop();
}
public void shutdown() throws java.lang.Exception {
super.shutdown();
}
protected ModelFileGenerator createModelFileGenerator()
throws JAXBException {
return null;
}
<% if(stats) { %>
class MyStatThread implements Runnable {
routines.system.CamelStat stats;
boolean isFinished;
public MyStatThread(routines.system.CamelStat stats) {
this.stats = stats;
}
public void run() {
while (true) {
try {
<%
for (INode node : processNodes) {
if (node.isActivate()) {
for(int i=0; i<node.getIncomingConnections().size(); i++) {
%>
stats.updateStatOnConnection("<%=node.getIncomingConnections().get(i).getUniqueName()%>", 1, "<%=node.getUniqueName()%>");
<%
}
}
}
%>
Thread.sleep(1000);
} catch (java.lang.Exception e) {
e.printStackTrace();
}
}
}
}
<% } //if stats %>
private Properties defaultProps = new Properties();
public class ContextProperties extends Properties {
public ContextProperties(Properties properties) {
super(properties);
}
public ContextProperties() {
super();
}
public void synchronizeContext() {
<% for (IContextParameter ctxParam : params){
String cParaName = ctxParam.getName(); %>
if(<%=cParaName %> != null){
<% if(ctxParam.getType().equals("id_Date")){ %>
String pattern_<%=cParaName %> = "yyyy-MM-dd HH:mm:ss";
String value_<%=cParaName %> = "<%=ctxParam.getValue() %>";
String[] parts_<%=cParaName %> = value_<%=cParaName %>.split(";");
if (parts_<%=cParaName %>.length > 1) {
pattern_<%=cParaName %> = parts_<%=cParaName %>[0];
this.setProperty("<%=cParaName %>", pattern_<%=cParaName %> + ";" + FormatterUtils.format_Date(<%=cParaName %>, pattern_<%=cParaName %>));
} else {
this.setProperty("<%=cParaName %>", FormatterUtils.format_Date(<%=cParaName %>, pattern_<%=cParaName %>));
}
<% } else { %>
this.setProperty("<%=cParaName %>", <%=cParaName %>.toString());
<% } %>
}
<% } %>
}
<%
for (IContextParameter ctxParam : params) {
if(ctxParam.getType().equals("id_List Of Value") || ctxParam.getType().equals("id_File") || ctxParam.getType().equals("id_Directory")) { %>
public String <%=ctxParam.getName()%>;
public String get<%=Character.toUpperCase(ctxParam.getName().charAt(0)) + ctxParam.getName().substring(1)%>() {
return this.<%=ctxParam.getName()%>;
}
<% } else { %>
public <%=JavaTypesManager.getTypeToGenerate(ctxParam.getType(),true)%> <%=ctxParam.getName()%>;
public <%=JavaTypesManager.getTypeToGenerate(ctxParam.getType(),true)%> get<%=Character.toUpperCase(ctxParam.getName().charAt(0)) + ctxParam.getName().substring(1)%>() {
return this.<%=ctxParam.getName()%>;
}
<% }
}
%>
}
private ContextProperties context = new ContextProperties();
public ContextProperties getContext() {
return this.context;
}
private final String jobVersion = "<%=process.getVersion() %>";
private final String jobName = "<%=codeGenArgument.getJobName() %>";
private final String projectName = "<%=codeGenArgument.getCurrentProjectName() %>";
public Integer errorCode = null;
public String resuming_logs_dir_path = null;
public String resuming_checkpoint_path = null;
public String parent_part_launcher = null;
@@ -240,8 +48,8 @@ for (IContextParameter ctxParam : params) {
private boolean execStat = true;
private Properties context_param = new Properties();
public Map<String, Object> parentContextMap = new HashMap<String, Object>();
private java.util.Properties context_param = new java.util.Properties();
public java.util.Map<String, Object> parentContextMap = new java.util.HashMap<String, Object>();
public static void main(String[] args){
final <%=process.getName() %> <%=process.getName() %>Class = new <%=process.getName() %>();
@@ -307,27 +115,10 @@ for (IContextParameter ctxParam : params) {
<%
}
%>
//read context values
readContextValues(contextStr);
try {
run();
} catch (java.lang.Exception e) {
System.err.println(e.getMessage());
e.printStackTrace();
return 1;
}
return 0;
}
/**
* read context values from specified context
* @parameter contextName : the name of context while will be used
*/
public void readContextValues(String contextName){
try {
java.io.InputStream inContext = <%=process.getName()%>.class.getClassLoader().getResourceAsStream("<%=codeGenArgument.getCurrentProjectName().toLowerCase() %>/<%=jobFolderName %>/contexts/"+contextName+".properties");
java.io.InputStream inContext = <%=process.getName()%>.class.getClassLoader().getResourceAsStream("<%=codeGenArgument.getCurrentProjectName().toLowerCase() %>/<%=jobFolderName %>/contexts/"+contextStr+".properties");
if (inContext!=null) {
//defaultProps is in order to keep the original context value
@@ -336,7 +127,7 @@ for (IContextParameter ctxParam : params) {
context = new ContextProperties(defaultProps);
}else{
//print info and job continue to run, for case: context_param is not empty.
System.err.println("Could not find the context " + contextName);
System.err.println("Could not find the context " + contextStr);
}
if(!context_param.isEmpty()) {
@@ -392,7 +183,7 @@ for (IContextParameter ctxParam : params) {
} //end for
%>
} catch (java.io.IOException ie) {
System.err.println("Could not load context "+contextName);
System.err.println("Could not load context "+contextStr);
ie.printStackTrace();
}
@@ -415,6 +206,15 @@ for (IContextParameter ctxParam : params) {
}
%>
}
try {
initUriMap();
Route(true);
} catch (Exception e) {
System.err.println(e.getMessage());
e.printStackTrace();
return 1;
}
return 0;
}
private void evalParam(String arg) {
@@ -453,64 +253,4 @@ for (IContextParameter ctxParam : params) {
}
}
}
}
class TalendRouteRegistry implements Registry {
private Map<String, Object> map = new HashMap<String, Object>();
private Registry wrapped = null;
public TalendRouteRegistry() {
this(null);
}
public TalendRouteRegistry(Registry wrapped) {
this.wrapped = wrapped;
}
public Object lookup(String name) {
Object obj = null;
if (wrapped != null) {
obj = wrapped.lookup(name);
}
if (obj == null) {
obj = map.get(name);
}
return obj;
}
public <T> T lookup(String name, Class<T> type) {
T t = null;
if (wrapped != null) {
t = wrapped.lookup(name, type);
}
if (t == null) {
t = (T) map.get(name);
}
return t;
}
public <T> Map<String, T> lookupByType(Class<T> type) {
Map<String, T> result = null;
if (wrapped != null) {
result = wrapped.lookupByType(type);
}
if (result == null) {
result = new HashMap<String, T>();
}
if (result.isEmpty()) {
for (Map.Entry<String, Object> entry : map.entrySet()) {
if (type.isInstance(entry.getValue())) {
result.put(entry.getKey(), type.cast(entry.getValue()));
}
}
}
return result;
}
public void register(String name, Object instance) {
map.put(name, instance);
}
}

View File

@@ -99,8 +99,8 @@ import java.util.Comparator;
String talendJobInterfaces = "TalendJob";
boolean talendMdmJob = !process.getNodesOfType("tMDMTriggerInput").isEmpty() || !process.getNodesOfType("tMDMTriggerOutput").isEmpty();
boolean talendEsbJob = !process.getNodesOfType("tESBProviderRequest").isEmpty() || !process.getNodesOfType("tESBConsumer").isEmpty() || !process.getNodesOfType("tRouteInput").isEmpty();
boolean talendEsbJobFactory = !process.getNodesOfType("tESBProviderRequest").isEmpty() || !process.getNodesOfType("tRouteInput").isEmpty();
boolean talendEsbJob = !process.getNodesOfType("tESBProviderRequest").isEmpty() || !process.getNodesOfType("tESBConsumer").isEmpty();
boolean talendEsbJobFactory = !process.getNodesOfType("tESBProviderRequest").isEmpty();
if (talendMdmJob) {
talendJobInterfaces += ", TalendMDMJob"; // Talend MDM job
@@ -116,19 +116,7 @@ public class <%=process.getName()%> implements <%=talendJobInterfaces%> {
<% if (talendEsbJobFactory) { %>
public TalendESBJob newTalendESBJob() {
<%=process.getName()%> talendESBJob = new <%=process.getName()%>();
java.util.Map<String, routines.system.TalendDataSource> talendDataSources =
(java.util.Map<String, routines.system.TalendDataSource>) globalMap.get(KEY_DB_DATASOURCES);
if (null != talendDataSources) {
java.util.Map<String, javax.sql.DataSource> dataSources = new java.util.HashMap<String, javax.sql.DataSource>();
for (java.util.Map.Entry<String, routines.system.TalendDataSource> talendDataSourceEntry : talendDataSources.entrySet()) {
dataSources.put(talendDataSourceEntry.getKey(), talendDataSourceEntry.getValue().getRawDataSource());
}
talendESBJob.setDataSources(dataSources);
}
// fix for TESB-7714
talendESBJob.setEndpointRegistry(registry);
return talendESBJob;
return new <%=process.getName()%>();
}
<% } %>
@@ -259,17 +247,6 @@ private RunTrace runTrace = new RunTrace();
public boolean isExportedAsOSGI = <%=exportAsOSGI%>;
// OSGi DataSource
private final static String KEY_DB_DATASOURCES = "KEY_DB_DATASOURCES";
public void setDataSources(java.util.Map<String, javax.sql.DataSource> dataSources) {
java.util.Map<String, routines.system.TalendDataSource> talendDataSources = new java.util.HashMap<String, routines.system.TalendDataSource>();
for (java.util.Map.Entry<String, javax.sql.DataSource> dataSourceEntry : dataSources.entrySet()) {
talendDataSources.put(dataSourceEntry.getKey(), new routines.system.TalendDataSource(dataSourceEntry.getValue()));
}
globalMap.put(KEY_DB_DATASOURCES, talendDataSources);
}
<%
for (INode logCatcher : process.getNodesOfType("tLogCatcher")) {
%>
@@ -307,36 +284,28 @@ public String getExceptionStackTrace() {
return null;
}
private java.lang.Exception exception = null;
private Exception exception = null;
public java.lang.Exception getException() {
public Exception getException() {
if ("failure".equals(this.getStatus())) {
return this.exception;
}
return null;
}
private class TalendException extends java.lang.Exception {
private class TalendException extends Exception {
private static final long serialVersionUID = 1L;
private java.util.Map<String, Object> globalMap = null;
private java.lang.Exception e = null;
private Exception e = null;
private String currentComponent = null;
private TalendException(java.lang.Exception e, String errorComponent, final java.util.Map<String, Object> globalMap) {
private TalendException(Exception e, String errorComponent, final java.util.Map<String, Object> globalMap) {
this.currentComponent= errorComponent;
this.globalMap = globalMap;
this.e = e;
}
public java.lang.Exception getException() {
return this.e;
}
public String getCurrentComponent() {
return this.currentComponent;
}
@Override
public void printStackTrace() {
@@ -477,7 +446,7 @@ private class TalendException extends java.lang.Exception {
for (INode node : processNodes) {
if (node.isActivate()) {
%>
public void <%=node.getUniqueName() %>_error(java.lang.Exception exception, String errorComponent, final java.util.Map<String, Object> globalMap) throws TalendException {
public void <%=node.getUniqueName() %>_error(Exception exception, String errorComponent, final java.util.Map<String, Object> globalMap) throws TalendException {
end_Hash.put("<%=node.getUniqueName() %>", System.currentTimeMillis());
<%
boolean ifBeforRunError = NodeUtil.checkComponentErrorConnectionAfterNode(node);
@@ -540,7 +509,7 @@ private class TalendException extends java.lang.Exception {
}
%>
} catch (java.lang.Exception e) {
} catch (Exception e) {
e.printStackTrace();
}
<%
@@ -583,27 +552,9 @@ private class TalendException extends java.lang.Exception {
}
}
//end
/*
This part of code has been added in order to call the correct onComponentError and onSubjobError for the specific components (like tWriteXMLField, tWriteJSONField, tMDMOutput, tBRMS, ...).
*/
INode subjob_start_node = node;
boolean hasBeenChanged = true;
while(subjob_start_node.getDesignSubjobStartNode().isVirtualGenerateNode() && hasBeenChanged) {
hasBeenChanged = false;
if(subjob_start_node.getDesignSubjobStartNode().getIncomingConnections(EConnectionType.ON_COMPONENT_OK) != null) {
if(subjob_start_node.getDesignSubjobStartNode().getIncomingConnections(EConnectionType.ON_COMPONENT_OK).size() >0) {
if(subjob_start_node.getDesignSubjobStartNode().getIncomingConnections(EConnectionType.ON_COMPONENT_OK).get(0).getSource().getVirtualLinkTo()==EConnectionType.ON_COMPONENT_OK) {
subjob_start_node = subjob_start_node.getDesignSubjobStartNode().getIncomingConnections(EConnectionType.ON_COMPONENT_OK).get(0).getSource();
hasBeenChanged = true;
}
}
}
}
%>
<%=subjob_start_node.getDesignSubjobStartNode().getUniqueName() %>_onSubJobError(exception, errorComponent, globalMap);
<%=node.getDesignSubjobStartNode().getUniqueName() %>_onSubJobError(exception, errorComponent, globalMap);
}
<%
}
@@ -611,7 +562,7 @@ private class TalendException extends java.lang.Exception {
for (INode node : processNodes) {
if (node.isDesignSubjobStartNode()) {
%>
public void <%=node.getUniqueName() %>_onSubJobError(java.lang.Exception exception, String errorComponent, final java.util.Map<String, Object> globalMap) throws TalendException {
public void <%=node.getUniqueName() %>_onSubJobError(Exception exception, String errorComponent, final java.util.Map<String, Object> globalMap) throws TalendException {
<%
List< ? extends IConnection> conns = node.getOutgoingConnections();
int count = 0;
@@ -661,7 +612,7 @@ resumeUtil.addLog("SYSTEM_LOG", "NODE:"+ errorComponent, "", Thread.currentThrea
<%
}
%>
} catch (java.lang.Exception e) {
} catch (Exception e) {
e.printStackTrace();
}
<%

View File

@@ -24,7 +24,6 @@
org.talend.designer.codegen.ITalendSynchronizer
org.talend.designer.codegen.config.CodeGeneratorArgument
org.talend.designer.runprocess.CodeGeneratorRoutine
org.talend.core.model.process.EParameterFieldType
"
class="Header"
%>
@@ -56,77 +55,44 @@ if (service instanceof AbstractBrandingService) {
package <%= packageName %>;
<%
java.util.Set<String> importsSet = new java.util.TreeSet<String>();
/* for (String routine : CodeGeneratorRoutine.getRequiredRoutineName(process)) {
if (!routine.equals(ITalendSynchronizer.TEMPLATE)) {
importsSet.add("import routines."+routine);
}
}
*/
importsSet.add("import java.util.HashMap");
importsSet.add("import java.util.Map");
importsSet.add("import javax.xml.bind.JAXBException");
importsSet.add("import org.apache.camel.ProducerTemplate");
importsSet.add("import org.apache.camel.builder.RouteBuilder");
importsSet.add("import org.apache.camel.impl.DefaultCamelContext");
importsSet.add("import org.apache.camel.main.MainSupport");
importsSet.add("import routines.TalendString");
importsSet.add("import routines.system.api.TalendESBRoute");
importsSet.add("import org.apache.camel.view.ModelFileGenerator");
importsSet.add("import org.apache.camel.spi.Registry");
importsSet.add("import org.apache.camel.impl.DefaultCamelContext");
importsSet.add("import org.apache.camel.osgi.CamelContextFactory");
importsSet.add("import org.apache.camel.CamelContext");
importsSet.add("import java.util.Properties");
importsSet.add("import org.apache.camel.management.JmxNotificationEventNotifier");
String headerImports = ElementParameterParser.getValue(process, "__HEADER_IMPORT__");
if(headerImports!=null && !"".equals(headerImports.trim())){
String[] imports = headerImports.split(";");
for(String s: imports){
if(s!=null && !"".equals(s.trim())){
importsSet.add(s.trim());
}
}
}
String footerImports = ElementParameterParser.getValue(process, "__FOOTER_IMPORT__");
if(footerImports!=null && !"".equals(footerImports.trim())){
String[] imports = footerImports.split(";");
for(String s: imports){
if(s!=null && !"".equals(s.trim())){
importsSet.add(s.trim());
}
}
}
List<? extends INode> generatingNodes = process.getGeneratingNodes();
for(INode n: generatingNodes){
List<? extends IElementParameter> elementParameters = n.getElementParameters();
for(IElementParameter p: elementParameters){
if(p.getShowIf() != null && !p.isShow(elementParameters)){
continue;
}
if(EParameterFieldType.MEMO_IMPORT == p.getFieldType()){
Object value = p.getValue();
if(value == null || !(value instanceof String) || "".equals(((String)value).trim())){
continue;
}
String[] imports = ((String)value).trim().split(";");
for(String s: imports){
if(s!=null && !"".equals(s.trim())){
importsSet.add(s.trim());
}
}
}
}
}
for(String s: importsSet){
for (String routine : CodeGeneratorRoutine.getRequiredRoutineName(process)) {
if (!routine.equals(ITalendSynchronizer.TEMPLATE)) {
%>
<%=s%> ;
import routines.<%=routine%>;
<%
}
}
%>
import routines.system.*;
import routines.system.api.*;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.math.BigDecimal;
import java.io.ByteArrayOutputStream;
import java.io.ByteArrayInputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.ObjectOutputStream;
import java.io.ObjectInputStream;
import java.io.IOException;
import java.util.Comparator;
<%=ElementParameterParser.getValue(process, "__HEADER_IMPORT__") %>
<%=ElementParameterParser.getValue(process, "__FOOTER_IMPORT__") %>
<%
List<INode> nodesWithImport = process.getNodesWithImport();
if (nodesWithImport != null) {
for (INode node:nodesWithImport) {
%>
//the import part of <%=node.getUniqueName() %>
<%=ElementParameterParser.getValue(node, "__IMPORT__") %>
<% }
}
%>
/**
@@ -136,9 +102,25 @@ package <%= packageName %>;
* @version <%=version %>
* @status <%=ElementParameterParser.getValue(process, "__STATUS__") %>
*/
public class <%=process.getName()%> extends MainSupport implements TalendESBRoute {
public class <%=process.getName()%> implements TalendESBRoute {
private final String jobVersion = "<%=process.getVersion() %>";
private final String jobName = "<%=codeGenArgument.getJobName() %>";
private final String projectName = "<%=codeGenArgument.getCurrentProjectName() %>";
public Integer errorCode = null;
private String currentComponent = "";
public TalendESBRoute stopDelegate = null;
public <%=process.getName()%>(){
initUriMap();
}
public void stop() throws Exception {
if (stopDelegate != null) stopDelegate.stop();
}
public void shutdown() throws Exception {
if (stopDelegate != null) stopDelegate.shutdown();
}
<%
@@ -157,9 +139,7 @@ package <%= packageName %>;
<%
for (INode node : graphicalNodes) {
if("cCXF".equals(node.getComponent().getName())
&& "true".equals(ElementParameterParser.getValue(node, "__ENABLE_SAM__"))
&& !"RAW".equals(ElementParameterParser.getValue(node, "__DATAFORMAT__"))) { %>
if("cCXF".equals(node.getComponent().getName())) { %>
//ESB Service Activity Monitor Feature
private org.apache.cxf.feature.AbstractFeature eventFeature;
@@ -171,158 +151,40 @@ package <%= packageName %>;
}
%>
private Map<String, String> uriMap;
private org.apache.camel.builder.RouteBuilder routeBuilder;
public Map<String,String> getUriMap() {
private java.util.Map<String, String> uriMap;
public java.util.Map<String,String> getUriMap() {
return this.uriMap;
}
public void loadCustomUriMap(Map<String,String> newMap) {
public void loadCustomUriMap(java.util.Map<String,String> newMap) {
if(newMap == null) {
return;
}
for(Map.Entry<String, String> entry: newMap.entrySet()) {
for(java.util.Map.Entry<String, String> entry: newMap.entrySet()) {
uriMap.put(entry.getKey(), entry.getValue());
}
}
/*
* the readContextValues(contextName) may have to invoked first before this
*/
public void initUriMap() {
uriMap = new HashMap<String, String>();
protected void initUriMap() {
uriMap = new java.util.HashMap<String, String>();
<%
String cid = "";
String componentName = "";
String uri = "";
for (INode node : graphicalNodes) {
if(!node.isActivate()){
continue;
}
cid = node.getUniqueName();
// http://jira.talendforge.org/browse/TESB-5241
/*
* change to use label + unique to make it unique but readable
*/
IElementParameter param = node.getElementParameter("LABEL");
if(param != null && !"__UNIQUE_NAME__".equals(param.getValue())){
cid = (String)param.getValue()+"_"+cid;
if (param != null && !"__UNIQUE_NAME__".equals(param.getValue())) {
cid = (String) param.getValue();
} else {
cid = node.getUniqueName();
}
componentName = node.getComponent().getName();
uri = "";
if ("cMessagingEndpoint".equals(componentName)) {
uri = ElementParameterParser.getValue(node, "__URI__");
}else if("cTimer".equals(componentName)){
uri = "\"timer:\"+\""+node.getUniqueName()+"\"";
StringBuilder sb = new StringBuilder();
String period = ElementParameterParser.getValue(node, "__PERIOD__");
if(period!=null && !period.trim().equals("") && !"1000".equals(period)){
sb.append("+\"?period=\"+");
sb.append(period);
}
String repeat = ElementParameterParser.getValue(node, "__REPEATCOUNT__");
if(repeat!=null && !repeat.trim().equals("") && !"0".equals(repeat)){
if(sb.length()==0){
sb.append("+\"?repeatCount=\"+");
sb.append(repeat);
}else{
sb.append("+\"&repeatCount=\"+");
sb.append(repeat);
}
}
String delay = ElementParameterParser.getValue(node, "__DELAY__");
if(delay!=null && !delay.trim().equals("") && !"1000".equals(delay)){
if(sb.length()==0){
sb.append("+\"?delay=\"+");
sb.append(delay);
}else{
sb.append("+\"&delay=\"+");
sb.append(delay);
}
}
String fixedRate = ElementParameterParser.getValue(node, "__FIXEDRATE__");
if("true".equals(fixedRate)){
if(sb.length()==0){
sb.append("+\"?fixedRate=true\"");
}else{
sb.append("+\"&fixedRate=true\"");
}
}
String daemon = ElementParameterParser.getValue(node, "__DAEMON__");
if("false".equals(daemon)){
if(sb.length()==0){
sb.append("+\"?daemon=false\"");
}else{
sb.append("+\"&daemon=false\"");
}
}
String setTime = ElementParameterParser.getValue(node, "__SET_TIME__");
if("true".equals(setTime)){
String time = ElementParameterParser.getValue(node, "__TIME__");
if(sb.length()==0){
sb.append("+\"?time=\"+");
sb.append(time);
}else{
sb.append("+\"&time=\"+");
sb.append(time);
}
}
if(sb.length()>0){
uri = uri + sb.toString();
}
}else if("cDataset".equals(componentName)){
uri = "\"dataset:\"+"+ElementParameterParser.getValue(node, "__DATASET_NAME__");
StringBuilder sb = new StringBuilder();
String produceDelay = ElementParameterParser.getValue(node, "__PRODUCE_DELAY__");
if(produceDelay!=null && !produceDelay.trim().equals("") && !"3".equals(produceDelay)){
sb.append("+\"?produceDelay=\"+");
sb.append(produceDelay);
}
String consumeDelay = ElementParameterParser.getValue(node, "__CONSUME_DELAY__");
if(consumeDelay!=null && !consumeDelay.trim().equals("") && !"0".equals(consumeDelay)){
if(sb.length()==0){
sb.append("+\"?consumeDelay=\"+");
sb.append(consumeDelay);
}else{
sb.append("+\"&consumeDelay=\"+");
sb.append(consumeDelay);
}
}
String preloadSize = ElementParameterParser.getValue(node, "__PRELOAD_SIZE__");
if(preloadSize!=null && !preloadSize.trim().equals("") && !"0".equals(preloadSize)){
if(sb.length()==0){
sb.append("+\"?preloadSize=\"+");
sb.append(preloadSize);
}else{
sb.append("+\"&preloadSize=\"+");
sb.append(preloadSize);
}
}
String initialDelay = ElementParameterParser.getValue(node, "__INITIAL_DELAY__");
if(initialDelay!=null && !initialDelay.trim().equals("") && !"1000".equals(initialDelay)){
if(sb.length()==0){
sb.append("+\"?initialDelay=\"+");
sb.append(initialDelay);
}else{
sb.append("+\"&initialDelay=\"+");
sb.append(initialDelay);
}
}
String minRate = ElementParameterParser.getValue(node, "__MIN_RATE__");
if(minRate!=null && !minRate.trim().equals("") && !"0".equals(minRate)){
if(sb.length()==0){
sb.append("+\"?minRate=\"+");
sb.append(minRate);
}else{
sb.append("+\"&minRate=\"+");
sb.append(minRate);
}
}
if(sb.length()>0){
uri = uri + sb.toString();
}
} else if ("cFile".equals(componentName)) {
String filePath = ElementParameterParser.getValue(node, "__URI__");
String noop = ElementParameterParser.getValue(node, "__NOOP__");
@@ -334,7 +196,7 @@ for (INode node : graphicalNodes) {
StringBuffer arguments = new StringBuffer();
uri = "\"file://\"+" + filePath;
uri = "\"file:///\"+" + filePath;
if ("true".equals(noop)) {
arguments.append("\"noop=true\"+");
@@ -396,17 +258,7 @@ for (INode node : graphicalNodes) {
sb.append("\"cxf://\"+").append(url).append("+\"?" + serviceType + "=\"");
if ("wsdlURL".equals(serviceType)) {
//http://jira.talendforge.org/browse/TESB-6226
String filePath = "";
String wsdlType = ElementParameterParser.getValue(node, "__WSDL_TYPE__");
if("file".equals(wsdlType)){
filePath = ElementParameterParser.getValue(node, "__WSDL_FILE__");
}else{
filePath = ElementParameterParser.getValue(node, "__ROUTE_RESOURCE_TYPE_RES_URI__");
filePath = "\"classpath:" + filePath + "\"";
}
String filePath = ElementParameterParser.getValue(node, "__WSDL_FILE__");
filePath.replaceAll("\\\\","/");
sb.append("+").append(filePath);
} else {
@@ -477,11 +329,10 @@ for (INode node : graphicalNodes) {
} else if("cJMS".equals(componentName)) {
//http://jira.talendforge.org/browse/TESB-4861
String name = ElementParameterParser.getValue(node, "__ROUTE_COMPONENT_TYPE_ID__");
String name = ElementParameterParser.getValue(node, "__CONNECTION_FACOTRY__");
if (name == null || name.equals("")) {
name = "jms";
}
name = name.replace("_", "");
name = "\"" + name + "\"";
//String name = ElementParameterParser.getValue(node, "__NAME__").trim();
//Remove unnecessary subfix
@@ -675,10 +526,10 @@ for (INode node : graphicalNodes) {
String resourceUri = ElementParameterParser.getValue(node, "__URI__");
sb.append(resourceUri);
boolean hasParam = resourceUri==null?false:resourceUri.contains("?");
boolean hasParam = false;
String method = ElementParameterParser.getValue(node, "__METHOD__");
if("GET".equals(method)||"HEAD".equals(method) || "DELETE".equals(method)){
if("GET".equals(method)||"HEAD".equals(method)){
List<Map<String, String>> parameters = (List<Map<String, String>>) ElementParameterParser.getObjectValue(node, "__PARAMETERS__");
String encodeCharset = ElementParameterParser.getValue(node, "__ENCODER_CHARSET__");
@@ -720,3 +571,93 @@ for (INode node : graphicalNodes) {
}
%>
}
private java.util.Properties defaultProps = new java.util.Properties();
public class ContextProperties extends java.util.Properties {
public ContextProperties(java.util.Properties properties) {
super(properties);
}
public ContextProperties() {
super();
}
public void synchronizeContext() {
<% for (IContextParameter ctxParam : params){
String cParaName = ctxParam.getName(); %>
if(<%=cParaName %> != null){
<% if(ctxParam.getType().equals("id_Date")){ %>
String pattern_<%=cParaName %> = "yyyy-MM-dd HH:mm:ss";
String value_<%=cParaName %> = "<%=ctxParam.getValue() %>";
String[] parts_<%=cParaName %> = value_<%=cParaName %>.split(";");
if (parts_<%=cParaName %>.length > 1) {
pattern_<%=cParaName %> = parts_<%=cParaName %>[0];
this.setProperty("<%=cParaName %>", pattern_<%=cParaName %> + ";" + FormatterUtils.format_Date(<%=cParaName %>, pattern_<%=cParaName %>));
} else {
this.setProperty("<%=cParaName %>", FormatterUtils.format_Date(<%=cParaName %>, pattern_<%=cParaName %>));
}
<% } else { %>
this.setProperty("<%=cParaName %>", <%=cParaName %>.toString());
<% } %>
}
<% } %>
}
<%
for (IContextParameter ctxParam : params) {
if(ctxParam.getType().equals("id_List Of Value") || ctxParam.getType().equals("id_File") || ctxParam.getType().equals("id_Directory")) { %>
public String <%=ctxParam.getName()%>;
public String get<%=Character.toUpperCase(ctxParam.getName().charAt(0)) + ctxParam.getName().substring(1)%>() {
return this.<%=ctxParam.getName()%>;
}
<% } else { %>
public <%=JavaTypesManager.getTypeToGenerate(ctxParam.getType(),true)%> <%=ctxParam.getName()%>;
public <%=JavaTypesManager.getTypeToGenerate(ctxParam.getType(),true)%> get<%=Character.toUpperCase(ctxParam.getName().charAt(0)) + ctxParam.getName().substring(1)%>() {
return this.<%=ctxParam.getName()%>;
}
<% }
}
%>
}
private ContextProperties context = new ContextProperties();
public ContextProperties getContext() {
return this.context;
}
<% if(stats) { %>
class MyStatThread implements Runnable {
CamelStat stats;
boolean isFinished;
public MyStatThread(CamelStat stats) {
this.stats = stats;
}
public void run() {
while (true) {
try {
<%
for (INode node : processNodes) {
if (node.isActivate()) {
for(int i=0; i<node.getIncomingConnections().size(); i++) {
%>
stats.updateStatOnConnection("<%=node.getIncomingConnections().get(i).getUniqueName()%>", 1, "<%=node.getUniqueName()%>");
<%
}
}
}
%>
Thread.sleep(1000);
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
<% } //if stats %>

View File

@@ -58,7 +58,7 @@ if(execStat){
<%
}
%>
} catch (java.lang.Exception e) {
} catch (Exception e) {
this.status = "failure";
Integer localErrorCode = (Integer) (((java.util.Map) threadLocal.get()).get("errorCode"));
if (localErrorCode != null) {

View File

@@ -53,7 +53,6 @@ for (IConnection iterateConn : iterateConnSet) { //1
%>
NB_ITERATE_<%=iterateNodeName %>++;
iterateLoop++;
<%
parallelIterate = "true".equals(ElementParameterParser.getValue(iterateConn, "__ENABLE_PARALLEL__"));
@@ -93,7 +92,6 @@ for (IConnection iterateConn : iterateConnSet) { //1
private java.util.Map<String, Object> globalMap = null;
boolean isRunning = false;
String iterateId = "";
int iterateLoop = 0;
<%
if(!subTree.isMergeSubTree()) {
List< ? extends IConnection> rootConns = subTree.getRootNode().getOutgoingConnections();
@@ -157,7 +155,6 @@ for (IConnection iterateConn : iterateConnSet) { //1
<%}%>
}
iterateId = "." + threadID;
iterateLoop++;
<%if(isRunJob) {%>
//bug21906 copy context to local for mutilthread
context.synchronizeContext();
@@ -203,7 +200,7 @@ if(execStat){
for (IConnection inLineConn : allInLineJobConns) {
%>
if(execStat){
runStat.updateStatOnConnection("<%=inLineConn.getUniqueName() %>", 3, 0);
runStat.updateStatOnConnection("<%=inLineConn.getUniqueName() %>", 3, "exec" + NB_ITERATE_<%=iterateNodeName %>);
}
<%
}

View File

@@ -36,7 +36,7 @@
if(isParallelize){
%>
} catch (java.lang.Exception e) {
} catch (Exception e) {
this.status = "failure";
Integer localErrorCode = (Integer) (((java.util.Map) threadLocal.get()).get("errorCode"));
if (localErrorCode != null) {
@@ -84,7 +84,7 @@
}
} catch (InterruptedException e) {
e.printStackTrace();
} catch (java.lang.Exception te) {
} catch (Exception te) {
throw new TalendException(te, currentComponent, globalMap);
}
<%
@@ -204,7 +204,7 @@
%>
} catch(java.lang.Exception e) {
} catch(Exception e) {
throw new TalendException(e, currentComponent, globalMap);

View File

@@ -134,12 +134,8 @@ public static class <%=conn.getName() %>Struct<%=templateOrigin %> implements ro
if (metadata !=null) {
for (IMetadataColumn column: metadata.getListColumns()) {
JavaType javaType = JavaTypesManager.getJavaTypeFromId(column.getTalendType());
String typeToGenerate = JavaTypesManager.getTypeToGenerate(column.getTalendType(), column.isNullable());
if("id_Document".equals(javaType.getId())) {
typeToGenerate = javaType.getNullableClass().getCanonicalName();
}
%>
public <%= typeToGenerate %> <%=column.getLabel() %><%
public <%= JavaTypesManager.getTypeToGenerate(column.getTalendType(), column.isNullable()) %> <%=column.getLabel() %><%
if(javaType == JavaTypesManager.CHARACTER && !column.isNullable()) {
%> = ' '<%
@@ -147,11 +143,11 @@ public static class <%=conn.getName() %>Struct<%=templateOrigin %> implements ro
%>;
public <%= typeToGenerate %> get<%=column.getLabel().substring(0, 1).toUpperCase()%><%=column.getLabel().substring(1)%> () {
public <%= JavaTypesManager.getTypeToGenerate(column.getTalendType(), column.isNullable()) %> get<%=column.getLabel().substring(0, 1).toUpperCase()%><%=column.getLabel().substring(1)%> () {
return this.<%=column.getLabel()%>;
}
<%
if((conn.getLineStyle() == EConnectionType.FLOW_REF) && conn.getTarget().getUniqueName().startsWith("tXMLMap") && "id_Document".equals(javaType.getId())) {
if("id_Document".equals(javaType.getId())) {
%>
public java.util.Map<String,Object> documentLookupResult = new java.util.HashMap<String,Object>();
<%
@@ -564,9 +560,6 @@ public static class <%=conn.getName() %>Struct<%=templateOrigin %> implements ro
<%
} else if(javaType.isObjectBased() || typeToGenerate.equals("Geometry") || typeToGenerate.equals("Dynamic")) {
hasAtLeastOneObjectType = true;
if("id_Document".equals(javaType.getId())) {
typeToGenerate = javaType.getNullableClass().getCanonicalName();
}
%>
this.<%=column.getLabel() %> = (<%= typeToGenerate %>) dis.readObject();
<%
@@ -740,9 +733,6 @@ public static class <%=conn.getName() %>Struct<%=templateOrigin %> implements ro
<%
} else if(typeToGenerate.equals("Object") || typeToGenerate.equals("Geometry") || typeToGenerate.equals("BigDecimal") || typeToGenerate.equals("List") || typeToGenerate.equals("Dynamic") || typeToGenerate.equals("Document")) {
hasAtLeastOneObjectType = true;
if("id_Document".equals(javaType.getId())) {
typeToGenerate = javaType.getNullableClass().getCanonicalName();
}
%>
this.<%=column.getLabel() %> = (<%= typeToGenerate %>) ois.readObject();
<%
@@ -993,7 +983,6 @@ public void <%=subTree.getName() %>Process(final java.util.Map<String, Object> g
}
boolean isRunning = false;
String iterateId = "";
int iterateLoop = 0;
public void run() {
java.util.Map threadRunResultMap = new java.util.HashMap();
@@ -1010,12 +999,11 @@ public void <%=subTree.getName() %>Process(final java.util.Map<String, Object> g
%>
String iterateId = "";
int iterateLoop = 0;
String currentComponent = "";
try {
String currentMethodName = new java.lang.Exception().getStackTrace()[0].getMethodName();
String currentMethodName = new Exception().getStackTrace()[0].getMethodName();
boolean resumeIt = currentMethodName.equals(resumeEntryMethodName);
if( resumeEntryMethodName == null || resumeIt || globalResumeTicket){//start the resume
globalResumeTicket = true;

View File

@@ -33,8 +33,8 @@
boolean stat = codeGenArgument.isStatistics();
%>
/**
* please initial uri map first before using the returned RouteBuilder
* @return RouteBuilder
*/
public RouteBuilder route() {
public org.apache.camel.builder.RouteBuilder Route(final boolean start) throws Exception {
String iterateId = "";
String currentComponent = "";

View File

@@ -669,14 +669,8 @@ public class CodeGenerator implements ICodeGenerator {
label = (String) parameter.getValue();
}
/*
* Fix https://jira.talendforge.org/browse/TESB-6685
* label + uniqueName to make it unique
*/
if (label == null) {
label = node.getUniqueName();
}else{
label += "_"+node.getUniqueName();
}
List<? extends IConnection> inConnections = node
.getIncomingConnections();

View File

@@ -69,7 +69,7 @@ import org.talend.core.model.components.IComponentsFactory;
import org.talend.core.model.general.Project;
import org.talend.core.model.properties.ComponentSetting;
import org.talend.core.ui.branding.IBrandingService;
import org.talend.core.utils.TalendCacheUtils;
import org.talend.core.utils.BrandingChecker;
import org.talend.designer.codegen.CodeGeneratorActivator;
import org.talend.designer.codegen.i18n.Messages;
import org.talend.designer.core.ITisLocalProviderService;
@@ -145,7 +145,7 @@ public class ComponentsFactory implements IComponentsFactory {
// generation indirectly.
// tFileInputFullRow + tSocketOutput : needed for DataViewer
private static final String[] COMPONENTS_ALWAYS_NEEDED = { "tPrejob", "tPostjob", //$NON-NLS-1$ //$NON-NLS-2$
"tJava", "tLibraryLoad", "tFileInputFullRow", "tSocketOutput", "tFilterRow", "tELTMysqlMap" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
"tJava", "tLibraryLoad", "tFileInputFullRow", "tSocketOutput", "tFilterRow" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
public ComponentsFactory() {
if (!INCLUDEFILEINJET_SUFFIX.equals(".inc.javajet")) { //$NON-NLS-1$
@@ -159,7 +159,7 @@ public class ComponentsFactory implements IComponentsFactory {
Project currentProject = ProjectManager.getInstance().getCurrentProject();
if (currentProject != null && currentProject.getEmfProject() != null) {
List<ComponentSetting> components = currentProject.getEmfProject().getComponentsSettings();
List<ComponentSetting> components = (List<ComponentSetting>) currentProject.getEmfProject().getComponentsSettings();
return components;
}
return Collections.emptyList();
@@ -231,7 +231,8 @@ public class ComponentsFactory implements IComponentsFactory {
ProjectManager manager = ProjectManager.getInstance();
List<Project> referencedProjects = manager.getReferencedProjects();
for (Project curProject : referencedProjects) {
List<ComponentSetting> componentsSettings = curProject.getEmfProject().getComponentsSettings();
List<ComponentSetting> componentsSettings = (List<ComponentSetting>) curProject.getEmfProject()
.getComponentsSettings();
for (ComponentSetting setting : componentsSettings) {
if (setting.isHidden() && setting.getName().equals(settingInMain.getName())
&& setting.getFamily().equals(settingInMain.getFamily())) {
@@ -261,7 +262,7 @@ public class ComponentsFactory implements IComponentsFactory {
skeletonList = new ArrayList<String>();
String installLocation = new Path(Platform.getConfigurationLocation().getURL().getPath()).toFile().getAbsolutePath();
componentToProviderMap = new HashMap<IComponent, AbstractComponentsProvider>();
boolean isNeedClean = TalendCacheUtils.cleanComponentCache();
boolean isNeedClean = cleanComponentCache();
isCreated = hasComponentFile(installLocation) && !isNeedClean;
if (isReset) {
isCreated = false;
@@ -347,7 +348,6 @@ public class ComponentsFactory implements IComponentsFactory {
FileFilter fileFilter = new FileFilter() {
@Override
public boolean accept(final File file) {
return file.isDirectory() && file.getName().charAt(0) != '.'
&& !file.getName().equals(IComponentsFactory.EXTERNAL_COMPONENTS_INNER_FOLDER)
@@ -482,6 +482,11 @@ public class ComponentsFactory implements IComponentsFactory {
return file.exists();
}
private boolean cleanComponentCache() {
return ArrayUtils.contains(Platform.getApplicationArgs(), "--clean_component_cache")
|| ArrayUtils.contains(Platform.getApplicationArgs(), "-clean") || BrandingChecker.isBrandingChanged();
}
private void loadComponentsFromComponentsProviderExtension() {
ComponentsProviderManager componentsProviderManager = ComponentsProviderManager.getInstance();
for (AbstractComponentsProvider componentsProvider : componentsProviderManager.getProviders()) {
@@ -512,7 +517,6 @@ public class ComponentsFactory implements IComponentsFactory {
}
}
@Override
public void loadUserComponentsFromComponentsProviderExtension() {
ComponentsProviderManager.getInstance().getProviders();
ComponentsProviderManager componentsProviderManager = ComponentsProviderManager.getInstance();
@@ -583,7 +587,6 @@ public class ComponentsFactory implements IComponentsFactory {
FileFilter fileFilter = new FileFilter() {
@Override
public boolean accept(final File file) {
return file.isDirectory() && file.getName().charAt(0) != '.'
&& !file.getName().equals(IComponentsFactory.EXTERNAL_COMPONENTS_INNER_FOLDER)
@@ -604,7 +607,6 @@ public class ComponentsFactory implements IComponentsFactory {
FileFilter skeletonFilter = new FileFilter() {
@Override
public boolean accept(final File file) {
String fileName = file.getName();
return file.isFile() && fileName.charAt(0) != '.'
@@ -911,7 +913,6 @@ public class ComponentsFactory implements IComponentsFactory {
component.setImageRegistry(componentsImageRegistry);
}
@Override
public int size() {
if (componentList == null) {
init(false);
@@ -919,7 +920,6 @@ public class ComponentsFactory implements IComponentsFactory {
return componentList.size();
}
@Override
public IComponent get(String name) {
if (componentList == null) {
init(false);
@@ -933,7 +933,6 @@ public class ComponentsFactory implements IComponentsFactory {
return null;
}
@Override
public void initializeComponents(IProgressMonitor monitor) {
this.monitor = monitor;
if (componentList == null) {
@@ -943,7 +942,6 @@ public class ComponentsFactory implements IComponentsFactory {
this.subMonitor = null;
}
@Override
public void initializeComponents(IProgressMonitor monitor, boolean duringLogon) {
this.monitor = monitor;
if (componentList == null) {
@@ -958,7 +956,6 @@ public class ComponentsFactory implements IComponentsFactory {
*
* @see org.talend.core.model.components.IComponentsFactory#getComponents()
*/
@Override
public Set<IComponent> getComponents() {
if (componentList == null) {
init(false);
@@ -966,7 +963,6 @@ public class ComponentsFactory implements IComponentsFactory {
return componentList;
}
@Override
public List<IComponent> getCustomComponents() {
if (customComponentList == null) {
init(false);
@@ -979,7 +975,6 @@ public class ComponentsFactory implements IComponentsFactory {
*
* @see org.talend.core.model.components.IComponentsFactory#getComponentPath()
*/
@Override
public URL getComponentPath() throws IOException {
String componentsPath = IComponentsFactory.COMPONENTS_LOCATION;
IBrandingService breaningService = (IBrandingService) GlobalServiceRegister.getDefault().getService(
@@ -997,7 +992,6 @@ public class ComponentsFactory implements IComponentsFactory {
*
* @see org.talend.core.model.components.IComponentsFactory#getSkeletons()
*/
@Override
public List<String> getSkeletons() {
if (skeletonList == null) {
init(false);
@@ -1005,7 +999,6 @@ public class ComponentsFactory implements IComponentsFactory {
return skeletonList;
}
@Override
public void reset() {
componentsImageRegistry.clear();
componentList = null;
@@ -1015,7 +1008,6 @@ public class ComponentsFactory implements IComponentsFactory {
}
@Override
public void resetCache() {
componentsImageRegistry.clear();
componentList = null;
@@ -1034,7 +1026,6 @@ public class ComponentsFactory implements IComponentsFactory {
* @see org.talend.core.model.components.IComponentsFactory#getFamilyTranslation(IComponent component,
* java.lang.String)
*/
@Override
public String getFamilyTranslation(Object component, String text) {
String translated = Messages.getString(text);
@@ -1065,7 +1056,6 @@ public class ComponentsFactory implements IComponentsFactory {
*
* @see org.talend.core.model.components.IComponentsFactory#getAllComponentsCanBeProvided()
*/
@Override
public Map<String, String> getAllComponentsCanBeProvided() {
List source = new ArrayList();
if (allComponents == null) {
@@ -1090,7 +1080,6 @@ public class ComponentsFactory implements IComponentsFactory {
FileFilter fileFilter = new FileFilter() {
@Override
public boolean accept(final File file) {
return file.isDirectory() && file.getName().charAt(0) != '.'
&& !file.getName().equals(IComponentsFactory.EXTERNAL_COMPONENTS_INNER_FOLDER);
@@ -1149,17 +1138,14 @@ public class ComponentsFactory implements IComponentsFactory {
analyseur = fabrique.newDocumentBuilder();
analyseur.setErrorHandler(new ErrorHandler() {
@Override
public void error(final SAXParseException exception) throws SAXException {
throw exception;
}
@Override
public void fatalError(final SAXParseException exception) throws SAXException {
throw exception;
}
@Override
public void warning(final SAXParseException exception) throws SAXException {
throw exception;
}
@@ -1211,12 +1197,10 @@ public class ComponentsFactory implements IComponentsFactory {
*
* @see org.talend.core.model.components.IComponentsFactory#resetSpecificComponents()
*/
@Override
public void resetSpecificComponents() {
loadComponentsFromExtensions();
}
@Override
public Map<String, File> getComponentsProvidersFolder() {
Map<String, File> list = new HashMap<String, File>();
@@ -1233,7 +1217,6 @@ public class ComponentsFactory implements IComponentsFactory {
return list;
}
@Override
public Map<String, ImageDescriptor> getComponentsImageRegistry() {
return componentsImageRegistry;
}

View File

@@ -16,8 +16,6 @@ import java.io.File;
import java.io.FileFilter;
import java.io.IOException;
import java.net.URL;
import java.util.HashSet;
import java.util.Set;
import org.apache.log4j.Logger;
import org.eclipse.core.runtime.FileLocator;
@@ -50,7 +48,6 @@ public class UserComponentsProvider extends AbstractComponentsProvider {
public UserComponentsProvider() {
}
@Override
protected File getExternalComponentsLocation() {
IPreferenceStore prefStore = CodeGeneratorActivator.getDefault().getPreferenceStore();
String path = prefStore.getString(IComponentPreferenceConstant.USER_COMPONENTS_FOLDER);
@@ -78,7 +75,6 @@ public class UserComponentsProvider extends AbstractComponentsProvider {
return path.toString();
}
@Override
public void preComponentsLoad() throws IOException {
File installationFolder = getInstallationFolder();
if (installationFolder.exists()) {
@@ -87,9 +83,8 @@ public class UserComponentsProvider extends AbstractComponentsProvider {
FilesUtils.createFoldersIfNotExists(installationFolder.getAbsolutePath(), false);
FileFilter ff = new FileFilter() {
@Override
public boolean accept(File pathname) {
if (FilesUtils.isSVNFolder(pathname)) {
if (pathname.getName().equals(".svn")) {
return false;
}
return true;
@@ -99,11 +94,9 @@ public class UserComponentsProvider extends AbstractComponentsProvider {
// synchroniz shared custom component
if (PluginChecker.isSVNProviderPluginLoaded()) {
Set<Project> allProjects = new HashSet<Project>();
allProjects.add(ProjectManager.getInstance().getCurrentProject());
allProjects.addAll(ProjectManager.getInstance().getReferencedProjects());
for (Project project : allProjects) {
String projectLabel = project.getTechnicalLabel();
Project currentProject = ProjectManager.getInstance().getCurrentProject();
if (currentProject != null) {
String projectLabel = currentProject.getTechnicalLabel();
String sourcePath = new Path(Platform.getInstanceLocation().getURL().getPath()).toFile().getPath()
+ File.separatorChar + projectLabel + File.separatorChar
+ ERepositoryObjectType.getFolderName(ERepositoryObjectType.COMPONENTS);

View File

@@ -80,14 +80,20 @@ public class XsdValidationCacheManager {
public boolean needCheck(java.io.File file, long currentCRC) {
String path = file.getAbsolutePath();
Long lastCheckedCRC = alreadyCheckedXsd.get(path);
if (forceXSDAlreadyChecked) {
alreadyCheckedXsd.put(path, currentCRC);
return false;
} else {
Long lastCheckedCRC = alreadyCheckedXsd.get(path);
if (lastCheckedCRC == null) {
return true;
if (lastCheckedCRC == null) {
return true;
}
boolean isChanged = currentCRC != lastCheckedCRC;
return isChanged;
}
boolean isChanged = currentCRC != lastCheckedCRC;
return isChanged;
}
public void setChecked(File file, long currentCRC) {

View File

@@ -14,7 +14,6 @@ package org.talend.designer.codegen.config;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.File;
import java.io.InputStream;
import java.lang.reflect.Method;
@@ -28,6 +27,7 @@ import java.util.StringTokenizer;
import org.apache.commons.lang.ArrayUtils;
import org.apache.log4j.Logger;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IMarker;
@@ -52,10 +52,12 @@ import org.eclipse.emf.common.util.Monitor;
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.IJavaModel;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
import org.talend.commons.debug.TalendDebugHandler;
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
import org.talend.core.model.components.ComponentCompilations;
import org.talend.designer.codegen.i18n.Messages;
/**
@@ -298,107 +300,93 @@ public class TalendJetEmitter extends JETEmitter {
progressMonitor.subTask(CodeGenPlugin.getPlugin().getString("_UI_JETOpeningJavaProject_message", //$NON-NLS-1$
new Object[] { project.getName() }));
// javaProject.open(new SubProgressMonitor(progressMonitor, 1));
IPackageFragmentRoot[] packageFragmentRoots = javaProject.getPackageFragmentRoots();
IPackageFragmentRoot sourcePackageFragmentRoot = null;
for (int j = 0; j < packageFragmentRoots.length; ++j) {
IPackageFragmentRoot packageFragmentRoot = packageFragmentRoots[j];
if (packageFragmentRoot.getKind() == IPackageFragmentRoot.K_SOURCE) {
sourcePackageFragmentRoot = packageFragmentRoot;
break;
}
}
String packageName = jetCompiler.getSkeleton().getPackageName();
StringTokenizer stringTokenizer = new StringTokenizer(packageName, "."); //$NON-NLS-1$
IProgressMonitor subProgressMonitor = new SubProgressMonitor(progressMonitor, 1);
subProgressMonitor.beginTask("", stringTokenizer.countTokens() + 4); //$NON-NLS-1$
subProgressMonitor.subTask(CodeGenPlugin.getPlugin().getString("_UI_CreateTargetFile_message")); //$NON-NLS-1$
IFolder sourceContainer = project.getFolder("src");
IContainer sourceContainer = (IContainer) sourcePackageFragmentRoot.getCorrespondingResource();
while (stringTokenizer.hasMoreElements()) {
String folderName = stringTokenizer.nextToken();
sourceContainer = sourceContainer.getFolder(new Path(folderName));
if (!sourceContainer.exists()) {
try {
sourceContainer.create(true, true, new SubProgressMonitor(subProgressMonitor, 1));
((IFolder) sourceContainer).create(true, true, new SubProgressMonitor(subProgressMonitor, 1));
} catch (Exception e) {
// e.printStackTrace();
ExceptionHandler.process(e);
}
}
}
boolean needRebuild = true;
IFile targetFile = sourceContainer.getFile(new Path(jetCompiler.getSkeleton().getClassName() + ".java")); //$NON-NLS-1$
if (!targetFile.exists()) {
subProgressMonitor.subTask(CodeGenPlugin.getPlugin().getString("_UI_JETCreating_message", //$NON-NLS-1$
new Object[] { targetFile.getFullPath() }));
targetFile.create(contents, true, new SubProgressMonitor(subProgressMonitor, 1));
} else {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
DataInputStream dis = new DataInputStream(targetFile.getContents());
int len = 0;
byte[] buf = new byte[1024];
while (((len = dis.read(buf))) != -1) {
baos.write(buf, 0, len);
}
dis.close();
String currentContent = baos.toString();
String newContent = outputStream.toString();
// since the build is done on linux, if use windows, it will use different rules for \r + \n
// so compare without \r, at least to see if original string is the same
// if yes, consider all is ok, no need to replace the content and recompile
currentContent = currentContent.replace("\r", ""); //$NON-NLS-1$//$NON-NLS-2$
newContent = newContent.replace("\r", ""); //$NON-NLS-1$//$NON-NLS-2$
if (!newContent.equals(currentContent)) {
subProgressMonitor.subTask(CodeGenPlugin.getPlugin().getString("_UI_JETUpdating_message", //$NON-NLS-1$
new Object[] { targetFile.getFullPath() }));
targetFile.setContents(contents, true, true, new SubProgressMonitor(subProgressMonitor, 1));
} else {
needRebuild = false;
}
subProgressMonitor.subTask(CodeGenPlugin.getPlugin().getString("_UI_JETUpdating_message", //$NON-NLS-1$
new Object[] { targetFile.getFullPath() }));
targetFile.setContents(contents, true, true, new SubProgressMonitor(subProgressMonitor, 1));
}
// if jetEmitter.getMethod() == null, means the class file doesn't exist anymore
// it should be impossible to have only the class file deleted and the .java never modified, but still
// handle this case.
if (needRebuild || jetEmitter.getMethod() == null) {
subProgressMonitor.subTask(CodeGenPlugin.getPlugin().getString("_UI_JETBuilding_message", //$NON-NLS-1$
new Object[] { project.getName() }));
subProgressMonitor.subTask(CodeGenPlugin.getPlugin().getString("_UI_JETBuilding_message", //$NON-NLS-1$
new Object[] { project.getName() }));
if (!ComponentCompilations.getMarkers()) {
project.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, new SubProgressMonitor(subProgressMonitor, 1));
}
IMarker[] markers = targetFile.findMarkers(IMarker.PROBLEM, true, IResource.DEPTH_INFINITE);
boolean errors = false;
for (int i = 0; i < markers.length; ++i) {
IMarker marker = markers[i];
if (marker.getAttribute(IMarker.SEVERITY, IMarker.SEVERITY_INFO) == IMarker.SEVERITY_ERROR) {
errors = true;
subProgressMonitor.subTask(marker.getAttribute(IMarker.MESSAGE) + " : " //$NON-NLS-1$
+ (CodeGenPlugin.getPlugin().getString("jet.mark.file.line", new Object[] { //$NON-NLS-1$
targetFile.getLocation(), marker.getAttribute(IMarker.LINE_NUMBER) })));
log.error(jetEmitter.templateURI.substring(jetEmitter.templateURI.lastIndexOf("/") + 1) //$NON-NLS-1$
+ Messages.getString(
"TalendJetEmitter.compileFail", //$NON-NLS-1$
marker.getAttribute(IMarker.MESSAGE),
(CodeGenPlugin.getPlugin().getString("jet.mark.file.line", new Object[] { //$NON-NLS-1$
targetFile.getLocation(), marker.getAttribute(IMarker.LINE_NUMBER) }))));
}
IMarker[] markers = targetFile.findMarkers(IMarker.PROBLEM, true, IResource.DEPTH_INFINITE);
boolean errors = false;
for (int i = 0; i < markers.length; ++i) {
IMarker marker = markers[i];
if (marker.getAttribute(IMarker.SEVERITY, IMarker.SEVERITY_INFO) == IMarker.SEVERITY_ERROR) {
errors = true;
subProgressMonitor.subTask(marker.getAttribute(IMarker.MESSAGE) + " : " //$NON-NLS-1$
+ (CodeGenPlugin.getPlugin().getString("jet.mark.file.line", new Object[] { //$NON-NLS-1$
targetFile.getLocation(), marker.getAttribute(IMarker.LINE_NUMBER) })));
log.error(jetEmitter.templateURI.substring(jetEmitter.templateURI.lastIndexOf("/") + 1) //$NON-NLS-1$
+ Messages.getString(
"TalendJetEmitter.compileFail", //$NON-NLS-1$
marker.getAttribute(IMarker.MESSAGE),
(CodeGenPlugin.getPlugin().getString("jet.mark.file.line", new Object[] { //$NON-NLS-1$
targetFile.getLocation(), marker.getAttribute(IMarker.LINE_NUMBER) }))));
}
}
if (!errors) {
subProgressMonitor.subTask(CodeGenPlugin.getPlugin().getString("_UI_JETLoadingClass_message", //$NON-NLS-1$
new Object[] { jetCompiler.getSkeleton().getClassName() + ".class" })); //$NON-NLS-1$
if (!errors) {
subProgressMonitor.subTask(CodeGenPlugin.getPlugin().getString("_UI_JETLoadingClass_message", //$NON-NLS-1$
new Object[] { jetCompiler.getSkeleton().getClassName() + ".class" })); //$NON-NLS-1$
// Construct a proper URL for relative lookup.
//
URL url = new File(project.getLocation()
+ "/" + javaProject.getOutputLocation().removeFirstSegments(1) + "/") //$NON-NLS-1$ //$NON-NLS-2$
.toURL();
URLClassLoader theClassLoader = new URLClassLoader(new URL[] { url }, jetEmitter.classLoader);
Class theClass = theClassLoader.loadClass((packageName.length() == 0 ? "" : packageName + ".") //$NON-NLS-1$ //$NON-NLS-2$
+ jetCompiler.getSkeleton().getClassName());
String methodName = jetCompiler.getSkeleton().getMethodName();
Method[] methods = theClass.getDeclaredMethods();
for (int i = 0; i < methods.length; ++i) {
if (methods[i].getName().equals(methodName)) {
jetEmitter.setMethod(methods[i]);
break;
}
// Construct a proper URL for relative lookup.
//
URL url = new File(project.getLocation() + "/" + javaProject.getOutputLocation().removeFirstSegments(1) + "/") //$NON-NLS-1$ //$NON-NLS-2$
.toURL();
URLClassLoader theClassLoader = new URLClassLoader(new URL[] { url }, jetEmitter.classLoader);
Class theClass = theClassLoader.loadClass((packageName.length() == 0 ? "" : packageName + ".") //$NON-NLS-1$ //$NON-NLS-2$
+ jetCompiler.getSkeleton().getClassName());
String methodName = jetCompiler.getSkeleton().getMethodName();
Method[] methods = theClass.getDeclaredMethods();
for (int i = 0; i < methods.length; ++i) {
if (methods[i].getName().equals(methodName)) {
jetEmitter.setMethod(methods[i]);
break;
}
}
}
subProgressMonitor.done();
} catch (CoreException exception) {
TalendDebugHandler.debug(exception);

View File

@@ -620,16 +620,11 @@ public final class CodeGeneratorEmittersPoolFactory {
} catch (Error e) {
throw new ClassNotFoundException(e.getMessage(), e);
}
// TDI-23079
try {
Method[] methods = theClass.getDeclaredMethods();
for (int i = 0; i < methods.length; ++i) {
if (methods[i].getName().equals(methodName)) {
return methods[i];
}
Method[] methods = theClass.getDeclaredMethods();
for (int i = 0; i < methods.length; ++i) {
if (methods[i].getName().equals(methodName)) {
return methods[i];
}
} catch (Exception e) {
return null;
}
return null;
}

View File

@@ -1 +0,0 @@
RefreshComponenentsAction.Label=Componentenlijst verversen

View File

@@ -1,2 +0,0 @@
DownloadComponenentsAction.Label=\u4E0B\u8F7D\u9009\u62E9\u7684\u7EC4\u4EF6
RefreshComponenentsAction.Label=\u5237\u65B0\u7EC4\u4EF6\u6E05\u5355

View File

@@ -1,7 +1,6 @@
ExchangeView.Exchange=Exchange
AvailableExtensionsComposite.ExtensionName=Nom de l'extension
AvailableExtensionsComposite.Version=Version
AvailableExtensionsComposite.Rating=Note
AvailableExtensionsComposite.Author=Auteur
AvailableExtensionsComposite.ViewDetail.installOperateStatus=Installer
AvailableExtensionsComposite.ViewDetail.WriteReview=Donnez votre avis
@@ -10,7 +9,6 @@ DownloadedExtensionsComposite.DownloadedVersion=Version t
DownloadedExtensionsComposite.DownloadDate=Date de téléchargement
DownloadedExtensionsComposite.installedOperateStatus=Installé
DownloadedExtensionsComposite.updateOperateStatus=Mettre à jour
MyExtensionsComposite.Version=Version
MyExtensionsComposite.UploadDate=Date du chargement
MyExtensionsComposite.AddNewExtensionTitle=Ajouter une nouvelle extension
MyExtensionsComposite.UpLoadNewVersionOperateStatus=Charger une nouvelle version
@@ -21,7 +19,6 @@ MyExtensionsComposite.Form.ExtensionTitle=Titre de l'extension
MyExtensionsComposite.Form.InitialVersion=Version initiale
MyExtensionsComposite.Form.Compatibility=Compatibilité
MyExtensionsComposite.Form.Compatibility.AllVersions=Toutes les versions
MyExtensionsComposite.Form.Compatibility.Version=Version
MyExtensionsComposite.Form.Compatibility.AllVersionsExcept=Toutes les versions sauf :
MyExtensionsComposite.Form.Compatibility.OnlyTheseVersions=Uniquement ces versions :
MyExtensionsComposite.Form.Description=Description

View File

@@ -1,13 +1 @@
AvailableExtensionsComposite.Version=Versie
DownloadedExtensionsComposite.updateOperateStatus=Update
MyExtensionsComposite.Version=Versie
MyExtensionsComposite.UpdateOperateStatus=Update
MyExtensionsComposite.ModifyOperateStatus=Wijzigen
MyExtensionsComposite.DeleteOperateStatus=Verwijderen
MyExtensionsComposite.Form.Compatibility.Version=Versie
MyExtensionsComposite.Form.Upload.Browse=Blader...
RefreshJob.FindExtensions.Title=Beschikbare extensies zoeken
RefreshJob.FindExtensions.Message=Extensies zoeken op Exchange...
UploadRevisionJob.Title=Upload Revisie...
UploadRevisionJob.Message=Upload Revisie...
UploadRevisionAction.InstalledFailure=Upload Revisie gefaald.

View File

@@ -1,4 +1,5 @@
DownloadedExtensionsComposite.updateOperateStatus=UPDATE
MyExtensionsComposite.UpdateOperateStatus=UPDATE
MyExtensionsComposite.DeleteOperateStatus=DELETE
ImportExchangeDialog.TEMPLATES_BUTTON=SQL \u0161abloni
ImportExchangeDialog.REFRESH_BUTTON=Osve\u017Eavanje

View File

@@ -1,25 +0,0 @@
AvailableExtensionsComposite.ExtensionName=\u6269\u5C55\u540D
AvailableExtensionsComposite.Version=\u7248\u672C
AvailableExtensionsComposite.Author=\u4F5C\u8005
AvailableExtensionsComposite.FilterTitle=\u8FC7\u6EE4
DownloadedExtensionsComposite.ExtensionName=\u6269\u5C55\u540D
DownloadedExtensionsComposite.installedOperateStatus=\u5DF2\u88C5\u8F7D
DownloadedExtensionsComposite.updateOperateStatus=\u66F4\u65B0
MyExtensionsComposite.ExtensionName=\u6269\u5C55\u540D
MyExtensionsComposite.Version=\u7248\u672C
MyExtensionsComposite.UpdateOperateStatus=\u66F4\u65B0
MyExtensionsComposite.DeleteOperateStatus=\u5220\u9664
MyExtensionsComposite.Form.Compatibility.Version=\u7248\u672C
MyExtensionsComposite.Form.Description=\u5FC5\u8981\u7684
MyExtensionsComposite.Form.Upload.Browse=\u6D4F\u89C8...
DownloadComponenentsAction.DownloadTaskName=\u4ECEURL\u4E0B\u8F7D\u6587\u4EF6
ImportExchangeDialog.dialogTitle=\u4ECETalend Exchange\u9009\u62E9\u4E00\u4E2A\u9879\u76EE
ImportExchangeDialog.WARNING=\u8B66\u544A
ImportExchangeDialog.EXTENSION_NAME=\u6269\u5C55\u540D
ImportExchangeDialog.LATEST_REVISION=\u6700\u65B0\u7248\u672C
ImportExchangeDialog.JOB_BUTTON=\u4F5C\u4E1A\u8BBE\u8BA1
ImportExchangeDialog.DOWNLOAD_JOB=\u4E0B\u8F7D\u4F5C\u4E1A\u8BBE\u8BA1
ImportExchangeDialog.ROUTINES_BUTTON=\u5E38\u89C4
ImportExchangeDialog.TEMPLATES_PROGRESSBAR=\u4E0B\u8F7DSQL\u6A21\u677F......
ImportExchangeDialog.REFRESH_BUTTON=\u5237\u65B0
ImportExchangeDialog.OPERATION_CANCELLED=\u64CD\u4F5C\u5DF2\u53D6\u6D88

View File

@@ -75,16 +75,14 @@ public class ExchangeComponentsProvider extends AbstractComponentsProvider {
private void copyFolder(File externalComponentsLocation, File installFolder) throws IOException {
FileFilter folderFilter = new FileFilter() {
@Override
public boolean accept(File file) {
return file.isDirectory();
}
};
FileFilter ff = new FileFilter() {
@Override
public boolean accept(File pathname) {
if (FilesUtils.isSVNFolder(pathname)) {
if (pathname.getName().equals(".svn")) {
return false;
}
return true;

View File

@@ -0,0 +1,185 @@
// ============================================================================
//
// 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.designer.components.exchange.jobs;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.URL;
import java.net.URLConnection;
import java.util.ArrayList;
import java.util.List;
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
import org.talend.designer.components.exchange.util.ExchangeWebService;
import us.monoid.json.JSONObject;
/**
*
* DOC hcyi class global comment. Detailled comment
*/
public class ComponentDownloader {
private List<DownloadListener> fListeners = new ArrayList<DownloadListener>();
private boolean fCancel = false;
private static final int BUFFER_SIZE = 8192;
/**
* Download file from specific url to local folder.
*
* @param componentUrl The file url to download
* @param targetFolder Local folder to store downloaded file
* @throws Exception
*/
public void download(String componentUrl, String targetFolder) throws Exception {
String fileName = componentUrl.substring(componentUrl.lastIndexOf('/'));
File destination = new File(targetFolder + fileName);
URL url = new URL(componentUrl);
download(url, destination);
}
/**
* Download file from specific url.
*
* @param componentUrl The file url to download
* @param destination The local file to be saved
* @throws Exception
*/
public void download(URL componentUrl, File destination) throws Exception {
BufferedInputStream bis = null;
BufferedOutputStream bos = null;
try {
URLConnection connection = componentUrl.openConnection();
bis = new BufferedInputStream(connection.getInputStream());
bos = new BufferedOutputStream(new FileOutputStream(destination));
fireDownloadStart(connection.getContentLength());
byte[] buf = new byte[BUFFER_SIZE];
int bytesDownloaded = 0;
int bytesRead = -1;
while ((bytesRead = bis.read(buf)) != -1) {
bos.write(buf, 0, bytesRead);
bytesDownloaded += bytesRead;
fireDownloadProgress(bytesRead);
if (fCancel) {
// cacel download process
return;
}
}
bos.flush();
// System.out.println(bytesDownloaded);
fireDownloadComplete();
} finally {
Exception e = null;
if (bis != null) {
try {
bis.close();
} catch (IOException ioe) {
e = ioe;
}
}
if (bos != null) {
try {
bos.close();
} catch (IOException ioe) {
e = ioe;
}
}
if (e != null) {
// rethrow the exception to caller
throw e;
}
}
}
/**
* Return true if the user cancel download process.
*
* @return the cancel
*/
public boolean isCancel() {
return fCancel;
}
/**
* Set true if the user cacel download process.
*
* @param cancel the cancel to set
*/
public void setCancel(boolean cancel) {
fCancel = cancel;
}
/**
* Notify listeners about progress.
*
* @param bytesRead
*/
private void fireDownloadProgress(int bytesRead) {
for (DownloadListener listener : fListeners) {
listener.downloadProgress(this, bytesRead);
}
}
/**
* Notify listeners at the end of download process.
*/
private void fireDownloadComplete() {
for (DownloadListener listener : fListeners) {
listener.downloadComplete();
}
}
/**
* Notify listeners at the begining of download process.
*/
private void fireDownloadStart(int contentLength) {
for (DownloadListener listener : fListeners) {
listener.downloadStart(contentLength);
}
}
/**
* Add listener to observe the download process.
*
* @param listener
*/
public void addDownloadListener(DownloadListener listener) {
fListeners.add(listener);
}
public void removeDownloadListener(DownloadListener listener) {
fListeners.remove(listener);
}
public static void main(String[] args) {
try {
new ComponentDownloader().download("http://talendforge.org/ext/upload/extension-33/revision-45/tFileOutputPDF.zip", //$NON-NLS-1$
"d:/temp"); //$NON-NLS-1$
} catch (Exception e) {
// e.printStackTrace();
ExceptionHandler.process(e);
}
}
}

View File

@@ -0,0 +1,41 @@
// ============================================================================
//
// 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.designer.components.exchange.jobs;
/**
*
* DOC hcyi class global comment. Detailled comment
*/
public interface DownloadListener {
/**
* Notify before download start.
*
* @param totalSize The size of file.
*/
void downloadStart(int totalSize);
/**
* Notify when download progress. DOC hcw Comment method "downloadProgress".
*
* @param downloader The source that trigger this event.
* @param bytesDownloaded The number of bytes that have readed just now.
*/
void downloadProgress(ComponentDownloader downloader, int bytesDownloaded);
/**
* Notify after download complete.
*/
void downloadComplete();
}

View File

@@ -42,8 +42,6 @@ import org.eclipse.ui.intro.config.IIntroAction;
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
import org.talend.core.CorePlugin;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.download.DownloadHelper;
import org.talend.core.download.DownloadListener;
import org.talend.core.language.ECodeLanguage;
import org.talend.core.language.LanguageManager;
import org.talend.core.model.components.ComponentUtilities;
@@ -53,7 +51,9 @@ import org.talend.designer.codegen.ICodeGeneratorService;
import org.talend.designer.components.exchange.ExchangeComponentsProvider;
import org.talend.designer.components.exchange.ExchangeConstants;
import org.talend.designer.components.exchange.i18n.Messages;
import org.talend.designer.components.exchange.jobs.ComponentDownloader;
import org.talend.designer.components.exchange.jobs.ComponentInstaller;
import org.talend.designer.components.exchange.jobs.DownloadListener;
import org.talend.designer.components.exchange.model.ComponentExtension;
import org.talend.designer.components.exchange.ui.htmlcontent.ContentConstants;
import org.talend.designer.components.exchange.ui.views.ExchangeManager;
@@ -288,7 +288,7 @@ public class DownloadComponenentsAction extends Action implements IIntroAction {
URL url = new URL(downloadUrl);
monitor.setTaskName(ExchangeConstants.getDownloadTaskNameLable() + url.toString());
DownloadHelper downloader = new DownloadHelper();
ComponentDownloader downloader = new ComponentDownloader();
downloader.addDownloadListener(this);
// block until download complete
downloader.download(url, localZipFile);
@@ -339,7 +339,7 @@ public class DownloadComponenentsAction extends Action implements IIntroAction {
public void downloadComplete() {
}
public void downloadProgress(DownloadHelper downloader, int bytesRead) {
public void downloadProgress(ComponentDownloader downloader, int bytesRead) {
if (fMonitor.isCanceled()) {
// cancel download
downloader.setCancel(true);

View File

@@ -50,9 +50,9 @@ import org.eclipse.ui.PlatformUI;
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
import org.talend.commons.ui.runtime.image.EImage;
import org.talend.commons.ui.runtime.image.ImageProvider;
import org.talend.core.download.DownloadHelper;
import org.talend.designer.components.exchange.ExchangePlugin;
import org.talend.designer.components.exchange.i18n.Messages;
import org.talend.designer.components.exchange.jobs.ComponentDownloader;
import org.talend.designer.components.exchange.jobs.ComponentSearcher;
import org.talend.designer.components.exchange.model.ComponentExtension;
import org.talend.designer.components.exchange.model.VersionRevision;
@@ -182,7 +182,7 @@ public class ImportExchangeDialog extends Dialog {
public void run() {
try {
new DownloadHelper().download(url, tempFile);
new ComponentDownloader().download(url, tempFile);
} catch (Exception e) {
ExceptionHandler.process(e);
}

View File

@@ -234,7 +234,7 @@ public class DownloadExtensionProvider implements IIntroXHTMLContentProvider {
String url = "http://org.eclipse.ui.intro/runAction?pluginId=org.talend.designer.components.exchange&"
+ "class=org.talend.designer.components.exchange.ui.actions.UpdateAction&"
+ "id=org.talend.designer.components.exchange.ui.actions.UpdateAction&"
+ AvailableCompositeProvider.NUMBER + "=" + count;
+ AvailableCompositeProvider.NUMBER + count;
;
hyperlink.setAttribute("href", url);
Text view = dom.createTextNode(Messages

View File

@@ -1,88 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="org.talend.designer.components.libs" default="process" basedir=".">
<property name="component.plugin.home" value="../../../org.talend.designer.components.localprovider/components" />
<!-- #################################################### -->
<!-- modification 1: config -->
<property name="jar.name" value="cobolX.jar" />
<property name="component.name" value="tFileInputEBCDIC" />
<property name="author.name" value="jjzhou" />
<!-- modification 2: compile classpath -->
<path id="compile.classpath">
</path>
<!-- #################################################### -->
<!-- sourcecode and final jar path -->
<property name="source.home" value="." />
<property name="jar.home" value="${component.plugin.home}/${component.name}/${jar.name}" />
<!-- temp dir for clasee files -->
<property name="build.dir" value="../../build" />
<!-- compile option -->
<property name="compile.debug" value="true" />
<property name="compile.deprecation" value="false" />
<property name="compile.optimize" value="true" />
<target name="process" description="prepare a temp dir">
<antcall target="prepare" />
<antcall target="compile" />
<antcall target="clean" />
</target>
<target name="prepare" description="prepare a temp dir">
<delete dir="${build.dir}" />
<mkdir dir="${build.dir}" />
<mkdir dir="${build.dir}/classes" />
</target>
<target name="compile" description="Compile Java sources">
<!-- compile -->
<javac srcdir="${source.home}" destdir="${build.dir}/classes" debug="${compile.debug}" deprecation="${compile.deprecation}" optimize="${compile.optimize}">
<classpath refid="compile.classpath" />
</javac>
<!-- include source code -->
<copy todir="${build.dir}/classes">
<fileset dir="${source.home}">
<exclude name="build.xml" />
</fileset>
</copy>
<!-- make jar -->
<tstamp>
<format property="date" pattern="yyyy-MM-dd HH:mm:ss" />
</tstamp>
<jar destfile="${build.dir}/${jar.name}" basedir="${build.dir}/classes">
<manifest>
<!-- who -->
<attribute name="Built-By" value="${author.name}" />
<!-- when -->
<attribute name="Built-Date" value="${date}"/>
<!-- JDK version -->
<attribute name="Created-By" value="${java.version} (${java.vendor})" />
<!-- Information about the program itself -->
<attribute name="Implementation-Vendor" value="Talend SA" />
<attribute name="Implementation-Title" value="${jar.name}" />
<attribute name="Implementation-Version" value="1.0" />
</manifest>
</jar>
<!-- move jar -->
<move file="${build.dir}/${jar.name}" tofile="${jar.home}" />
</target>
<target name="clean" description="clean the temp dir">
<delete dir="${build.dir}" />
<mkdir dir="${build.dir}" />
</target>
</project>

View File

@@ -1,57 +0,0 @@
package cobolConversion;
import java.io.UnsupportedEncodingException;
import java.nio.charset.Charset;
public enum CharSetEnum {
// define data table for using
Cp037("Cp037", "{ABCDEFGHI", "}JKLMNOPQR"), Cp273("Cp273", "äABCDEFGHI",
"üJKLMNOPQR"), Cp277("Cp277", "æABCDEFGHI", "åJKLMNOPQR"), Cp278(
"Cp278", "äABCDEFGHI", "åJKLMNOPQR"), Cp280("Cp280", "àABCDEFGHI",
"èJKLMNOPQR"), Cp284("Cp284", "{ABCDEFGHI", "}JKLMNOPQR"), Cp285(
"Cp285", "{ABCDEFGHI", "}JKLMNOPQR"), Cp297("Cp297", "éABCDEFGHI",
"èJKLMNOPQR"), Cp420("Cp420", "{ABCDEFGHI", "}JKLMNOPQR"), Cp424(
"Cp424", "{ABCDEFGHI", "}JKLMNOPQR"), Cp500("Cp500", "{ABCDEFGHI",
"}JKLMNOPQR"), Cp870("Cp870", "{ABCDEFGHI", "}JKLMNOPQR"), Cp871(
"Cp871", "þABCDEFGHI", "æJKLMNOPQR"), Cp875("Cp875", "{ABCDEFGHI",
"}JKLMNOPQR"), Cp1025("Cp1025", "{ABCDEFGHI", "}JKLMNOPQR"), Cp1026(
"Cp1026", "çABCDEFGHI", "ğJKLMNOPQR"), Cp1047("Cp1047",
"{ABCDEFGHI", "}JKLMNOPQR"), Cp1112("Cp1112", "{ABCDEFGHI",
"}JKLMNOPQR"), Cp1122("Cp1122", "äABCDEFGHI", "ğJKLMNOPQR"), Cp1123(
"Cp1123", "{ABCDEFGHI", "}JKLMNOPQR"), Cp1140("Cp1140",
"{ABCDEFGHI", "}JKLMNOPQR"), Cp1141("Cp1141", "äABCDEFGHI",
"üJKLMNOPQR"), Cp1142("Cp1142", "æABCDEFGHI", "åJKLMNOPQR"), Cp1143(
"Cp1143", "äABCDEFGHI", "åJKLMNOPQR"), Cp1144("Cp1144",
"àABCDEFGHI", "èJKLMNOPQR"), Cp1145("Cp1145", "{ABCDEFGHI",
"}JKLMNOPQR"), Cp1146("Cp1146", "{ABCDEFGHI", "}JKLMNOPQR"), Cp1147(
"Cp1147", "éABCDEFGHI", "èJKLMNOPQR"), Cp1148("Cp1148",
"{ABCDEFGHI", "}JKLMNOPQR"), Cp1149("Cp1149", "þABCDEFGHI",
"æJKLMNOPQR");
String charSet;
String failoverpositives;
String failovernegatives;
//default construct
CharSetEnum(String charSet, String failoverpositives,
String failovernegatives) {
this.charSet = charSet;
this.failoverpositives = failoverpositives;
this.failovernegatives = failovernegatives;
}
public String getCharSet() {
return charSet;
}
public static void main(String[] a) {
String charset = "Cp037";
System.out.println(Charset.defaultCharset());
for (CharSetEnum charsetEnum : CharSetEnum.values()) {
if (charset.equals(charsetEnum.getCharSet())) {
System.out.println(charsetEnum.failoverpositives);
System.out.println(charsetEnum.failovernegatives);
}
}
}
}

View File

@@ -1,115 +0,0 @@
package cobolConversion;
import java.math.BigDecimal;
import org.apache.commons.lang.mutable.MutableInt;
public class EBCDICType3 {
public static BigDecimal readType3Value(byte[] byteValue, int decimal,
boolean isImpliedDecimal) throws Exception {
int len = byteValue.length;
StringBuffer strbuf = new StringBuffer();
int tmp;
int tmp1;
int tmp2;
for (int i = 0; i < len; i++) {
tmp = byteValue[i];
tmp1 = tmp & 0xF0;
tmp2 = tmp1 >> 4;
strbuf.append(tmp2);
if (i < (len - 1)) {
tmp = byteValue[i];
tmp1 = tmp & 0x0F;
strbuf.append(tmp1);
}
}
if ((decimal > 0) && isImpliedDecimal) {
strbuf.insert(strbuf.length() - decimal, '.');
}
BigDecimal retVal;
try {
retVal = new BigDecimal(strbuf.toString());
} catch (NumberFormatException ex) {
throw new Exception();
}
tmp = byteValue[len - 1];
tmp1 = tmp & 0x0F;
if ((tmp1 == 0x0F) || (tmp1 == 0x0C)) {
return retVal;
} else if (tmp1 == 0x0D) {
return retVal.negate();
} else {
return retVal;
}
}
public static byte[] writeType3Value(int length, int decimal,
BigDecimal value, boolean isSigned) throws Exception {
if (decimal != value.scale()) {
BigDecimal tmp = value.setScale(decimal, BigDecimal.ROUND_FLOOR);
value = tmp;
}
String str = value.toPlainString();
int len = str.length();
byte[] buf = new byte[length];
MutableInt k = new MutableInt(len);
byte even; // left and right nibble ( we go from right to left )
byte odd;
for (int i = length - 1; i >= 0; i--) {
// Last byte needs sign nibble
if (i == (length - 1)) {
even = getNextByte(str, k);
if (isSigned) {
if (value.signum() >= 0) {
odd = 0x0C;
} else {
odd = 0x0D;
}
} else {
odd = (byte) 0x0F;
}
} else {
// Packing rest of the digits...
// Get even digit if exist or zero
odd = getNextByte(str, k);
even = getNextByte(str, k);
}
buf[i] = (byte) ((even << 4) | odd);
}
// TODO: Check if str ">" buf and eventually throw an Exc.
return buf;
}
private static byte getNextByte(String number, MutableInt recentlyReturned) {
MutableInt zero = new MutableInt(0);
recentlyReturned.decrement();
if (recentlyReturned.compareTo(zero) >= 0) {
while (!"0123456789".contains(String.valueOf(number
.charAt(recentlyReturned.intValue())))) {
recentlyReturned.decrement();
if (recentlyReturned.compareTo(zero) < 0) {
return 0;
}
}
return (byte) (Character.getNumericValue(number
.charAt(recentlyReturned.intValue())));
} else {
return 0;
}
}
}

View File

@@ -1,146 +0,0 @@
package cobolConversion;
import java.math.BigDecimal;
import cobolConversion.CharSetEnum;
public class EBCDICType9 {
public static byte[] writeType9Value(int length, int decimal, BigDecimal value,
boolean isSigned, boolean isImpliedDecimal,String charset) throws Exception {
byte[] reValue = null;
String failoverpositives = "{ABCDEFGHI";
String failovernegatives = "}JKLMNOPQR";
if (decimal != value.scale()) {
BigDecimal tmp = value.setScale(decimal, BigDecimal.ROUND_FLOOR);
value = tmp;
}
String str = value.toPlainString();
StringBuffer buf = new StringBuffer(str);
// Modify byte with sign ...
if (isSigned) {
int lastidx = buf.length() - 1;
char lastbyte = buf.charAt(lastidx);
char repl;
for (CharSetEnum charsetEnum : CharSetEnum.values()){
if(charset.equals(charsetEnum.getCharSet())){
failoverpositives = charsetEnum.failoverpositives;
failovernegatives = charsetEnum.failovernegatives;
break;
}
}
if (value.signum() >= 0) {
repl = failoverpositives.charAt(Integer.parseInt(String
.valueOf(lastbyte)));
} else {
repl = failovernegatives.charAt(Integer.parseInt(String
.valueOf(lastbyte)));
}
buf.setCharAt(lastidx, repl);
// Delete sign char
String tmp = buf.toString();
String tmp2 = tmp.replace("-", "");
buf = new StringBuffer(tmp2);
}
// Delete decimal point...
if (isImpliedDecimal) {
String tmp = buf.toString();
String tmp2 = tmp.replace(".", "");
buf = new StringBuffer(tmp2);
}
// Adding some leading zeros ...
while (length > buf.length()) {
buf.insert(0, "0");
}
reValue = buf.toString().getBytes(charset);
return reValue;
}
public static BigDecimal readType9Value(byte[] byteValue,int decimal,boolean isImpliedDecimal,String charset) throws Exception{
byte[] b = byteValue;
String failoverpositives = "{ABCDEFGHI";
String failovernegatives = "}JKLMNOPQR";
int idx;
char[] pos = { 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9 };
char[] neg = { 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9 };
String IBMpositives = new String(pos);
String IBMnegatives = new String(neg);
String MFnegatives = "pqrstuvwxy";
String CAnegatives = " !\"#$%&'()";
for (CharSetEnum charsetEnum : CharSetEnum.values()){
if(charset.equals(charsetEnum.getCharSet())){
failoverpositives = charsetEnum.failoverpositives;
failovernegatives = charsetEnum.failovernegatives;
break;
}
}
StringBuffer buf = new StringBuffer(new String(b, charset));
int lastidx = buf.length() - 1;
char lastbyte = buf.charAt(lastidx);
boolean positive = true;
idx = IBMpositives.indexOf(lastbyte);
if (idx > -1) {
buf.replace(lastidx, lastidx + 1, new Integer(idx).toString());
positive = true;
}
idx = IBMnegatives.indexOf(lastbyte);
if (idx > -1) {
buf.replace(lastidx, lastidx + 1, new Integer(idx).toString());
positive = false;
}
idx = failoverpositives.indexOf(lastbyte);
if (idx > -1) {
buf.replace(lastidx, lastidx + 1, new Integer(idx).toString());
positive = true;
}
idx = failovernegatives.indexOf(lastbyte);
if (idx > -1) {
buf.replace(lastidx, lastidx + 1, new Integer(idx).toString());
positive = false;
}
idx = MFnegatives.indexOf(lastbyte);
if (idx > -1) {
buf.replace(lastidx, lastidx + 1, new Integer(idx).toString());
positive = false;
}
idx = CAnegatives.indexOf(lastbyte);
if (idx > -1) {
buf.replace(lastidx, lastidx + 1, new Integer(idx).toString());
positive = false;
}
if ((decimal > 0) && isImpliedDecimal) {
buf.insert(buf.length() - decimal, '.');
}
BigDecimal retVal;
try {
retVal = new BigDecimal(buf.toString());
} catch (NumberFormatException ex) {
throw new Exception();
}
if (!positive) {
retVal = retVal.negate();
}
return retVal;
}
}

View File

@@ -1,216 +0,0 @@
package org.talend.datastewardship.server.ws;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.datatype.XMLGregorianCalendar;
/**
* <p>
* Java class for deleteTasks complex type.
*
* <p>
* The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="deleteTasks">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="typeId" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
* &lt;element name="owner" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;element name="tagLabel" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;element name="createTimeLowerBound" type="{http://www.w3.org/2001/XMLSchema}dateTime" minOccurs="0"/>
* &lt;element name="createTimeUpperBound" type="{http://www.w3.org/2001/XMLSchema}dateTime" minOccurs="0"/>
* &lt;element name="starNum" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
* &lt;element name="limit" type="{http://www.w3.org/2001/XMLSchema}int"/>
* &lt;element name="status" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "deleteTasks", propOrder = { "typeId", "owner", "tagLabel", "createTimeLowerBound", "createTimeUpperBound",
"starNum", "limit", "status" })
public class DeleteTasks {
protected Integer typeId;
protected String owner;
protected String tagLabel;
@XmlSchemaType(name = "dateTime")
protected XMLGregorianCalendar createTimeLowerBound;
@XmlSchemaType(name = "dateTime")
protected XMLGregorianCalendar createTimeUpperBound;
protected Integer starNum;
protected int limit;
protected String status;
/**
* Gets the value of the typeId property.
*
* @return possible object is {@link Integer }
*
*/
public Integer getTypeId() {
return typeId;
}
/**
* Sets the value of the typeId property.
*
* @param value allowed object is {@link Integer }
*
*/
public void setTypeId(Integer value) {
this.typeId = value;
}
/**
* Gets the value of the owner property.
*
* @return possible object is {@link String }
*
*/
public String getOwner() {
return owner;
}
/**
* Sets the value of the owner property.
*
* @param value allowed object is {@link String }
*
*/
public void setOwner(String value) {
this.owner = value;
}
/**
* Gets the value of the tagLabel property.
*
* @return possible object is {@link String }
*
*/
public String getTagLabel() {
return tagLabel;
}
/**
* Sets the value of the tagLabel property.
*
* @param value allowed object is {@link String }
*
*/
public void setTagLabel(String value) {
this.tagLabel = value;
}
/**
* Gets the value of the createTimeLowerBound property.
*
* @return possible object is {@link XMLGregorianCalendar }
*
*/
public XMLGregorianCalendar getCreateTimeLowerBound() {
return createTimeLowerBound;
}
/**
* Sets the value of the createTimeLowerBound property.
*
* @param value allowed object is {@link XMLGregorianCalendar }
*
*/
public void setCreateTimeLowerBound(XMLGregorianCalendar value) {
this.createTimeLowerBound = value;
}
/**
* Gets the value of the createTimeUpperBound property.
*
* @return possible object is {@link XMLGregorianCalendar }
*
*/
public XMLGregorianCalendar getCreateTimeUpperBound() {
return createTimeUpperBound;
}
/**
* Sets the value of the createTimeUpperBound property.
*
* @param value allowed object is {@link XMLGregorianCalendar }
*
*/
public void setCreateTimeUpperBound(XMLGregorianCalendar value) {
this.createTimeUpperBound = value;
}
/**
* Gets the value of the starNum property.
*
* @return possible object is {@link Integer }
*
*/
public Integer getStarNum() {
return starNum;
}
/**
* Sets the value of the starNum property.
*
* @param value allowed object is {@link Integer }
*
*/
public void setStarNum(Integer value) {
this.starNum = value;
}
/**
* Gets the value of the limit property.
*
*/
public int getLimit() {
return limit;
}
/**
* Sets the value of the limit property.
*
*/
public void setLimit(int value) {
this.limit = value;
}
/**
* Gets the value of the status property.
*
* @return possible object is {@link String }
*
*/
public String getStatus() {
return status;
}
/**
* Sets the value of the status property.
*
* @param value allowed object is {@link String }
*
*/
public void setStatus(String value) {
this.status = value;
}
}

View File

@@ -1,58 +0,0 @@
package org.talend.datastewardship.server.ws;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>
* Java class for deleteTasksResponse complex type.
*
* <p>
* The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="deleteTasksResponse">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="return" type="{http://jaxb.dev.java.net/array}int" maxOccurs="unbounded" minOccurs="0"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "deleteTasksResponse", propOrder = { "_return" })
public class DeleteTasksResponse {
@XmlElement(name = "return")
protected int _return;
/**
* Gets the value of the return property.
*
* <p>
* This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to
* the returned list will be present inside the JAXB object. This is why there is not a <CODE>set</CODE> method for
* the return property.
*
*
*/
public int getReturn() {
return _return;
}
/**
* Sets the value of the return property.
*
*/
public void setReturn(int value) {
this._return = value;
}
}

View File

@@ -27,10 +27,8 @@ public class ObjectFactory {
private final static QName _GetTgtRecord_QNAME = new QName("http://ws.server.datastewardship.talend.org/", "getTgtRecord");
private final static QName _Echo_QNAME = new QName("http://ws.server.datastewardship.talend.org/", "echo");
private final static QName _EchoResponse_QNAME = new QName("http://ws.server.datastewardship.talend.org/", "echoResponse");
private final static QName _DeleteTasksResponse_QNAME = new QName("http://ws.server.datastewardship.talend.org/","deleteTasksResponse");
private final static QName _GetSrcRecord_QNAME = new QName("http://ws.server.datastewardship.talend.org/", "getSrcRecord");
private final static QName _GetTgtRecordResponse_QNAME = new QName("http://ws.server.datastewardship.talend.org/", "getTgtRecordResponse");
private final static QName _DeleteTasks_QNAME = new QName("http://ws.server.datastewardship.talend.org/", "deleteTasks");
private final static QName _SearchTasks_QNAME = new QName("http://ws.server.datastewardship.talend.org/", "searchTasks");
private final static QName _GetSrcRecordResponse_QNAME = new QName("http://ws.server.datastewardship.talend.org/", "getSrcRecordResponse");
private final static QName _SearchTasksResponse_QNAME = new QName("http://ws.server.datastewardship.talend.org/", "searchTasksResponse");
@@ -149,15 +147,6 @@ public class ObjectFactory {
return new JAXBElement<EchoResponse>(_EchoResponse_QNAME, EchoResponse.class, null, value);
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link DeleteTasksResponse }{@code >}
*
*/
@XmlElementDecl(namespace = "http://ws.server.datastewardship.talend.org/", name = "deleteTasksResponse")
public JAXBElement<DeleteTasksResponse> createDeleteTasksResponse(DeleteTasksResponse value) {
return new JAXBElement<DeleteTasksResponse>(_DeleteTasksResponse_QNAME, DeleteTasksResponse.class, null, value);
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link GetSrcRecord }{@code >}}
*
@@ -185,15 +174,6 @@ public class ObjectFactory {
return new JAXBElement<SearchTasks>(_SearchTasks_QNAME, SearchTasks.class, null, value);
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link DeleteTasks }{@code >}
*
*/
@XmlElementDecl(namespace = "http://ws.server.datastewardship.talend.org/", name = "deleteTasks")
public JAXBElement<DeleteTasks> createDeleteTasks(DeleteTasks value) {
return new JAXBElement<DeleteTasks>(_DeleteTasks_QNAME, DeleteTasks.class, null, value);
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link GetSrcRecordResponse }{@code >}}
*

View File

@@ -68,27 +68,4 @@ public interface TDSCWS {
@WebParam(name = "taskID", targetNamespace = "")
java.lang.String taskID
);
@WebResult(name = "return", targetNamespace = "")
@RequestWrapper(localName = "deleteTasks", targetNamespace = "http://ws.server.datastewardship.talend.org/", className = "org.talend.datastewardship.server.ws.DeleteTasks")
@WebMethod
@ResponseWrapper(localName = "deleteTasksResponse", targetNamespace = "http://ws.server.datastewardship.talend.org/", className = "org.talend.datastewardship.server.ws.DeleteTasksResponse")
public int deleteTasks(
@WebParam(name = "typeId", targetNamespace = "")
java.lang.Integer typeId,
@WebParam(name = "owner", targetNamespace = "")
java.lang.String owner,
@WebParam(name = "tagLabel", targetNamespace = "")
java.lang.String tagLabel,
@WebParam(name = "createTimeLowerBound", targetNamespace = "")
javax.xml.datatype.XMLGregorianCalendar createTimeLowerBound,
@WebParam(name = "createTimeUpperBound", targetNamespace = "")
javax.xml.datatype.XMLGregorianCalendar createTimeUpperBound,
@WebParam(name = "starNum", targetNamespace = "")
java.lang.Integer starNum,
@WebParam(name = "limit", targetNamespace = "")
int limit,
@WebParam(name = "status", targetNamespace = "")
java.lang.String status
);
}

View File

@@ -1,7 +1,6 @@
package org.talend.xml.sax;
import java.io.IOException;
import java.io.Reader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
@@ -12,6 +11,12 @@ import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.talend.xml.sax.FunctionRegister;
import org.talend.xml.sax.LoopEntry;
import org.talend.xml.sax.SAXLoopCompositeHandler;
import org.talend.xml.sax.SAXLoopHandler;
import org.talend.xml.sax.SAXLoopIterator;
import org.talend.xml.sax.SAXMultiLoopIterator;
import org.talend.xml.sax.commons.ISAXLooper;
import org.talend.xml.sax.function.inter.Function;
import org.talend.xml.sax.io.UnicodeReader;
@@ -137,7 +142,6 @@ public class ComplexSAXLooper implements ISAXLooper {
*/
public void parse(String fileURL, String charset) {
this.charset = charset;
Reader reader = null;
try {
DefaultHandler hd = null;
SAXParser saxParser = null;
@@ -154,8 +158,9 @@ public class ComplexSAXLooper implements ISAXLooper {
hd = newHandler2();
}
saxParser.setProperty("http://xml.org/sax/properties/lexical-handler", hd);
reader = new UnicodeReader(new java.io.FileInputStream(fileURL),this.charset);
org.xml.sax.InputSource inSource = new org.xml.sax.InputSource(reader);
org.xml.sax.InputSource inSource = new org.xml.sax.InputSource(
new UnicodeReader(new java.io.FileInputStream(fileURL),this.charset));
// inSource.setEncoding(this.charset);
saxParser.parse(inSource, hd);
} catch (ParserConfigurationException e) {
@@ -164,14 +169,6 @@ public class ComplexSAXLooper implements ISAXLooper {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally {
if(reader!=null) {
try {
reader.close();
} catch(IOException e) {
e.printStackTrace();
}
}
}
}
@@ -182,7 +179,6 @@ public class ComplexSAXLooper implements ISAXLooper {
*/
public void parse(java.io.InputStream is, String charset) {
this.charset = charset;
Reader reader = null;
try {
DefaultHandler hd = null;
SAXParser saxParser = SAXParserFactory.newInstance().newSAXParser();
@@ -193,9 +189,9 @@ public class ComplexSAXLooper implements ISAXLooper {
}
saxParser.setProperty("http://xml.org/sax/properties/lexical-handler", hd);
// routines.system.UnicodeReader.java is used to ignore the BOM of the source file.
reader = new UnicodeReader(is,this.charset);
org.xml.sax.InputSource inSource = new org.xml.sax.InputSource(reader);
saxParser.parse(inSource, hd);
org.xml.sax.InputSource inSource = new org.xml.sax.InputSource(new UnicodeReader(is,this.charset));
// inSource.setEncoding(this.charset);
saxParser.parse(is, hd);
} catch (ParserConfigurationException e) {
e.printStackTrace();
@@ -203,14 +199,6 @@ public class ComplexSAXLooper implements ISAXLooper {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally {
if(reader!=null) {
try {
reader.close();
} catch(IOException e) {
e.printStackTrace();
}
}
}
}

View File

@@ -12,7 +12,6 @@
// ============================================================================
package org.talend.xml.sax.simpleparser;
import java.io.Reader;
import java.util.Iterator;
import java.util.Map;
import java.util.concurrent.Callable;
@@ -114,7 +113,6 @@ public class SimpleSAXLooper implements ISAXLooper,Callable {
}
public Object call() throws Exception {
Reader reader = null;
try {
DefaultHandler hd = new SimpleSAXLoopHandler(nodes, bcache);
SAXParser saxParser = null;
@@ -128,22 +126,17 @@ public class SimpleSAXLooper implements ISAXLooper,Callable {
saxParser.setProperty("http://xml.org/sax/properties/lexical-handler", hd);
if (fileURL != null) {
// routines.system.UnicodeReader.java is used to ignore the BOM of the source file.
reader = new UnicodeReader(new java.io.FileInputStream(fileURL),this.charset);
org.xml.sax.InputSource inSource = new org.xml.sax.InputSource(reader);
org.xml.sax.InputSource inSource = new org.xml.sax.InputSource(
new UnicodeReader(new java.io.FileInputStream(fileURL),this.charset));
// inSource.setEncoding(this.charset);
saxParser.parse(inSource, hd);
} else {
reader = new UnicodeReader(is,this.charset);
org.xml.sax.InputSource inSource = new org.xml.sax.InputSource(reader);
saxParser.parse(inSource, hd);
org.xml.sax.InputSource inSource = new org.xml.sax.InputSource(new UnicodeReader(is,this.charset));
// inSource.setEncoding(this.charset);
saxParser.parse(is, hd);
}
} finally {
try {
if(reader!=null) {
reader.close();
}
} finally {
bcache.notifyErrorOccurred();
}
bcache.notifyErrorOccurred();
}
return null;
}

View File

@@ -35,9 +35,7 @@ public class FileCopy {
public static void copyFile(String srcFileName, String desFileName, boolean delSrc) throws Exception {
FileInputStream srcInputStream = null;
try{
srcInputStream = new FileInputStream(srcFileName);
FileInputStream srcInputStream = new FileInputStream(srcFileName);
long lastModified = new File(srcFileName).lastModified();
int available = srcInputStream.available();
if (available > L_SIZE) {// X > 100M
@@ -49,11 +47,6 @@ public class FileCopy {
}
// keep modification_time
new File(desFileName).setLastModified(lastModified);
}finally{
if(srcInputStream!=null){
srcInputStream.close();
}
}
}
private static void copyFileS(String srcFileName, FileInputStream srcInputStream, String desFileName, boolean delSrc)
@@ -100,13 +93,8 @@ public class FileCopy {
try {
in = srcInputStream.getChannel();
out = new FileOutputStream(dest).getChannel();
int maxCount = (32 * 1024 * 1024) - (28 * 1024);
long size = in.size();
long position = 0;
while (position < size) {
position += in.transferTo(position, maxCount, out);
}
in.transferTo(0, in.size(), out);
in.close();
out.close();

View File

@@ -1,55 +1,32 @@
package org.talend.mdm.bulkload.client;
import java.io.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.Reader;
import java.net.URL;
import java.util.List;
public class BulkloadClient {
private String url;
private String username;
private String password;
private String universe;
private String cluster;
private String concept;
private String dataModel;
private BulkloadOptions options = new BulkloadOptions();
private static final AtomicInteger startedBulkloadCount = new AtomicInteger(0);
public BulkloadClient(String url, String username, String password, String universe, String cluster, String concept, String dataModel) {
String url;
String username;
String password;
String universe;
String cluster;
String concept;
String datamodel;
BulkloadOptions options=new BulkloadOptions();
public BulkloadClient(String url, String username,String password,String universe,String cluster,String concept,String datamodel) {
this.url=url;
this.username=username;
this.password=password;
this.universe=universe;
this.cluster=cluster;
this.concept=concept;
this.dataModel = dataModel;
this.datamodel=datamodel;
}
public void startThreadCount(){
// Kept for compatibility with tMDMBulkload.
}
public void waitForEndOfQueue() {
try {
synchronized (startedBulkloadCount) {
while (startedBulkloadCount.get() > 0) {
System.out.println(startedBulkloadCount.get() + " remaining.");
startedBulkloadCount.wait();
}
}
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
public String getUrl() {
return url;
}
@@ -99,11 +76,11 @@ public class BulkloadClient {
}
public String getDatamodel() {
return dataModel;
return datamodel;
}
public void setDatamodel(String dataModel) {
this.dataModel = dataModel;
public void setDatamodel(String datamodel) {
this.datamodel = datamodel;
}
public BulkloadOptions getOptions() {
@@ -113,75 +90,93 @@ public class BulkloadClient {
public void setOptions(BulkloadOptions options) {
this.options = options;
}
/**
* load from a huge xml string
* @param xmlString A full xml document.
* @throws Exception Thrown in case of bulk load error.
*/
public void load(String xmlString) throws Exception {
load(new ByteArrayInputStream(xmlString.getBytes("UTF-8")));
public void load(List<String > items) {
doLoad(items);
}
/**
* load from a huge xml string
* @param xmlString
*/
public void load(String xmlString)throws Exception {
List<String > items=BulkloadClientUtil.getItemXmls(xmlString);
doLoad(items);
}
private void doLoad(List<String> items) {
if(items.size()>options.getArraySize()) {
int loop=items.size()/options.getArraySize();
int left=items.size()-options.getArraySize()*loop;
for(int i=0; i<loop; i++) {
List<String> subItems=items.subList(i*options.getArraySize(), (i+1)*options.getArraySize());
try {
BulkloadClientUtil.bulkload(url, cluster, concept, datamodel, options.isValidate(), options.isSmartpk(), subItems, username, password,universe);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
if(left>0) {
List<String> subItems=items.subList(loop*options.getArraySize(), loop*options.getArraySize()+left);
try {
BulkloadClientUtil.bulkload(url, cluster, concept, datamodel, options.isValidate(), options.isSmartpk(), subItems, username, password,universe);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}else {
try {
BulkloadClientUtil.bulkload(url, cluster, concept, datamodel, options.isValidate(), options.isSmartpk(), items, username, password,universe);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
/**
* load from File
* @param inputXmlFile
*/
public void load(Reader inputXmlFile) {
BufferedReader reader=null;
try {
reader=new BufferedReader(inputXmlFile);
StringBuffer sb=new StringBuffer();
String line=reader.readLine();
while(line!=null) {
sb=sb.append(line);
line=reader.readLine();
}
List<String > items=BulkloadClientUtil.getItemXmls(sb.toString());
doLoad(items);
}catch(Exception e) {
e.printStackTrace();
}finally {
if(reader!=null)
try {
reader.close();
} catch (IOException e) {
}
}
}
public static void main(String[] args) {
//test
//FileReader reader=new FileReader(file)
URL url=BulkloadClient.class.getResource("test.xml");
try {
BufferedInputStream in=((BufferedInputStream)url.getContent());
byte[] buf=new byte[in.available()];
in.read(buf);
String xml=new String(buf);
BulkloadClient client=new BulkloadClient("http://localhost:8080/datamanager/loadServlet","admin","talend",null,"Order","Country","Order");
client.setOptions(new BulkloadOptions());
client.load(xml);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/**
* <p>
* Loads XML documents in MDM using an InputStream. All documents should follow each other.
* For instance this InputStream can be used with this method.
* </p>
*
* <code>
* InputStream is = new ByteArrayInputStream("<doc></doc><doc></doc><doc></doc>".getBytes());
* </code>
*
* <p>
* This method blocks until all documents in <code>xmlDocuments</code> are read. For non blocking use cases
* see {@link #load()}.
* </p>
*
* @param xmlDocuments A stream that contains several XML documents.
* @throws Exception Thrown in case of bulk load error
*/
public void load(InputStream xmlDocuments) throws Exception {
BulkloadClientUtil.bulkload(url,
cluster,
concept,
dataModel,
options.isValidate(),
options.isSmartpk(),
xmlDocuments,
username,
password,
universe);
}
/**
* <p>
* Loads XML documents in MDM using an InputStream created for the load. This method creates a {@link Thread} that
* wait for {@link InputStreamMerger#push(java.io.InputStream)} to get called.
* </p>
*
* <code>
* BulkloadClient client = ...<br/>
* InputStreamMerger is = client.load();<br/>
* for(...) {<br/>
* is.push(new ByteArrayInputStream("...".getBytes());<br/>
* }
* </code>
*
* @throws Exception Thrown in case of communication error
* @see InputStreamMerger
* @return A {@link InputStreamMerger} that allow asynchronous push to bulkload client.
*/
public InputStreamMerger load() throws Exception {
return BulkloadClientUtil.bulkload(url,
cluster,
concept,
dataModel,
options.isValidate(),
options.isSmartpk(),
username,
password,
universe,
startedBulkloadCount);
}
}

View File

@@ -1,131 +1,189 @@
package org.talend.mdm.bulkload.client;
import java.io.InputStream;
import java.util.concurrent.atomic.AtomicInteger;
import java.io.IOException;
import java.io.StringReader;
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import org.apache.commons.httpclient.HostConfiguration;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpException;
import org.apache.commons.httpclient.NameValuePair;
import org.apache.commons.httpclient.URI;
import org.apache.commons.httpclient.UsernamePasswordCredentials;
import org.apache.commons.httpclient.auth.AuthScope;
import org.apache.commons.httpclient.cookie.CookiePolicy;
import org.apache.commons.httpclient.methods.InputStreamRequestEntity;
import org.apache.commons.httpclient.methods.PutMethod;
import org.apache.commons.httpclient.methods.PostMethod;
import org.apache.commons.httpclient.params.HttpClientParams;
import org.apache.commons.httpclient.params.HttpMethodParams;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
/**
* Bulkload amount items client
* @author achen
*
*/
public class BulkloadClientUtil {
public static void bulkload(String url, String cluster, String concept, String datamodel, boolean validate, boolean smartpk, InputStream itemdata,
String username, String password, String universe) throws Exception {
HostConfiguration config = new HostConfiguration();
URI uri = new URI(url, false, "UTF-8"); //$NON-NLS-1$
config.setHost(uri);
/**
* @param args
*/
public static void main(String[] args)throws Exception {
if((!args[0].startsWith("http://") && args.length>0) && (args.length != 9 || args.length!=7 || args.length!=6)) {
usage();
return;
}
String url= args[0];
String username=args[1];
String password=args[2];
String cluster= args[3];
String concept= args[4];
String datamodel= args[5];
boolean validate= false;
boolean smartpk= false;
List<String> itemdata= new ArrayList<String>();
if(args.length==9) {
validate= Boolean.valueOf(args[6]);
smartpk= Boolean.valueOf(args[7]);
itemdata=getItemXmls(args[8]);
}
if(args.length==7) {
itemdata=getItemXmls(args[6]);
}
if(args.length==6) {//get itemdata from System.in
byte[] buf=new byte[System.in.available()];
System.in.read(buf);
itemdata=getItemXmls(new String(buf));
}
try {
bulkload(url,cluster, concept,datamodel, validate, smartpk, itemdata,username,password,null);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public static List<String> getItemXmls(String itemdata)throws Exception {
Element root=parse(itemdata).getDocumentElement();
List<String> items=new ArrayList<String>();
for(int i=0; i<root.getChildNodes().getLength(); i++) {
Node node=root.getChildNodes().item(i);
if(node.getNodeType() == Node.ELEMENT_NODE) {
items.add(nodeToString(node, true));
}
}
return items;
}
private static String nodeToString(Node n, boolean omitXMLDeclaration) throws TransformerException{
StringWriter sw = new StringWriter();
Transformer transformer = TransformerFactory.newInstance().newTransformer();
if (omitXMLDeclaration)
transformer.setOutputProperty("omit-xml-declaration","yes");
else
transformer.setOutputProperty("omit-xml-declaration","no");
transformer.setOutputProperty("indent","yes");
transformer.transform(
new DOMSource(n),
new StreamResult(sw)
);
if (sw==null) return null;
return sw.toString().replaceAll("\r\n", "\n");
}
private static Document parse(String xmlString) throws ParserConfigurationException,IOException, SAXException{
//parse
Document d=null;
NameValuePair[] parameters = {new NameValuePair("cluster", cluster), //$NON-NLS-1$
new NameValuePair("concept", concept), //$NON-NLS-1$
new NameValuePair("datamodel", datamodel), //$NON-NLS-1$
new NameValuePair("validate", String.valueOf(validate)), //$NON-NLS-1$
new NameValuePair("action", "load"), //$NON-NLS-1$ //$NON-NLS-2$
new NameValuePair("smartpk", String.valueOf(smartpk))}; //$NON-NLS-1$
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
//Schema validation based on schemaURL
factory.setNamespaceAware(true);
factory.setAttribute(
"http://java.sun.com/xml/jaxp/properties/schemaLanguage",
"http://www.w3.org/2001/XMLSchema");
DocumentBuilder builder;
builder = factory.newDocumentBuilder();
HttpClient client = new HttpClient();
String user = universe == null || universe.trim().length() == 0 ? username : universe + "/" + username; //$NON-NLS-1$
client.getState().setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(user, password));
HttpClientParams clientParams = client.getParams();
clientParams.setAuthenticationPreemptive(true);
clientParams.setCookiePolicy(CookiePolicy.IGNORE_COOKIES);
d = builder.parse(new InputSource(new StringReader(xmlString)));
PutMethod putMethod = new PutMethod();
// This setPath call is *really* important (if not set, request will be sent to the JBoss root '/')
putMethod.setPath(url);
String responseBody;
try {
// Configuration
putMethod.setRequestHeader("Content-Type", "text/xml; charset=utf8"); //$NON-NLS-1$ //$NON-NLS-2$
putMethod.setQueryString(parameters);
putMethod.setContentChunked(true);
// Set the content of the PUT request
putMethod.setRequestEntity(new InputStreamRequestEntity(itemdata));
return d;
}
private static void usage() {
String usage="Usage:\n"+
"\t java -jar bulkloadclient.jar <url> <username> <password> <datacontainer> <concept> <datamodel> [validate] [smartpk] [itemdata] \n"+
"\t example1: java -jar bulkloadclient.jar http://localhost:8080/datamanager/loadServlet admin talend Order Country Order <itemdata><Country><isoCode>zh</isoCode><label>china</label><Continent>Asia</Continent></Country></itemdata>"+
"\t example2(on linux): cat myfile.xml|java -jar bulkloadclient.jar http://localhost:8080/datamanager/loadServlet admin talend Order Country Order";
System.out.println(usage);
}
public static boolean bulkload(String URL, String cluster,String concept,String datamodel, boolean validate, boolean smartpk, List<String> itemdata,
String username, String password,String universe) throws Exception {
HttpClient client = new HttpClient();
HttpClientParams params = new HttpClientParams();
// params.setSoTimeout(1000);
// params.setConnectionManagerTimeout(200);
client.setParams(params);
String user=universe==null||universe.trim().length()==0?username:universe+"/"+username;
client.getState().setCredentials(AuthScope.ANY,
new UsernamePasswordCredentials(user, password));
client.executeMethod(config, putMethod);
responseBody = putMethod.getResponseBodyAsString();
} catch (Exception e) {
throw new RuntimeException(e);
} finally {
putMethod.releaseConnection();
}
URI uri = new URI(URL, false, "utf-8");
HostConfiguration config = new HostConfiguration();
config.setHost(uri);
int statusCode = putMethod.getStatusCode();
if (statusCode >= 400) {
throw new BulkloadException(responseBody);
}
}
PostMethod postMethod = new PostMethod(URL);
HttpMethodParams reqParams = postMethod.getParams();
reqParams.setContentCharset("UTF-8");
List<NameValuePair> list=new ArrayList<NameValuePair>();
NameValuePair[] data = { new NameValuePair("cluster", cluster),
new NameValuePair("concept", concept),
new NameValuePair("datamodel", datamodel),
new NameValuePair("validate", String.valueOf(validate)),
new NameValuePair("smartpk", String.valueOf(smartpk))};
list.addAll(Arrays.asList(data));
for(int i=0; i<itemdata.size(); i++) {
list.add(new NameValuePair("itemdata"+i, itemdata.get(i)));
}
postMethod.setRequestBody((NameValuePair[])list.toArray(new NameValuePair[list.size()]));
// post method
int statusCode = 0;
try {
statusCode = client.executeMethod(config,postMethod);
} catch (HttpException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
public static InputStreamMerger bulkload(String url, String cluster, String concept, String dataModel, boolean validate, boolean smartPK, String username, String password, String universe, AtomicInteger startedBulkloadCount) {
InputStreamMerger merger = new InputStreamMerger();
if (statusCode >= 400)
return false;
String str = "";
try {
str = postMethod.getResponseBodyAsString();
} catch (IOException e) {
Runnable loadRunnable = new AsyncLoadRunnable(url, cluster, concept, dataModel, validate, smartPK, merger, username, password, universe, startedBulkloadCount);
Thread loadThread = new Thread(loadRunnable);
loadThread.start();
}
System.out.println(str);
return merger;
}
postMethod.releaseConnection();
return true;
}
private static class AsyncLoadRunnable implements Runnable {
private final String url;
private final String cluster;
private final String concept;
private final String dataModel;
private final boolean validate;
private final boolean smartPK;
private final InputStreamMerger inputStream;
private final String userName;
private final String password;
private final String universe;
private final AtomicInteger startedBulkloadCount;
public AsyncLoadRunnable(String url, String cluster, String concept, String dataModel, boolean validate, boolean smartPK, InputStreamMerger inputStream, String userName, String password, String universe, AtomicInteger startedBulkloadCount) {
this.url = url;
this.cluster = cluster;
this.concept = concept;
this.dataModel = dataModel;
this.validate = validate;
this.smartPK = smartPK;
this.inputStream = inputStream;
this.userName = userName;
this.password = password;
this.universe = universe;
this.startedBulkloadCount = startedBulkloadCount;
}
public void run() {
try {
startedBulkloadCount.incrementAndGet();
bulkload(url, cluster, concept, dataModel, validate, smartPK, inputStream, userName, password, universe);
} catch (Throwable e) {
inputStream.reportFailure(e);
} finally {
startedBulkloadCount.decrementAndGet();
synchronized (startedBulkloadCount) {
startedBulkloadCount.notifyAll();
}
}
}
}
}

View File

@@ -1,52 +0,0 @@
/*
* Copyright (C) 2006-2012 Talend Inc. - www.talend.com
*
* This source code is available under agreement available at
* %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
*
* You should have received a copy of the agreement
* along with this program; if not, write to Talend SA
* 9 rue Pages 92150 Suresnes, France
*/
package org.talend.mdm.bulkload.client;
import java.io.PrintStream;
import java.io.PrintWriter;
/**
*
*/
public class BulkloadException extends RuntimeException {
private static final String SERVER_EXCEPTION_SEPARATOR = "== SERVER EXCEPTION ==";
private static final String LINE_SEPARATOR = System.getProperty("line.separator"); //$NON-NLS-1$
private final String serverException;
public BulkloadException(String serverException) {
super("An exception happened during bulk load on MDM server.");
this.serverException = serverException;
}
public String getServerException() {
return serverException;
}
@Override
public void printStackTrace(PrintStream s) {
super.printStackTrace(s);
s.append(LINE_SEPARATOR);
s.append(SERVER_EXCEPTION_SEPARATOR);
s.append(LINE_SEPARATOR);
s.append(serverException);
}
@Override
public void printStackTrace(PrintWriter s) {
super.printStackTrace(s);
s.println(SERVER_EXCEPTION_SEPARATOR);
s.println(serverException);
}
}

View File

@@ -1,191 +0,0 @@
/*
* Copyright (C) 2006-2012 Talend Inc. - www.talend.com
*
* This source code is available under agreement available at
* %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
*
* You should have received a copy of the agreement
* along with this program; if not, write to Talend SA
* 9 rue Pages 92150 Suresnes, France
*/
package org.talend.mdm.bulkload.client;
import java.io.IOException;
import java.io.InputStream;
import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
*/
public class InputStreamMerger extends InputStream {
private static final Logger log = Logger.getLogger(InputStreamMerger.class.getName());
private final Queue<InputStream> inputStreamBuffer = new ConcurrentLinkedQueue<InputStream>();
private final Object readLock = new Object();
private final Object exhaustLock = new Object();
private boolean isClosed;
private InputStream currentStream;
private boolean hasFinishedRead;
private Throwable lastFailure;
public void push(InputStream inputStream) throws IOException {
if (inputStream == null) {
throw new IllegalArgumentException("Input stream can not be null.");
}
if (isClosed) {
throw new IOException("Stream is closed");
}
inputStreamBuffer.add(inputStream);
debug("Added a new input stream (buffer now has " + inputStreamBuffer.size() + " streams)");
}
public void reportFailure(Throwable e) {
debug("Exception occurred in consumer thread: " + e.getMessage());
lastFailure = e;
synchronized (exhaustLock) {
exhaustLock.notifyAll();
}
}
@Override
public int available() throws IOException {
return 4096;
}
@Override
public boolean markSupported() {
return false;
}
/**
* <p> Read block the current thread until data is pushed to this stream (using {@link #push(java.io.InputStream)}
* or if {@link #close()} is called. </p>
*
* @return the next byte of data, or <code>-1</code> if the end of the stream is reached <b>or</b> if stream is
* closed.
* @throws IOException
* @see java.io.InputStream#read()
*/
@Override
public int read() throws IOException {
int read = -1;
if (currentStream != null) {
read = currentStream.read();
} else {
moveToNextInputStream();
if (currentStream != null) {
read = currentStream.read();
}
}
if (read < 0) {
moveToNextInputStream();
if (currentStream != null) {
read = currentStream.read();
}
}
if (read < 0) {
synchronized (exhaustLock) {
debug("Notify exhaust lock");
exhaustLock.notifyAll();
}
}
// Throw any exception that might have occurred during last record processing.
throwLastFailure();
return read;
}
private void throwLastFailure() throws IOException {
if (lastFailure != null) {
debug("Report last failure exception to producer.");
throw new IOException("An exception occurred while processing last record.", lastFailure);
}
}
private void moveToNextInputStream() throws IOException {
// Throw any exception that might have occurred during previous records
throwLastFailure();
// Check the isClosed flag in case we've got waken up by a close()
while (inputStreamBuffer.isEmpty() && !isClosed) {
synchronized (readLock) {
try {
debug("Wait for more input...");
readLock.wait();
debug("Wait for more input done.");
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
}
if (!inputStreamBuffer.isEmpty()) {
if (currentStream != null) {
currentStream.close();
}
currentStream = inputStreamBuffer.poll();
} else {
currentStream = null;
hasFinishedRead = true;
}
debug("Remaining buffers : " + inputStreamBuffer.size());
}
/**
* <p> Close this stream and perform some checks: <ul> <li>Mark this stream as closed (no more calls to {@link
* #push(java.io.InputStream)} are allowed)</li> <li>Closes any remaining stream pushed to this stream</li> </ul>
* </p> <p> Calling this method wakes up any thread blocked on {@link #read()} </p> <p> Wait till all streams pushed
* to this stream (and stored in <code>inputStreamBuffer</code>) are processed by a reader. </p> <p> When this
* method exits, the buffer is empty and the last stream in buffer is fully read (i.e. until read() returns -1).
* </p>
*
* @throws IOException In case at least one stream in buffer hasn't been read.
* @see java.io.InputStream#close()
*/
@Override
public void close() throws IOException {
super.close();
isClosed = true;
synchronized (readLock) {
readLock.notifyAll();
}
debug("Input stream buffer size: " + +inputStreamBuffer.size());
debug("Has finished read: " + hasFinishedRead);
debug("Stop condition: " + (!inputStreamBuffer.isEmpty() && !hasFinishedRead));
while (!inputStreamBuffer.isEmpty() && !hasFinishedRead) {
try {
debug("Waiting for exhaust... (" + inputStreamBuffer.size() + " remaining)");
synchronized (exhaustLock) {
exhaustLock.wait();
}
// In case we got woken up due to a failure
throwLastFailure();
debug("Waiting for exhaust done.");
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
// In case failure happened on very last read.
throwLastFailure();
debug("Close completed.");
}
private static void debug(String message) {
Level debugLevel = Level.FINEST;
if (log.isLoggable(debugLevel)) {
log.log(debugLevel, "[" + Thread.currentThread() + "] " + message);
}
}
public Throwable getLastReportedFailure() {
return lastFailure;
}
}

View File

@@ -16,7 +16,7 @@
<pathelement location="lib/httpclient-4.0.1.jar"/>
<pathelement location="lib/httpcore-4.0.1.jar"/>
<pathelement location="lib/httpmime-4.0.1.jar"/>
<pathelement location="lib/talendcsv.jar"/>
<pathelement location="lib/javacsv-2.0.jar"/>
</path>
<target name="init">
<mkdir dir="bin"/>

View File

@@ -1,138 +1,131 @@
package org.talend.jpalo;
import org.apache.http.*;
import org.apache.http.client.methods.*;
import org.apache.http.client.utils.*;
import org.apache.http.conn.*;
import org.apache.http.conn.scheme.*;
import org.apache.http.impl.client.*;
import org.apache.http.impl.conn.tsccm.*;
import org.apache.http.message.*;
import org.apache.http.params.*;
//import java.math.BigInteger;
//import java.net.InetAddress;
import java.net.Socket;
import java.net.URI;
import java.util.ArrayList;
import java.util.List;
import java.nio.charset.Charset;
import java.util.*;
import org.apache.http.HttpEntity;
import org.apache.http.HttpHost;
import org.apache.http.HttpResponse;
import org.apache.http.HttpVersion;
import org.apache.http.NameValuePair;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.utils.URIUtils;
import org.apache.http.client.utils.URLEncodedUtils;
import org.apache.http.conn.ClientConnectionManager;
import org.apache.http.conn.scheme.PlainSocketFactory;
import org.apache.http.conn.scheme.Scheme;
import org.apache.http.conn.scheme.SchemeRegistry;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.params.BasicHttpParams;
import org.apache.http.params.HttpParams;
import org.apache.http.params.HttpProtocolParams;
import com.talend.csv.CSVReader;
import com.csvreader.*;
public class paloconnection {
private HttpHost paloTargetHost;
private DefaultHttpClient paloHttpClient;
private String strToken = "";
private int iSessionTimeOut=0;
private String strUserName = "";
private String strUserPW = "";
private String strServer = "";
private String strPort = "";
public paloconnection(String strUserName, String strUserPW, String strServer, String strPort) throws paloexception{
super();
this.strUserName = strUserName;
this.strUserPW = strUserPW;
this.strServer = strServer;
this.strPort = strPort;
private HttpHost paloTargetHost;
private DefaultHttpClient paloHttpClient;
private String strToken = "";
private int iSessionTimeOut = 0;
private String strUserName = "";
private String strUserPW = "";
private String strServer = "";
private String strPort = "";
public paloconnection(String strUserName, String strUserPW, String strServer, String strPort) throws paloexception {
super();
this.strUserName = strUserName;
this.strUserPW = strUserPW;
this.strServer = strServer;
this.strPort = strPort;
initConnection();
initConnection();
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("user", this.strUserName));
qparams.add(new BasicNameValuePair("password", palohelpers.getMD5(this.strUserPW)));
try {
HttpEntity entity = sendToServer(qparams, "/server/login");
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
csv.setQuoteChar('"');
csv.readNext();
this.strToken = csv.get(0);
this.iSessionTimeOut = Integer.valueOf(csv.get(1));
csv.close();
entity.consumeContent();
} catch (Exception e) {
throw new paloexception(e.toString());
try{
HttpEntity entity = sendToServer(qparams, "/server/login");
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
csv.setDelimiter(';');
csv.setTextQualifier('"');
csv.readRecord();
this.strToken = csv.get(0);
this.iSessionTimeOut = Integer.valueOf(csv.get(1));
csv.close();
entity.consumeContent();
}catch(Exception e){
throw new paloexception(e.toString());
}
}
}
public String getPaloToken(){
return strToken;
}
public int getSessionTimeout(){
return iSessionTimeOut;
}
public palodatabases getDatabases()throws paloexception {
return new palodatabases(this);
}
// Load the Server
public void load() throws paloexception{
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.strToken));
sendToServerSingleRC(qparams, "/server/load");
}
// Saves the Server
public void save() throws paloexception{
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.strToken));
sendToServerSingleRC(qparams, "/server/save");
}
// Shutdowns the Server
public void shutdown() throws paloexception{
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.strToken));
sendToServerSingleRC(qparams, "/server/shutdown");
}
// Logouts the current palo User
public void logout() throws paloexception{
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.strToken));
try{
HttpEntity entity = sendToServer(qparams, "/server/logout");
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
public String getPaloToken() {
return strToken;
}
public int getSessionTimeout() {
return iSessionTimeOut;
}
public palodatabases getDatabases() throws paloexception {
return new palodatabases(this);
}
// Load the Server
public void load() throws paloexception {
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.strToken));
sendToServerSingleRC(qparams, "/server/load");
}
// Saves the Server
public void save() throws paloexception {
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.strToken));
sendToServerSingleRC(qparams, "/server/save");
}
// Shutdowns the Server
public void shutdown() throws paloexception {
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.strToken));
sendToServerSingleRC(qparams, "/server/shutdown");
}
// Logouts the current palo User
public void logout() throws paloexception {
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.strToken));
try {
HttpEntity entity = sendToServer(qparams, "/server/logout");
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
// CsvReader csv = new CsvReader(sendToServer(qparams, "/server/logout").getContent(),
// Charset.defaultCharset());
csv.setQuoteChar('"');
csv.readNext();
csv.close();
entity.consumeContent();
// paloHttpClient.getConnectionManager().shutdown();
} catch (Exception e) {
throw new paloexception(e.getMessage());
//CsvReader csv = new CsvReader(sendToServer(qparams, "/server/logout").getContent(), Charset.defaultCharset());
csv.setDelimiter(';');
csv.setTextQualifier('"');
csv.readRecord();
csv.close();
entity.consumeContent();
//paloHttpClient.getConnectionManager().shutdown();
}catch(Exception e){
throw new paloexception(e.getMessage());
}
}
private void initConnection() {
pingPaloServer();
paloTargetHost = new HttpHost(strServer, Integer.valueOf(strPort), "http");
}
private void initConnection(){
pingPaloServer();
paloTargetHost = new HttpHost(strServer, Integer.valueOf(strPort), "http");
SchemeRegistry supportedSchemes = new SchemeRegistry();
supportedSchemes.register(new Scheme("http", PlainSocketFactory.getSocketFactory(), Integer.valueOf(strPort)));
supportedSchemes.register(new Scheme("http",PlainSocketFactory.getSocketFactory(), Integer.valueOf(strPort)));
// prepare parameters
HttpParams params = new BasicHttpParams();
@@ -140,129 +133,134 @@ public class paloconnection {
HttpProtocolParams.setContentCharset(params, "UTF-8");
HttpProtocolParams.setUseExpectContinue(params, true);
ClientConnectionManager connMgr = new ThreadSafeClientConnManager(params, supportedSchemes);
ClientConnectionManager connMgr = new ThreadSafeClientConnManager(params,supportedSchemes);
paloHttpClient = new DefaultHttpClient(connMgr, params);
}
private void pingPaloServer() {
try {
// int timeOut = 1000; // I recommend 3 seconds at least int timeout = 3000; / / Ich empfehle 3 Sekunden
// mindestens
// boolean status = InetAddress.getByName(strServer).isReachable(timeOut);
Socket s = new Socket(strServer, Integer.valueOf(strPort));
s.close();
} catch (Exception e) {
}
private void pingPaloServer(){
try{
//int timeOut = 1000; // I recommend 3 seconds at least int timeout = 3000; / / Ich empfehle 3 Sekunden mindestens
//boolean status = InetAddress.getByName(strServer).isReachable(timeOut);
Socket s = new Socket(strServer, Integer.valueOf(strPort));
s.close();
}catch(Exception e){
}
}
// Retrieves only true or false based on the given connection
public boolean sendToServerSingleRC(List<NameValuePair> qparams, String strAPIUrl) throws paloexception{
try{
HttpEntity entity = sendToServer(qparams, strAPIUrl);
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
//CsvReader csv = new CsvReader(sendToServer(qparams, strAPIUrl).getContent(), Charset.defaultCharset());
csv.setDelimiter(';');
csv.setTextQualifier('"');
csv.readRecord();
boolean bStatus = Boolean.getBoolean(csv.get(0));
csv.close();
entity.consumeContent();
return bStatus;
}catch(Exception e){
throw new paloexception(e.getMessage());
}
}
public HttpEntity sendToServer(List<NameValuePair> qparams, String strAPIUrl) throws paloexception{
try{
URI uri = URIUtils.createURI("http", strServer, Integer.valueOf(strPort), strAPIUrl, URLEncodedUtils.format(qparams, "UTF-8"), null);
HttpGet req = new HttpGet(uri);
// System.out.println(req.getURI());
// Send to Server
HttpResponse rsp = paloHttpClient.execute(paloTargetHost, req);
HttpEntity entity = rsp.getEntity();
///System.out.println(rsp.getStatusLine().getStatusCode());
if(rsp.getStatusLine().getStatusCode()!=200){
// Error had been occured
// Close Connection and thend raise paloexception error
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
csv.setDelimiter(';');
csv.setTextQualifier('"');
csv.readRecord();
paloexception plX = new paloexception(csv.get(0),csv.get(1),csv.get(2));
csv.close();
entity.consumeContent();
//req.abort();
//paloHttpClient.getConnectionManager().shutdown();
throw(plX);
}else{
return entity;
}
}catch(Exception e){
//if(paloHttpClient!=null)paloHttpClient.getConnectionManager().shutdown();
throw new paloexception(e.getMessage());
}
}
// Retrieves only true or false based on the given connection
public boolean sendToServerSingleRC(List<NameValuePair> qparams, String strAPIUrl) throws paloexception {
try {
HttpEntity entity = sendToServer(qparams, strAPIUrl);
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
// CsvReader csv = new CsvReader(sendToServer(qparams, strAPIUrl).getContent(), Charset.defaultCharset());
csv.setQuoteChar('"');
csv.readNext();
boolean bStatus = Boolean.getBoolean(csv.get(0));
csv.close();
entity.consumeContent();
return bStatus;
} catch (Exception e) {
throw new paloexception(e.getMessage());
}
}
public HttpEntity sendToServer(List<NameValuePair> qparams, String strAPIUrl) throws paloexception {
try {
URI uri = URIUtils.createURI("http", strServer, Integer.valueOf(strPort), strAPIUrl,
URLEncodedUtils.format(qparams, "UTF-8"), null);
HttpGet req = new HttpGet(uri);
// System.out.println(req.getURI());
// Send to Server
HttpResponse rsp = paloHttpClient.execute(paloTargetHost, req);
HttpEntity entity = rsp.getEntity();
// /System.out.println(rsp.getStatusLine().getStatusCode());
if (rsp.getStatusLine().getStatusCode() != 200) {
// Error had been occured
// Close Connection and thend raise paloexception error
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
csv.setQuoteChar('"');
csv.readNext();
paloexception plX = new paloexception(csv.get(0), csv.get(1), csv.get(2));
csv.close();
entity.consumeContent();
// req.abort();
// paloHttpClient.getConnectionManager().shutdown();
throw (plX);
} else {
return entity;
}
} catch (Exception e) {
// if(paloHttpClient!=null)paloHttpClient.getConnectionManager().shutdown();
throw new paloexception(e.getMessage());
}
}
public String getRulefunctions() throws paloexception {
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", getPaloToken()));
try {
StringBuilder sb = new StringBuilder();
HttpEntity entity = sendToServer(qparams, "/rule/functions");
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
csv.setQuoteChar('"');
while (csv.readNext()) {
sb.append(csv.get(0));
}
csv.close();
entity.consumeContent();
return sb.toString();
} catch (Exception e) {
throw new paloexception(e.getMessage());
}
}
public String getVersion() throws paloexception {
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("", ""));
try {
StringBuilder sb = new StringBuilder();
HttpEntity entity = sendToServer(qparams, "/server/info");
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
csv.setQuoteChar('"');
while (csv.readNext()) {
sb.append(csv.get(0));
sb.append(".");
sb.append(csv.get(1));
sb.append(".");
sb.append(csv.get(2));
sb.append(".");
sb.append(csv.get(3));
}
csv.close();
entity.consumeContent();
return sb.toString();
} catch (Exception e) {
throw new paloexception(e.getMessage());
}
}
@Override
protected void finalize() throws Throwable {
try {
if (paloHttpClient != null) {
paloHttpClient.getConnectionManager().shutdown();
}
} catch (Exception e) {
} finally {
super.finalize();
}
}
public String getRulefunctions()throws paloexception {
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", getPaloToken()));
try{
StringBuilder sb = new StringBuilder();
HttpEntity entity = sendToServer(qparams, "/rule/functions");
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
csv.setDelimiter(';');
csv.setTextQualifier('"');
while(csv.readRecord()){
sb.append(csv.get(0));
}
csv.close();
entity.consumeContent();
return sb.toString();
}catch(Exception e){
throw new paloexception(e.getMessage());
}
}
public String getVersion() throws paloexception {
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("", ""));
try{
StringBuilder sb = new StringBuilder();
HttpEntity entity = sendToServer(qparams, "/server/info");
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
csv.setDelimiter(';');
csv.setTextQualifier('"');
while(csv.readRecord()){
sb.append(csv.get(0));
sb.append(".");
sb.append(csv.get(1));
sb.append(".");
sb.append(csv.get(2));
sb.append(".");
sb.append(csv.get(3));
}
csv.close();
entity.consumeContent();
return sb.toString();
}catch(Exception e){
throw new paloexception(e.getMessage());
}
}
protected void finalize() throws Throwable {
try {
if(paloHttpClient!=null)paloHttpClient.getConnectionManager().shutdown();
} catch(Exception e) {
}
finally {
super.finalize();
}
}
}

View File

@@ -1,5 +1,6 @@
package org.talend.jpalo;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.List;
@@ -7,219 +8,216 @@ import org.apache.http.HttpEntity;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import com.talend.csv.CSVReader;
import com.csvreader.CsvReader;
public class palocube {
// OK
// OK
// @SuppressWarnings("unused")
// private ArrayList<palocubelock> paloCubelocks = new ArrayList<palocubelock>();
//@SuppressWarnings("unused")
//private ArrayList<palocubelock> paloCubelocks = new ArrayList<palocubelock>();
private paloconnection plConn;
private long lDatabaseId;
private paloconnection plConn;
private int iCubeId;
private String strCubeName;
private int iNumberOfDimensions;
private int[] iArrDimensionsIdentifier;
private long iNumberOfCells;
private long lNumberOfFilledCells;
private int iCubeStatus;
private int iCubeType;
@SuppressWarnings("unused")
private int iCubeToken;
public palocube(paloconnection plConn, long lDatabaseId,
int iCubeId, //0 cube identifier Identifier of the cube
String strCubeName, //1 name_cube string Name of the cube
int iNumberOfDimensions, //2 number_dimensions integer Number of dimensions
int[] iArrDimensionsIdentifier, //3 dimensions integer Comma separate list of dimension identifiers
long lNumberOfCells, //4 number_cells integer Total number of cells
long lNumberOfFilledCells,//5 number_filled_cells integer Number of filled numeric base cells plus number of filled string cells
int iCubeStatus, //6 status integer Status of cube (0=unloaded, 1=loaded and 2=changed)
int iCubeType, //7 type integer Type of cube (0=normal, 1=system, 2=attribute, 3=user info)
int strCubeToken//8 cube_token integer The cube token of the cube
){
super();
this.plConn = plConn;
this.lDatabaseId=lDatabaseId;
this.iCubeId=iCubeId;
this.strCubeName=strCubeName;
this.iNumberOfDimensions=iNumberOfDimensions;
this.iArrDimensionsIdentifier=iArrDimensionsIdentifier;
this.iNumberOfCells=lNumberOfCells;
this.lNumberOfFilledCells=lNumberOfFilledCells;
this.iCubeStatus=iCubeStatus;
this.iCubeType=iCubeType;
this.iCubeToken=strCubeToken;
}
private long lDatabaseId;
public String getName(){
return strCubeName;
}
private int iCubeId;
public String getDatabaseName(){
return "";//strDatabaseName;
}
public void rename(String strCubeNewName) throws paloexception{
if(null!=strCubeNewName && strCubeNewName.length()>0 && !strCubeName.equals(strCubeNewName)){
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(lDatabaseId)));
qparams.add(new BasicNameValuePair("cube", String.valueOf(iCubeId)));
qparams.add(new BasicNameValuePair("new_name", strCubeNewName));
try{
HttpEntity entity = this.plConn.sendToServer(qparams, "/cube/rename");
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
//CsvReader csv = new CsvReader(this.plConn.sendToServer(qparams, "/cube/rename").getContent(), Charset.defaultCharset());
csv.setDelimiter(';');
csv.setTextQualifier('"');
csv.readRecord();
this.strCubeName = csv.get(1);
csv.close();
entity.consumeContent();
}catch(Exception e){
throw new paloexception(e.getMessage());
}
}
}
public int getCubeId(){
return iCubeId;
}
public int getNumberOfDimensions(){
return iNumberOfDimensions;
}
public long getNumberOfCells(){
return iNumberOfCells;
}
public long getNumberOfFilledCells(){
return lNumberOfFilledCells;
}
public int getCubeStatus(){
return iCubeStatus;
}
public int getCubeType(){
return iCubeType;
}
public void save()throws paloexception{
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
qparams.add(new BasicNameValuePair("cube", String.valueOf(this.iCubeId)));
plConn.sendToServerSingleRC(qparams, "/cube/save");
}
private String strCubeName;
public void load() throws paloexception{
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
qparams.add(new BasicNameValuePair("cube", String.valueOf(this.iCubeId)));
plConn.sendToServerSingleRC(qparams, "/cube/load");
}
private int iNumberOfDimensions;
public void unload() throws paloexception{
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
qparams.add(new BasicNameValuePair("cube", String.valueOf(this.iCubeId)));
plConn.sendToServerSingleRC(qparams, "/cube/unload");
}
public void refreshCubeInfo() throws paloexception{
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(lDatabaseId)));
qparams.add(new BasicNameValuePair("cube", String.valueOf(iCubeId)));
try{
HttpEntity entity = this.plConn.sendToServer(qparams, "/cube/info");
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
csv.setDelimiter(';');
csv.setTextQualifier('"');
csv.readRecord();
private int[] iArrDimensionsIdentifier;
this.iCubeId = palohelpers.StringToInt(csv.get(0));
this.strCubeName = csv.get(1);
this.iNumberOfDimensions=palohelpers.StringToInt(csv.get(2));
this.iArrDimensionsIdentifier=palohelpers.StringToIntArray(csv.get(3), palohelpers.StringToInt(csv.get(2)));
this.iNumberOfCells=palohelpers.StringToLong(csv.get(4));
this.lNumberOfFilledCells=palohelpers.StringToLong(csv.get(5));
this.iCubeStatus=palohelpers.StringToInt(csv.get(6));
this.iCubeType=palohelpers.StringToInt(csv.get(7));
this.iCubeToken=palohelpers.StringToInt(csv.get(8));
csv.close();
entity.consumeContent();
}catch(Exception e){
throw new paloexception(e.getMessage());
}
}
public void clear() throws paloexception{
clear(null);
}
public void clear(String strArrArea) throws paloexception{
private long iNumberOfCells;
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(lDatabaseId)));
qparams.add(new BasicNameValuePair("cube", String.valueOf(iCubeId)));
if(strArrArea==null){
qparams.add(new BasicNameValuePair("complete", "1"));
}else{
//qparams.add(new BasicNameValuePair("complete", "0"));
qparams.add(new BasicNameValuePair("area", strArrArea));
}
try{
HttpEntity entity = this.plConn.sendToServer(qparams, "/cube/clear");
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
csv.setDelimiter(';');
csv.setTextQualifier('"');
csv.readRecord();
private long lNumberOfFilledCells;
this.iCubeId = palohelpers.StringToInt(csv.get(0));
this.strCubeName = csv.get(1);
this.iNumberOfDimensions=palohelpers.StringToInt(csv.get(2));
this.iArrDimensionsIdentifier=palohelpers.StringToIntArray(csv.get(3), palohelpers.StringToInt(csv.get(2)));
this.iNumberOfCells=palohelpers.StringToLong(csv.get(4));
this.lNumberOfFilledCells=palohelpers.StringToLong(csv.get(5));
this.iCubeStatus=palohelpers.StringToInt(csv.get(6));
this.iCubeType=palohelpers.StringToInt(csv.get(7));
this.iCubeToken=palohelpers.StringToInt(csv.get(8));
csv.close();
entity.consumeContent();
}catch(Exception e){
throw new paloexception(e.getMessage());
}
}
public palorules getCubeRules() throws paloexception {
return new palorules(this.plConn, this.lDatabaseId, this.iCubeId);
}
private int iCubeStatus;
private int iCubeType;
@SuppressWarnings("unused")
private int iCubeToken;
public palocube(paloconnection plConn, long lDatabaseId, int iCubeId, // 0 cube identifier Identifier of the cube
String strCubeName, // 1 name_cube string Name of the cube
int iNumberOfDimensions, // 2 number_dimensions integer Number of dimensions
int[] iArrDimensionsIdentifier, // 3 dimensions integer Comma separate list of dimension identifiers
long lNumberOfCells, // 4 number_cells integer Total number of cells
long lNumberOfFilledCells,// 5 number_filled_cells integer Number of filled numeric base cells plus number
// of filled string cells
int iCubeStatus, // 6 status integer Status of cube (0=unloaded, 1=loaded and 2=changed)
int iCubeType, // 7 type integer Type of cube (0=normal, 1=system, 2=attribute, 3=user info)
int strCubeToken// 8 cube_token integer The cube token of the cube
) {
super();
this.plConn = plConn;
this.lDatabaseId = lDatabaseId;
this.iCubeId = iCubeId;
this.strCubeName = strCubeName;
this.iNumberOfDimensions = iNumberOfDimensions;
this.iArrDimensionsIdentifier = iArrDimensionsIdentifier;
this.iNumberOfCells = lNumberOfCells;
this.lNumberOfFilledCells = lNumberOfFilledCells;
this.iCubeStatus = iCubeStatus;
this.iCubeType = iCubeType;
this.iCubeToken = strCubeToken;
}
public String getName() {
return strCubeName;
}
public String getDatabaseName() {
return "";// strDatabaseName;
}
public void rename(String strCubeNewName) throws paloexception {
if (null != strCubeNewName && strCubeNewName.length() > 0 && !strCubeName.equals(strCubeNewName)) {
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(lDatabaseId)));
qparams.add(new BasicNameValuePair("cube", String.valueOf(iCubeId)));
qparams.add(new BasicNameValuePair("new_name", strCubeNewName));
try {
HttpEntity entity = this.plConn.sendToServer(qparams, "/cube/rename");
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
csv.setQuoteChar('"');
csv.readNext();
this.strCubeName = csv.get(1);
csv.close();
entity.consumeContent();
} catch (Exception e) {
throw new paloexception(e.getMessage());
}
}
}
public int getCubeId() {
return iCubeId;
}
public int getNumberOfDimensions() {
return iNumberOfDimensions;
}
public long getNumberOfCells() {
return iNumberOfCells;
}
public long getNumberOfFilledCells() {
return lNumberOfFilledCells;
}
public int getCubeStatus() {
return iCubeStatus;
}
public int getCubeType() {
return iCubeType;
}
public void save() throws paloexception {
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
qparams.add(new BasicNameValuePair("cube", String.valueOf(this.iCubeId)));
plConn.sendToServerSingleRC(qparams, "/cube/save");
}
public void load() throws paloexception {
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
qparams.add(new BasicNameValuePair("cube", String.valueOf(this.iCubeId)));
plConn.sendToServerSingleRC(qparams, "/cube/load");
}
public void unload() throws paloexception {
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
qparams.add(new BasicNameValuePair("cube", String.valueOf(this.iCubeId)));
plConn.sendToServerSingleRC(qparams, "/cube/unload");
}
public void refreshCubeInfo() throws paloexception {
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(lDatabaseId)));
qparams.add(new BasicNameValuePair("cube", String.valueOf(iCubeId)));
try {
HttpEntity entity = this.plConn.sendToServer(qparams, "/cube/info");
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
csv.setQuoteChar('"');
csv.readNext();
this.iCubeId = palohelpers.StringToInt(csv.get(0));
this.strCubeName = csv.get(1);
this.iNumberOfDimensions = palohelpers.StringToInt(csv.get(2));
this.iArrDimensionsIdentifier = palohelpers.StringToIntArray(csv.get(3), palohelpers.StringToInt(csv.get(2)));
this.iNumberOfCells = palohelpers.StringToLong(csv.get(4));
this.lNumberOfFilledCells = palohelpers.StringToLong(csv.get(5));
this.iCubeStatus = palohelpers.StringToInt(csv.get(6));
this.iCubeType = palohelpers.StringToInt(csv.get(7));
this.iCubeToken = palohelpers.StringToInt(csv.get(8));
csv.close();
entity.consumeContent();
} catch (Exception e) {
throw new paloexception(e.getMessage());
}
}
public void clear() throws paloexception {
clear(null);
}
public void clear(String strArrArea) throws paloexception {
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(lDatabaseId)));
qparams.add(new BasicNameValuePair("cube", String.valueOf(iCubeId)));
if (strArrArea == null) {
qparams.add(new BasicNameValuePair("complete", "1"));
} else {
// qparams.add(new BasicNameValuePair("complete", "0"));
qparams.add(new BasicNameValuePair("area", strArrArea));
}
try {
HttpEntity entity = this.plConn.sendToServer(qparams, "/cube/clear");
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
csv.setQuoteChar('"');
csv.readNext();
this.iCubeId = palohelpers.StringToInt(csv.get(0));
this.strCubeName = csv.get(1);
this.iNumberOfDimensions = palohelpers.StringToInt(csv.get(2));
this.iArrDimensionsIdentifier = palohelpers.StringToIntArray(csv.get(3), palohelpers.StringToInt(csv.get(2)));
this.iNumberOfCells = palohelpers.StringToLong(csv.get(4));
this.lNumberOfFilledCells = palohelpers.StringToLong(csv.get(5));
this.iCubeStatus = palohelpers.StringToInt(csv.get(6));
this.iCubeType = palohelpers.StringToInt(csv.get(7));
this.iCubeToken = palohelpers.StringToInt(csv.get(8));
csv.close();
entity.consumeContent();
} catch (Exception e) {
throw new paloexception(e.getMessage());
}
}
public palorules getCubeRules() throws paloexception {
return new palorules(this.plConn, this.lDatabaseId, this.iCubeId);
}
public palodimensions getDimensions() throws paloexception {
return new palodimensions(this.plConn, this.lDatabaseId, this.iCubeType, this.iArrDimensionsIdentifier);
}
public palodimensions getDimensions() throws paloexception {
return new palodimensions(this.plConn, this.lDatabaseId, this.iCubeType, this.iArrDimensionsIdentifier);
}
}

View File

@@ -1,5 +1,6 @@
package org.talend.jpalo;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.List;
@@ -7,248 +8,260 @@ import org.apache.http.HttpEntity;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import com.talend.csv.CSVReader;
import com.csvreader.CsvReader;
public class palocubes {
public static final int CUBE_NORMAL = 0;
public static final int CUBE_NORMAL = 0;
public static final int CUBE_SYSTEM= 1;
public static final int CUBE_ATTRIBUT = 2;
public static final int CUBE_USER_INFO = 3;
public static final int CUBE_UNKNOWN = -1;
public static final int CUBE_STATUS_UNLOADED = 0;
public static final int CUBE_STATUS_LOADED = 1;
public static final int CUBE_STATUS_CHANGED = 2;
public static final int CUBE_STATUS_UNKNOWN = -1;
private paloconnection plConn;
private palodatabase plDB;
private ArrayList<palocube> paloCubes = new ArrayList<palocube>();
public palocubes(paloconnection plConn, palodatabase plDB, int iCubeType) throws paloexception{
super();
this.plConn = plConn;
this.plDB = plDB;
public static final int CUBE_SYSTEM = 1;
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(this.plDB.getDatabaseId())));
public static final int CUBE_ATTRIBUT = 2;
switch(iCubeType){
case CUBE_NORMAL:
qparams.add(new BasicNameValuePair("show_info","0"));
qparams.add(new BasicNameValuePair("show_normal","1"));
qparams.add(new BasicNameValuePair("show_attribute","0"));
qparams.add(new BasicNameValuePair("show_system","0"));
break;
case CUBE_SYSTEM:
qparams.add(new BasicNameValuePair("show_info","0"));
qparams.add(new BasicNameValuePair("show_normal","0"));
qparams.add(new BasicNameValuePair("show_attribute","0"));
qparams.add(new BasicNameValuePair("show_system","1"));
break;
case CUBE_ATTRIBUT:
qparams.add(new BasicNameValuePair("show_info","0"));
qparams.add(new BasicNameValuePair("show_normal","0"));
qparams.add(new BasicNameValuePair("show_attribute","1"));
qparams.add(new BasicNameValuePair("show_system","0"));
break;
case CUBE_USER_INFO:
qparams.add(new BasicNameValuePair("show_info","1"));
qparams.add(new BasicNameValuePair("show_normal","0"));
qparams.add(new BasicNameValuePair("show_attribute","0"));
qparams.add(new BasicNameValuePair("show_system","0"));
break;
case CUBE_UNKNOWN:
qparams.add(new BasicNameValuePair("show_info","1"));
qparams.add(new BasicNameValuePair("show_normal","1"));
qparams.add(new BasicNameValuePair("show_attribute","1"));
qparams.add(new BasicNameValuePair("show_system","1"));
break;
}
try{
HttpEntity entity = this.plConn.sendToServer(qparams, "/database/cubes");
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
csv.setDelimiter(';');
csv.setTextQualifier('"');
while(csv.readRecord()){
palocube plCube = new palocube(plConn, plDB.getDatabaseId(),
palohelpers.StringToInt(csv.get(0)),
csv.get(1),
palohelpers.StringToInt(csv.get(2)),
palohelpers.StringToIntArray(csv.get(3), palohelpers.StringToInt(csv.get(2))),
palohelpers.StringToLong(csv.get(4)),
palohelpers.StringToLong(csv.get(5)),
palohelpers.StringToInt(csv.get(6)),
palohelpers.StringToInt(csv.get(7)),
palohelpers.StringToInt(csv.get(8))
);
paloCubes.add(plCube);
}
csv.close();
entity.consumeContent();
}catch(Exception e){
throw new paloexception(e.getMessage());
}
}
public palocubes(paloconnection plConn, long lDatabaseId, int iCubeType, int iDimensionId) throws paloexception{
super();
this.plConn = plConn;
public static final int CUBE_USER_INFO = 3;
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(lDatabaseId)));
qparams.add(new BasicNameValuePair("dimension", String.valueOf(iDimensionId)));
switch(iCubeType){
case CUBE_NORMAL:
qparams.add(new BasicNameValuePair("show_info","0"));
qparams.add(new BasicNameValuePair("show_normal","1"));
qparams.add(new BasicNameValuePair("show_attribute","0"));
qparams.add(new BasicNameValuePair("show_system","0"));
break;
case CUBE_SYSTEM:
qparams.add(new BasicNameValuePair("show_info","0"));
qparams.add(new BasicNameValuePair("show_normal","0"));
qparams.add(new BasicNameValuePair("show_attribute","0"));
qparams.add(new BasicNameValuePair("show_system","1"));
break;
case CUBE_ATTRIBUT:
qparams.add(new BasicNameValuePair("show_info","0"));
qparams.add(new BasicNameValuePair("show_normal","0"));
qparams.add(new BasicNameValuePair("show_attribute","1"));
qparams.add(new BasicNameValuePair("show_system","0"));
break;
case CUBE_USER_INFO:
qparams.add(new BasicNameValuePair("show_info","1"));
qparams.add(new BasicNameValuePair("show_normal","0"));
qparams.add(new BasicNameValuePair("show_attribute","0"));
qparams.add(new BasicNameValuePair("show_system","0"));
break;
case CUBE_UNKNOWN:
qparams.add(new BasicNameValuePair("show_info","1"));
qparams.add(new BasicNameValuePair("show_normal","1"));
qparams.add(new BasicNameValuePair("show_attribute","1"));
qparams.add(new BasicNameValuePair("show_system","1"));
break;
}
try{
HttpEntity entity = this.plConn.sendToServer(qparams, "/dimension/cubes");
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
csv.setDelimiter(';');
csv.setTextQualifier('"');
while(csv.readRecord()){
palocube plCube = new palocube(plConn, lDatabaseId,
palohelpers.StringToInt(csv.get(0)),
csv.get(1),
palohelpers.StringToInt(csv.get(2)),
palohelpers.StringToIntArray(csv.get(3), palohelpers.StringToInt(csv.get(2))),
palohelpers.StringToLong(csv.get(4)),
palohelpers.StringToLong(csv.get(5)),
palohelpers.StringToInt(csv.get(6)),
palohelpers.StringToInt(csv.get(7)),
palohelpers.StringToInt(csv.get(8))
);
paloCubes.add(plCube);
}
csv.close();
entity.consumeContent();
}catch(Exception e){
throw new paloexception(e.getMessage());
}
}
public static final int CUBE_UNKNOWN = -1;
public static final int CUBE_STATUS_UNLOADED = 0;
public static final int CUBE_STATUS_LOADED = 1;
public static final int CUBE_STATUS_CHANGED = 2;
public static final int CUBE_STATUS_UNKNOWN = -1;
private paloconnection plConn;
private palodatabase plDB;
private ArrayList<palocube> paloCubes = new ArrayList<palocube>();
public palocubes(paloconnection plConn, palodatabase plDB, int iCubeType) throws paloexception {
super();
this.plConn = plConn;
this.plDB = plDB;
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(this.plDB.getDatabaseId())));
switch (iCubeType) {
case CUBE_NORMAL:
qparams.add(new BasicNameValuePair("show_info", "0"));
qparams.add(new BasicNameValuePair("show_normal", "1"));
qparams.add(new BasicNameValuePair("show_attribute", "0"));
qparams.add(new BasicNameValuePair("show_system", "0"));
break;
case CUBE_SYSTEM:
qparams.add(new BasicNameValuePair("show_info", "0"));
qparams.add(new BasicNameValuePair("show_normal", "0"));
qparams.add(new BasicNameValuePair("show_attribute", "0"));
qparams.add(new BasicNameValuePair("show_system", "1"));
break;
case CUBE_ATTRIBUT:
qparams.add(new BasicNameValuePair("show_info", "0"));
qparams.add(new BasicNameValuePair("show_normal", "0"));
qparams.add(new BasicNameValuePair("show_attribute", "1"));
qparams.add(new BasicNameValuePair("show_system", "0"));
break;
case CUBE_USER_INFO:
qparams.add(new BasicNameValuePair("show_info", "1"));
qparams.add(new BasicNameValuePair("show_normal", "0"));
qparams.add(new BasicNameValuePair("show_attribute", "0"));
qparams.add(new BasicNameValuePair("show_system", "0"));
break;
case CUBE_UNKNOWN:
qparams.add(new BasicNameValuePair("show_info", "1"));
qparams.add(new BasicNameValuePair("show_normal", "1"));
qparams.add(new BasicNameValuePair("show_attribute", "1"));
qparams.add(new BasicNameValuePair("show_system", "1"));
break;
}
try {
HttpEntity entity = this.plConn.sendToServer(qparams, "/database/cubes");
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
csv.setQuoteChar('"');
while (csv.readNext()) {
palocube plCube = new palocube(plConn, plDB.getDatabaseId(), palohelpers.StringToInt(csv.get(0)), csv.get(1),
palohelpers.StringToInt(csv.get(2)), palohelpers.StringToIntArray(csv.get(3),
palohelpers.StringToInt(csv.get(2))), palohelpers.StringToLong(csv.get(4)),
palohelpers.StringToLong(csv.get(5)), palohelpers.StringToInt(csv.get(6)), palohelpers.StringToInt(csv
.get(7)), palohelpers.StringToInt(csv.get(8)));
paloCubes.add(plCube);
}
csv.close();
entity.consumeContent();
} catch (Exception e) {
throw new paloexception(e.getMessage());
}
}
public palocubes(paloconnection plConn, long lDatabaseId, int iCubeType, int iDimensionId) throws paloexception {
super();
this.plConn = plConn;
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(lDatabaseId)));
qparams.add(new BasicNameValuePair("dimension", String.valueOf(iDimensionId)));
switch (iCubeType) {
case CUBE_NORMAL:
qparams.add(new BasicNameValuePair("show_info", "0"));
qparams.add(new BasicNameValuePair("show_normal", "1"));
qparams.add(new BasicNameValuePair("show_attribute", "0"));
qparams.add(new BasicNameValuePair("show_system", "0"));
break;
case CUBE_SYSTEM:
qparams.add(new BasicNameValuePair("show_info", "0"));
qparams.add(new BasicNameValuePair("show_normal", "0"));
qparams.add(new BasicNameValuePair("show_attribute", "0"));
qparams.add(new BasicNameValuePair("show_system", "1"));
break;
case CUBE_ATTRIBUT:
qparams.add(new BasicNameValuePair("show_info", "0"));
qparams.add(new BasicNameValuePair("show_normal", "0"));
qparams.add(new BasicNameValuePair("show_attribute", "1"));
qparams.add(new BasicNameValuePair("show_system", "0"));
break;
case CUBE_USER_INFO:
qparams.add(new BasicNameValuePair("show_info", "1"));
qparams.add(new BasicNameValuePair("show_normal", "0"));
qparams.add(new BasicNameValuePair("show_attribute", "0"));
qparams.add(new BasicNameValuePair("show_system", "0"));
break;
case CUBE_UNKNOWN:
qparams.add(new BasicNameValuePair("show_info", "1"));
qparams.add(new BasicNameValuePair("show_normal", "1"));
qparams.add(new BasicNameValuePair("show_attribute", "1"));
qparams.add(new BasicNameValuePair("show_system", "1"));
break;
}
try {
HttpEntity entity = this.plConn.sendToServer(qparams, "/dimension/cubes");
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
csv.setQuoteChar('"');
while (csv.readNext()) {
palocube plCube = new palocube(plConn, lDatabaseId, palohelpers.StringToInt(csv.get(0)), csv.get(1),
palohelpers.StringToInt(csv.get(2)), palohelpers.StringToIntArray(csv.get(3),
palohelpers.StringToInt(csv.get(2))), palohelpers.StringToLong(csv.get(4)),
palohelpers.StringToLong(csv.get(5)), palohelpers.StringToInt(csv.get(6)), palohelpers.StringToInt(csv
.get(7)), palohelpers.StringToInt(csv.get(8)));
paloCubes.add(plCube);
}
csv.close();
entity.consumeContent();
} catch (Exception e) {
throw new paloexception(e.getMessage());
}
}
public int getNumberOfCubes() {
return paloCubes.size();
}
public palocube getCube(int iIndex) {
return paloCubes.get(iIndex);
}
public ArrayList<palocube> getCubes() {
return paloCubes;
}
public void deleteCube(String strCubeName) throws paloexception {
palocube paloCubeToRemove = getCube(strCubeName);
if (null != paloCubeToRemove) {
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(this.plDB.getDatabaseId())));
qparams.add(new BasicNameValuePair("cube", String.valueOf(paloCubeToRemove.getCubeId())));
plConn.sendToServerSingleRC(qparams, "/cube/destroy");
paloCubes.remove(paloCubeToRemove);
}
}
public palocube getCube(String strCubeName) {
for (palocube paloCube : paloCubes) {
if (paloCube.getName().equals(strCubeName)) {
return paloCube;
}
}
return null;
}
public palocube getCubeByIdentifier(int iCubeId) {
for (palocube paloCube : paloCubes) {
if (paloCube.getCubeId() == iCubeId) {
return paloCube;
}
}
return null;
}
public palocube createCube(String strCubeName, String[] strArrDimensions, int iType) throws paloexception {
palodimensions plDIMs = plDB.getDimensions(iType);
StringBuilder sbDimensionsToCreate = new StringBuilder();
int iPos = 0;
for (String strDimensionName : strArrDimensions) {
if (iPos > 0) {
sbDimensionsToCreate.append(",");
}
palodimension plDIM = plDIMs.getDimension(strDimensionName);
if (null == plDIM) {
sbDimensionsToCreate.append("-1");
} else {
sbDimensionsToCreate.append(plDIMs.getDimension(strDimensionName).getDimensionId());
}
iPos++;
}
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(this.plDB.getDatabaseId())));
qparams.add(new BasicNameValuePair("new_name", strCubeName));
qparams.add(new BasicNameValuePair("type", String.valueOf(iType)));
qparams.add(new BasicNameValuePair("dimensions", sbDimensionsToCreate.toString()));
try {
palocube plCube = null;
HttpEntity entity = this.plConn.sendToServer(qparams, "/cube/create");
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
csv.setQuoteChar('"');
while (csv.readNext()) {
// System.out.println(csv.getRawRecord());
plCube = new palocube(plConn, plDB.getDatabaseId(), palohelpers.StringToInt(csv.get(0)), csv.get(1),
palohelpers.StringToInt(csv.get(2)), palohelpers.StringToIntArray(csv.get(3),
palohelpers.StringToInt(csv.get(2))), palohelpers.StringToLong(csv.get(4)),
palohelpers.StringToLong(csv.get(5)), palohelpers.StringToInt(csv.get(6)), palohelpers.StringToInt(csv
.get(7)), palohelpers.StringToInt(csv.get(8)));
paloCubes.add(plCube);
}
csv.close();
entity.consumeContent();
return plCube;
} catch (Exception e) {
throw new paloexception(e.getMessage());
}
}
public int getNumberOfCubes(){
return paloCubes.size();
}
public palocube getCube(int iIndex){
return paloCubes.get(iIndex);
}
public ArrayList<palocube> getCubes(){
return paloCubes;
}
public void deleteCube(String strCubeName) throws paloexception{
palocube paloCubeToRemove = getCube(strCubeName);
if(null != paloCubeToRemove){
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(this.plDB.getDatabaseId())));
qparams.add(new BasicNameValuePair("cube", String.valueOf(paloCubeToRemove.getCubeId())));
plConn.sendToServerSingleRC(qparams, "/cube/destroy");
paloCubes.remove(paloCubeToRemove);
}
}
public palocube getCube(String strCubeName){
for(palocube paloCube : paloCubes){
if(paloCube.getName().equals(strCubeName)) return paloCube;
}
return null;
}
public palocube getCubeByIdentifier(int iCubeId){
for(palocube paloCube : paloCubes){
if(paloCube.getCubeId()==iCubeId) return paloCube;
}
return null;
}
public palocube createCube(String strCubeName, String[] strArrDimensions, int iType) throws paloexception{
palodimensions plDIMs = plDB.getDimensions(iType);
StringBuilder sbDimensionsToCreate = new StringBuilder();
int iPos=0;
for(String strDimensionName : strArrDimensions){
if(iPos>0)sbDimensionsToCreate.append(",");
palodimension plDIM = plDIMs.getDimension(strDimensionName);
if(null==plDIM)sbDimensionsToCreate.append("-1");
else sbDimensionsToCreate.append(plDIMs.getDimension(strDimensionName).getDimensionId());
iPos++;
}
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(this.plDB.getDatabaseId())));
qparams.add(new BasicNameValuePair("new_name", strCubeName));
qparams.add(new BasicNameValuePair("type", String.valueOf(iType)));
qparams.add(new BasicNameValuePair("dimensions", sbDimensionsToCreate.toString()));
try{
palocube plCube=null;
HttpEntity entity = this.plConn.sendToServer(qparams, "/cube/create");
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
csv.setDelimiter(';');
csv.setTextQualifier('"');
while(csv.readRecord()){
//System.out.println(csv.getRawRecord());
plCube = new palocube(plConn, plDB.getDatabaseId(),
palohelpers.StringToInt(csv.get(0)),
csv.get(1),
palohelpers.StringToInt(csv.get(2)),
palohelpers.StringToIntArray(csv.get(3), palohelpers.StringToInt(csv.get(2))),
palohelpers.StringToLong(csv.get(4)),
palohelpers.StringToLong(csv.get(5)),
palohelpers.StringToInt(csv.get(6)),
palohelpers.StringToInt(csv.get(7)),
palohelpers.StringToInt(csv.get(8))
);
paloCubes.add(plCube);
}
csv.close();
entity.consumeContent();
return plCube;
}catch(Exception e){
throw new paloexception(e.getMessage());
}
}
}

View File

@@ -1,223 +1,216 @@
package org.talend.jpalo;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import com.csvreader.CsvReader;
import java.nio.charset.Charset;
import java.util.*;
import org.apache.http.HttpEntity;
import org.apache.http.message.BasicNameValuePair;
import com.talend.csv.CSVReader;
public class palodata {
public palodata() {
alPaloElements = new ArrayList();
htPaloResultData = new Hashtable();
lstDimensionElements = new LinkedList();
}
public palodata() {
alPaloElements = new ArrayList();
htPaloResultData = new Hashtable();
lstDimensionElements = new LinkedList();
}
public palodata(paloconnection plConn, palodatabase plDB, palocube paloCube)
public palodata(paloconnection plConn, palodatabase plDB, palocube paloCube)
{
alPaloElements = new ArrayList();
htPaloResultData = new Hashtable();
lstDimensionElements = new LinkedList();
this.plConn = plConn;
lDatabaseId = plDB.getDatabaseId();
plCube = paloCube;
}
{
alPaloElements = new ArrayList();
htPaloResultData = new Hashtable();
lstDimensionElements = new LinkedList();
this.plConn = plConn;
lDatabaseId = plDB.getDatabaseId();
plCube = paloCube;
}
public palodata(paloconnection plConn, palodatabase plDB, palocube paloCube, ArrayList alPaloElements,
String strDimensionElementsArray[][], int iBatchSize) {
this.alPaloElements = new ArrayList();
htPaloResultData = new Hashtable();
lstDimensionElements = new LinkedList();
this.plConn = plConn;
lDatabaseId = plDB.getDatabaseId();
plCube = paloCube;
this.alPaloElements = alPaloElements;
this.strDimensionElementsArray = strDimensionElementsArray;
public palodata(paloconnection plConn, palodatabase plDB,
palocube paloCube, ArrayList alPaloElements,
String strDimensionElementsArray[][], int iBatchSize) {
this.alPaloElements = new ArrayList();
htPaloResultData = new Hashtable();
lstDimensionElements = new LinkedList();
this.plConn = plConn;
lDatabaseId = plDB.getDatabaseId();
plCube = paloCube;
this.alPaloElements = alPaloElements;
this.strDimensionElementsArray = strDimensionElementsArray;
this.iBatchSize = iBatchSize;
htPaloResultData = new Hashtable();
buildDimElemIteratorFromArray();
}
this.iBatchSize = iBatchSize;
htPaloResultData = new Hashtable();
buildDimElemIteratorFromArray();
}
private void buildDimElemIteratorFromArray() {
iDimensionElementLength = strDimensionElementsArray.length;
for (String[] element : strDimensionElementsArray) {
lstDimensionElements.add(Arrays.asList(element));
}
private void buildDimElemIteratorFromArray() {
iDimensionElementLength = strDimensionElementsArray.length;
for (int i = 0; i < strDimensionElementsArray.length; i++)
itDimensionElements = palohelpers.finiteCartesianProduct(lstDimensionElements).iterator();
}
lstDimensionElements.add(Arrays
.asList(strDimensionElementsArray[i]));
public boolean getResults() throws paloexception {
int iRowCounter = 0;
List lstDimensionElementArray = new LinkedList();
htPaloResultData = new Hashtable();
for (; itDimensionElements.hasNext() && iRowCounter < iBatchSize; iRowCounter++) {
List x = (List) itDimensionElements.next();
for (int i = 0; i < x.size(); i++) {
lstDimensionElementArray.add(x.get(i));
}
itDimensionElements = palohelpers.finiteCartesianProduct(
lstDimensionElements).iterator();
}
}
public boolean getResults() throws paloexception {
int iRowCounter = 0;
List lstDimensionElementArray = new LinkedList();
htPaloResultData = new Hashtable();
for (; itDimensionElements.hasNext() && iRowCounter < iBatchSize; iRowCounter++) {
List x = (List) itDimensionElements.next();
for (int i = 0; i < x.size(); i++)
lstDimensionElementArray.add((String) x.get(i));
int iPos = 0;
int iCoordPos = 0;
StringBuilder sbCoordinates = new StringBuilder();
for (Iterator iterator = lstDimensionElementArray.iterator(); iterator.hasNext();) {
String strCoordElement = (String) iterator.next();
if (iPos > 0) {
sbCoordinates.append(",");
}
paloelement plElm = ((paloelements) alPaloElements.get(iCoordPos)).getElement(strCoordElement);
if (plElm == null) {
sbCoordinates.append("-1");
} else {
sbCoordinates.append(plElm.getElementIdentifier());
}
iPos++;
if (++iCoordPos >= iDimensionElementLength) {
iCoordPos = 0;
sbCoordinates.append(":");
iPos = 0;
}
}
}
if (iRowCounter > 0) {
List qparams = new ArrayList();
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(lDatabaseId)));
qparams.add(new BasicNameValuePair("cube", String.valueOf(plCube.getCubeId())));
qparams.add(new BasicNameValuePair("paths", sbCoordinates.toString()));
try {
HttpEntity entity = plConn.sendToServer(qparams, "/cell/values");
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
csv.setQuoteChar('"');
int iCoordElem = 0;
while (csv.readNext()) {
String strArrCoord[] = new String[iDimensionElementLength];
for (int i = 0; i < iDimensionElementLength; i++) {
strArrCoord[i] = (String) lstDimensionElementArray.get(iCoordElem++);
}
int iPos = 0;
int iCoordPos = 0;
StringBuilder sbCoordinates = new StringBuilder();
for (Iterator iterator = lstDimensionElementArray.iterator(); iterator
.hasNext();) {
String strCoordElement = (String) iterator.next();
if (iPos > 0)
sbCoordinates.append(",");
paloelement plElm = ((paloelements) alPaloElements.get(iCoordPos))
.getElement(strCoordElement);
if (plElm == null)
sbCoordinates.append("-1");
else
sbCoordinates.append(plElm.getElementIdentifier());
iPos++;
if (++iCoordPos >= iDimensionElementLength) {
iCoordPos = 0;
sbCoordinates.append(":");
iPos = 0;
}
}
if (palohelpers.StringToInt(csv.get(0)) == 1) {
if (palohelpers.StringToInt(csv.get(1)) > 0) {
htPaloResultData.put(strArrCoord,
new palodatavalue(strArrCoord, palohelpers.StringToDouble(csv.get(2))));
} else {
htPaloResultData.put(strArrCoord, new palodatavalue(strArrCoord, 0.0D));
}
} else if (palohelpers.StringToInt(csv.get(0)) == 0) {
htPaloResultData.put(strArrCoord, new palodatavalue(strArrCoord, csv.get(2)));
}
}
csv.close();
entity.consumeContent();
} catch (Exception e) {
throw new paloexception(e.getMessage());
}
}
return iRowCounter <= iBatchSize && iRowCounter > 0;
}
if (iRowCounter > 0) {
List qparams = new ArrayList();
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String
.valueOf(lDatabaseId)));
qparams.add(new BasicNameValuePair("cube", String.valueOf(plCube
.getCubeId())));
qparams.add(new BasicNameValuePair("paths", sbCoordinates
.toString()));
try {
HttpEntity entity = plConn
.sendToServer(qparams, "/cell/values");
CsvReader csv = new CsvReader(entity.getContent(),
Charset.forName("UTF-8"));
csv.setDelimiter(';');
csv.setTextQualifier('"');
int iCoordElem = 0;
while (csv.readRecord()) {
String strArrCoord[] = new String[iDimensionElementLength];
for (int i = 0; i < iDimensionElementLength; i++)
strArrCoord[i] = (String) lstDimensionElementArray
.get(iCoordElem++);
public Hashtable getResultHashTable() {
return htPaloResultData;
}
if (palohelpers.StringToInt(csv.get(0)) == 1) {
if (palohelpers.StringToInt(csv.get(1)) > 0)
htPaloResultData.put(
strArrCoord,
new palodatavalue(strArrCoord, palohelpers
.StringToDouble(csv.get(2))));
else
htPaloResultData.put(strArrCoord,
new palodatavalue(strArrCoord, 0.0D));
} else if (palohelpers.StringToInt(csv.get(0)) == 0)
htPaloResultData.put(strArrCoord, new palodatavalue(
strArrCoord, csv.get(2)));
}
csv.close();
entity.consumeContent();
} catch (Exception e) {
throw new paloexception(e.getMessage());
}
}
return iRowCounter <= iBatchSize && iRowCounter > 0;
}
public palodatavalue getValue(String strDimensionElementArray[], boolean bRefreshElements) throws paloexception {
long lDimensionElementIdentifierArray[] = new long[strDimensionElementArray.length];
if (plDims == null || bRefreshElements) {
plDims = plCube.getDimensions();
}
for (int i = 0; i < strDimensionElementArray.length; i++) {
paloelement plElm = plDims.getDimension(i).getElements(false).getElement(strDimensionElementArray[i]);
if (plElm == null) {
lDimensionElementIdentifierArray[i] = -1L;
} else {
lDimensionElementIdentifierArray[i] = plElm.getElementIdentifier();
}
}
public Hashtable getResultHashTable() {
return htPaloResultData;
}
return getValue(lDimensionElementIdentifierArray);
}
public palodatavalue getValue(String strDimensionElementArray[],
boolean bRefreshElements) throws paloexception {
long lDimensionElementIdentifierArray[] = new long[strDimensionElementArray.length];
if (plDims == null || bRefreshElements)
plDims = plCube.getDimensions();
for (int i = 0; i < strDimensionElementArray.length; i++) {
paloelement plElm = plDims.getDimension(i).getElements(false)
.getElement(strDimensionElementArray[i]);
if (plElm == null)
lDimensionElementIdentifierArray[i] = -1L;
else
lDimensionElementIdentifierArray[i] = plElm
.getElementIdentifier();
}
public palodatavalue getValue(long lDimensionElementIdentifierArray[]) throws paloexception {
List qparams = new ArrayList();
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(lDatabaseId)));
qparams.add(new BasicNameValuePair("cube", String.valueOf(plCube.getCubeId())));
StringBuilder sbCoordinates = new StringBuilder();
int iPos = 0;
long al[];
int j = (al = lDimensionElementIdentifierArray).length;
for (int i = 0; i < j; i++) {
long lDimensionElementIdentifier = al[i];
if (iPos > 0) {
sbCoordinates.append(",");
}
sbCoordinates.append(lDimensionElementIdentifier);
iPos++;
}
return getValue(lDimensionElementIdentifierArray);
}
qparams.add(new BasicNameValuePair("path", sbCoordinates.toString()));
palodatavalue rcDataValue = null;
try {
HttpEntity entity = plConn.sendToServer(qparams, "/cell/value");
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
csv.setQuoteChar('"');
while (csv.readNext()) {
if (palohelpers.StringToInt(csv.get(0)) == 1) {
if (palohelpers.StringToInt(csv.get(1)) > 0) {
rcDataValue = new palodatavalue(palohelpers.StringToDouble(csv.get(2)));
} else {
rcDataValue = new palodatavalue(0.0D);
}
} else if (palohelpers.StringToInt(csv.get(0)) == 0) {
rcDataValue = new palodatavalue(csv.get(2));
}
}
csv.close();
entity.consumeContent();
return rcDataValue;
} catch (Exception e) {
throw new paloexception(e.getMessage());
}
}
public palodatavalue getValue(long lDimensionElementIdentifierArray[])
throws paloexception {
List qparams = new ArrayList();
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String
.valueOf(lDatabaseId)));
qparams.add(new BasicNameValuePair("cube", String.valueOf(plCube
.getCubeId())));
StringBuilder sbCoordinates = new StringBuilder();
int iPos = 0;
long al[];
int j = (al = lDimensionElementIdentifierArray).length;
for (int i = 0; i < j; i++) {
long lDimensionElementIdentifier = al[i];
if (iPos > 0)
sbCoordinates.append(",");
sbCoordinates.append(lDimensionElementIdentifier);
iPos++;
}
public static final int PALO_SPLASH_DISABLE = 0;
qparams.add(new BasicNameValuePair("path", sbCoordinates.toString()));
palodatavalue rcDataValue = null;
try {
HttpEntity entity = plConn.sendToServer(qparams, "/cell/value");
CsvReader csv = new CsvReader(entity.getContent(),
Charset.forName("UTF-8"));
csv.setDelimiter(';');
csv.setTextQualifier('"');
while (csv.readRecord())
if (palohelpers.StringToInt(csv.get(0)) == 1) {
if (palohelpers.StringToInt(csv.get(1)) > 0)
rcDataValue = new palodatavalue(
palohelpers.StringToDouble(csv.get(2)));
else
rcDataValue = new palodatavalue(0.0D);
} else if (palohelpers.StringToInt(csv.get(0)) == 0)
rcDataValue = new palodatavalue(csv.get(2));
csv.close();
entity.consumeContent();
return rcDataValue;
} catch (Exception e) {
throw new paloexception(e.getMessage());
}
}
public static final int PALO_SPLASH_DEFAULT = 1;
public static final int PALO_SPLASH_BASE_SET = 3;
public static final int PALO_SPLASH_BASE_ADD = 2;
private paloconnection plConn;
private palodimensions plDims;
private long lDatabaseId;
private ArrayList alPaloElements;
private Hashtable htPaloResultData;
private palocube plCube;
private String strDimensionElementsArray[][];
private List lstDimensionElements;
private Iterator itDimensionElements;
private int iBatchSize;
private int iDimensionElementLength;
public static final int PALO_SPLASH_DISABLE = 0;
public static final int PALO_SPLASH_DEFAULT = 1;
public static final int PALO_SPLASH_BASE_SET = 3;
public static final int PALO_SPLASH_BASE_ADD = 2;
private paloconnection plConn;
private palodimensions plDims;
private long lDatabaseId;
private ArrayList alPaloElements;
private Hashtable htPaloResultData;
private palocube plCube;
private String strDimensionElementsArray[][];
private List lstDimensionElements;
private Iterator itDimensionElements;
private int iBatchSize;
private int iDimensionElementLength;
}

View File

@@ -1,5 +1,6 @@
package org.talend.jpalo;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.List;
@@ -7,148 +8,144 @@ import org.apache.http.HttpEntity;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import com.talend.csv.CSVReader;
import com.csvreader.CsvReader;
public class palodatabase {
private paloconnection plConn;
private paloconnection plConn;
// OK
// private native palodimensions JNIgetDimensions(palodatabase paloDatabase, int iDimensionType);
// private native palocubes JNIgetCubes(palodatabase paloDatabase, int iDimensionType, int iWithCell);
// OK
//private native palodimensions JNIgetDimensions(palodatabase paloDatabase, int iDimensionType);
//private native palocubes JNIgetCubes(palodatabase paloDatabase, int iDimensionType, int iWithCell);
private String strDatabaseName;
private long lDatabaseId;
private int iNumberOfDimensions;
private int iNumberOfCubes;
private int iStatus;
private int iType;
@SuppressWarnings("unused")
private String strDatabaseToken;
public palodatabase(paloconnection plConn, String strDatabaseName, long lDatabaseId, int iNumberOfDimensions, int iNumberOfCubes, int iStatus, int iType, String strDatabaseToken){
super();
this.plConn = plConn;
this.strDatabaseName = strDatabaseName;
this.lDatabaseId = lDatabaseId;
this.iNumberOfCubes = iNumberOfCubes;
this.iNumberOfDimensions = iNumberOfDimensions;
this.iStatus = iStatus;
this.iType = iType;
this.strDatabaseToken = strDatabaseToken;
}
public palodimensions getDimensions(int iDimensionType)throws paloexception{
return new palodimensions(this.plConn, this, iDimensionType);
}
public palocubes getCubes(int iCubeType) throws paloexception{
return new palocubes(this.plConn, this, iCubeType);
//return getCubes(iCubeType, 0);
}
/*
public palocubes getCubes(int iCubeType, int iOnlyWithCells){
return JNIgetCubes(this, iCubeType, iOnlyWithCells);
}*/
public void save()throws paloexception{
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
plConn.sendToServerSingleRC(qparams, "/database/save");
}
private String strDatabaseName;
public void load() throws paloexception{
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
plConn.sendToServerSingleRC(qparams, "/database/load");
}
private long lDatabaseId;
public void unload()throws paloexception{
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
plConn.sendToServerSingleRC(qparams, "/database/unload");
}
public void rename(String strNewName) throws paloexception{
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
qparams.add(new BasicNameValuePair("new_name",strNewName));
private int iNumberOfDimensions;
try{
HttpEntity entity = this.plConn.sendToServer(qparams, "/database/rename");
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
private int iNumberOfCubes;
//CsvReader csv = new CsvReader(this.plConn.sendToServer(qparams, "/database/rename").getContent(), Charset.defaultCharset());
csv.setDelimiter(';');
csv.setTextQualifier('"');
csv.readRecord();
private int iStatus;
private int iType;
@SuppressWarnings("unused")
private String strDatabaseToken;
public palodatabase(paloconnection plConn, String strDatabaseName, long lDatabaseId, int iNumberOfDimensions,
int iNumberOfCubes, int iStatus, int iType, String strDatabaseToken) {
super();
this.plConn = plConn;
this.strDatabaseName = strDatabaseName;
this.lDatabaseId = lDatabaseId;
this.iNumberOfCubes = iNumberOfCubes;
this.iNumberOfDimensions = iNumberOfDimensions;
this.iStatus = iStatus;
this.iType = iType;
this.strDatabaseToken = strDatabaseToken;
}
public palodimensions getDimensions(int iDimensionType) throws paloexception {
return new palodimensions(this.plConn, this, iDimensionType);
}
public palocubes getCubes(int iCubeType) throws paloexception {
return new palocubes(this.plConn, this, iCubeType);
// return getCubes(iCubeType, 0);
}
/*
* public palocubes getCubes(int iCubeType, int iOnlyWithCells){ return JNIgetCubes(this, iCubeType,
* iOnlyWithCells); }
*/
public void save() throws paloexception {
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
plConn.sendToServerSingleRC(qparams, "/database/save");
}
public void load() throws paloexception {
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
plConn.sendToServerSingleRC(qparams, "/database/load");
}
public void unload() throws paloexception {
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
plConn.sendToServerSingleRC(qparams, "/database/unload");
}
public void rename(String strNewName) throws paloexception {
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
qparams.add(new BasicNameValuePair("new_name", strNewName));
try {
HttpEntity entity = this.plConn.sendToServer(qparams, "/database/rename");
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
csv.setQuoteChar('"');
csv.readNext();
this.strDatabaseName = csv.get(1);
this.iNumberOfDimensions = Integer.valueOf(csv.get(2));
this.iNumberOfCubes = Integer.valueOf(csv.get(3));
this.iStatus = Integer.valueOf(csv.get(4));
this.iType = Integer.valueOf(csv.get(5));
csv.close();
entity.consumeContent();
} catch (Exception e) {
throw new paloexception(e.getMessage());
this.strDatabaseName = csv.get(1);
this.iNumberOfDimensions = Integer.valueOf(csv.get(2));
this.iNumberOfCubes = Integer.valueOf(csv.get(3));
this.iStatus = Integer.valueOf(csv.get(4));
this.iType = Integer.valueOf(csv.get(5));
csv.close();
entity.consumeContent();
}catch(Exception e){
throw new paloexception(e.getMessage());
}
}
}
public String getName(){
return strDatabaseName;
}
public long getDatabaseId(){
return lDatabaseId;
}
public int getNumberOfDimensions(){
return iNumberOfDimensions;
}
public int getNumberOfCubes(){
return iNumberOfCubes;
}
public int getStatus(){
return iStatus;
}
public int getType(){
return iType;
}
public void refreshDatabaseInfo() throws paloexception{
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
public String getName() {
return strDatabaseName;
}
try{
HttpEntity entity = this.plConn.sendToServer(qparams, "/database/info");
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
//CsvReader csv = new CsvReader(this.plConn.sendToServer(qparams, "/database/info").getContent(), Charset.defaultCharset());
csv.setDelimiter(';');
csv.setTextQualifier('"');
csv.readRecord();
public long getDatabaseId() {
return lDatabaseId;
}
public int getNumberOfDimensions() {
return iNumberOfDimensions;
}
public int getNumberOfCubes() {
return iNumberOfCubes;
}
public int getStatus() {
return iStatus;
}
public int getType() {
return iType;
}
public void refreshDatabaseInfo() throws paloexception {
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
try {
HttpEntity entity = this.plConn.sendToServer(qparams, "/database/info");
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
csv.setQuoteChar('"');
csv.readNext();
this.strDatabaseName = csv.get(1);
this.iNumberOfDimensions = Integer.valueOf(csv.get(2));
this.iNumberOfCubes = Integer.valueOf(csv.get(3));
this.iStatus = Integer.valueOf(csv.get(4));
this.iType = Integer.valueOf(csv.get(5));
this.strDatabaseToken = csv.get(6);
csv.close();
entity.consumeContent();
} catch (Exception e) {
throw new paloexception(e.getMessage());
this.strDatabaseName = csv.get(1);
this.iNumberOfDimensions = Integer.valueOf(csv.get(2));
this.iNumberOfCubes = Integer.valueOf(csv.get(3));
this.iStatus = Integer.valueOf(csv.get(4));
this.iType = Integer.valueOf(csv.get(5));
this.strDatabaseToken = csv.get(6);
csv.close();
entity.consumeContent();
}catch(Exception e){
throw new paloexception(e.getMessage());
}
}
}
}

View File

@@ -1,5 +1,6 @@
package org.talend.jpalo;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.List;
@@ -7,110 +8,108 @@ import org.apache.http.HttpEntity;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import com.talend.csv.CSVReader;
import com.csvreader.CsvReader;
public class palodatabases {
private paloconnection plConn;
private paloconnection plConn;
// OK
public static final int DATABASE_TYPE_NORMAL = 0;
public static final int DATABASE_TYPE_SYSTEM_= 1;
public static final int DATABASE_TYPE_UNKNOWN = -1;
public static final int DATABASE_STATUS_UNLOADED=0;
public static final int DATABASE_STATUS_LOADED=1;
public static final int DATABASE_STATUS_CHANGED=2;
public static final int DATABASE_STATUS_LOADING=3;
public static final int DATABASE_STATUS_UNKNOWN=-1;
// OK
public static final int DATABASE_TYPE_NORMAL = 0;
private ArrayList<palodatabase> paloDatabases = new ArrayList<palodatabase>();
public palodatabases(paloconnection plConn) throws paloexception{
super();
this.plConn = plConn;
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("show_normal","1"));
qparams.add(new BasicNameValuePair("show_system","1"));
public static final int DATABASE_TYPE_SYSTEM_ = 1;
try{
HttpEntity entity = this.plConn.sendToServer(qparams, "/server/databases");
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
public static final int DATABASE_TYPE_UNKNOWN = -1;
public static final int DATABASE_STATUS_UNLOADED = 0;
public static final int DATABASE_STATUS_LOADED = 1;
public static final int DATABASE_STATUS_CHANGED = 2;
public static final int DATABASE_STATUS_LOADING = 3;
public static final int DATABASE_STATUS_UNKNOWN = -1;
private ArrayList<palodatabase> paloDatabases = new ArrayList<palodatabase>();
public palodatabases(paloconnection plConn) throws paloexception {
super();
this.plConn = plConn;
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("show_normal", "1"));
qparams.add(new BasicNameValuePair("show_system", "1"));
try {
HttpEntity entity = this.plConn.sendToServer(qparams, "/server/databases");
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
csv.setQuoteChar('"');
while (csv.readNext()) {
paloDatabases.add(new palodatabase(this.plConn, csv.get(1), Long.parseLong(csv.get(0)), Integer.valueOf(csv
.get(2)), Integer.valueOf(csv.get(3)), Integer.valueOf(csv.get(4)), Integer.valueOf(csv.get(5)), csv
.get(6)));
// System.out.println(csv.getRawRecord());
}
csv.close();
entity.consumeContent();
} catch (Exception e) {
throw new paloexception(e.getMessage());
//CsvReader csv = new CsvReader(this.plConn.sendToServer(qparams, "/server/databases").getContent(), Charset.defaultCharset());
csv.setDelimiter(';');
csv.setTextQualifier('"');
while(csv.readRecord()){
paloDatabases.add(new palodatabase(this.plConn, csv.get(1), Long.parseLong(csv.get(0)), Integer.valueOf(csv.get(2)),Integer.valueOf(csv.get(3)),Integer.valueOf(csv.get(4)),Integer.valueOf(csv.get(5)), csv.get(6)));
//System.out.println(csv.getRawRecord());
}
csv.close();
entity.consumeContent();
}catch(Exception e){
throw new paloexception(e.getMessage());
}
}
public palodatabase createDatabase(String strDatabaseName) throws paloexception {
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("new_name", strDatabaseName));
try {
HttpEntity entity = this.plConn.sendToServer(qparams, "/database/create");
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
csv.setQuoteChar('"');
csv.readNext();
palodatabase plDB = new palodatabase(this.plConn, csv.get(1), Long.parseLong(csv.get(0)),
Integer.valueOf(csv.get(2)), Integer.valueOf(csv.get(3)), Integer.valueOf(csv.get(4)), Integer.valueOf(csv
.get(5)), "");
csv.close();
entity.consumeContent();
plDB.refreshDatabaseInfo();
paloDatabases.add(plDB);
return plDB;
} catch (Exception e) {
throw new paloexception(e.getMessage());
}
public palodatabase createDatabase(String strDatabaseName) throws paloexception{
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("new_name",strDatabaseName));
try{
HttpEntity entity = this.plConn.sendToServer(qparams, "/database/create");
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
//CsvReader csv = new CsvReader(this.plConn.sendToServer(qparams, "/database/create").getContent(), Charset.defaultCharset());
csv.setDelimiter(';');
csv.setTextQualifier('"');
csv.readRecord();
palodatabase plDB = new palodatabase(this.plConn, csv.get(1), Long.parseLong(csv.get(0)), Integer.valueOf(csv.get(2)),Integer.valueOf(csv.get(3)),Integer.valueOf(csv.get(4)),Integer.valueOf(csv.get(5)),"");
csv.close();
entity.consumeContent();
plDB.refreshDatabaseInfo();
paloDatabases.add(plDB);
return plDB;
}catch(Exception e){
throw new paloexception(e.getMessage());
}
}
}
public void deleteDatabase(String strDatabaseName) throws paloexception {
palodatabase paloDBToRemove = getDatabase(strDatabaseName);
if (null != paloDBToRemove) {
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(paloDBToRemove.getDatabaseId())));
plConn.sendToServerSingleRC(qparams, "/database/destroy");
paloDatabases.remove(paloDBToRemove);
}
}
public int getNumberOfDatabases() {
return paloDatabases.size();
}
public palodatabase getDatabase(int iIndex) {
return paloDatabases.get(iIndex);
}
public ArrayList<palodatabase> getDatabases() {
return paloDatabases;
}
public palodatabase getDatabase(String strDatabaseName) {
for (palodatabase palodb : paloDatabases) {
if (palodb.getName().equals(strDatabaseName)) {
return palodb;
}
}
return null;
}
public void deleteDatabase(String strDatabaseName) throws paloexception{
palodatabase paloDBToRemove = getDatabase(strDatabaseName);
if(null != paloDBToRemove){
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(paloDBToRemove.getDatabaseId())));
plConn.sendToServerSingleRC(qparams, "/database/destroy");
paloDatabases.remove(paloDBToRemove);
}
}
public int getNumberOfDatabases(){
return paloDatabases.size();
}
public palodatabase getDatabase(int iIndex){
return paloDatabases.get(iIndex);
}
public ArrayList<palodatabase> getDatabases(){
return paloDatabases;
}
public palodatabase getDatabase(String strDatabaseName){
for(palodatabase palodb : paloDatabases){
if(palodb.getName().equals(strDatabaseName)) return palodb;
}
return null;
}
}

View File

@@ -1,134 +1,127 @@
package org.talend.jpalo;
import java.util.ArrayList;
import java.util.List;
import java.nio.charset.Charset;
import java.util.*;
import org.apache.http.HttpEntity;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import com.talend.csv.CSVReader;
import com.csvreader.CsvReader;
public class palodatamulti {
public final static int PALO_SPLASH_DISABLE=0;
public final static int PALO_SPLASH_DEFAULT=1;
public final static int PALO_SPLASH_BASE_SET=3;
public final static int PALO_SPLASH_BASE_ADD=2;
public final static int PALO_SPLASH_DISABLE = 0;
private paloconnection plConn;
private long lDatabaseId;
private ArrayList<paloelements> alPaloElements = new ArrayList<paloelements>();
private List<palodatavalue> lstPaloValues = new ArrayList<palodatavalue>();
private int iNbOfCoordinates=0;
private int iNbOfDataVolumns=0;
private int iCurrentPos=0;
private void initDataSetList(){
String strArr[] = new String[iNbOfCoordinates];
for(int i=0;i<iNbOfDataVolumns;i++){
palodatavalue plDV = new palodatavalue(strArr, 0);
lstPaloValues.add(plDV);
}
}
public void cleanDataSetList(){
iCurrentPos=0;
}
public palodatamulti(paloconnection plConn, palodatabase plDB, int iNbOfDataVolumns, int iNbOfCoordinates, ArrayList<paloelements> alPaloElements){
this.plConn = plConn;
this.lDatabaseId = plDB.getDatabaseId();
lstPaloValues = new ArrayList<palodatavalue>(iNbOfDataVolumns);
this.iNbOfCoordinates = iNbOfCoordinates;
this.iNbOfDataVolumns = iNbOfDataVolumns;
this.alPaloElements = alPaloElements;
// Init lstPaloValues
initDataSetList();
}
public void addToValueList(String[] strArrCoordinates, double dValue){
strArrCoordinates = replaceStringArrWithElementId(strArrCoordinates);
lstPaloValues.get(iCurrentPos++).setValue(strArrCoordinates, dValue);
}
public void addToValueList(String[] strArrCoordinates, String sValue){
strArrCoordinates = replaceStringArrWithElementId(strArrCoordinates);
lstPaloValues.get(iCurrentPos++).setValue(strArrCoordinates, sValue);
}
public int getNumberOfValues(){
return iCurrentPos;
}
public palodatavalue getDataValue(int iPos){
return lstPaloValues.get(iPos);
}
public final static int PALO_SPLASH_DEFAULT = 1;
public void setData( palocube plCube, int SPLASH_MODE, boolean bAddValue, boolean bUseEventProcessor) throws paloexception{
public final static int PALO_SPLASH_BASE_SET = 3;
public final static int PALO_SPLASH_BASE_ADD = 2;
private paloconnection plConn;
private long lDatabaseId;
private ArrayList<paloelements> alPaloElements = new ArrayList<paloelements>();
private List<palodatavalue> lstPaloValues = new ArrayList<palodatavalue>();
private int iNbOfCoordinates = 0;
private int iNbOfDataVolumns = 0;
private int iCurrentPos = 0;
private void initDataSetList() {
String strArr[] = new String[iNbOfCoordinates];
for (int i = 0; i < iNbOfDataVolumns; i++) {
palodatavalue plDV = new palodatavalue(strArr, 0);
lstPaloValues.add(plDV);
}
}
public void cleanDataSetList() {
iCurrentPos = 0;
}
public palodatamulti(paloconnection plConn, palodatabase plDB, int iNbOfDataVolumns, int iNbOfCoordinates,
ArrayList<paloelements> alPaloElements) {
this.plConn = plConn;
this.lDatabaseId = plDB.getDatabaseId();
lstPaloValues = new ArrayList<palodatavalue>(iNbOfDataVolumns);
this.iNbOfCoordinates = iNbOfCoordinates;
this.iNbOfDataVolumns = iNbOfDataVolumns;
this.alPaloElements = alPaloElements;
// Init lstPaloValues
initDataSetList();
}
public void addToValueList(String[] strArrCoordinates, double dValue) {
strArrCoordinates = replaceStringArrWithElementId(strArrCoordinates);
lstPaloValues.get(iCurrentPos++).setValue(strArrCoordinates, dValue);
}
public void addToValueList(String[] strArrCoordinates, String sValue) {
strArrCoordinates = replaceStringArrWithElementId(strArrCoordinates);
lstPaloValues.get(iCurrentPos++).setValue(strArrCoordinates, sValue);
}
public int getNumberOfValues() {
return iCurrentPos;
}
public palodatavalue getDataValue(int iPos) {
return lstPaloValues.get(iPos);
}
public void setData(palocube plCube, int SPLASH_MODE, boolean bAddValue, boolean bUseEventProcessor) throws paloexception {
StringBuilder sbCoordinates = new StringBuilder();
StringBuilder sbValues = new StringBuilder();
int iPos = 0;
for (int i = 0; i < iCurrentPos; i++) {
// for(palodatavalue plValue : this.lstPaloValues){
palodatavalue plValue = getDataValue(i);
if (iPos > 0) {
sbCoordinates.append(":");
sbValues.append(":");
}
sbCoordinates.append(plValue.getCoordinatesString());
if (palodatavalue.PALO_NUMERIC == plValue.getType()) {
sbValues.append(plValue.getDoubleValue());
} else {
sbValues.append(plValue.getStringValue());
}
iPos++;
}
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
qparams.add(new BasicNameValuePair("cube", String.valueOf(plCube.getCubeId())));
qparams.add(new BasicNameValuePair("paths", sbCoordinates.toString()));
qparams.add(new BasicNameValuePair("values", sbValues.toString()));
qparams.add(new BasicNameValuePair("add", palohelpers.BooleanToString(bAddValue)));
qparams.add(new BasicNameValuePair("event_processor", palohelpers.BooleanToString(bUseEventProcessor)));
qparams.add(new BasicNameValuePair("splash", String.valueOf(SPLASH_MODE)));
try {
HttpEntity entity = this.plConn.sendToServer(qparams, "/cell/replace_bulk");
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
csv.setQuoteChar('"');
csv.readNext();
csv.close();
entity.consumeContent();
} catch (Exception e) {
throw new paloexception(e.getMessage());
}
}
private String[] replaceStringArrWithElementId(String[] strArr) {
for (int i = 0; i < strArr.length; i++) {
paloelement plElm = alPaloElements.get(i).getElement(strArr[i]);
if (null == plElm) {
strArr[i] = "-1";
} else {
strArr[i] = String.valueOf(plElm.getElementIdentifier());
}
}
return strArr;
}
StringBuilder sbCoordinates = new StringBuilder();
StringBuilder sbValues = new StringBuilder();
int iPos=0;
for(int i=0;i<iCurrentPos;i++){
//for(palodatavalue plValue : this.lstPaloValues){
palodatavalue plValue = getDataValue(i);
if(iPos>0){
sbCoordinates.append(":");
sbValues.append(":");
}
sbCoordinates.append(plValue.getCoordinatesString());
if(palodatavalue.PALO_NUMERIC == plValue.getType())
sbValues.append(plValue.getDoubleValue());
else
sbValues.append(plValue.getStringValue());
iPos++;
}
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
qparams.add(new BasicNameValuePair("cube", String.valueOf(plCube.getCubeId())));
qparams.add(new BasicNameValuePair("paths", sbCoordinates.toString()));
qparams.add(new BasicNameValuePair("values", sbValues.toString()));
qparams.add(new BasicNameValuePair("add", palohelpers.BooleanToString(bAddValue)));
qparams.add(new BasicNameValuePair("event_processor", palohelpers.BooleanToString(bUseEventProcessor)));
qparams.add(new BasicNameValuePair("splash", String.valueOf(SPLASH_MODE)));
try{
HttpEntity entity = this.plConn.sendToServer(qparams, "/cell/replace_bulk");
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
csv.setDelimiter(';');
csv.setTextQualifier('"');
csv.readRecord();
csv.close();
entity.consumeContent();
}catch(Exception e){
throw new paloexception(e.getMessage());
}
}
private String[] replaceStringArrWithElementId(String[] strArr){
for(int i=0;i<strArr.length;i++){
paloelement plElm = alPaloElements.get(i).getElement(strArr[i]);
if(null==plElm) strArr[i]="-1";
else strArr[i] = String.valueOf(plElm.getElementIdentifier());
}
return strArr;
}
}

View File

@@ -1,5 +1,6 @@
package org.talend.jpalo;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
@@ -8,222 +9,233 @@ import org.apache.http.HttpEntity;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import com.talend.csv.CSVReader;
import com.csvreader.CsvReader;
public class palodimension {
private paloelements paloElements;
private paloconnection plConn;
private paloelements paloElements;
private paloconnection plConn;
private long lDatabaseId;
@SuppressWarnings("unused")
private String strCubeName;
private String strDimensionName;
private int iDimensionId;
@SuppressWarnings("unused")
private int iAssocDimension;
private int iAttributCube;
private int iRightsCube;
private int iNumberOfElements;
private int iMaximumLevel;
private int iMaximumIndent;
private int iMaximumDepth;
@SuppressWarnings("unused")
private int iDimensionToken;
private int iDimensionType;
private long lDatabaseId;
public palodimension(paloconnection plConn, long lDatabaseId,
String strDimensionName,
int iDimensionId,
int iAssocDimension,
int iAttributCube,
int iRightsCube,
int iNumberOfElements,
int iMaximumLevel,
int iMaximumIndent,
int iMaximumDepth,
int iDimensionToken
){
super();
this.plConn = plConn;
this.lDatabaseId = lDatabaseId;
this.strDimensionName=strDimensionName;
this.iDimensionId=iDimensionId;
this.iAssocDimension=iAssocDimension;
this.iAttributCube=iAttributCube;
this.iRightsCube=iRightsCube;
this.iNumberOfElements=iNumberOfElements;
this.iMaximumLevel=iMaximumLevel;
this.iMaximumIndent=iMaximumIndent;
this.iMaximumDepth=iMaximumDepth;
this.iDimensionToken=iDimensionToken;
}
@SuppressWarnings("unused")
private String strCubeName;
public paloelements getElements(boolean bRefresh) throws paloexception {
if(null==paloElements || bRefresh)
paloElements = new paloelements(plConn, this.lDatabaseId, this.iDimensionId);
return paloElements;
}
public paloelements getElements() throws paloexception {
paloElements = new paloelements(plConn, this.lDatabaseId, this.iDimensionId);
//return new paloelements(plConn, this.lDatabaseId, this.iDimensionId);
return paloElements;
}
public paloelements getElements(HashSet<String> hsFilteredElements) throws paloexception {
return new paloelements(plConn, this.lDatabaseId, this.iDimensionId, hsFilteredElements);
}
public String getName(){
return strDimensionName;
}
public int getDimensionId(){
return iDimensionId;
}
public String getAssocDimension(){
private String strDimensionName;
return "";//return iAssocDimension;
}
public String getAttributCube() throws paloexception{
try{
palocubes plCubes = getCubes(palocubes.CUBE_ATTRIBUT);
if(plCubes!=null && this.iAttributCube > 1){
palocube plAttributeCube = plCubes.getCubeByIdentifier(this.iAttributCube);
if(plAttributeCube!=null) return plAttributeCube.getName();
}
}catch(Exception e){
}
return "";
}
public String getRightsCube(){
try{
palocubes plCubes = getCubes(palocubes.CUBE_SYSTEM);
if(plCubes!=null && this.iRightsCube > 1){
palocube plAttributeCube = plCubes.getCubeByIdentifier(this.iRightsCube);
if(plAttributeCube!=null) return plAttributeCube.getName();
}
}catch(Exception e){
}
return "";
}
public int getNumberOfElements(){
return iNumberOfElements;
}
public int getMaximumLevel(){
return iMaximumLevel;
}
public int getMaximumIndent(){
return iMaximumIndent;
}
public int getMaximumDepth(){
return iMaximumDepth;
}
public int getDimensionType(){
return iDimensionType;
}
private int iDimensionId;
@SuppressWarnings("unused")
private int iAssocDimension;
public void rename(String strDimensionNewName) throws paloexception{
if(null!=strDimensionNewName && strDimensionNewName.length()>0 && !strDimensionName.equals(strDimensionNewName)){
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(lDatabaseId)));
qparams.add(new BasicNameValuePair("dimension", String.valueOf(this.iDimensionId)));
qparams.add(new BasicNameValuePair("new_name", strDimensionNewName));
try{
HttpEntity entity = this.plConn.sendToServer(qparams, "/dimension/rename");
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
//CsvReader csv = new CsvReader(this.plConn.sendToServer(qparams, "/dimension/rename").getContent(), Charset.defaultCharset());
csv.setDelimiter(';');
csv.setTextQualifier('"');
csv.readRecord();
this.strDimensionName= csv.get(1);
csv.close();
entity.consumeContent();
}catch(Exception e){
throw new paloexception(e.getMessage());
}
}
}
public palocubes getCubes() throws paloexception{
return new palocubes(this.plConn, this.lDatabaseId, this.iDimensionType, this.iDimensionId);
}
public palocubes getCubes(int iCubeType) throws paloexception{
return new palocubes(this.plConn, this.lDatabaseId, iCubeType, this.iDimensionId);
}
private int iAttributCube;
private int iRightsCube;
private int iNumberOfElements;
private int iMaximumLevel;
private int iMaximumIndent;
private int iMaximumDepth;
@SuppressWarnings("unused")
private int iDimensionToken;
private int iDimensionType;
public palodimension(paloconnection plConn, long lDatabaseId, String strDimensionName, int iDimensionId, int iAssocDimension,
int iAttributCube, int iRightsCube, int iNumberOfElements, int iMaximumLevel, int iMaximumIndent, int iMaximumDepth,
int iDimensionToken) {
super();
this.plConn = plConn;
this.lDatabaseId = lDatabaseId;
this.strDimensionName = strDimensionName;
this.iDimensionId = iDimensionId;
this.iAssocDimension = iAssocDimension;
this.iAttributCube = iAttributCube;
this.iRightsCube = iRightsCube;
this.iNumberOfElements = iNumberOfElements;
this.iMaximumLevel = iMaximumLevel;
this.iMaximumIndent = iMaximumIndent;
this.iMaximumDepth = iMaximumDepth;
this.iDimensionToken = iDimensionToken;
}
public paloelements getElements(boolean bRefresh) throws paloexception {
if (null == paloElements || bRefresh) {
paloElements = new paloelements(plConn, this.lDatabaseId, this.iDimensionId);
public void clear() throws paloexception{
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(lDatabaseId)));
qparams.add(new BasicNameValuePair("dimension", String.valueOf(this.iDimensionId)));
try{
HttpEntity entity = this.plConn.sendToServer(qparams, "/dimension/clear");
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
//CsvReader csv = new CsvReader(this.plConn.sendToServer(qparams, "/dimension/clear").getContent(), Charset.defaultCharset());
csv.setDelimiter(';');
csv.setTextQualifier('"');
csv.readRecord();
this.strDimensionName= csv.get(1);
this.iDimensionId=Integer.valueOf(csv.get(0));
this.iAssocDimension=palohelpers.StringToInt(csv.get(7));
this.iAttributCube=palohelpers.StringToInt(csv.get(8));
this.iRightsCube=palohelpers.StringToInt(csv.get(9));
this.iNumberOfElements=palohelpers.StringToInt(csv.get(2));
this.iMaximumLevel=palohelpers.StringToInt(csv.get(3));
this.iMaximumIndent=palohelpers.StringToInt(csv.get(4));
this.iMaximumDepth=palohelpers.StringToInt(csv.get(5));
this.iDimensionToken=palohelpers.StringToInt(csv.get(10));
csv.close();
entity.consumeContent();
}catch(Exception e){
throw new paloexception(e.getMessage());
}
return paloElements;
}
public paloelements getElements() throws paloexception {
paloElements = new paloelements(plConn, this.lDatabaseId, this.iDimensionId);
// return new paloelements(plConn, this.lDatabaseId, this.iDimensionId);
return paloElements;
}
public paloelements getElements(HashSet<String> hsFilteredElements) throws paloexception {
return new paloelements(plConn, this.lDatabaseId, this.iDimensionId, hsFilteredElements);
}
public String getName() {
return strDimensionName;
}
public int getDimensionId() {
return iDimensionId;
}
public String getAssocDimension() {
return "";// return iAssocDimension;
}
public String getAttributCube() throws paloexception {
try {
palocubes plCubes = getCubes(palocubes.CUBE_ATTRIBUT);
if (plCubes != null && this.iAttributCube > 1) {
palocube plAttributeCube = plCubes.getCubeByIdentifier(this.iAttributCube);
if (plAttributeCube != null) {
return plAttributeCube.getName();
}
}
} catch (Exception e) {
}
public void refreshDimensionInfo() throws paloexception{
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(lDatabaseId)));
qparams.add(new BasicNameValuePair("dimension", String.valueOf(this.iDimensionId)));
try{
HttpEntity entity = this.plConn.sendToServer(qparams, "/dimension/info");
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
//CsvReader csv = new CsvReader(this.plConn.sendToServer(qparams, "/dimension/info").getContent(), Charset.defaultCharset());
csv.setDelimiter(';');
csv.setTextQualifier('"');
csv.readRecord();
this.strDimensionName= csv.get(1);
this.iDimensionId=Integer.valueOf(csv.get(0));
this.iAssocDimension=palohelpers.StringToInt(csv.get(7));
this.iAttributCube=palohelpers.StringToInt(csv.get(8));
this.iRightsCube=palohelpers.StringToInt(csv.get(9));
this.iNumberOfElements=palohelpers.StringToInt(csv.get(2));
this.iMaximumLevel=palohelpers.StringToInt(csv.get(3));
this.iMaximumIndent=palohelpers.StringToInt(csv.get(4));
this.iMaximumDepth=palohelpers.StringToInt(csv.get(5));
this.iDimensionToken=palohelpers.StringToInt(csv.get(10));
csv.close();
entity.consumeContent();
}catch(Exception e){
throw new paloexception(e.getMessage());
}
return "";
}
public String getRightsCube() {
try {
palocubes plCubes = getCubes(palocubes.CUBE_SYSTEM);
if (plCubes != null && this.iRightsCube > 1) {
palocube plAttributeCube = plCubes.getCubeByIdentifier(this.iRightsCube);
if (plAttributeCube != null) {
return plAttributeCube.getName();
}
}
} catch (Exception e) {
}
return "";
}
public int getNumberOfElements() {
return iNumberOfElements;
}
public int getMaximumLevel() {
return iMaximumLevel;
}
public int getMaximumIndent() {
return iMaximumIndent;
}
public int getMaximumDepth() {
return iMaximumDepth;
}
public int getDimensionType() {
return iDimensionType;
}
public void rename(String strDimensionNewName) throws paloexception {
if (null != strDimensionNewName && strDimensionNewName.length() > 0 && !strDimensionName.equals(strDimensionNewName)) {
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(lDatabaseId)));
qparams.add(new BasicNameValuePair("dimension", String.valueOf(this.iDimensionId)));
qparams.add(new BasicNameValuePair("new_name", strDimensionNewName));
try {
HttpEntity entity = this.plConn.sendToServer(qparams, "/dimension/rename");
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
csv.setQuoteChar('"');
csv.readNext();
this.strDimensionName = csv.get(1);
csv.close();
entity.consumeContent();
} catch (Exception e) {
throw new paloexception(e.getMessage());
}
}
}
public palocubes getCubes() throws paloexception {
return new palocubes(this.plConn, this.lDatabaseId, this.iDimensionType, this.iDimensionId);
}
public palocubes getCubes(int iCubeType) throws paloexception {
return new palocubes(this.plConn, this.lDatabaseId, iCubeType, this.iDimensionId);
}
public void clear() throws paloexception {
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(lDatabaseId)));
qparams.add(new BasicNameValuePair("dimension", String.valueOf(this.iDimensionId)));
try {
HttpEntity entity = this.plConn.sendToServer(qparams, "/dimension/clear");
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
csv.setQuoteChar('"');
csv.readNext();
this.strDimensionName = csv.get(1);
this.iDimensionId = Integer.valueOf(csv.get(0));
this.iAssocDimension = palohelpers.StringToInt(csv.get(7));
this.iAttributCube = palohelpers.StringToInt(csv.get(8));
this.iRightsCube = palohelpers.StringToInt(csv.get(9));
this.iNumberOfElements = palohelpers.StringToInt(csv.get(2));
this.iMaximumLevel = palohelpers.StringToInt(csv.get(3));
this.iMaximumIndent = palohelpers.StringToInt(csv.get(4));
this.iMaximumDepth = palohelpers.StringToInt(csv.get(5));
this.iDimensionToken = palohelpers.StringToInt(csv.get(10));
csv.close();
entity.consumeContent();
} catch (Exception e) {
throw new paloexception(e.getMessage());
}
}
public void refreshDimensionInfo() throws paloexception {
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(lDatabaseId)));
qparams.add(new BasicNameValuePair("dimension", String.valueOf(this.iDimensionId)));
try {
HttpEntity entity = this.plConn.sendToServer(qparams, "/dimension/info");
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
csv.setQuoteChar('"');
csv.readNext();
this.strDimensionName = csv.get(1);
this.iDimensionId = Integer.valueOf(csv.get(0));
this.iAssocDimension = palohelpers.StringToInt(csv.get(7));
this.iAttributCube = palohelpers.StringToInt(csv.get(8));
this.iRightsCube = palohelpers.StringToInt(csv.get(9));
this.iNumberOfElements = palohelpers.StringToInt(csv.get(2));
this.iMaximumLevel = palohelpers.StringToInt(csv.get(3));
this.iMaximumIndent = palohelpers.StringToInt(csv.get(4));
this.iMaximumDepth = palohelpers.StringToInt(csv.get(5));
this.iDimensionToken = palohelpers.StringToInt(csv.get(10));
csv.close();
entity.consumeContent();
} catch (Exception e) {
throw new paloexception(e.getMessage());
}
}
}
}

View File

@@ -1,5 +1,6 @@
package org.talend.jpalo;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.List;
@@ -7,247 +8,273 @@ import org.apache.http.HttpEntity;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import com.talend.csv.CSVReader;
import com.csvreader.CsvReader;
public class palodimensions {
public static final int DIMENSION_UNKNOWN = -1;
public static final int DIMENSION_UNKNOWN=-1;
public static final int DIMENSION_NORMAL =0;
public static final int DIMENSION_SYSTEM =1;
public static final int DIMENSION_ATTRIBUTE =2;
public static final int DIMENSION_USER_INFO =3;
public static final int DIMENSION_NORMAL = 0;
public static final int DIMENSION_SYSTEM = 1;
public static final int DIMENSION_ATTRIBUTE = 2;
public static final int DIMENSION_USER_INFO = 3;
private ArrayList<palodimension> paloDimensions = new ArrayList<palodimension>();
private paloconnection plConn;
private palodatabase plDB;
private String strDatabaseName;
private String strCubeName;
public palodimensions(paloconnection plConn, palodatabase plDB, int iDimensionType) throws paloexception {
super();
this.plConn = plConn;
this.plDB = plDB;
strDatabaseName = plDB.getName();
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(this.plDB.getDatabaseId())));
switch (iDimensionType) {
case DIMENSION_NORMAL:
qparams.add(new BasicNameValuePair("show_normal", "1"));
qparams.add(new BasicNameValuePair("show_system", "0"));
qparams.add(new BasicNameValuePair("show_attribute", "0"));
qparams.add(new BasicNameValuePair("show_info", "0"));
break;
case DIMENSION_SYSTEM:
qparams.add(new BasicNameValuePair("show_normal", "0"));
qparams.add(new BasicNameValuePair("show_system", "1"));
qparams.add(new BasicNameValuePair("show_attribute", "0"));
qparams.add(new BasicNameValuePair("show_info", "0"));
break;
case DIMENSION_ATTRIBUTE:
qparams.add(new BasicNameValuePair("show_normal", "1"));
qparams.add(new BasicNameValuePair("show_system", "0"));
qparams.add(new BasicNameValuePair("show_attribute", "1"));
qparams.add(new BasicNameValuePair("show_info", "0"));
break;
case DIMENSION_USER_INFO:
qparams.add(new BasicNameValuePair("show_normal", "0"));
qparams.add(new BasicNameValuePair("show_system", "0"));
qparams.add(new BasicNameValuePair("show_attribute", "0"));
qparams.add(new BasicNameValuePair("show_info", "1"));
break;
case DIMENSION_UNKNOWN:
qparams.add(new BasicNameValuePair("show_normal", "1"));
qparams.add(new BasicNameValuePair("show_system", "1"));
qparams.add(new BasicNameValuePair("show_attribute", "1"));
qparams.add(new BasicNameValuePair("show_info", "1"));
break;
private ArrayList<palodimension> paloDimensions = new ArrayList<palodimension>();
private paloconnection plConn;
private palodatabase plDB;
private String strDatabaseName;
private String strCubeName;
public palodimensions(paloconnection plConn, palodatabase plDB, int iDimensionType) throws paloexception{
super();
this.plConn = plConn;
this.plDB = plDB;
strDatabaseName = plDB.getName();
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(this.plDB.getDatabaseId())));
switch(iDimensionType){
case DIMENSION_NORMAL:
qparams.add(new BasicNameValuePair("show_normal","1"));
qparams.add(new BasicNameValuePair("show_system","0"));
qparams.add(new BasicNameValuePair("show_attribute","0"));
qparams.add(new BasicNameValuePair("show_info","0"));
break;
case DIMENSION_SYSTEM:
qparams.add(new BasicNameValuePair("show_normal","0"));
qparams.add(new BasicNameValuePair("show_system","1"));
qparams.add(new BasicNameValuePair("show_attribute","0"));
qparams.add(new BasicNameValuePair("show_info","0"));
break;
case DIMENSION_ATTRIBUTE:
qparams.add(new BasicNameValuePair("show_normal","1"));
qparams.add(new BasicNameValuePair("show_system","0"));
qparams.add(new BasicNameValuePair("show_attribute","1"));
qparams.add(new BasicNameValuePair("show_info","0"));
break;
case DIMENSION_USER_INFO:
qparams.add(new BasicNameValuePair("show_normal","0"));
qparams.add(new BasicNameValuePair("show_system","0"));
qparams.add(new BasicNameValuePair("show_attribute","0"));
qparams.add(new BasicNameValuePair("show_info","1"));
break;
case DIMENSION_UNKNOWN:
qparams.add(new BasicNameValuePair("show_normal","1"));
qparams.add(new BasicNameValuePair("show_system","1"));
qparams.add(new BasicNameValuePair("show_attribute","1"));
qparams.add(new BasicNameValuePair("show_info","1"));
break;
}
try{
HttpEntity entity = this.plConn.sendToServer(qparams, "/database/dimensions");
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
csv.setDelimiter(';');
csv.setTextQualifier('"');
while(csv.readRecord()){
paloDimensions.add(new palodimension(
this.plConn,
this.plDB.getDatabaseId(),
csv.get(1),
Integer.valueOf(csv.get(0)),
palohelpers.StringToInt(csv.get(7)),
palohelpers.StringToInt(csv.get(8)),
palohelpers.StringToInt(csv.get(9)),
palohelpers.StringToInt(csv.get(2)),
palohelpers.StringToInt(csv.get(3)),
palohelpers.StringToInt(csv.get(4)),
palohelpers.StringToInt(csv.get(5)),
palohelpers.StringToInt(csv.get(10))
));
}
csv.close();
entity.consumeContent();
}catch(Exception e){
throw new paloexception(e.getMessage());
}
}
try {
HttpEntity entity = this.plConn.sendToServer(qparams, "/database/dimensions");
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
csv.setQuoteChar('"');
while (csv.readNext()) {
paloDimensions.add(new palodimension(this.plConn, this.plDB.getDatabaseId(), csv.get(1), Integer.valueOf(csv
.get(0)), palohelpers.StringToInt(csv.get(7)), palohelpers.StringToInt(csv.get(8)), palohelpers
.StringToInt(csv.get(9)), palohelpers.StringToInt(csv.get(2)), palohelpers.StringToInt(csv.get(3)),
palohelpers.StringToInt(csv.get(4)), palohelpers.StringToInt(csv.get(5)), palohelpers.StringToInt(csv
.get(10))));
}
csv.close();
entity.consumeContent();
} catch (Exception e) {
throw new paloexception(e.getMessage());
public palodimensions(paloconnection plConn, long lDatabaseId, int iDimensionType, int[] iArrDimensionsIdentifier) throws paloexception{
super();
this.plConn = plConn;
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(lDatabaseId)));
switch(iDimensionType){
case DIMENSION_NORMAL:
qparams.add(new BasicNameValuePair("show_normal","1"));
qparams.add(new BasicNameValuePair("show_system","0"));
qparams.add(new BasicNameValuePair("show_attribute","0"));
qparams.add(new BasicNameValuePair("show_info","0"));
break;
case DIMENSION_SYSTEM:
qparams.add(new BasicNameValuePair("show_normal","0"));
qparams.add(new BasicNameValuePair("show_system","1"));
qparams.add(new BasicNameValuePair("show_attribute","0"));
qparams.add(new BasicNameValuePair("show_info","0"));
break;
case DIMENSION_ATTRIBUTE:
qparams.add(new BasicNameValuePair("show_normal","1"));
qparams.add(new BasicNameValuePair("show_system","0"));
qparams.add(new BasicNameValuePair("show_attribute","1"));
qparams.add(new BasicNameValuePair("show_info","0"));
break;
case DIMENSION_USER_INFO:
qparams.add(new BasicNameValuePair("show_normal","0"));
qparams.add(new BasicNameValuePair("show_system","0"));
qparams.add(new BasicNameValuePair("show_attribute","0"));
qparams.add(new BasicNameValuePair("show_info","1"));
break;
case DIMENSION_UNKNOWN:
qparams.add(new BasicNameValuePair("show_normal","1"));
qparams.add(new BasicNameValuePair("show_system","1"));
qparams.add(new BasicNameValuePair("show_attribute","1"));
qparams.add(new BasicNameValuePair("show_info","1"));
break;
}
try{
ArrayList<palodimension> paloDimensionsCube = new ArrayList<palodimension>();
HttpEntity entity = this.plConn.sendToServer(qparams, "/database/dimensions");
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
csv.setDelimiter(';');
csv.setTextQualifier('"');
while(csv.readRecord()){
paloDimensionsCube.add(new palodimension(
this.plConn,
lDatabaseId,
csv.get(1),
Integer.valueOf(csv.get(0)),
palohelpers.StringToInt(csv.get(7)),
palohelpers.StringToInt(csv.get(8)),
palohelpers.StringToInt(csv.get(9)),
palohelpers.StringToInt(csv.get(2)),
palohelpers.StringToInt(csv.get(3)),
palohelpers.StringToInt(csv.get(4)),
palohelpers.StringToInt(csv.get(5)),
palohelpers.StringToInt(csv.get(10))
));
}
csv.close();
entity.consumeContent();
for(int i=0;i<iArrDimensionsIdentifier.length;i++){
for(palodimension plDimCube : paloDimensionsCube){
if(plDimCube.getDimensionId()==iArrDimensionsIdentifier[i]) paloDimensions.add(plDimCube);
}
}
}catch(Exception e){
throw new paloexception(e.getMessage());
}
}
public palodimensions(paloconnection plConn, long lDatabaseId, int iDimensionType, int[] iArrDimensionsIdentifier)
throws paloexception {
super();
this.plConn = plConn;
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(lDatabaseId)));
switch (iDimensionType) {
case DIMENSION_NORMAL:
qparams.add(new BasicNameValuePair("show_normal", "1"));
qparams.add(new BasicNameValuePair("show_system", "0"));
qparams.add(new BasicNameValuePair("show_attribute", "0"));
qparams.add(new BasicNameValuePair("show_info", "0"));
break;
case DIMENSION_SYSTEM:
qparams.add(new BasicNameValuePair("show_normal", "0"));
qparams.add(new BasicNameValuePair("show_system", "1"));
qparams.add(new BasicNameValuePair("show_attribute", "0"));
qparams.add(new BasicNameValuePair("show_info", "0"));
break;
case DIMENSION_ATTRIBUTE:
qparams.add(new BasicNameValuePair("show_normal", "1"));
qparams.add(new BasicNameValuePair("show_system", "0"));
qparams.add(new BasicNameValuePair("show_attribute", "1"));
qparams.add(new BasicNameValuePair("show_info", "0"));
break;
case DIMENSION_USER_INFO:
qparams.add(new BasicNameValuePair("show_normal", "0"));
qparams.add(new BasicNameValuePair("show_system", "0"));
qparams.add(new BasicNameValuePair("show_attribute", "0"));
qparams.add(new BasicNameValuePair("show_info", "1"));
break;
case DIMENSION_UNKNOWN:
qparams.add(new BasicNameValuePair("show_normal", "1"));
qparams.add(new BasicNameValuePair("show_system", "1"));
qparams.add(new BasicNameValuePair("show_attribute", "1"));
qparams.add(new BasicNameValuePair("show_info", "1"));
break;
}
public palodimension createDimension(String strDimensionName, int iType) throws paloexception{
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(this.plDB.getDatabaseId())));
qparams.add(new BasicNameValuePair("new_name", strDimensionName));
qparams.add(new BasicNameValuePair("type", String.valueOf(iType)));
try{
HttpEntity entity = this.plConn.sendToServer(qparams, "/dimension/create");
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
//CsvReader csv = new CsvReader(this.plConn.sendToServer(qparams, "/dimension/create").getContent(), Charset.defaultCharset());
csv.setDelimiter(';');
csv.setTextQualifier('"');
csv.readRecord();
palodimension plDim = new palodimension(
this.plConn,
this.plDB.getDatabaseId(),
csv.get(1),
palohelpers.StringToInt(csv.get(0)),
palohelpers.StringToInt(csv.get(7)),
palohelpers.StringToInt(csv.get(8)),
palohelpers.StringToInt(csv.get(9)),
palohelpers.StringToInt(csv.get(2)),
palohelpers.StringToInt(csv.get(3)),
palohelpers.StringToInt(csv.get(4)),
palohelpers.StringToInt(csv.get(5)),
palohelpers.StringToInt(csv.get(10))
);
paloDimensions.add(plDim);
csv.close();
entity.consumeContent();
return plDim;
}catch(Exception e){
throw new paloexception(e.getMessage());
}
}
public palodimension createDimension(String strDimensionName) throws paloexception{
return createDimension(strDimensionName, palodimensions.DIMENSION_NORMAL);
}
public ArrayList<palodimension> getDimensions(){
return paloDimensions;
}
public String getDatabaseName(){
return strDatabaseName;
}
public String getCubeName(){
return strCubeName;
}
try {
ArrayList<palodimension> paloDimensionsCube = new ArrayList<palodimension>();
HttpEntity entity = this.plConn.sendToServer(qparams, "/database/dimensions");
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
csv.setQuoteChar('"');
while (csv.readNext()) {
paloDimensionsCube.add(new palodimension(this.plConn, lDatabaseId, csv.get(1), Integer.valueOf(csv.get(0)),
palohelpers.StringToInt(csv.get(7)), palohelpers.StringToInt(csv.get(8)), palohelpers.StringToInt(csv
.get(9)), palohelpers.StringToInt(csv.get(2)), palohelpers.StringToInt(csv.get(3)), palohelpers
.StringToInt(csv.get(4)), palohelpers.StringToInt(csv.get(5)), palohelpers.StringToInt(csv
.get(10))));
}
csv.close();
entity.consumeContent();
for (int element : iArrDimensionsIdentifier) {
for (palodimension plDimCube : paloDimensionsCube) {
if (plDimCube.getDimensionId() == element) {
paloDimensions.add(plDimCube);
}
}
}
} catch (Exception e) {
throw new paloexception(e.getMessage());
}
}
public palodimension createDimension(String strDimensionName, int iType) throws paloexception {
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(this.plDB.getDatabaseId())));
qparams.add(new BasicNameValuePair("new_name", strDimensionName));
qparams.add(new BasicNameValuePair("type", String.valueOf(iType)));
try {
HttpEntity entity = this.plConn.sendToServer(qparams, "/dimension/create");
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
csv.setQuoteChar('"');
csv.readNext();
palodimension plDim = new palodimension(this.plConn, this.plDB.getDatabaseId(), csv.get(1),
palohelpers.StringToInt(csv.get(0)), palohelpers.StringToInt(csv.get(7)),
palohelpers.StringToInt(csv.get(8)), palohelpers.StringToInt(csv.get(9)),
palohelpers.StringToInt(csv.get(2)), palohelpers.StringToInt(csv.get(3)),
palohelpers.StringToInt(csv.get(4)), palohelpers.StringToInt(csv.get(5)),
palohelpers.StringToInt(csv.get(10)));
paloDimensions.add(plDim);
csv.close();
entity.consumeContent();
return plDim;
} catch (Exception e) {
throw new paloexception(e.getMessage());
}
}
public palodimension createDimension(String strDimensionName) throws paloexception {
return createDimension(strDimensionName, palodimensions.DIMENSION_NORMAL);
}
public ArrayList<palodimension> getDimensions() {
return paloDimensions;
}
public String getDatabaseName() {
return strDatabaseName;
}
public String getCubeName() {
return strCubeName;
}
public int getNumberOfDimensions() {
return paloDimensions.size();
}
public palodimension getDimension(int iIndex) {
return paloDimensions.get(iIndex);
}
public palodimension getDimension(String strDimensionName) {
for (palodimension palodim : paloDimensions) {
if (palodim.getName().equals(strDimensionName)) {
return palodim;
}
}
return null;
}
public palodimension getDimensionByIdentifier(int iDimensionId) {
for (palodimension palodim : paloDimensions) {
if (palodim.getDimensionId() == iDimensionId) {
return palodim;
}
}
return null;
}
public void deleteDimension(String strDimensionName) throws paloexception {
palodimension paloDimToRemove = getDimension(strDimensionName);
if (null != paloDimToRemove) {
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(plDB.getDatabaseId())));
qparams.add(new BasicNameValuePair("dimension", String.valueOf(paloDimToRemove.getDimensionId())));
plConn.sendToServerSingleRC(qparams, "/dimension/destroy");
paloDimensions.remove(paloDimToRemove);
}
}
public int getNumberOfDimensions(){
return paloDimensions.size();
}
public palodimension getDimension(int iIndex){
return paloDimensions.get(iIndex);
}
public palodimension getDimension(String strDimensionName){
for(palodimension palodim : paloDimensions){
if(palodim.getName().equals(strDimensionName)) return palodim;
}
return null;
}
public palodimension getDimensionByIdentifier(int iDimensionId){
for(palodimension palodim : paloDimensions){
if(palodim.getDimensionId()==iDimensionId) return palodim;
}
return null;
}
public void deleteDimension(String strDimensionName) throws paloexception{
palodimension paloDimToRemove = getDimension(strDimensionName);
if(null != paloDimToRemove){
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(plDB.getDatabaseId())));
qparams.add(new BasicNameValuePair("dimension", String.valueOf(paloDimToRemove.getDimensionId())));
plConn.sendToServerSingleRC(qparams, "/dimension/destroy");
paloDimensions.remove(paloDimToRemove);
}
}
}

View File

@@ -1,5 +1,6 @@
package org.talend.jpalo;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.List;
@@ -7,438 +8,425 @@ import org.apache.http.HttpEntity;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import com.talend.csv.CSVReader;
import com.csvreader.CsvReader;
@SuppressWarnings("unchecked")
public class paloelement implements Comparable {
public class paloelement implements Comparable {
/*
* private native void JNIupdateElement(paloelement plElem, paloconsolidations plCons, int iAddToConsolidation);
*/
/*
private native void JNIupdateElement(paloelement plElem, paloconsolidations plCons, int iAddToConsolidation);
*/
private paloconnection plConn;
private long lDatabaseId;
private int iDimensionId;
private long lElementIdentifier;
private String strElementName="";
private int iElementType;
private int iElementLevel;
private int iElementIndent;
private int iElementDepth;
private int iElementPosition;
private int iElementNumOfParents;
private int[] iArrElementParents;
private int iElementNumOfChildren;
private int[] iArrElementChildren;
private double[] dArrElementChildrenWeights;
private long lElementParentIdentifier;
private paloelements paloElements;
public paloelement(paloconnection plConn, long lDatabaseId, int iDimensionId, paloelements paloElements,
long lElementIdentifier, //0 element identifier Identifier of the element
String strElementName, //1 name_element string Name of the element
int iElementPosition, //2 position integer Position of the element
int iElementLevel, //3 level integer Level of the element
int iElementIndent, //4 indent integer Indent of the element
int iElementDepth, //5 depth integer Depth of the element
int iElementType, //6 type integer Type of the element (1=NUMERIC, 2=STRING, 4=CONSOLIDATED)
int iElementNumOfParents, //7 number_parents integer Number of parents
int[] iArrElementParents, //8 parents identifier Comma separate list of parent identifiers
int iElementNumOfChildren, //9 number_children integer Number of children
int[] iArrElementChildren, //10 children identifier Comma separate list of children identifiers
double[] dArrElementChildrenWeights //11 weights double Comma separate list of children weight
){
super();
this.plConn=plConn;
this.lDatabaseId=lDatabaseId;
this.iDimensionId=iDimensionId;
this.paloElements = paloElements;
this.lElementIdentifier=lElementIdentifier;
this.strElementName=strElementName;
this.iElementPosition=iElementPosition;
this.iElementLevel=iElementLevel;
this.iElementIndent=iElementIndent;
this.iElementDepth= iElementDepth;
this.iElementType=iElementType;
this.iElementNumOfParents=iElementNumOfParents;
this.iArrElementParents=iArrElementParents;
this.iElementNumOfChildren=iElementNumOfChildren;
this.iArrElementChildren=iArrElementChildren;
this.dArrElementChildrenWeights=dArrElementChildrenWeights;
this.lElementParentIdentifier = (null==this.iArrElementParents)? this.lElementIdentifier : this.iArrElementParents[0];
}
private paloconnection plConn;
private long lDatabaseId;
private int iDimensionId;
private long lElementIdentifier;
private String strElementName = "";
private int iElementType;
private int iElementLevel;
private int iElementIndent;
private int iElementDepth;
private int iElementPosition;
private int iElementNumOfParents;
private int[] iArrElementParents;
private int iElementNumOfChildren;
private int[] iArrElementChildren;
private double[] dArrElementChildrenWeights;
private long lElementParentIdentifier;
private paloelements paloElements;
public paloelement(paloconnection plConn, long lDatabaseId, int iDimensionId, paloelements paloElements,
long lElementIdentifier, // 0 element identifier Identifier of the element
String strElementName, // 1 name_element string Name of the element
int iElementPosition, // 2 position integer Position of the element
int iElementLevel, // 3 level integer Level of the element
int iElementIndent, // 4 indent integer Indent of the element
int iElementDepth, // 5 depth integer Depth of the element
int iElementType, // 6 type integer Type of the element (1=NUMERIC, 2=STRING, 4=CONSOLIDATED)
int iElementNumOfParents, // 7 number_parents integer Number of parents
int[] iArrElementParents, // 8 parents identifier Comma separate list of parent identifiers
int iElementNumOfChildren, // 9 number_children integer Number of children
int[] iArrElementChildren, // 10 children identifier Comma separate list of children identifiers
double[] dArrElementChildrenWeights // 11 weights double Comma separate list of children weight
) {
super();
this.plConn = plConn;
this.lDatabaseId = lDatabaseId;
this.iDimensionId = iDimensionId;
this.paloElements = paloElements;
this.lElementIdentifier = lElementIdentifier;
this.strElementName = strElementName;
this.iElementPosition = iElementPosition;
this.iElementLevel = iElementLevel;
this.iElementIndent = iElementIndent;
this.iElementDepth = iElementDepth;
this.iElementType = iElementType;
this.iElementNumOfParents = iElementNumOfParents;
this.iArrElementParents = iArrElementParents;
this.iElementNumOfChildren = iElementNumOfChildren;
this.iArrElementChildren = iArrElementChildren;
this.dArrElementChildrenWeights = dArrElementChildrenWeights;
this.lElementParentIdentifier = (null == this.iArrElementParents) ? this.lElementIdentifier : this.iArrElementParents[0];
}
public paloelement(paloelements paloElements) {
super();
this.paloElements = paloElements;
}
/*
* public void setPaloElements(paloelements paloElements){ this.paloElements = paloElements; }
*/
public long getElementIdentifier() {
return lElementIdentifier;
}
public String getName() {
return strElementName;
}
public int getElementType() {
return iElementType;
}
public long getElementLevel() {
return iElementLevel;
}
public long getElementIndent() {
return iElementIndent;
}
public long getElementDepth() {
return iElementDepth;
}
public long getElementPosition() {
return iElementPosition;
}
public long getElementNumOfParents() {
return iElementNumOfParents;
}
public long getElementNumOfChildren() {
return iElementNumOfChildren;
}
public long getElementParentIdentifier() {
return lElementParentIdentifier;
}
public boolean hasChildren() {
if (iElementNumOfChildren > 0) {
return true;
}
return false;
}
public boolean isConsolidation() {
if (paloelements.ELEMENT_CONSOLIDATION == iElementType) {
return true;
}
return false;
}
public boolean isNumeric() {
if (paloelements.ELEMENT_NUMERIC == iElementType) {
return true;
}
return false;
}
public boolean isString() {
if (paloelements.ELEMENT_STRING == iElementType) {
return true;
}
return false;
}
public boolean isRule() {
if (paloelements.ELEMENT_RULE == iElementType) {
return true;
}
return false;
}
@Override
public String toString() {
StringBuffer sbRC = new StringBuffer();
sbRC.append(lElementIdentifier + " / ");
sbRC.append(strElementName + " / ");
sbRC.append(iElementType + " / ");
sbRC.append(iElementLevel + " / ");
sbRC.append(iElementIndent + " / ");
sbRC.append(iElementDepth + " / ");
sbRC.append(iElementPosition + " / ");
sbRC.append(iElementNumOfParents + " / ");
sbRC.append(iElementNumOfChildren + " / ");
sbRC.append(lElementParentIdentifier);
return sbRC.toString();
}
public void rename(String strElementNewName) throws paloexception {
if (null != strElementNewName && strElementNewName.length() > 0 && !strElementName.equals(strElementNewName)) {
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(lDatabaseId)));
qparams.add(new BasicNameValuePair("dimension", String.valueOf(this.iDimensionId)));
qparams.add(new BasicNameValuePair("element", String.valueOf(this.lElementIdentifier)));
qparams.add(new BasicNameValuePair("new_name", strElementNewName));
try {
HttpEntity entity = this.plConn.sendToServer(qparams, "/element/rename");
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
csv.setQuoteChar('"');
csv.readNext();
this.strElementName = csv.get(1);
csv.close();
entity.consumeContent();
} catch (Exception e) {
throw new paloexception(e.getMessage());
}
strElementName = strElementNewName;
}
}
public int[] getElementChildren() {
return iArrElementChildren;
}
public int[] getElementParents() {
return iArrElementParents;
}
public double[] getElementChildrenWeights() {
return dArrElementChildrenWeights;
}
public void move(long lElementNewPosition) throws paloexception {
if (lElementNewPosition > -1 && lElementNewPosition != iElementPosition) {
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(lDatabaseId)));
qparams.add(new BasicNameValuePair("dimension", String.valueOf(this.iDimensionId)));
qparams.add(new BasicNameValuePair("element", String.valueOf(this.lElementIdentifier)));
qparams.add(new BasicNameValuePair("position", String.valueOf(lElementNewPosition)));
try {
HttpEntity entity = this.plConn.sendToServer(qparams, "/element/move");
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
csv.setQuoteChar('"');
while (csv.readNext()) {
this.lElementIdentifier = palohelpers.StringToLong(csv.get(0));
this.strElementName = csv.get(1);
this.iElementPosition = palohelpers.StringToInt(csv.get(2));
this.iElementLevel = palohelpers.StringToInt(csv.get(3));
this.iElementIndent = palohelpers.StringToInt(csv.get(4));
this.iElementDepth = palohelpers.StringToInt(csv.get(5));
this.iElementType = palohelpers.StringToInt(csv.get(6));
this.iElementNumOfParents = palohelpers.StringToInt(csv.get(7));
this.iArrElementParents = palohelpers.StringToIntArray(csv.get(8), palohelpers.StringToInt(csv.get(7)));
this.iElementNumOfChildren = palohelpers.StringToInt(csv.get(9));
this.iArrElementChildren = palohelpers.StringToIntArray(csv.get(10), palohelpers.StringToInt(csv.get(9)));
this.dArrElementChildrenWeights = palohelpers.StringToDoubleArray(csv.get(11),
palohelpers.StringToInt(csv.get(9)));
}
csv.close();
entity.consumeContent();
} catch (Exception e) {
throw new paloexception(e.getMessage());
}
}
}
// get father paloelement
public paloelement getFatherPaloelement() throws paloexception {
long identifier = getElementParentIdentifier();
paloelement plElm = null;
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(lDatabaseId)));
qparams.add(new BasicNameValuePair("dimension", String.valueOf(this.iDimensionId)));
qparams.add(new BasicNameValuePair("element", String.valueOf(identifier)));
try {
HttpEntity entity = this.plConn.sendToServer(qparams, "/element/info");
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
csv.setQuoteChar('"');
while (csv.readNext()) {
if (palohelpers.StringToLong(csv.get(0)) == identifier) {
plElm = new paloelement(this.plConn, this.lDatabaseId, this.iDimensionId, paloElements,
palohelpers.StringToLong(csv.get(0)), csv.get(1), palohelpers.StringToInt(csv.get(2)),
palohelpers.StringToInt(csv.get(3)), palohelpers.StringToInt(csv.get(4)), palohelpers.StringToInt(csv
.get(5)), palohelpers.StringToInt(csv.get(6)), palohelpers.StringToInt(csv.get(7)),
palohelpers.StringToIntArray(csv.get(8), palohelpers.StringToInt(csv.get(7))),
palohelpers.StringToInt(csv.get(9)), palohelpers.StringToIntArray(csv.get(10),
palohelpers.StringToInt(csv.get(9))), palohelpers.StringToDoubleArray(csv.get(11),
palohelpers.StringToInt(csv.get(9))));
}
}
csv.close();
entity.consumeContent();
} catch (Exception e) {
throw new paloexception(e.getMessage());
public paloelement(paloelements paloElements){
super();
this.paloElements = paloElements;
}
/*
public void setPaloElements(paloelements paloElements){
this.paloElements = paloElements;
}*/
public long getElementIdentifier(){
return lElementIdentifier;
}
public String getName(){
return strElementName;
}
public int getElementType(){
return iElementType;
}
public long getElementLevel(){
return iElementLevel;
}
public long getElementIndent(){
return iElementIndent;
}
public long getElementDepth(){
return iElementDepth;
}
public long getElementPosition(){
return iElementPosition;
}
public long getElementNumOfParents(){
return iElementNumOfParents;
}
public long getElementNumOfChildren(){
return iElementNumOfChildren;
}
public long getElementParentIdentifier(){
return lElementParentIdentifier;
}
public boolean hasChildren(){
if(iElementNumOfChildren>0) return true;
return false;
}
public boolean isConsolidation(){
if(paloelements.ELEMENT_CONSOLIDATION==iElementType) return true;
return false;
}
public boolean isNumeric(){
if(paloelements.ELEMENT_NUMERIC==iElementType) return true;
return false;
}
public boolean isString(){
if(paloelements.ELEMENT_STRING==iElementType) return true;
return false;
}
public boolean isRule(){
if(paloelements.ELEMENT_RULE==iElementType) return true;
return false;
}
public String toString(){
StringBuffer sbRC = new StringBuffer();
sbRC.append(lElementIdentifier+" / ");
sbRC.append(strElementName+" / ");
sbRC.append(iElementType+" / ");
sbRC.append(iElementLevel+" / ");
sbRC.append(iElementIndent+" / ");
sbRC.append(iElementDepth+" / ");
sbRC.append(iElementPosition+" / ");
sbRC.append(iElementNumOfParents+" / ");
sbRC.append(iElementNumOfChildren+" / ");
sbRC.append(lElementParentIdentifier);
return sbRC.toString();
}
public void rename(String strElementNewName) throws paloexception{
if(null!=strElementNewName && strElementNewName.length()>0 && !strElementName.equals(strElementNewName)){
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(lDatabaseId)));
qparams.add(new BasicNameValuePair("dimension", String.valueOf(this.iDimensionId)));
qparams.add(new BasicNameValuePair("element", String.valueOf(this.lElementIdentifier)));
qparams.add(new BasicNameValuePair("new_name", strElementNewName));
try{
HttpEntity entity = this.plConn.sendToServer(qparams, "/element/rename");
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
csv.setDelimiter(';');
csv.setTextQualifier('"');
csv.readRecord();
this.strElementName= csv.get(1);
csv.close();
entity.consumeContent();
}catch(Exception e){
throw new paloexception(e.getMessage());
}
strElementName = strElementNewName;
}
}
public int[] getElementChildren(){
return iArrElementChildren;
}
public int[] getElementParents(){
return iArrElementParents;
}
public double[] getElementChildrenWeights(){
return dArrElementChildrenWeights;
}
public void move(long lElementNewPosition) throws paloexception{
if(lElementNewPosition >-1 && lElementNewPosition != iElementPosition){
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(lDatabaseId)));
qparams.add(new BasicNameValuePair("dimension", String.valueOf(this.iDimensionId)));
qparams.add(new BasicNameValuePair("element", String.valueOf(this.lElementIdentifier)));
qparams.add(new BasicNameValuePair("position", String.valueOf(lElementNewPosition)));
try{
HttpEntity entity = this.plConn.sendToServer(qparams, "/element/move");
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
csv.setDelimiter(';');
csv.setTextQualifier('"');
csv.setUseTextQualifier(true);
while(csv.readRecord()){
this.lElementIdentifier = palohelpers.StringToLong(csv.get(0));
this.strElementName = csv.get(1);
this.iElementPosition = palohelpers.StringToInt(csv.get(2));
this.iElementLevel = palohelpers.StringToInt(csv.get(3));
this.iElementIndent = palohelpers.StringToInt(csv.get(4));
this.iElementDepth = palohelpers.StringToInt(csv.get(5));
this.iElementType = palohelpers.StringToInt(csv.get(6));
this.iElementNumOfParents = palohelpers.StringToInt(csv.get(7));
this.iArrElementParents = palohelpers.StringToIntArray(csv.get(8), palohelpers.StringToInt(csv.get(7)));
this.iElementNumOfChildren = palohelpers.StringToInt(csv.get(9));
this.iArrElementChildren = palohelpers.StringToIntArray(csv.get(10), palohelpers.StringToInt(csv.get(9)));
this.dArrElementChildrenWeights = palohelpers.StringToDoubleArray(csv.get(11), palohelpers.StringToInt(csv.get(9)));
}
csv.close();
entity.consumeContent();
}catch(Exception e){
throw new paloexception(e.getMessage());
}
}
}
//get father paloelement
public paloelement getFatherPaloelement() throws paloexception{
long identifier = getElementParentIdentifier();
paloelement plElm = null;
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(lDatabaseId)));
qparams.add(new BasicNameValuePair("dimension", String.valueOf(this.iDimensionId)));
qparams.add(new BasicNameValuePair("element", String.valueOf(identifier)));
try{
HttpEntity entity = this.plConn.sendToServer(qparams, "/element/info");
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
csv.setDelimiter(';');
csv.setTextQualifier('"');
csv.setUseTextQualifier(true);
while(csv.readRecord()){
if(palohelpers.StringToLong(csv.get(0)) == identifier){
plElm = new paloelement(
this.plConn,
this.lDatabaseId,
this.iDimensionId,
paloElements,
palohelpers.StringToLong(csv.get(0)),
csv.get(1),
palohelpers.StringToInt(csv.get(2)),
palohelpers.StringToInt(csv.get(3)),
palohelpers.StringToInt(csv.get(4)),
palohelpers.StringToInt(csv.get(5)),
palohelpers.StringToInt(csv.get(6)),
palohelpers.StringToInt(csv.get(7)),
palohelpers.StringToIntArray(csv.get(8), palohelpers.StringToInt(csv.get(7))),
palohelpers.StringToInt(csv.get(9)),
palohelpers.StringToIntArray(csv.get(10), palohelpers.StringToInt(csv.get(9))),
palohelpers.StringToDoubleArray(csv.get(11), palohelpers.StringToInt(csv.get(9))));
}
}
csv.close();
entity.consumeContent();
}catch(Exception e){
throw new paloexception(e.getMessage());
}
return plElm;
}
public void refreshElementInfo() throws paloexception {
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(lDatabaseId)));
qparams.add(new BasicNameValuePair("dimension", String.valueOf(this.iDimensionId)));
qparams.add(new BasicNameValuePair("element", String.valueOf(this.lElementIdentifier)));
try {
HttpEntity entity = this.plConn.sendToServer(qparams, "/element/info");
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
csv.setQuoteChar('"');
while (csv.readNext()) {
this.lElementIdentifier = palohelpers.StringToLong(csv.get(0));
this.strElementName = csv.get(1);
this.iElementPosition = palohelpers.StringToInt(csv.get(2));
this.iElementLevel = palohelpers.StringToInt(csv.get(3));
this.iElementIndent = palohelpers.StringToInt(csv.get(4));
this.iElementDepth = palohelpers.StringToInt(csv.get(5));
this.iElementType = palohelpers.StringToInt(csv.get(6));
this.iElementNumOfParents = palohelpers.StringToInt(csv.get(7));
this.iArrElementParents = palohelpers.StringToIntArray(csv.get(8), palohelpers.StringToInt(csv.get(7)));
this.iElementNumOfChildren = palohelpers.StringToInt(csv.get(9));
this.iArrElementChildren = palohelpers.StringToIntArray(csv.get(10), palohelpers.StringToInt(csv.get(9)));
this.dArrElementChildrenWeights = palohelpers.StringToDoubleArray(csv.get(11),
palohelpers.StringToInt(csv.get(9)));
}
csv.close();
entity.consumeContent();
} catch (Exception e) {
throw new paloexception(e.getMessage());
}
public void refreshElementInfo() throws paloexception{
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(lDatabaseId)));
qparams.add(new BasicNameValuePair("dimension", String.valueOf(this.iDimensionId)));
qparams.add(new BasicNameValuePair("element", String.valueOf(this.lElementIdentifier)));
try{
HttpEntity entity = this.plConn.sendToServer(qparams, "/element/info");
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
csv.setDelimiter(';');
csv.setTextQualifier('"');
csv.setUseTextQualifier(true);
while(csv.readRecord()){
this.lElementIdentifier = palohelpers.StringToLong(csv.get(0));
this.strElementName = csv.get(1);
this.iElementPosition = palohelpers.StringToInt(csv.get(2));
this.iElementLevel = palohelpers.StringToInt(csv.get(3));
this.iElementIndent = palohelpers.StringToInt(csv.get(4));
this.iElementDepth = palohelpers.StringToInt(csv.get(5));
this.iElementType = palohelpers.StringToInt(csv.get(6));
this.iElementNumOfParents = palohelpers.StringToInt(csv.get(7));
this.iArrElementParents = palohelpers.StringToIntArray(csv.get(8), palohelpers.StringToInt(csv.get(7)));
this.iElementNumOfChildren = palohelpers.StringToInt(csv.get(9));
this.iArrElementChildren = palohelpers.StringToIntArray(csv.get(10), palohelpers.StringToInt(csv.get(9)));
this.dArrElementChildrenWeights = palohelpers.StringToDoubleArray(csv.get(11), palohelpers.StringToInt(csv.get(9)));
}
csv.close();
entity.consumeContent();
}catch(Exception e){
throw new paloexception(e.getMessage());
}
}
}
public paloconsolidations getConsolidations() {
return new paloconsolidations(paloElements, this);
}
public void updateElement(paloconsolidations plCons, boolean bAddToConsolidation) throws paloexception{
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(lDatabaseId)));
qparams.add(new BasicNameValuePair("dimension", String.valueOf(iDimensionId)));
qparams.add(new BasicNameValuePair("element", String.valueOf(lElementIdentifier)));
public paloconsolidations getConsolidations() {
return new paloconsolidations(paloElements, this);
}
String strURLApiCall = "/element/append";
if(!bAddToConsolidation){
if(plCons!=null) iElementType=paloelements.ELEMENT_CONSOLIDATION;
qparams.add(new BasicNameValuePair("name_element", strElementName));
qparams.add(new BasicNameValuePair("type", String.valueOf(iElementType)));
strURLApiCall ="/element/replace";
}
public void updateElement(paloconsolidations plCons, boolean bAddToConsolidation) throws paloexception {
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(lDatabaseId)));
qparams.add(new BasicNameValuePair("dimension", String.valueOf(iDimensionId)));
qparams.add(new BasicNameValuePair("element", String.valueOf(lElementIdentifier)));
String strURLApiCall = "/element/append";
if (!bAddToConsolidation) {
if (plCons != null) {
iElementType = paloelements.ELEMENT_CONSOLIDATION;
}
qparams.add(new BasicNameValuePair("name_element", strElementName));
qparams.add(new BasicNameValuePair("type", String.valueOf(iElementType)));
strURLApiCall = "/element/replace";
//if(plConsiElementType=paloelements.ELEMENT_CONSOLIDATION;
if(plCons != null){
qparams.add(new BasicNameValuePair("children", plCons.getConsolidationStringElementIdentifiers()));
qparams.add(new BasicNameValuePair("weights", plCons.getConsolidationStringElementWeights()));
}
try{
HttpEntity entity = this.plConn.sendToServer(qparams, strURLApiCall);
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
csv.setDelimiter(';');
csv.setTextQualifier('"');
csv.setUseTextQualifier(true);
csv.readRecord();
//System.out.println(csv.getRawRecord());
this.lElementIdentifier = palohelpers.StringToLong(csv.get(0));
this.strElementName = csv.get(1);
this.iElementPosition = palohelpers.StringToInt(csv.get(2));
this.iElementLevel = palohelpers.StringToInt(csv.get(3));
this.iElementIndent = palohelpers.StringToInt(csv.get(4));
this.iElementDepth = palohelpers.StringToInt(csv.get(5));
this.iElementType = palohelpers.StringToInt(csv.get(6));
this.iElementNumOfParents = palohelpers.StringToInt(csv.get(7));
this.iArrElementParents = palohelpers.StringToIntArray(csv.get(8), palohelpers.StringToInt(csv.get(7)));
this.iElementNumOfChildren = palohelpers.StringToInt(csv.get(9));
this.iArrElementChildren = palohelpers.StringToIntArray(csv.get(10), palohelpers.StringToInt(csv.get(9)));
this.dArrElementChildrenWeights = palohelpers.StringToDoubleArray(csv.get(11), palohelpers.StringToInt(csv.get(9)));
csv.close();
entity.consumeContent();
}catch(Exception e){
throw new paloexception(e.getMessage());
}
}
public void updateElementConsolidation(String strElementChildrensId, String strElementChildrenWeights, boolean bReplace) throws paloexception{
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(lDatabaseId)));
qparams.add(new BasicNameValuePair("dimension", String.valueOf(iDimensionId)));
qparams.add(new BasicNameValuePair("element", String.valueOf(lElementIdentifier)));
// if(plConsiElementType=paloelements.ELEMENT_CONSOLIDATION;
String strURLApiCall = "/element/append";
if(bReplace) strURLApiCall = "/element/replace";
iElementType=paloelements.ELEMENT_CONSOLIDATION;
qparams.add(new BasicNameValuePair("type", String.valueOf(iElementType)));
if (plCons != null) {
qparams.add(new BasicNameValuePair("children", plCons.getConsolidationStringElementIdentifiers()));
qparams.add(new BasicNameValuePair("weights", plCons.getConsolidationStringElementWeights()));
qparams.add(new BasicNameValuePair("children", strElementChildrensId));
qparams.add(new BasicNameValuePair("weights", strElementChildrenWeights));
try{
this.plConn.sendToServerSingleRC(qparams, strURLApiCall);
}catch(Exception e){
throw new paloexception(e.getMessage());
}
}
public void updateElement() throws paloexception {
updateElement(getConsolidations(), false);
}
public void updateElement(paloconsolidations plCons) throws paloexception {
updateElement(plCons, false);
}
try {
HttpEntity entity = this.plConn.sendToServer(qparams, strURLApiCall);
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
csv.setQuoteChar('"');
csv.readNext();
// System.out.println(csv.getRawRecord());
this.lElementIdentifier = palohelpers.StringToLong(csv.get(0));
this.strElementName = csv.get(1);
this.iElementPosition = palohelpers.StringToInt(csv.get(2));
this.iElementLevel = palohelpers.StringToInt(csv.get(3));
this.iElementIndent = palohelpers.StringToInt(csv.get(4));
this.iElementDepth = palohelpers.StringToInt(csv.get(5));
this.iElementType = palohelpers.StringToInt(csv.get(6));
this.iElementNumOfParents = palohelpers.StringToInt(csv.get(7));
this.iArrElementParents = palohelpers.StringToIntArray(csv.get(8), palohelpers.StringToInt(csv.get(7)));
this.iElementNumOfChildren = palohelpers.StringToInt(csv.get(9));
this.iArrElementChildren = palohelpers.StringToIntArray(csv.get(10), palohelpers.StringToInt(csv.get(9)));
this.dArrElementChildrenWeights = palohelpers.StringToDoubleArray(csv.get(11), palohelpers.StringToInt(csv.get(9)));
csv.close();
entity.consumeContent();
} catch (Exception e) {
throw new paloexception(e.getMessage());
}
}
public void updateElementConsolidation(String strElementChildrensId, String strElementChildrenWeights, boolean bReplace)
throws paloexception {
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(lDatabaseId)));
qparams.add(new BasicNameValuePair("dimension", String.valueOf(iDimensionId)));
qparams.add(new BasicNameValuePair("element", String.valueOf(lElementIdentifier)));
String strURLApiCall = "/element/append";
if (bReplace) {
strURLApiCall = "/element/replace";
}
iElementType = paloelements.ELEMENT_CONSOLIDATION;
qparams.add(new BasicNameValuePair("type", String.valueOf(iElementType)));
qparams.add(new BasicNameValuePair("children", strElementChildrensId));
qparams.add(new BasicNameValuePair("weights", strElementChildrenWeights));
try {
this.plConn.sendToServerSingleRC(qparams, strURLApiCall);
} catch (Exception e) {
throw new paloexception(e.getMessage());
}
}
public void updateElement() throws paloexception {
updateElement(getConsolidations(), false);
}
public void updateElement(paloconsolidations plCons) throws paloexception {
updateElement(plCons, false);
}
@Override
public boolean equals(Object obj) {
if (null == obj) {
@Override
public boolean equals(Object obj){
if (null == obj){
throw new IllegalArgumentException();
}
if (obj instanceof paloelement) {
if (obj instanceof paloelement){
return strElementName.equals(((paloelement) obj).strElementName);
}
return false;
}
public int compareTo(Object o) {
if (this.iElementPosition > ((paloelement) o).getElementPosition()) {
return -1;
} else {
return 1;
}
}
public int compareTo ( Object o ){
if(this.iElementPosition>((paloelement)o).getElementPosition()) return -1;
else return 1;
}
}

View File

@@ -1,354 +1,404 @@
package org.talend.jpalo;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.HashSet;
import java.util.Hashtable;
import java.util.List;
import java.util.Map;
import java.nio.charset.Charset;
import java.util.*;
import org.apache.http.HttpEntity;
import org.apache.http.NameValuePair;
import org.apache.http.*;
import org.apache.http.message.BasicNameValuePair;
import com.talend.csv.CSVReader;
import com.csvreader.CsvReader;
public class paloelements {
// OK
// OK
public static final int ELEMENT_NUMERIC = 1;
public static final int ELEMENT_STRING = 2;
public static final int ELEMENT_CONSOLIDATION = 4;
public static final int ELEMENT_RULE = 4;
public static final int ELEMENT_UNKNOWN = -1;
public static final int MODE_UNKNOWN = 0;
public static final int MODE_ADD = 1;
public static final int MODE_FORCE_ADD = 2;
public static final int MODE_UPDATE = 3;
public static final int MODE_ADD_OR_UPDATE = 4;
//D private Hashtable<Integer, String> paloElementsIdentifier = new Hashtable<Integer, String>();
//D private Hashtable<String, paloelement> paloElements = new Hashtable<String,paloelement>();
private Hashtable<Long, String> paloElementsIdentifier = new Hashtable<Long, String>();
private Hashtable<String, paloelement> paloElementsList = new Hashtable<String,paloelement>();
private ArrayList<paloelement> paloSortedElements = new ArrayList<paloelement>();
public static final int ELEMENT_NUMERIC = 1;
private elementComparator elemComp = new elementComparator();
public static final int ELEMENT_STRING = 2;
public static final int ELEMENT_CONSOLIDATION = 4;
public static final int ELEMENT_RULE = 4;
public static final int ELEMENT_UNKNOWN = -1;
public static final int MODE_UNKNOWN = 0;
public static final int MODE_ADD = 1;
public static final int MODE_FORCE_ADD = 2;
public static final int MODE_UPDATE = 3;
public static final int MODE_ADD_OR_UPDATE = 4;
// D private Hashtable<Integer, String> paloElementsIdentifier = new Hashtable<Integer, String>();
// D private Hashtable<String, paloelement> paloElements = new Hashtable<String,paloelement>();
private Hashtable<Long, String> paloElementsIdentifier = new Hashtable<Long, String>();
private Hashtable<String, paloelement> paloElementsList = new Hashtable<String, paloelement>();
private ArrayList<paloelement> paloSortedElements = new ArrayList<paloelement>();
private elementComparator elemComp = new elementComparator();
private paloconnection plConn;
private long lDatabaseId;
private int iDimensionId;
private List<String> elementNameList = new ArrayList<String>();
public paloelements(paloconnection plConn, long lDatabaseId, int iDimensionId, HashSet<String> hsFilteredElements)
throws paloexception {
super();
this.plConn = plConn;
this.lDatabaseId = lDatabaseId;
this.iDimensionId = iDimensionId;
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
qparams.add(new BasicNameValuePair("dimension", String.valueOf(this.iDimensionId)));
try {
HttpEntity entity = this.plConn.sendToServer(qparams, "/dimension/elements");
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
csv.setQuoteChar('"');
while (csv.readNext()) {
if (hsFilteredElements.contains(csv.get(1))) {
paloelement plElm = new paloelement(this.plConn, this.lDatabaseId, this.iDimensionId, this,
palohelpers.StringToLong(csv.get(0)), csv.get(1), palohelpers.StringToInt(csv.get(2)),
palohelpers.StringToInt(csv.get(3)), palohelpers.StringToInt(csv.get(4)), palohelpers.StringToInt(csv
.get(5)), palohelpers.StringToInt(csv.get(6)), palohelpers.StringToInt(csv.get(7)),
palohelpers.StringToIntArray(csv.get(8), palohelpers.StringToInt(csv.get(7))),
palohelpers.StringToInt(csv.get(9)), palohelpers.StringToIntArray(csv.get(10),
palohelpers.StringToInt(csv.get(9))), palohelpers.StringToDoubleArray(csv.get(11),
palohelpers.StringToInt(csv.get(9))));
paloElementsList.put(plElm.getName(), plElm);
paloElementsIdentifier.put(palohelpers.StringToLong(csv.get(0)), csv.get(1));
// plElm.setPaloElements(this);
/*
* long lElementIdentifier, //0 element identifier Identifier of the element String strElementName,
* //1 name_element string Name of the element int iElementPosition, //2 position integer Position
* of the element int iElementLevel, //3 level integer Level of the element int iElementIndent, //4
* indent integer Indent of the element int iElementDepth, //5 depth integer Depth of the element
* int iElementType, //6 type integer Type of the element (1=NUMERIC, 2=STRING, 4=CONSOLIDATED) int
* iElementNumOfParents, //7 number_parents integer Number of parents int[] iArrElementParents, //8
* parents identifier Comma separate list of parent identifiers int iElementNumOfChildren, //9
* number_children integer Number of children int[] iArrElementChildren, //10 children identifier
* Comma separate list of children identifiers double[] dArrElementChildrenWeights //11 weights
* double Comma separate list of children weight
*/
}
}
csv.close();
entity.consumeContent();
} catch (Exception e) {
throw new paloexception(e.getMessage());
private paloconnection plConn;
private long lDatabaseId;
private int iDimensionId;
private List<String> elementNameList = new ArrayList<String>();
public paloelements(paloconnection plConn, long lDatabaseId, int iDimensionId, HashSet<String> hsFilteredElements)throws paloexception{
super();
this.plConn = plConn;
this.lDatabaseId=lDatabaseId;
this.iDimensionId = iDimensionId;
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
qparams.add(new BasicNameValuePair("dimension", String.valueOf(this.iDimensionId)));
try{
HttpEntity entity = this.plConn.sendToServer(qparams, "/dimension/elements");
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
csv.setDelimiter(';');
csv.setTextQualifier('"');
csv.setUseTextQualifier(true);
while(csv.readRecord()){
if(hsFilteredElements.contains(csv.get(1))){
paloelement plElm = new paloelement(
this.plConn,
this.lDatabaseId,
this.iDimensionId,
this,
palohelpers.StringToLong(csv.get(0)),
csv.get(1),
palohelpers.StringToInt(csv.get(2)),
palohelpers.StringToInt(csv.get(3)),
palohelpers.StringToInt(csv.get(4)),
palohelpers.StringToInt(csv.get(5)),
palohelpers.StringToInt(csv.get(6)),
palohelpers.StringToInt(csv.get(7)),
palohelpers.StringToIntArray(csv.get(8), palohelpers.StringToInt(csv.get(7))),
palohelpers.StringToInt(csv.get(9)),
palohelpers.StringToIntArray(csv.get(10), palohelpers.StringToInt(csv.get(9))),
palohelpers.StringToDoubleArray(csv.get(11), palohelpers.StringToInt(csv.get(9)))
);
paloElementsList.put(plElm.getName(), plElm);
paloElementsIdentifier.put(palohelpers.StringToLong(csv.get(0)),csv.get(1));
//plElm.setPaloElements(this);
/*
long lElementIdentifier, //0 element identifier Identifier of the element
String strElementName, //1 name_element string Name of the element
int iElementPosition, //2 position integer Position of the element
int iElementLevel, //3 level integer Level of the element
int iElementIndent, //4 indent integer Indent of the element
int iElementDepth, //5 depth integer Depth of the element
int iElementType, //6 type integer Type of the element (1=NUMERIC, 2=STRING, 4=CONSOLIDATED)
int iElementNumOfParents, //7 number_parents integer Number of parents
int[] iArrElementParents, //8 parents identifier Comma separate list of parent identifiers
int iElementNumOfChildren, //9 number_children integer Number of children
int[] iArrElementChildren, //10 children identifier Comma separate list of children identifiers
double[] dArrElementChildrenWeights //11 weights double Comma separate list of children weight
*/
}}
csv.close();
entity.consumeContent();
}catch(Exception e){
throw new paloexception(e.getMessage());
}
}
public paloelements(paloconnection plConn, long lDatabaseId, int iDimensionId) throws paloexception {
super();
this.plConn = plConn;
this.lDatabaseId = lDatabaseId;
this.iDimensionId = iDimensionId;
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
qparams.add(new BasicNameValuePair("dimension", String.valueOf(this.iDimensionId)));
try {
HttpEntity entity = this.plConn.sendToServer(qparams, "/dimension/elements");
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
csv.setQuoteChar('"');
while (csv.readNext()) {
/*
*
* paloElementsList.put(csv.get(1), new paloelement( this.plConn, this.lDatabaseId, this.iDimensionId,
* this, palohelpers.StringToLong(csv.get(0)), csv.get(1), palohelpers.StringToInt(csv.get(2)),
* palohelpers.StringToInt(csv.get(3)), palohelpers.StringToInt(csv.get(4)),
* palohelpers.StringToInt(csv.get(5)), palohelpers.StringToInt(csv.get(6)),
* palohelpers.StringToInt(csv.get(7)), palohelpers.StringToIntArray(csv.get(8),
* palohelpers.StringToInt(csv.get(7))), palohelpers.StringToInt(csv.get(9)),
* palohelpers.StringToIntArray(csv.get(10), palohelpers.StringToInt(csv.get(9))),
* palohelpers.StringToDoubleArray(csv.get(11), palohelpers.StringToInt(csv.get(9))) ));
*/
paloelement plElm = new paloelement(this.plConn, this.lDatabaseId, this.iDimensionId, this,
palohelpers.StringToLong(csv.get(0)), csv.get(1), palohelpers.StringToInt(csv.get(2)),
palohelpers.StringToInt(csv.get(3)), palohelpers.StringToInt(csv.get(4)), palohelpers.StringToInt(csv
.get(5)), palohelpers.StringToInt(csv.get(6)), palohelpers.StringToInt(csv.get(7)),
palohelpers.StringToIntArray(csv.get(8), palohelpers.StringToInt(csv.get(7))),
palohelpers.StringToInt(csv.get(9)), palohelpers.StringToIntArray(csv.get(10),
palohelpers.StringToInt(csv.get(9))), palohelpers.StringToDoubleArray(csv.get(11),
palohelpers.StringToInt(csv.get(9))));
paloElementsList.put(plElm.getName(), plElm);
paloElementsIdentifier.put(palohelpers.StringToLong(csv.get(0)), csv.get(1));
// plElm.setPaloElements(this);
/*
* long lElementIdentifier, //0 element identifier Identifier of the element String strElementName, //1
* name_element string Name of the element int iElementPosition, //2 position integer Position of the
* element int iElementLevel, //3 level integer Level of the element int iElementIndent, //4 indent
* integer Indent of the element int iElementDepth, //5 depth integer Depth of the element int
* iElementType, //6 type integer Type of the element (1=NUMERIC, 2=STRING, 4=CONSOLIDATED) int
* iElementNumOfParents, //7 number_parents integer Number of parents int[] iArrElementParents, //8
* parents identifier Comma separate list of parent identifiers int iElementNumOfChildren, //9
* number_children integer Number of children int[] iArrElementChildren, //10 children identifier Comma
* separate list of children identifiers double[] dArrElementChildrenWeights //11 weights double Comma
* separate list of children weight
*/
}
csv.close();
entity.consumeContent();
} catch (Exception e) {
throw new paloexception(e.getMessage());
}
public paloelements(paloconnection plConn, long lDatabaseId, int iDimensionId)throws paloexception{
super();
this.plConn = plConn;
this.lDatabaseId=lDatabaseId;
this.iDimensionId = iDimensionId;
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
qparams.add(new BasicNameValuePair("dimension", String.valueOf(this.iDimensionId)));
try{
HttpEntity entity = this.plConn.sendToServer(qparams, "/dimension/elements");
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
csv.setDelimiter(';');
csv.setTextQualifier('"');
csv.setUseTextQualifier(true);
while(csv.readRecord()){
/*
paloElementsList.put(csv.get(1), new paloelement(
this.plConn,
this.lDatabaseId,
this.iDimensionId,
this,
palohelpers.StringToLong(csv.get(0)),
csv.get(1),
palohelpers.StringToInt(csv.get(2)),
palohelpers.StringToInt(csv.get(3)),
palohelpers.StringToInt(csv.get(4)),
palohelpers.StringToInt(csv.get(5)),
palohelpers.StringToInt(csv.get(6)),
palohelpers.StringToInt(csv.get(7)),
palohelpers.StringToIntArray(csv.get(8), palohelpers.StringToInt(csv.get(7))),
palohelpers.StringToInt(csv.get(9)),
palohelpers.StringToIntArray(csv.get(10), palohelpers.StringToInt(csv.get(9))),
palohelpers.StringToDoubleArray(csv.get(11), palohelpers.StringToInt(csv.get(9)))
));*/
paloelement plElm = new paloelement(
this.plConn,
this.lDatabaseId,
this.iDimensionId,
this,
palohelpers.StringToLong(csv.get(0)),
csv.get(1),
palohelpers.StringToInt(csv.get(2)),
palohelpers.StringToInt(csv.get(3)),
palohelpers.StringToInt(csv.get(4)),
palohelpers.StringToInt(csv.get(5)),
palohelpers.StringToInt(csv.get(6)),
palohelpers.StringToInt(csv.get(7)),
palohelpers.StringToIntArray(csv.get(8), palohelpers.StringToInt(csv.get(7))),
palohelpers.StringToInt(csv.get(9)),
palohelpers.StringToIntArray(csv.get(10), palohelpers.StringToInt(csv.get(9))),
palohelpers.StringToDoubleArray(csv.get(11), palohelpers.StringToInt(csv.get(9)))
);
paloElementsList.put(plElm.getName(), plElm);
paloElementsIdentifier.put(palohelpers.StringToLong(csv.get(0)),csv.get(1));
//plElm.setPaloElements(this);
/*
long lElementIdentifier, //0 element identifier Identifier of the element
String strElementName, //1 name_element string Name of the element
int iElementPosition, //2 position integer Position of the element
int iElementLevel, //3 level integer Level of the element
int iElementIndent, //4 indent integer Indent of the element
int iElementDepth, //5 depth integer Depth of the element
int iElementType, //6 type integer Type of the element (1=NUMERIC, 2=STRING, 4=CONSOLIDATED)
int iElementNumOfParents, //7 number_parents integer Number of parents
int[] iArrElementParents, //8 parents identifier Comma separate list of parent identifiers
int iElementNumOfChildren, //9 number_children integer Number of children
int[] iArrElementChildren, //10 children identifier Comma separate list of children identifiers
double[] dArrElementChildrenWeights //11 weights double Comma separate list of children weight
*/
}
csv.close();
entity.consumeContent();
}catch(Exception e){
throw new paloexception(e.getMessage());
}
}
}
public void createElementsBulk(String strElementNames, String strElementTypes) throws paloexception{
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
qparams.add(new BasicNameValuePair("dimension", String.valueOf(this.iDimensionId)));
qparams.add(new BasicNameValuePair("name_elements", strElementNames));
qparams.add(new BasicNameValuePair("types", strElementTypes));
this.plConn.sendToServerSingleRC(qparams, "/element/create_bulk");
}
public paloelement createElement(String strElementName, int iElementType, int iMode) throws paloexception{
paloelement plElem = null;
if(!elementNameList.contains(strElementName)){
elementNameList.add(strElementName);
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
qparams.add(new BasicNameValuePair("dimension", String.valueOf(this.iDimensionId)));
qparams.add(new BasicNameValuePair("new_name", strElementName));
qparams.add(new BasicNameValuePair("type", String.valueOf(iElementType)));
try{
HttpEntity entity=null;
switch(iMode){
case MODE_ADD:
entity = this.plConn.sendToServer(qparams, "/element/create");
break;
case MODE_UNKNOWN:
case MODE_ADD_OR_UPDATE:
paloelement plElm = getElement(strElementName);
if(null==plElm) entity = this.plConn.sendToServer(qparams, "/element/create");
else{
qparams.add(new BasicNameValuePair("element", String.valueOf(plElm.getElementIdentifier())));
entity = this.plConn.sendToServer(qparams, "/element/replace");
}
break;
case MODE_UPDATE:
plElm = getElement(strElementName);
if(null==plElm) throw new paloexception("Element " + strElementName +" does not exists!");
qparams.add(new BasicNameValuePair("element", String.valueOf(plElm.getElementIdentifier())));
entity = this.plConn.sendToServer(qparams, "/element/replace");
break;
case MODE_FORCE_ADD:
plElm = getElement(strElementName);
if(null!=plElm) deleteElement(plElm);
entity = this.plConn.sendToServer(qparams, "/element/create");
break;
public void createElementsBulk(String strElementNames, String strElementTypes) throws paloexception {
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
qparams.add(new BasicNameValuePair("dimension", String.valueOf(this.iDimensionId)));
}
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
csv.setDelimiter(';');
csv.setTextQualifier('"');
csv.setUseTextQualifier(true);
csv.readRecord();
plElem = new paloelement(
this.plConn,
this.lDatabaseId,
this.iDimensionId,
this,
palohelpers.StringToLong(csv.get(0)),
csv.get(1),
palohelpers.StringToInt(csv.get(2)),
palohelpers.StringToInt(csv.get(3)),
palohelpers.StringToInt(csv.get(4)),
palohelpers.StringToInt(csv.get(5)),
palohelpers.StringToInt(csv.get(6)),
palohelpers.StringToInt(csv.get(7)),
palohelpers.StringToIntArray(csv.get(8), palohelpers.StringToInt(csv.get(7))),
palohelpers.StringToInt(csv.get(9)),
palohelpers.StringToIntArray(csv.get(10), palohelpers.StringToInt(csv.get(9))),
palohelpers.StringToDoubleArray(csv.get(11), palohelpers.StringToInt(csv.get(9)))
);
csv.close();
entity.consumeContent();
paloElementsList.put(plElem.getName(), plElem);
paloElementsIdentifier.put(plElem.getElementIdentifier(),plElem.getName());
//plElem.setPaloElements(this);
}catch(Exception e){
System.out.println("Hier " + strElementName);
throw new paloexception(e.getMessage());
}
}
return plElem;
}
qparams.add(new BasicNameValuePair("name_elements", strElementNames));
qparams.add(new BasicNameValuePair("types", strElementTypes));
this.plConn.sendToServerSingleRC(qparams, "/element/create_bulk");
}
public paloelement createElement(String strElementName, int iElementType)throws paloexception{
return createElement(strElementName, iElementType, MODE_ADD);
}
public paloelement createElement(String strElementName, int iElementType, int iMode) throws paloexception {
paloelement plElem = null;
public paloelement createElement(String strElementName) throws paloexception{
return createElement(strElementName, ELEMENT_NUMERIC, MODE_ADD);
}
public void deleteElement(paloelement paloElemToRemove) throws paloexception{
if(null != paloElemToRemove){
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
qparams.add(new BasicNameValuePair("dimension", String.valueOf(this.iDimensionId)));
qparams.add(new BasicNameValuePair("element", String.valueOf(paloElemToRemove.getElementIdentifier())));
plConn.sendToServerSingleRC(qparams, "/element/destroy");
paloElementsIdentifier.remove(paloElemToRemove.getElementIdentifier());
paloElementsList.remove(paloElemToRemove.getName());
}
}
public void deleteElement(String strElementName) throws paloexception{
paloelement paloElemToRemove = getElement(strElementName);
if(null != paloElemToRemove){
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
qparams.add(new BasicNameValuePair("dimension", String.valueOf(this.iDimensionId)));
qparams.add(new BasicNameValuePair("element", String.valueOf(paloElemToRemove.getElementIdentifier())));
plConn.sendToServerSingleRC(qparams, "/element/destroy");
paloElementsIdentifier.remove(paloElemToRemove.getElementIdentifier());
paloElementsList.remove(paloElemToRemove.getName());
}
}
public int getNumberOfElements(){
return paloElementsList.size();
}
public paloelement getElement(int iIndex){
return paloElementsList.get(iIndex);
}
public paloelement getElementByIdentifier(long lElementIdentifier){
return paloElementsList.get(paloElementsIdentifier.get(lElementIdentifier));
}
public ArrayList<paloelement> getFilteredElements(long lParentPosition){
if (!elementNameList.contains(strElementName)) {
elementNameList.add(strElementName);
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
qparams.add(new BasicNameValuePair("dimension", String.valueOf(this.iDimensionId)));
qparams.add(new BasicNameValuePair("new_name", strElementName));
qparams.add(new BasicNameValuePair("type", String.valueOf(iElementType)));
try {
HttpEntity entity = null;
switch (iMode) {
case MODE_ADD:
entity = this.plConn.sendToServer(qparams, "/element/create");
break;
case MODE_UNKNOWN:
case MODE_ADD_OR_UPDATE:
paloelement plElm = getElement(strElementName);
if (null == plElm) {
entity = this.plConn.sendToServer(qparams, "/element/create");
} else {
qparams.add(new BasicNameValuePair("element", String.valueOf(plElm.getElementIdentifier())));
entity = this.plConn.sendToServer(qparams, "/element/replace");
}
break;
case MODE_UPDATE:
plElm = getElement(strElementName);
if (null == plElm) {
throw new paloexception("Element " + strElementName + " does not exists!");
}
qparams.add(new BasicNameValuePair("element", String.valueOf(plElm.getElementIdentifier())));
entity = this.plConn.sendToServer(qparams, "/element/replace");
break;
case MODE_FORCE_ADD:
plElm = getElement(strElementName);
if (null != plElm) {
deleteElement(plElm);
}
entity = this.plConn.sendToServer(qparams, "/element/create");
break;
}
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
csv.setQuoteChar('"');
csv.readNext();
plElem = new paloelement(this.plConn, this.lDatabaseId, this.iDimensionId, this, palohelpers.StringToLong(csv
.get(0)), csv.get(1), palohelpers.StringToInt(csv.get(2)), palohelpers.StringToInt(csv.get(3)),
palohelpers.StringToInt(csv.get(4)), palohelpers.StringToInt(csv.get(5)), palohelpers.StringToInt(csv
.get(6)), palohelpers.StringToInt(csv.get(7)), palohelpers.StringToIntArray(csv.get(8),
palohelpers.StringToInt(csv.get(7))), palohelpers.StringToInt(csv.get(9)),
palohelpers.StringToIntArray(csv.get(10), palohelpers.StringToInt(csv.get(9))),
palohelpers.StringToDoubleArray(csv.get(11), palohelpers.StringToInt(csv.get(9))));
csv.close();
entity.consumeContent();
paloElementsList.put(plElem.getName(), plElem);
paloElementsIdentifier.put(plElem.getElementIdentifier(), plElem.getName());
// plElem.setPaloElements(this);
} catch (Exception e) {
System.out.println("Hier " + strElementName);
throw new paloexception(e.getMessage());
}
}
return plElem;
}
public paloelement createElement(String strElementName, int iElementType) throws paloexception {
return createElement(strElementName, iElementType, MODE_ADD);
}
public paloelement createElement(String strElementName) throws paloexception {
return createElement(strElementName, ELEMENT_NUMERIC, MODE_ADD);
}
public void deleteElement(paloelement paloElemToRemove) throws paloexception {
if (null != paloElemToRemove) {
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
qparams.add(new BasicNameValuePair("dimension", String.valueOf(this.iDimensionId)));
qparams.add(new BasicNameValuePair("element", String.valueOf(paloElemToRemove.getElementIdentifier())));
plConn.sendToServerSingleRC(qparams, "/element/destroy");
paloElementsIdentifier.remove(paloElemToRemove.getElementIdentifier());
paloElementsList.remove(paloElemToRemove.getName());
}
}
public void deleteElement(String strElementName) throws paloexception {
paloelement paloElemToRemove = getElement(strElementName);
if (null != paloElemToRemove) {
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
qparams.add(new BasicNameValuePair("dimension", String.valueOf(this.iDimensionId)));
qparams.add(new BasicNameValuePair("element", String.valueOf(paloElemToRemove.getElementIdentifier())));
plConn.sendToServerSingleRC(qparams, "/element/destroy");
paloElementsIdentifier.remove(paloElemToRemove.getElementIdentifier());
paloElementsList.remove(paloElemToRemove.getName());
}
}
public int getNumberOfElements() {
return paloElementsList.size();
}
public paloelement getElement(int iIndex) {
return paloElementsList.get(iIndex);
}
public paloelement getElementByIdentifier(long lElementIdentifier) {
return paloElementsList.get(paloElementsIdentifier.get(lElementIdentifier));
}
public ArrayList<paloelement> getFilteredElements(long lParentPosition) {
ArrayList<paloelement> paloFilteredElements = new ArrayList<paloelement>();
for (paloelement plElement : getElements()) {
if (lParentPosition == plElement.getElementParentIdentifier()) {
paloFilteredElements.add(plElement);
}
}
return paloFilteredElements;
}
@SuppressWarnings("unchecked")
private void buildSortedElementArray() {
paloSortedElements = new ArrayList<paloelement>();
Object[] arObjectsToSort = paloElementsList.entrySet().toArray();
Arrays.sort(arObjectsToSort, (Comparator) elemComp);
for (Object element : arObjectsToSort) {
paloSortedElements.add(((paloelement) ((Map.Entry) element).getValue()));
}
}
public ArrayList<paloelement> getElements() {
if (paloSortedElements == null || paloSortedElements.size() < 1) {
buildSortedElementArray();
}
return paloSortedElements;
/*
* ArrayList<paloelement> rcArrayList = new ArrayList<paloelement>(); Object[] arObjectsToSort =
* paloElements.entrySet().toArray(); Arrays.sort(arObjectsToSort, (Comparator)elemComp); for(int
* i=0;i<arObjectsToSort.length;i++){
* rcArrayList.add(((paloelement)((Map.Entry)arObjectsToSort[i]).getValue())); } return rcArrayList;
*/
}
public paloelement getElement(String strElementName) {
return paloElementsList.get(strElementName);
}
class elementComparator implements Comparator<Map.Entry<String, paloelement>> {
public int compare(Map.Entry<String, paloelement> o1, Map.Entry<String, paloelement> o2) {
if (o1.getValue().getElementPosition() > o2.getValue().getElementPosition()) {
return 1;
} else {
return -1;
}
}
}
ArrayList<paloelement> paloFilteredElements = new ArrayList<paloelement>();
for(paloelement plElement:getElements()){
if(lParentPosition==plElement.getElementParentIdentifier()){
paloFilteredElements.add(plElement);
}
}
return paloFilteredElements;
}
@SuppressWarnings("unchecked")
private void buildSortedElementArray(){
paloSortedElements = new ArrayList<paloelement>();
Object[] arObjectsToSort = paloElementsList.entrySet().toArray();
Arrays.sort(arObjectsToSort, (Comparator)elemComp);
for(int i=0;i<arObjectsToSort.length;i++){
paloSortedElements.add(((paloelement)((Map.Entry)arObjectsToSort[i]).getValue()));
}
}
public ArrayList<paloelement> getElements(){
if(paloSortedElements==null || paloSortedElements.size()<1) buildSortedElementArray();
return paloSortedElements;
/*
ArrayList<paloelement> rcArrayList = new ArrayList<paloelement>();
Object[] arObjectsToSort = paloElements.entrySet().toArray();
Arrays.sort(arObjectsToSort, (Comparator)elemComp);
for(int i=0;i<arObjectsToSort.length;i++){
rcArrayList.add(((paloelement)((Map.Entry)arObjectsToSort[i]).getValue()));
}
return rcArrayList;
*/
}
public paloelement getElement(String strElementName){
return paloElementsList.get(strElementName);
}
class elementComparator implements Comparator<Map.Entry<String, paloelement>>{
public int compare(Map.Entry<String, paloelement> o1, Map.Entry<String, paloelement> o2){
if(o1.getValue().getElementPosition()> o2.getValue().getElementPosition()) return 1;
else return -1;
}
}
}

View File

@@ -1,5 +1,6 @@
package org.talend.jpalo;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@@ -8,150 +9,147 @@ import org.apache.http.HttpEntity;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import com.talend.csv.CSVReader;
import com.csvreader.CsvReader;
public class palorule {
private paloconnection plConn;
private paloconnection plConn;
private long lDatabaseId;
private int iCubeId;
private long lDatabaseId;
private int lIdentifier;
private String strDefinition;
private String strExtern_Id;
private String strComment;
private long lTimeStamp;
private boolean bActivated;
private int iCubeId;
public palorule(
paloconnection plConn,
long lDatabaseId,
int iCubeId,
int lIdentifier, //0 rule identifier Identifier of the rule
String strDefinition,//1 rule_string string Textual representation for the rule
String strExtern_Id,//2 external_identifier string external identifier of the rule
String strComment, //3 comment string comment for the rule
long lTimeStamp, // 4 timestamp string creation time of the rule in seconds since 1970-01-01
boolean bActivated // 5 active integer 0=rule is not active, 1=rule is active
){
super();
this.plConn=plConn;
this.lDatabaseId=lDatabaseId;
this.iCubeId=iCubeId;
this.lIdentifier=lIdentifier;
this.strDefinition=strDefinition;
this.strExtern_Id=strExtern_Id;
this.strComment=strComment;
this.lTimeStamp=lTimeStamp;
this.bActivated=bActivated;
}
private int lIdentifier;
public long getIdentifier(){
return lIdentifier;
}
private String strDefinition;
public String getDefinition(){
return strDefinition;
}
public void setDefinition(String strDefinition){
this.strDefinition= strDefinition;
}
public String getExtern_Id(){
return strExtern_Id;
}
public void setExtern_Id(String strExtern_Id){
this.strExtern_Id=strExtern_Id;
}
public String getComment(){
return strComment;
}
public void setComment(String strComment){
this.strComment=strComment;
}
public long getTimeStamp(){
return lTimeStamp;
}
public Date getModificationData(){
return palohelpers.getCalcDateBegin((int)lTimeStamp);
}
public boolean getActivated(){
return bActivated;
}
public void setActivated(boolean bActivated){
this.bActivated=bActivated;
}
private String strExtern_Id;
private String strComment;
private long lTimeStamp;
private boolean bActivated;
public palorule(paloconnection plConn, long lDatabaseId, int iCubeId, int lIdentifier, // 0 rule identifier
// Identifier of the rule
String strDefinition,// 1 rule_string string Textual representation for the rule
String strExtern_Id,// 2 external_identifier string external identifier of the rule
String strComment, // 3 comment string comment for the rule
long lTimeStamp, // 4 timestamp string creation time of the rule in seconds since 1970-01-01
boolean bActivated // 5 active integer 0=rule is not active, 1=rule is active
) {
super();
this.plConn = plConn;
this.lDatabaseId = lDatabaseId;
this.iCubeId = iCubeId;
this.lIdentifier = lIdentifier;
this.strDefinition = strDefinition;
this.strExtern_Id = strExtern_Id;
this.strComment = strComment;
this.lTimeStamp = lTimeStamp;
this.bActivated = bActivated;
}
public long getIdentifier() {
return lIdentifier;
}
public String getDefinition() {
return strDefinition;
}
public void setDefinition(String strDefinition) {
this.strDefinition = strDefinition;
}
public String getExtern_Id() {
return strExtern_Id;
}
public void setExtern_Id(String strExtern_Id) {
this.strExtern_Id = strExtern_Id;
}
public String getComment() {
return strComment;
}
public void setComment(String strComment) {
this.strComment = strComment;
}
public long getTimeStamp() {
return lTimeStamp;
}
public Date getModificationData() {
return palohelpers.getCalcDateBegin((int) lTimeStamp);
}
public boolean getActivated() {
return bActivated;
}
public void setActivated(boolean bActivated) {
this.bActivated = bActivated;
}
public void refreshRuleInfo() throws paloexception {
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
qparams.add(new BasicNameValuePair("cube", String.valueOf(this.iCubeId)));
qparams.add(new BasicNameValuePair("rule", String.valueOf(this.lIdentifier)));
qparams.add(new BasicNameValuePair("use_identifier", palohelpers.BooleanToString(false)));
try {
HttpEntity entity = this.plConn.sendToServer(qparams, "/rule/info");
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
csv.setQuoteChar('"');
while (csv.readNext()) {
lIdentifier = palohelpers.StringToInt(csv.get(0));
strDefinition = csv.get(1);
strExtern_Id = csv.get(2);
strComment = csv.get(3);
lTimeStamp = palohelpers.StringToLong(csv.get(4));
bActivated = palohelpers.StringToBoolean(csv.get(5));
}
csv.close();
entity.consumeContent();
} catch (Exception e) {
throw new paloexception(e.getMessage());
}
}
public void modifyRule() throws paloexception {
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
qparams.add(new BasicNameValuePair("cube", String.valueOf(this.iCubeId)));
qparams.add(new BasicNameValuePair("rule", String.valueOf(this.lIdentifier)));
qparams.add(new BasicNameValuePair("definition", strDefinition));
qparams.add(new BasicNameValuePair("activate", palohelpers.BooleanToString(this.bActivated)));
qparams.add(new BasicNameValuePair("external_identifier", strExtern_Id));
qparams.add(new BasicNameValuePair("comment", strComment));
qparams.add(new BasicNameValuePair("use_identifier", palohelpers.BooleanToString(false)));
try {
HttpEntity entity = this.plConn.sendToServer(qparams, "/rule/modify");
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
csv.setQuoteChar('"');
while (csv.readNext()) {
lIdentifier = palohelpers.StringToInt(csv.get(0));
strDefinition = csv.get(1);
strExtern_Id = csv.get(2);
strComment = csv.get(3);
lTimeStamp = palohelpers.StringToLong(csv.get(4));
bActivated = palohelpers.StringToBoolean(csv.get(5));
}
csv.close();
entity.consumeContent();
} catch (Exception e) {
throw new paloexception(e.getMessage());
}
}
public void refreshRuleInfo() throws paloexception{
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
qparams.add(new BasicNameValuePair("cube", String.valueOf(this.iCubeId)));
qparams.add(new BasicNameValuePair("rule", String.valueOf(this.lIdentifier)));
qparams.add(new BasicNameValuePair("use_identifier", palohelpers.BooleanToString(false)));
try{
HttpEntity entity = this.plConn.sendToServer(qparams, "/rule/info");
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
csv.setDelimiter(';');
csv.setTextQualifier('"');
while(csv.readRecord()){
lIdentifier = palohelpers.StringToInt(csv.get(0));
strDefinition = csv.get(1);
strExtern_Id =csv.get(2);
strComment = csv.get(3);
lTimeStamp=palohelpers.StringToLong(csv.get(4));
bActivated = palohelpers.StringToBoolean(csv.get(5));
}
csv.close();
entity.consumeContent();
}catch(Exception e){
throw new paloexception(e.getMessage());
}
}
public void modifyRule() throws paloexception{
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
qparams.add(new BasicNameValuePair("cube", String.valueOf(this.iCubeId)));
qparams.add(new BasicNameValuePair("rule", String.valueOf(this.lIdentifier)));
qparams.add(new BasicNameValuePair("definition", strDefinition));
qparams.add(new BasicNameValuePair("activate", palohelpers.BooleanToString(this.bActivated)));
qparams.add(new BasicNameValuePair("external_identifier", strExtern_Id));
qparams.add(new BasicNameValuePair("comment", strComment));
qparams.add(new BasicNameValuePair("use_identifier", palohelpers.BooleanToString(false)));
try{
HttpEntity entity = this.plConn.sendToServer(qparams, "/rule/modify");
CsvReader csv = new CsvReader(entity.getContent(), Charset.forName("UTF-8"));
csv.setDelimiter(';');
csv.setTextQualifier('"');
while(csv.readRecord()){
lIdentifier = palohelpers.StringToInt(csv.get(0));
strDefinition = csv.get(1);
strExtern_Id =csv.get(2);
strComment = csv.get(3);
lTimeStamp=palohelpers.StringToLong(csv.get(4));
bActivated = palohelpers.StringToBoolean(csv.get(5));
}
csv.close();
entity.consumeContent();
}catch(Exception e){
throw new paloexception(e.getMessage());
}
}
}

View File

@@ -1,5 +1,6 @@
package org.talend.jpalo;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.List;
@@ -7,214 +8,243 @@ import org.apache.http.HttpEntity;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import com.talend.csv.CSVReader;
import com.csvreader.CsvReader;
public class palorules {
public static final int RULES_TEXT = 0;
public static final int RULES_NUMERIC = 1;
public static final int RULES_TEXT = 0;
private ArrayList<palorule> paloRules = new ArrayList<palorule>();
public static final int RULES_NUMERIC = 1;
private paloconnection plConn;
private long lDatabaseId;
private int iCubeId;
private ArrayList<palorule> paloRules = new ArrayList<palorule>();
private String strRuleParseResult;
private paloconnection plConn;
public palorules(paloconnection plConn, long lDatabaseId, int iCubeId)
throws paloexception {
super();
this.plConn = plConn;
this.lDatabaseId = lDatabaseId;
this.iCubeId = iCubeId;
private long lDatabaseId;
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String
.valueOf(this.lDatabaseId)));
qparams.add(new BasicNameValuePair("cube", String.valueOf(this.iCubeId)));
qparams.add(new BasicNameValuePair("use_identifier", "0"));
try {
HttpEntity entity = this.plConn
.sendToServer(qparams, "/cube/rules");
CsvReader csv = new CsvReader(entity.getContent(),
Charset.forName("UTF-8"));
csv.setDelimiter(';');
csv.setTextQualifier('"');
while (csv.readRecord()) {
// System.out.println(csv.getRawRecord());
paloRules.add(new palorule(plConn, lDatabaseId, iCubeId,
palohelpers.StringToInt(csv.get(0)), csv.get(1), csv
.get(2), csv.get(3), palohelpers
.StringToLong(csv.get(4)), palohelpers
.StringToBoolean(csv.get(5))));
}
csv.close();
entity.consumeContent();
} catch (Exception e) {
throw new paloexception(e.getMessage());
}
private int iCubeId;
}
private String strRuleParseResult;
public int getNumberOfRules() {
return paloRules.size();
}
public palorules(paloconnection plConn, long lDatabaseId, int iCubeId) throws paloexception {
super();
this.plConn = plConn;
this.lDatabaseId = lDatabaseId;
this.iCubeId = iCubeId;
// Returns the Rule at the given Position
public palorule getRule(int iIndex) {
return paloRules.get(iIndex);
}
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
qparams.add(new BasicNameValuePair("cube", String.valueOf(this.iCubeId)));
qparams.add(new BasicNameValuePair("use_identifier", "0"));
try {
HttpEntity entity = this.plConn.sendToServer(qparams, "/cube/rules");
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
csv.setQuoteChar('"');
while (csv.readNext()) {
// System.out.println(csv.getRawRecord());
paloRules.add(new palorule(plConn, lDatabaseId, iCubeId, palohelpers.StringToInt(csv.get(0)), csv.get(1), csv
.get(2), csv.get(3), palohelpers.StringToLong(csv.get(4)), palohelpers.StringToBoolean(csv.get(5))));
}
csv.close();
entity.consumeContent();
} catch (Exception e) {
throw new paloexception(e.getMessage());
}
// Returns the Rule with the given Identifier
public palorule getRule(long lIdentifier) {
for (palorule paloRule : paloRules) {
if (paloRule.getIdentifier() == lIdentifier)
return paloRule;
}
return null;
}
}
// Returns the Rule with the given Extern_Id
public palorule getRule(String strExtern_Id) {
for (palorule paloRule : paloRules) {
if (paloRule.getExtern_Id().equals(strExtern_Id))
return paloRule;
}
return null;
}
public int getNumberOfRules() {
return paloRules.size();
}
public ArrayList<palorule> getRules() {
return paloRules;
}
// Returns the Rule at the given Position
public palorule getRule(int iIndex) {
return paloRules.get(iIndex);
}
// Deletes the Rule at the given position
public void deleteRule(int iIndex) throws paloexception {
palorule paloRuleToRemove = getRule(iIndex);
if (null != paloRuleToRemove) {
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String
.valueOf(this.lDatabaseId)));
qparams.add(new BasicNameValuePair("cube", String
.valueOf(this.iCubeId)));
qparams.add(new BasicNameValuePair("rule", String
.valueOf(paloRuleToRemove.getIdentifier())));
plConn.sendToServerSingleRC(qparams, "/rule/destroy");
paloRules.remove(paloRuleToRemove);
}
}
// Returns the Rule with the given Identifier
public palorule getRule(long lIdentifier) {
for (palorule paloRule : paloRules) {
if (paloRule.getIdentifier() == lIdentifier) {
return paloRule;
}
}
return null;
}
// Deletes the Rule with given Identifier
public void deleteRule(long lIdentifier) throws paloexception {
palorule paloRuleToRemove = getRule(lIdentifier);
if (null != paloRuleToRemove) {
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String
.valueOf(this.lDatabaseId)));
qparams.add(new BasicNameValuePair("cube", String
.valueOf(this.iCubeId)));
qparams.add(new BasicNameValuePair("rule", String
.valueOf(paloRuleToRemove.getIdentifier())));
plConn.sendToServerSingleRC(qparams, "/rule/destroy");
paloRules.remove(paloRuleToRemove);
}
}
// Returns the Rule with the given Extern_Id
public palorule getRule(String strExtern_Id) {
for (palorule paloRule : paloRules) {
if (paloRule.getExtern_Id().equals(strExtern_Id)) {
return paloRule;
}
}
return null;
}
// Deletes the Rule with given External_Id
public void deleteRule(String strExtern_Id) throws paloexception {
palorule paloRuleToRemove = getRule(strExtern_Id);
if (null != paloRuleToRemove) {
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String
.valueOf(this.lDatabaseId)));
qparams.add(new BasicNameValuePair("cube", String
.valueOf(this.iCubeId)));
qparams.add(new BasicNameValuePair("rule", String
.valueOf(paloRuleToRemove.getIdentifier())));
plConn.sendToServerSingleRC(qparams, "/rule/destroy");
paloRules.remove(paloRuleToRemove);
}
}
public ArrayList<palorule> getRules() {
return paloRules;
}
public String parseRule(String strRuleToParse) throws paloexception {
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String
.valueOf(this.lDatabaseId)));
qparams.add(new BasicNameValuePair("cube", String.valueOf(this.iCubeId)));
qparams.add(new BasicNameValuePair("definition", strRuleToParse));
try {
StringBuilder sb = new StringBuilder();
HttpEntity entity = this.plConn
.sendToServer(qparams, "/rule/parse");
CsvReader csv = new CsvReader(entity.getContent(),
Charset.forName("UTF-8"));
csv.setDelimiter(';');
csv.setTextQualifier('"');
while (csv.readRecord()) {
sb.append(csv.get(0));
}
csv.close();
entity.consumeContent();
return sb.toString();
} catch (Exception e) {
throw new paloexception(e.getMessage());
}
}
// Deletes the Rule at the given position
public void deleteRule(int iIndex) throws paloexception {
palorule paloRuleToRemove = getRule(iIndex);
if (null != paloRuleToRemove) {
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
qparams.add(new BasicNameValuePair("cube", String.valueOf(this.iCubeId)));
qparams.add(new BasicNameValuePair("rule", String.valueOf(paloRuleToRemove.getIdentifier())));
plConn.sendToServerSingleRC(qparams, "/rule/destroy");
paloRules.remove(paloRuleToRemove);
}
}
public String getParseRuleResult() {
return strRuleParseResult;
}
// Deletes the Rule with given Identifier
public void deleteRule(long lIdentifier) throws paloexception {
palorule paloRuleToRemove = getRule(lIdentifier);
if (null != paloRuleToRemove) {
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
qparams.add(new BasicNameValuePair("cube", String.valueOf(this.iCubeId)));
qparams.add(new BasicNameValuePair("rule", String.valueOf(paloRuleToRemove.getIdentifier())));
plConn.sendToServerSingleRC(qparams, "/rule/destroy");
paloRules.remove(paloRuleToRemove);
}
}
/**
* Adds a rule to the given cube
*
*
* @param The
* rule definition
* @param Identifier
* flag
* @param An
* external Id
* @param The
* comment for this rule
* @param Acitvation
* flag
* @return The added palorule
*/
public palorule addRule(String strRuleDefinition, boolean bUseIdentifier,
String strExtern_Id, String strComment, boolean bActivate)
throws paloexception {
palorule plRule = null;
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String
.valueOf(this.lDatabaseId)));
qparams.add(new BasicNameValuePair("cube", String.valueOf(this.iCubeId)));
qparams.add(new BasicNameValuePair("definition", strRuleDefinition));
qparams.add(new BasicNameValuePair("activate", palohelpers
.BooleanToString(bActivate)));
qparams.add(new BasicNameValuePair("external_identifier", strExtern_Id));
qparams.add(new BasicNameValuePair("comment", strComment));
qparams.add(new BasicNameValuePair("use_identifier", palohelpers
.BooleanToString(bUseIdentifier)));
// Deletes the Rule with given External_Id
public void deleteRule(String strExtern_Id) throws paloexception {
palorule paloRuleToRemove = getRule(strExtern_Id);
if (null != paloRuleToRemove) {
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
qparams.add(new BasicNameValuePair("cube", String.valueOf(this.iCubeId)));
qparams.add(new BasicNameValuePair("rule", String.valueOf(paloRuleToRemove.getIdentifier())));
plConn.sendToServerSingleRC(qparams, "/rule/destroy");
paloRules.remove(paloRuleToRemove);
}
}
try {
HttpEntity entity = this.plConn.sendToServer(qparams,
"/rule/create");
CsvReader csv = new CsvReader(entity.getContent(),
Charset.forName("UTF-8"));
csv.setDelimiter(';');
csv.setTextQualifier('"');
while (csv.readRecord()) {
// System.out.println(csv.getRawRecord());
plRule = new palorule(plConn, lDatabaseId, iCubeId,
palohelpers.StringToInt(csv.get(0)), csv.get(1),
csv.get(2), csv.get(3), palohelpers.StringToLong(csv
.get(4)), palohelpers.StringToBoolean(csv
.get(5)));
paloRules.add(plRule);
}
csv.close();
entity.consumeContent();
return plRule;
} catch (Exception e) {
throw new paloexception(e.getMessage());
}
}
public String parseRule(String strRuleToParse) throws paloexception {
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
qparams.add(new BasicNameValuePair("cube", String.valueOf(this.iCubeId)));
qparams.add(new BasicNameValuePair("definition", strRuleToParse));
try {
StringBuilder sb = new StringBuilder();
HttpEntity entity = this.plConn.sendToServer(qparams, "/rule/parse");
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
csv.setQuoteChar('"');
while (csv.readNext()) {
sb.append(csv.get(0));
}
csv.close();
entity.consumeContent();
return sb.toString();
} catch (Exception e) {
throw new paloexception(e.getMessage());
}
}
public String getParseRuleResult() {
return strRuleParseResult;
}
/**
* Adds a rule to the given cube
*
*
* @param The rule definition
* @param Identifier flag
* @param An external Id
* @param The comment for this rule
* @param Acitvation flag
* @return The added palorule
*/
public palorule addRule(String strRuleDefinition, boolean bUseIdentifier, String strExtern_Id, String strComment,
boolean bActivate) throws paloexception {
palorule plRule = null;
List<NameValuePair> qparams = new ArrayList<NameValuePair>();
qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
qparams.add(new BasicNameValuePair("cube", String.valueOf(this.iCubeId)));
qparams.add(new BasicNameValuePair("definition", strRuleDefinition));
qparams.add(new BasicNameValuePair("activate", palohelpers.BooleanToString(bActivate)));
qparams.add(new BasicNameValuePair("external_identifier", strExtern_Id));
qparams.add(new BasicNameValuePair("comment", strComment));
qparams.add(new BasicNameValuePair("use_identifier", palohelpers.BooleanToString(bUseIdentifier)));
try {
HttpEntity entity = this.plConn.sendToServer(qparams, "/rule/create");
CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
csv.setQuoteChar('"');
while (csv.readNext()) {
// System.out.println(csv.getRawRecord());
plRule = new palorule(plConn, lDatabaseId, iCubeId, palohelpers.StringToInt(csv.get(0)), csv.get(1), csv.get(2),
csv.get(3), palohelpers.StringToLong(csv.get(4)), palohelpers.StringToBoolean(csv.get(5)));
paloRules.add(plRule);
}
csv.close();
entity.consumeContent();
return plRule;
} catch (Exception e) {
throw new paloexception(e.getMessage());
}
}
public static void main(String args[]) throws Exception {
paloconnection pcon = new paloconnection("admin", "admin", "localhost", "7777");
palodatabases pds = new palodatabases(pcon);
palodatabase pd = pds.createDatabase("PaloRuleTest");
palodimensions pdims = pd.getDimensions(0);
palodimension pdim = null;
palodimension pdim1 = null;
pdim = pdims.getDimension("Monat");
if (pdim == null) {
pdim = pdims.createDimension("Monat");
}
pdim1 = pdims.getDimension("D2");
if (pdim1 == null) {
pdim = pdims.createDimension("D2");
}
palocubes pcs = new palocubes(pcon, pd, 0);
if (pcs.getCube("cube1") == null) {
pcs.createCube("cube1", new String[] { "Monat", "D2" }, 0);
}
palorules pll = new palorules(pcon, pd.getDatabaseId(), pcs.getCube("cube1").getCubeId());
}
public static void main(String args[]) throws Exception {
paloconnection pcon = new paloconnection("admin", "admin", "localhost",
"7777");
palodatabases pds = new palodatabases(pcon);
palodatabase pd = pds.createDatabase("PaloRuleTest");
palodimensions pdims = pd.getDimensions(0);
palodimension pdim = null;
palodimension pdim1 = null;
pdim = pdims.getDimension("Monat");
if (pdim == null)
pdim = pdims.createDimension("Monat");
pdim1 = pdims.getDimension("D2");
if (pdim1 == null)
pdim = pdims.createDimension("D2");
palocubes pcs = new palocubes(pcon, pd, 0);
if (pcs.getCube("cube1") == null)
pcs.createCube("cube1", new String[] { "Monat", "D2" }, 0);
palorules pll = new palorules(pcon, pd.getDatabaseId(), pcs.getCube(
"cube1").getCubeId());
}
}

View File

@@ -15,7 +15,7 @@
<path id="compile.classpath">
<pathelement location="${component.plugin.home}/tSalesforceBulkExec/partnerBulk.jar" />
<pathelement location="${component.plugin.home}/tSalesforceBulkExec/wsc.jar" />
<pathelement location="${component.plugin.home}/tFileInputDelimited/talendcsv.jar" />
<pathelement location="${component.plugin.home}/tFileInputDelimited/javacsv.jar" />
</path>
<!-- #################################################### -->

View File

@@ -2,228 +2,167 @@ package com.sforce.soap.partner;
/** * Generated class, please do not edit. */
public class ChildRelationship implements com.sforce.ws.bind.XMLizable {
/** * Constructor */
public ChildRelationship() {
}
/**
* * element : cascadeDelete of type
* {http://www.w3.org/2001/XMLSchema}boolean * java type: boolean
*/
private static final com.sforce.ws.bind.TypeInfo cascadeDelete__typeInfo = new com.sforce.ws.bind.TypeInfo(
"urn:partner.soap.sforce.com", "cascadeDelete",
"http://www.w3.org/2001/XMLSchema", "boolean", 1, 1, true);
private boolean cascadeDelete__is_set = false;
private boolean cascadeDelete;
/** * Constructor */
public ChildRelationship() {
}
public boolean getCascadeDelete() {
return cascadeDelete;
}
/** * element : cascadeDelete of type {http://www.w3.org/2001/XMLSchema}boolean * java type: boolean */
private static final com.sforce.ws.bind.TypeInfo cascadeDelete__typeInfo = new com.sforce.ws.bind.TypeInfo(
"urn:partner.soap.sforce.com", "cascadeDelete", "http://www.w3.org/2001/XMLSchema", "boolean", 1, 1, true);
public boolean isCascadeDelete() {
return cascadeDelete;
}
private boolean cascadeDelete__is_set = false;
public void setCascadeDelete(boolean cascadeDelete) {
this.cascadeDelete = cascadeDelete;
cascadeDelete__is_set = true;
}
private boolean cascadeDelete;
/**
* * element : childSObject of type {http://www.w3.org/2001/XMLSchema}string
* * java type: java.lang.String
*/
private static final com.sforce.ws.bind.TypeInfo childSObject__typeInfo = new com.sforce.ws.bind.TypeInfo(
"urn:partner.soap.sforce.com", "childSObject",
"http://www.w3.org/2001/XMLSchema", "string", 1, 1, true);
private boolean childSObject__is_set = false;
private java.lang.String childSObject;
public boolean getCascadeDelete() {
return cascadeDelete;
}
public java.lang.String getChildSObject() {
return childSObject;
}
public boolean isCascadeDelete() {
return cascadeDelete;
}
public void setChildSObject(java.lang.String childSObject) {
this.childSObject = childSObject;
childSObject__is_set = true;
}
public void setCascadeDelete(boolean cascadeDelete) {
this.cascadeDelete = cascadeDelete;
cascadeDelete__is_set = true;
}
/**
* * element : deprecatedAndHidden of type
* {http://www.w3.org/2001/XMLSchema}boolean * java type: boolean
*/
private static final com.sforce.ws.bind.TypeInfo deprecatedAndHidden__typeInfo = new com.sforce.ws.bind.TypeInfo(
"urn:partner.soap.sforce.com", "deprecatedAndHidden",
"http://www.w3.org/2001/XMLSchema", "boolean", 1, 1, true);
private boolean deprecatedAndHidden__is_set = false;
private boolean deprecatedAndHidden;
/** * element : childSObject of type {http://www.w3.org/2001/XMLSchema}string * java type: java.lang.String */
private static final com.sforce.ws.bind.TypeInfo childSObject__typeInfo = new com.sforce.ws.bind.TypeInfo(
"urn:partner.soap.sforce.com", "childSObject", "http://www.w3.org/2001/XMLSchema", "string", 1, 1, true);
public boolean getDeprecatedAndHidden() {
return deprecatedAndHidden;
}
private boolean childSObject__is_set = false;
public boolean isDeprecatedAndHidden() {
return deprecatedAndHidden;
}
private java.lang.String childSObject;
public void setDeprecatedAndHidden(boolean deprecatedAndHidden) {
this.deprecatedAndHidden = deprecatedAndHidden;
deprecatedAndHidden__is_set = true;
}
public java.lang.String getChildSObject() {
return childSObject;
}
/**
* * element : field of type {http://www.w3.org/2001/XMLSchema}string * java
* type: java.lang.String
*/
private static final com.sforce.ws.bind.TypeInfo field__typeInfo = new com.sforce.ws.bind.TypeInfo(
"urn:partner.soap.sforce.com", "field",
"http://www.w3.org/2001/XMLSchema", "string", 1, 1, true);
private boolean field__is_set = false;
private java.lang.String field;
public void setChildSObject(java.lang.String childSObject) {
this.childSObject = childSObject;
childSObject__is_set = true;
}
public java.lang.String getField() {
return field;
}
/** * element : deprecatedAndHidden of type {http://www.w3.org/2001/XMLSchema}boolean * java type: boolean */
private static final com.sforce.ws.bind.TypeInfo deprecatedAndHidden__typeInfo = new com.sforce.ws.bind.TypeInfo(
"urn:partner.soap.sforce.com", "deprecatedAndHidden", "http://www.w3.org/2001/XMLSchema", "boolean", 1, 1, true);
public void setField(java.lang.String field) {
this.field = field;
field__is_set = true;
}
private boolean deprecatedAndHidden__is_set = false;
/**
* * element : relationshipName of type
* {http://www.w3.org/2001/XMLSchema}string * java type: java.lang.String
*/
private static final com.sforce.ws.bind.TypeInfo relationshipName__typeInfo = new com.sforce.ws.bind.TypeInfo(
"urn:partner.soap.sforce.com", "relationshipName",
"http://www.w3.org/2001/XMLSchema", "string", 0, 1, true);
private boolean relationshipName__is_set = false;
private java.lang.String relationshipName;
private boolean deprecatedAndHidden;
public java.lang.String getRelationshipName() {
return relationshipName;
}
public boolean getDeprecatedAndHidden() {
return deprecatedAndHidden;
}
public void setRelationshipName(java.lang.String relationshipName) {
this.relationshipName = relationshipName;
relationshipName__is_set = true;
}
public boolean isDeprecatedAndHidden() {
return deprecatedAndHidden;
}
/**
* * element : restrictedDelete of type
* {http://www.w3.org/2001/XMLSchema}boolean * java type: boolean
*/
private static final com.sforce.ws.bind.TypeInfo restrictedDelete__typeInfo = new com.sforce.ws.bind.TypeInfo(
"urn:partner.soap.sforce.com", "restrictedDelete",
"http://www.w3.org/2001/XMLSchema", "boolean", 0, 1, true);
private boolean restrictedDelete__is_set = false;
private boolean restrictedDelete;
public void setDeprecatedAndHidden(boolean deprecatedAndHidden) {
this.deprecatedAndHidden = deprecatedAndHidden;
deprecatedAndHidden__is_set = true;
}
public boolean getRestrictedDelete() {
return restrictedDelete;
}
/** * element : field of type {http://www.w3.org/2001/XMLSchema}string * java type: java.lang.String */
private static final com.sforce.ws.bind.TypeInfo field__typeInfo = new com.sforce.ws.bind.TypeInfo(
"urn:partner.soap.sforce.com", "field", "http://www.w3.org/2001/XMLSchema", "string", 1, 1, true);
public boolean isRestrictedDelete() {
return restrictedDelete;
}
private boolean field__is_set = false;
public void setRestrictedDelete(boolean restrictedDelete) {
this.restrictedDelete = restrictedDelete;
restrictedDelete__is_set = true;
}
private java.lang.String field;
/** */
public void write(javax.xml.namespace.QName __element,
com.sforce.ws.parser.XmlOutputStream __out,
com.sforce.ws.bind.TypeMapper __typeMapper)
throws java.io.IOException {
__out.writeStartTag(__element.getNamespaceURI(),
__element.getLocalPart());
writeFields(__out, __typeMapper);
__out.writeEndTag(__element.getNamespaceURI(), __element.getLocalPart());
}
public java.lang.String getField() {
return field;
}
protected void writeFields(com.sforce.ws.parser.XmlOutputStream __out,
com.sforce.ws.bind.TypeMapper __typeMapper)
throws java.io.IOException {
__typeMapper.writeBoolean(__out, cascadeDelete__typeInfo,
cascadeDelete, cascadeDelete__is_set);
__typeMapper.writeString(__out, childSObject__typeInfo, childSObject,
childSObject__is_set);
__typeMapper.writeBoolean(__out, deprecatedAndHidden__typeInfo,
deprecatedAndHidden, deprecatedAndHidden__is_set);
__typeMapper.writeString(__out, field__typeInfo, field, field__is_set);
__typeMapper.writeString(__out, relationshipName__typeInfo,
relationshipName, relationshipName__is_set);
__typeMapper.writeBoolean(__out, restrictedDelete__typeInfo,
restrictedDelete, restrictedDelete__is_set);
}
public void setField(java.lang.String field) {
this.field = field;
field__is_set = true;
}
public void load(com.sforce.ws.parser.XmlInputStream __in,
com.sforce.ws.bind.TypeMapper __typeMapper)
throws java.io.IOException, com.sforce.ws.ConnectionException {
__typeMapper.consumeStartTag(__in);
loadFields(__in, __typeMapper);
__typeMapper.consumeEndTag(__in);
}
/** * element : relationshipName of type {http://www.w3.org/2001/XMLSchema}string * java type: java.lang.String */
private static final com.sforce.ws.bind.TypeInfo relationshipName__typeInfo = new com.sforce.ws.bind.TypeInfo(
"urn:partner.soap.sforce.com", "relationshipName", "http://www.w3.org/2001/XMLSchema", "string", 0, 1, true);
protected void loadFields(com.sforce.ws.parser.XmlInputStream __in,
com.sforce.ws.bind.TypeMapper __typeMapper)
throws java.io.IOException, com.sforce.ws.ConnectionException {
__in.peekTag();
if (__typeMapper.verifyElement(__in, cascadeDelete__typeInfo)) {
setCascadeDelete((boolean) __typeMapper.readBoolean(__in,
cascadeDelete__typeInfo, boolean.class));
}
__in.peekTag();
if (__typeMapper.verifyElement(__in, childSObject__typeInfo)) {
setChildSObject((java.lang.String) __typeMapper.readString(__in,
childSObject__typeInfo, java.lang.String.class));
}
__in.peekTag();
if (__typeMapper.verifyElement(__in, deprecatedAndHidden__typeInfo)) {
setDeprecatedAndHidden((boolean) __typeMapper.readBoolean(__in,
deprecatedAndHidden__typeInfo, boolean.class));
}
__in.peekTag();
if (__typeMapper.verifyElement(__in, field__typeInfo)) {
setField((java.lang.String) __typeMapper.readString(__in,
field__typeInfo, java.lang.String.class));
}
__in.peekTag();
if (__typeMapper.isElement(__in, relationshipName__typeInfo)) {
setRelationshipName((java.lang.String) __typeMapper.readString(
__in, relationshipName__typeInfo, java.lang.String.class));
}
__in.peekTag();
if (__typeMapper.isElement(__in, restrictedDelete__typeInfo)) {
setRestrictedDelete((boolean) __typeMapper.readBoolean(__in,
restrictedDelete__typeInfo, boolean.class));
}
}
private boolean relationshipName__is_set = false;
public String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder();
sb.append("[ChildRelationship ");
sb.append(" cascadeDelete=");
sb.append("'" + com.sforce.ws.util.Verbose.toString(cascadeDelete)
+ "'\n");
sb.append(" childSObject=");
sb.append("'" + com.sforce.ws.util.Verbose.toString(childSObject)
+ "'\n");
sb.append(" deprecatedAndHidden=");
sb.append("'"
+ com.sforce.ws.util.Verbose.toString(deprecatedAndHidden)
+ "'\n");
sb.append(" field=");
sb.append("'" + com.sforce.ws.util.Verbose.toString(field) + "'\n");
sb.append(" relationshipName=");
sb.append("'" + com.sforce.ws.util.Verbose.toString(relationshipName)
+ "'\n");
sb.append(" restrictedDelete=");
sb.append("'" + com.sforce.ws.util.Verbose.toString(restrictedDelete)
+ "'\n");
sb.append("]\n");
return sb.toString();
}
}
private java.lang.String relationshipName;
public java.lang.String getRelationshipName() {
return relationshipName;
}
public void setRelationshipName(java.lang.String relationshipName) {
this.relationshipName = relationshipName;
relationshipName__is_set = true;
}
/** */
public void write(javax.xml.namespace.QName __element, com.sforce.ws.parser.XmlOutputStream __out,
com.sforce.ws.bind.TypeMapper __typeMapper) throws java.io.IOException {
__out.writeStartTag(__element.getNamespaceURI(), __element.getLocalPart());
writeFields(__out, __typeMapper);
__out.writeEndTag(__element.getNamespaceURI(), __element.getLocalPart());
}
protected void writeFields(com.sforce.ws.parser.XmlOutputStream __out, com.sforce.ws.bind.TypeMapper __typeMapper)
throws java.io.IOException {
__typeMapper.writeBoolean(__out, cascadeDelete__typeInfo, cascadeDelete, cascadeDelete__is_set);
__typeMapper.writeString(__out, childSObject__typeInfo, childSObject, childSObject__is_set);
__typeMapper.writeBoolean(__out, deprecatedAndHidden__typeInfo, deprecatedAndHidden, deprecatedAndHidden__is_set);
__typeMapper.writeString(__out, field__typeInfo, field, field__is_set);
__typeMapper.writeString(__out, relationshipName__typeInfo, relationshipName, relationshipName__is_set);
}
public void load(com.sforce.ws.parser.XmlInputStream __in, com.sforce.ws.bind.TypeMapper __typeMapper)
throws java.io.IOException, com.sforce.ws.ConnectionException {
__typeMapper.consumeStartTag(__in);
loadFields(__in, __typeMapper);
__typeMapper.consumeEndTag(__in);
}
protected void loadFields(com.sforce.ws.parser.XmlInputStream __in, com.sforce.ws.bind.TypeMapper __typeMapper)
throws java.io.IOException, com.sforce.ws.ConnectionException {
__in.peekTag();
if (__typeMapper.verifyElement(__in, cascadeDelete__typeInfo)) {
setCascadeDelete((boolean) __typeMapper.readBoolean(__in, cascadeDelete__typeInfo, boolean.class));
}
__in.peekTag();
if (__typeMapper.verifyElement(__in, childSObject__typeInfo)) {
setChildSObject((java.lang.String) __typeMapper.readString(__in, childSObject__typeInfo, java.lang.String.class));
}
__in.peekTag();
if (__typeMapper.verifyElement(__in, deprecatedAndHidden__typeInfo)) {
setDeprecatedAndHidden((boolean) __typeMapper.readBoolean(__in, deprecatedAndHidden__typeInfo, boolean.class));
}
__in.peekTag();
if (__typeMapper.verifyElement(__in, field__typeInfo)) {
setField((java.lang.String) __typeMapper.readString(__in, field__typeInfo, java.lang.String.class));
}
__in.peekTag();
if (__typeMapper.isElement(__in, relationshipName__typeInfo)) {
setRelationshipName((java.lang.String) __typeMapper.readString(__in, relationshipName__typeInfo,
java.lang.String.class));
}
}
public String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder();
sb.append("[ChildRelationship ");
sb.append(" cascadeDelete=");
sb.append("'" + com.sforce.ws.util.Verbose.toString(cascadeDelete) + "'\n");
sb.append(" childSObject=");
sb.append("'" + com.sforce.ws.util.Verbose.toString(childSObject) + "'\n");
sb.append(" deprecatedAndHidden=");
sb.append("'" + com.sforce.ws.util.Verbose.toString(deprecatedAndHidden) + "'\n");
sb.append(" field=");
sb.append("'" + com.sforce.ws.util.Verbose.toString(field) + "'\n");
sb.append(" relationshipName=");
sb.append("'" + com.sforce.ws.util.Verbose.toString(relationshipName) + "'\n");
sb.append("]\n");
return sb.toString();
}
}

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