Compare commits

...

80 Commits

Author SHA1 Message Date
wwang-talend
ec90da2ec4 fix(TPS-3319): tLogCatcher and tAssertCatcher cause compilation error
when used together
2019-08-12 11:18:02 +08:00
Vladimir Bogatyrov
257de029cc [TESB-24188] Route with datamapper components working in Studio and not working in Runtime
Enable "Edit routine dependencies" menu items for routes
2018-11-27 12:50:39 +02:00
hcyi
0b782891c1 fix(TUP-17556):remove the test classs since compilation failure. 2018-07-25 16:58:28 +08:00
wang wei
a913118af5 fix(TDI-40329): Constant String too long due to a large schema 2018-05-04 18:07:24 +08:00
Haiting Yin
cd705075ea TPS-2412 MDM transaction does not commit when multiple tMDMOutput used in same subjob (TMDM-11629) (#2229) (#2238) 2018-04-20 10:55:29 +08:00
zwxue
ec6aa5ab06 fix(TUP-18278):Could not find or load main class exception after (#1547) 2017-09-12 10:15:26 +08:00
SunChaoqun
423f53f552 TESB-18147:java.lang.NoSuchMethodError: org.springframework.core.MethodParameter.getContainingClass() (#926) (#1006)
* TESB-18147:java.lang.NoSuchMethodError:
org.springframework.core.MethodParameter.getContainingClass()

* TESB-18147:java.lang.NoSuchMethodError:
org.springframework.core.MethodParameter.getContainingClass()
2017-08-23 13:22:29 +08:00
hwang-talend
30ef6fc468 fix(TUP-18217):Testcase for tWriteJSONFiled gives junitGlobalMap cannot (#1509)
be resolved exception
2017-08-21 11:47:12 +08:00
wchen-talend
ed42bb5219 fix(TPS-2096):[6.2.1]tXMLMap miss some fields while import schema from
repository(TUP-18382)
2017-08-15 12:13:21 +08:00
kjwang-talend
ed5dbe18fa fix(TUP-17996):When Deploying one customer's job in CI, the build failed with error: constant string too long (#1403)
fix(TUP-17996):When Deploying one customer's job in CI, the build failed with error: constant string too long
https://jira.talendforge.org/browse/TUP-17996
2017-08-07 15:42:40 +08:00
wchen-talend
6a527e75fe fix(TUP-18128):joblets change not applied to all jobs automatically (#1459) 2017-08-01 15:17:26 +08:00
kjwang-talend
6cde2ae7d7 fix(TUP-17412): remote Runs from Studio Display Project Setting Log4jLevel (#1164) 2017-07-31 17:57:38 +08:00
nrousseau
feeafd4903 TUP-17326: fix tMap for bigdata, since it should not be as virtual (#1087)
component
2017-07-18 11:47:51 +08:00
hwang
d9da03b602 fix(TUP-17556):compile error 2017-07-03 14:42:47 +08:00
hwang
746ace2b5e fix(TUP-17556):compile error 2017-07-03 14:42:21 +08:00
hwang-talend
b73c932d4d fix(TUP-17556):Changes to a tmap in an expanded joblet from a job does not get saved 2017-07-03 14:08:38 +08:00
hwang-talend
d3173d80a5 fix(TUP-17556):Changes to a tmap in an expanded joblet from a job does (#1268)
not get saved
2017-07-03 14:08:19 +08:00
hwang
097fbee0be fix(TUP-17600):Label on lookup from joblet to another joblet is removed 2017-07-03 13:58:15 +08:00
ycbai
7deff74377 TUP-16211: NPE error when main spark job ues ref project hadoop cluster 2017-05-23 17:28:32 +08:00
hwang-talend
e5e4b7a51d fix(TUP-17255):Context groups once edited, changes it name. (#1167) 2017-05-02 11:13:23 +08:00
hwang
2dd0069b6c TUP-17255:Context groups once edited, changes it name. 2017-05-02 11:10:56 +08:00
hwang
1ed0c7f097 TUP-17255:Context groups once edited, changes it name.
Conflicts:
	main/plugins/org.talend.repository/plugin.xml
2017-05-02 11:06:37 +08:00
Yucheng Bai
cf641aedc5 TUP-16441: Issue with opening job with context group in Salesforce (#829)
component.
2017-04-11 11:48:01 +08:00
Yucheng Bai
a88465f325 TUP-16774: File Widget of session directory in metadata for salesforce (#937) 2017-04-11 11:47:00 +08:00
jzhao
f6e06eb32b fix(TDI-38377): add migration for salesforce api version (#1047) 2017-04-11 11:44:48 +08:00
ycbai
52b21db1d1 TUP-17095: Job is not properly built when the reference project is
presented
2017-03-31 16:15:06 +08:00
jzhao
084fac454e feat(TDI-35748):salesforce connection save and reuse session
* migration from old framework
* add directory mapping with widget type
2017-03-29 13:25:15 +08:00
zwxue
a55eafdf22 TDI-36420: "apply context to children" doesn't work for the published
normal task in TAC.
2017-03-27 16:39:07 +08:00
ycbai
538a77015b TUP-17176: set modules from "HOTLIBS" as dynamic. 2017-03-22 17:43:53 +08:00
hwang-talend
ddee810392 TUP-17194:Error with a job using nested joblets with MDM components (#1041) 2017-03-15 10:57:02 +08:00
jzhao
273ed94100 fix(TDI-38056):add iterator line for new framework components. (#986) 2017-03-14 14:55:59 +08:00
iwangtalend
8a29ce0cca Merge pull request #1033 from Talend/feature/DEVOPS-1729/patch/6.2.1_nexus
DEVOPS-1729 Nexus migration: Update URLs [patch/6.2.1]
2017-03-02 16:42:01 +01:00
build-talend
3baad3ccb4 DEVOPS-1729 Nexus migration: Update URLs 2017-03-02 16:32:15 +01:00
Pingwen Lin
000d0a7303 TPS-1761 [6.2.1]Data Services with MDM Connection - behaviour change from 6.1.1(TMDM-10433)
TMDM-10433 : Data Services with MDM Connection - behaviour change from 6.1.1 (#915)
2017-03-01 14:06:15 +08:00
Haiting Yin
7ff2c1ed85 TPS-1782 [6.2.1]the job throw compile error while checking 'Extended output' for tMDMOutput(TMDM-10544)
TMDM-10151 Uncheck Fire a Create/Update event option would happen compile error (#717)
2017-02-24 11:24:04 +08:00
GGu
f29a245b37 TUP-17139: fixed the problem for wrong renaming expression 2017-02-22 11:47:28 +08:00
hwang
353ddf4c81 TUP-17093:[Talend Studio] Compilation error not shown on a box 2017-02-22 10:54:19 +08:00
hwang
628b9823d0 TUP-17093:[Talend Studio] Compilation error not shown on a box 2017-02-22 10:53:25 +08:00
jzhao
e43eddc640 Revert "fix(TDI-37987): tMicrosoftCrmOutput has NullPointerException"
This reverts commit 07dbb2290b and
7324909e47
2017-02-21 14:36:54 +08:00
Dmytro Chmyga
7324909e47 fix(TDI-37987): tMicrosoftCrmOutput has NullPointerException
* Add migration task
2017-02-16 15:23:01 +02:00
Dmytro Chmyga
07dbb2290b fix(TDI-37987): tMicrosoftCrmOutput has NullPointerException
* Add "Ignore null" property

* Add ignoring null values code

* Add fix for NPE when set primitive value from null(Online 2011 API)
2017-02-16 15:22:06 +02:00
cmeng-talend
0d9fcd37aa TUP-17099 fix: Studio blocked after click refresh button
https://jira.talendforge.org/browse/TUP-17099
2017-02-14 20:04:09 +08:00
cmeng-talend
04e548767d TUP-16616 fix: Error "java.util.ConcurrentModificationException" when
connecting to studio
https://jira.talendforge.org/browse/TUP-16616
2017-01-18 17:13:40 +08:00
zwxue
05b930b03c TUP-16573: cmdline generate time increase as the tasks number increase. 2017-01-10 10:38:55 +08:00
ycbai
57129a397b TUP-16619: SFTP problems related to the migration from 5.2.1 to 6.2.1 2017-01-05 10:52:04 +08:00
hwang
9ae828aff5 TUP-16297:Importing a Job from 5.5 to 6.2 throws errors on ftp component 2017-01-04 16:49:10 +08:00
hwang
9070781c2f TUP-16590:[6.2.1] Nested Joblets cause code generation failures for 2016-12-29 17:15:40 +08:00
hwang
b4a3af4f67 TUP-16590:[6.2.1] Nested Joblets cause code generation failures for 2016-12-29 15:22:57 +08:00
ycbai
48f72b11d7 TUP-15848: tRowGenerator Not Saving DataMasking Parameters 2016-12-20 16:53:16 +08:00
GGu
46220f02bc TUP-16324: Enhance the dialog to use dynamic jobs. 2016-12-19 11:31:18 +08:00
hwang
13c80b2c88 TUP-16104:[6.2.1] Get error in the tRedshiftInput when Guess Schema
selected
2016-12-19 11:15:59 +08:00
hwang
f0da35cf60 TUP-16104:[6.2.1] Get error in the tRedshiftInput when Guess Schema
selected
2016-12-19 11:15:45 +08:00
GGu
2537ae8e2e TUP-4922: If resources folder is not existed, will create it 2016-12-05 18:35:32 +08:00
Yucheng Bai
b55cf75135 TUP-16317: migration : password of implicit context Load project (#795)
settings wrongly handled.
2016-11-28 18:22:35 +08:00
nrousseau
0627124947 TUP-15998: Improve build speed for jobs
# Conflicts:
#	main/plugins/org.talend.designer.runprocess/src/main/java/org/talend/designer/runprocess/java/TalendProcessJavaProject.java

Conflicts:
	main/plugins/org.talend.designer.runprocess/src/main/java/org/talend/designer/runprocess/java/TalendProcessJavaProject.java
2016-11-16 16:01:07 +08:00
Yucheng Bai
190450f915 TUP-16192: Propagating tSalesForceInputs Schema Changes Are Destroying tMap Mappings (#749)
* TUP-16192: Propagating tSalesForceInputs Schema Changes Are Destroying
tMap Mappings

* TUP-16192: Consider schema propagated is true for new components.
2016-11-15 17:46:59 +08:00
wchen-talend
86c77c0416 TPS-1605:[6.2.1]Guess Schema for tJDBCInput/tSAPHanaInput does not work
for SAP HANA tables(TUP-15996)
2016-10-25 11:34:31 +08:00
hwang
2fb6ef6e53 TUP-14724:The build folder structure was change in 6.2.1
Conflicts:
	main/plugins/org.talend.repository/src/main/java/org/talend/repository/ui/wizards/exportjob/JobScriptsExportWizardPage.java
2016-10-10 13:31:54 +08:00
nrousseau
b1311bcd54 TDI-37164: avoid to check the generated process 2016-09-13 18:17:31 +08:00
nrousseau
b271f83c1c TDI-36930: force to refresh the target folder 2016-09-13 18:05:47 +08:00
nrousseau
45afa66efd TDI-36930: Improve performances during the build (#610) 2016-09-13 18:05:16 +08:00
GGu
3aa3e47855 TDI-36930: Only format main job and check compile error after build 2016-09-13 18:04:25 +08:00
wchen-talend
eb1301dccf TPS-1501:[6.2.1] Allow manual/edit git merge (TUP-4819) 2016-08-29 16:49:58 +08:00
cmeng-talend
ac1022bc79 TUP-5221 fix: shouldn't do update when logon local mode project
https://jira.talendforge.org/browse/TUP-5221
2016-08-24 17:12:45 +08:00
cmeng-talend
cd3a00d088 TUP-5221 fix: shouldn't do update when logon local mode project
https://jira.talendforge.org/browse/TUP-5221
2016-08-23 10:30:57 +08:00
ycbai
164fcde5b0 TUP-5009: [6.1.1] Export Context on Metadata Hadoop Connection erroneous
behavior when HA properties
2016-07-29 15:21:07 +08:00
Pierre Teyssier
9335d70831 Revert "TDI-36822: NPE in tDatasetOutput when performing a full run on a live"
This reverts commit 471fe65fb5.
2016-07-06 17:31:23 +08:00
Irene Wang
9a5d16c730 DEVOPS-667 Update NOTICE file 2016-07-05 12:08:53 +02:00
wdliu
a32215f49e TUP-4998:Git:There is error when logon branch 2016-07-04 18:55:37 +08:00
wdliu
fa2e0bf792 TUP-4998:Git:There is error when logon branch 2016-07-04 18:55:34 +08:00
Remy Dubois
d68cf06314 TUP-4994 - compile the job and the routines with JDT in order to make the maven package work with a JRE 2016-07-04 12:41:06 +02:00
nrousseau
52b889c93b Merge pull request #549 from Talend/bugfix/6.2.1/TDI-36770_fixRoutineRefresh
TDI-36770: fix dirty on routines
2016-07-04 18:35:54 +08:00
wang wei
471fe65fb5 TDI-36822: NPE in tDatasetOutput when performing a full run on a live
dataset
https://jira.talendforge.org/browse/TDI-36822
2016-07-04 18:34:14 +08:00
nrousseau
f79830afa4 TDI-36770: fix dirty on routines 2016-07-02 17:36:13 +08:00
wdliu
2785036086 TDI-36731: sometimes can't retrieve remote project on login page 2016-07-01 16:22:16 +08:00
jzhao
d189eab24e TUP-4964: New framework dynamic long to date convert issue
https://jira.talendforge.org/browse/TUP-4964
2016-07-01 14:51:34 +08:00
ycbai
9030083da6 TDI-36776: Component Framework :Salesforce: when export to context, the
name of the context will change to context mode too.
2016-06-30 19:55:12 +08:00
cmeng-talend
3daf9e5f0d TDI-36772 fix: No response when click restart button when I start studio
with cutom workspace
https://jira.talendforge.org/browse/TDI-36772
2016-06-30 19:48:31 +08:00
GGu
975352f4d1 TDI-36717: When generete codes, need check children job 2016-06-30 19:28:52 +08:00
nhaumont
6a28240d32 Set versions for 6.2.1 2016-06-27 16:12:27 +02:00
251 changed files with 5608 additions and 1827 deletions

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>6.2.1-SNAPSHOT</version> <version>6.2.1</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.componentdesigner.nl</artifactId> <artifactId>org.talend.componentdesigner.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>6.2.1-SNAPSHOT</version> <version>6.2.1</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.componentdesigner.rcp.nl</artifactId> <artifactId>org.talend.componentdesigner.rcp.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>6.2.1-SNAPSHOT</version> <version>6.2.1</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.designer.abstractmap.nl</artifactId> <artifactId>org.talend.designer.abstractmap.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>6.2.1-SNAPSHOT</version> <version>6.2.1</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.designer.alfrescooutput.nl</artifactId> <artifactId>org.talend.designer.alfrescooutput.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>6.2.1-SNAPSHOT</version> <version>6.2.1</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.designer.business.diagram.nl</artifactId> <artifactId>org.talend.designer.business.diagram.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>6.2.1-SNAPSHOT</version> <version>6.2.1</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.designer.codegen.nl</artifactId> <artifactId>org.talend.designer.codegen.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>6.2.1-SNAPSHOT</version> <version>6.2.1</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.designer.components.exchange.nl</artifactId> <artifactId>org.talend.designer.components.exchange.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>6.2.1-SNAPSHOT</version> <version>6.2.1</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.designer.core.nl</artifactId> <artifactId>org.talend.designer.core.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>6.2.1-SNAPSHOT</version> <version>6.2.1</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.designer.dbmap.nl</artifactId> <artifactId>org.talend.designer.dbmap.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>6.2.1-SNAPSHOT</version> <version>6.2.1</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.designer.documentation.nl</artifactId> <artifactId>org.talend.designer.documentation.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>6.2.1-SNAPSHOT</version> <version>6.2.1</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.designer.fileoutputxml.nl</artifactId> <artifactId>org.talend.designer.fileoutputxml.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>6.2.1-SNAPSHOT</version> <version>6.2.1</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.designer.gefabstractmap.nl</artifactId> <artifactId>org.talend.designer.gefabstractmap.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>6.2.1-SNAPSHOT</version> <version>6.2.1</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.designer.hl7.nl</artifactId> <artifactId>org.talend.designer.hl7.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>6.2.1-SNAPSHOT</version> <version>6.2.1</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.designer.mapper.nl</artifactId> <artifactId>org.talend.designer.mapper.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>6.2.1-SNAPSHOT</version> <version>6.2.1</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.designer.maven.job.nl</artifactId> <artifactId>org.talend.designer.maven.job.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>6.2.1-SNAPSHOT</version> <version>6.2.1</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.designer.rowgenerator.nl</artifactId> <artifactId>org.talend.designer.rowgenerator.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>6.2.1-SNAPSHOT</version> <version>6.2.1</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.designer.runprocess.nl</artifactId> <artifactId>org.talend.designer.runprocess.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>6.2.1-SNAPSHOT</version> <version>6.2.1</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.designer.scd.nl</artifactId> <artifactId>org.talend.designer.scd.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>6.2.1-SNAPSHOT</version> <version>6.2.1</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.designer.webservice.nl</artifactId> <artifactId>org.talend.designer.webservice.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>6.2.1-SNAPSHOT</version> <version>6.2.1</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.designer.xmlmap.nl</artifactId> <artifactId>org.talend.designer.xmlmap.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>6.2.1-SNAPSHOT</version> <version>6.2.1</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.expressionbuilder.nl</artifactId> <artifactId>org.talend.expressionbuilder.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>6.2.1-SNAPSHOT</version> <version>6.2.1</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.presentation.onboarding.resource.nl</artifactId> <artifactId>org.talend.presentation.onboarding.resource.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>6.2.1-SNAPSHOT</version> <version>6.2.1</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.presentation.onboarding.resource.tos.nl</artifactId> <artifactId>org.talend.presentation.onboarding.resource.tos.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>6.2.1-SNAPSHOT</version> <version>6.2.1</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.repository.ftp.nl</artifactId> <artifactId>org.talend.repository.ftp.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>6.2.1-SNAPSHOT</version> <version>6.2.1</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.repository.json.nl</artifactId> <artifactId>org.talend.repository.json.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>6.2.1-SNAPSHOT</version> <version>6.2.1</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.repository.nl</artifactId> <artifactId>org.talend.repository.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>6.2.1-SNAPSHOT</version> <version>6.2.1</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.repository.view.di.nl</artifactId> <artifactId>org.talend.repository.view.di.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>6.2.1-SNAPSHOT</version> <version>6.2.1</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.sbi.engines.client.nl</artifactId> <artifactId>org.talend.sbi.engines.client.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>6.2.1-SNAPSHOT</version> <version>6.2.1</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.spagic.engines.client.nl</artifactId> <artifactId>org.talend.spagic.engines.client.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>6.2.1-SNAPSHOT</version> <version>6.2.1</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.sqlbuilder.nl</artifactId> <artifactId>org.talend.sqlbuilder.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>6.2.1-SNAPSHOT</version> <version>6.2.1</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.componentdesigner.feature</artifactId> <artifactId>org.talend.componentdesigner.feature</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>6.2.1-SNAPSHOT</version> <version>6.2.1</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.designer.business.feature</artifactId> <artifactId>org.talend.designer.business.feature</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>6.2.1-SNAPSHOT</version> <version>6.2.1</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.designer.feature</artifactId> <artifactId>org.talend.designer.feature</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>6.2.1-SNAPSHOT</version> <version>6.2.1</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.rcp.branding.tos.feature</artifactId> <artifactId>org.talend.rcp.branding.tos.feature</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>6.2.1-SNAPSHOT</version> <version>6.2.1</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.rcp.branding.tos.test.feature</artifactId> <artifactId>org.talend.rcp.branding.tos.test.feature</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>6.2.1-SNAPSHOT</version> <version>6.2.1</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.repository.feature</artifactId> <artifactId>org.talend.repository.feature</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>6.2.1-SNAPSHOT</version> <version>6.2.1</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.sbi.feature</artifactId> <artifactId>org.talend.sbi.feature</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>6.2.1-SNAPSHOT</version> <version>6.2.1</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.spagic.feature</artifactId> <artifactId>org.talend.spagic.feature</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>6.2.1-SNAPSHOT</version> <version>6.2.1</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.tos.components.feature</artifactId> <artifactId>org.talend.tos.components.feature</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>6.2.1-SNAPSHOT</version> <version>6.2.1</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.tos.feature</artifactId> <artifactId>org.talend.tos.feature</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>6.2.1-SNAPSHOT</version> <version>6.2.1</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.tos.libraries.feature</artifactId> <artifactId>org.talend.tos.libraries.feature</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>6.2.1-SNAPSHOT</version> <version>6.2.1</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.componentdesigner.rcp</artifactId> <artifactId>org.talend.componentdesigner.rcp</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>6.2.1-SNAPSHOT</version> <version>6.2.1</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.componentdesigner</artifactId> <artifactId>org.talend.componentdesigner</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>6.2.1-SNAPSHOT</version> <version>6.2.1</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.designer.abstractmap</artifactId> <artifactId>org.talend.designer.abstractmap</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>6.2.1-SNAPSHOT</version> <version>6.2.1</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.designer.alfrescooutput</artifactId> <artifactId>org.talend.designer.alfrescooutput</artifactId>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>6.2.1-SNAPSHOT</version> <version>6.2.1</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.designer.business.diagram</artifactId> <artifactId>org.talend.designer.business.diagram</artifactId>

View File

@@ -1110,13 +1110,16 @@ if (execStat) {
<% if(exist_tMDM) { %> <% if(exist_tMDM) { %>
private void closeMDMConnections() { private void closeMDMConnections() {
try { try {
<% for (INode mdmComponent : mdmComponentsList) { %> java.util.Iterator keySets = globalMap.keySet().iterator();
org.talend.mdm.webservice.TMDMService service_<%=mdmComponent.getUniqueName() %> = (org.talend.mdm.webservice.TMDMService)globalMap.get("TMDMService_<%=mdmComponent.getUniqueName() %>"); while (keySets.hasNext()) {
if(service_<%=mdmComponent.getUniqueName() %> != null) String key = keySets.next().toString();
{ if (key.startsWith("TMDMService_tMDMConnection_")) {
service_<%=mdmComponent.getUniqueName() %>.logout(new org.talend.mdm.webservice.WSLogout()); org.talend.mdm.webservice.TMDMService service = (org.talend.mdm.webservice.TMDMService)globalMap.get(key);
} if (service != null) {
<% } %> service.logout(new org.talend.mdm.webservice.WSLogout());
}
}
}
} catch (java.lang.Exception e) { } catch (java.lang.Exception e) {
} }
} }
@@ -1228,12 +1231,14 @@ if (execStat) {
connections.put("connBaseDN_<%=ldapNode.getUniqueName() %>", globalMap.get("connBaseDN_<%=ldapNode.getUniqueName() %>")); connections.put("connBaseDN_<%=ldapNode.getUniqueName() %>", globalMap.get("connBaseDN_<%=ldapNode.getUniqueName() %>"));
<% } %> <% } %>
<% for (INode mdmNode : mdmComponentsList) {%> <% for (INode mdmNode : mdmComponentsList) {%>
connections.put("TMDMService_<%=mdmNode.getUniqueName() %>", globalMap.get("TMDMService_<%=mdmNode.getUniqueName() %>")); connections.put("mdmUrl_<%=mdmNode.getUniqueName() %>", globalMap.get("mdmUrl_<%=mdmNode.getUniqueName() %>"));
<% if( "false".equals(ElementParameterParser.getValue(mdmNode, "__AUTO_COMMIT__"))) {%> connections.put("username_<%=mdmNode.getUniqueName() %>", globalMap.get("username_<%=mdmNode.getUniqueName() %>"));
connections.put("mdmTransaction_<%=mdmNode.getUniqueName() %>", globalMap.get("mdmTransaction_<%=mdmNode.getUniqueName() %>")); connections.put("password_<%=mdmNode.getUniqueName() %>", globalMap.get("password_<%=mdmNode.getUniqueName() %>"));
<% } connections.put("useTransaction_<%=mdmNode.getUniqueName() %>", globalMap.get("useTransaction_<%=mdmNode.getUniqueName() %>"));
} %> connections.put("useClientTranId_<%=mdmNode.getUniqueName() %>", globalMap.get("useClientTranId_<%=mdmNode.getUniqueName() %>"));
<% } %>
<% for (INode paloNode : paloComponentsList) { %> <% for (INode paloNode : paloComponentsList) { %>
connections.put("p_<%=paloNode.getUniqueName() %>", globalMap.get("p_<%=paloNode.getUniqueName() %>")); connections.put("p_<%=paloNode.getUniqueName() %>", globalMap.get("p_<%=paloNode.getUniqueName() %>"));
connections.put("pConn_<%=paloNode.getUniqueName() %>", globalMap.get("pConn_<%=paloNode.getUniqueName() %>")); connections.put("pConn_<%=paloNode.getUniqueName() %>", globalMap.get("pConn_<%=paloNode.getUniqueName() %>"));

View File

@@ -65,6 +65,8 @@ List<Component.CodegenPropInfo> propsToProcess = component.getCodegenPropInfos(c
(<%= componentProps.getClass().getName()%>) def_<%=cid %>.createRuntimeProperties(); (<%= componentProps.getClass().getName()%>) def_<%=cid %>.createRuntimeProperties();
<% <%
int schemaIndex = 0;
for (Component.CodegenPropInfo propInfo : propsToProcess) { // propInfo for (Component.CodegenPropInfo propInfo : propsToProcess) { // propInfo
List<NamedThing> properties = propInfo.props.getProperties(); List<NamedThing> properties = propInfo.props.getProperties();
for (NamedThing prop : properties) { // property for (NamedThing prop : properties) { // property
@@ -116,9 +118,59 @@ for (Component.CodegenPropInfo propInfo : propsToProcess) { // propInfo
<%=property.getType()%>.<%=property.getValue()%>); <%=property.getType()%>.<%=property.getValue()%>);
<% <%
} else if (property instanceof org.talend.daikon.properties.property.SchemaProperty) { } else if (property instanceof org.talend.daikon.properties.property.SchemaProperty) {
String schemaValue = component.getCodegenValue(property, property.getStringValue());
String[] splits = schemaValue.split("(?=\\\\\"name\\\\\":)");
%> %>
class SchemaSettingTool_<%=cid%>_<%=++schemaIndex%> {
String getSchemaValue() {
<%
if((splits == null) || (splits.length < 2)) {
%>
return <%=schemaValue%>;
<%
} else {
%>
StringBuilder s = new StringBuilder();
<%
for(int i=0; i<splits.length; i++) {
String currentSplit = splits[i];
if(i == 0) {
%>
a(<%=currentSplit%>",s);
<%
continue;
}
if(i == (splits.length - 1)) {
%>
a("<%=currentSplit%>,s);
<%
continue;
}
%>
a("<%=currentSplit%>",s);
<%
}
%>
return s.toString();
<%
}
%>
}
void a(String part, StringBuilder strB) {
strB.append(part);
}
}
SchemaSettingTool_<%=cid%>_<%=schemaIndex%> sst_<%=cid%>_<%=schemaIndex%> = new SchemaSettingTool_<%=cid%>_<%=schemaIndex%>();
props_<%=cid %><%=propInfo.fieldName%>.setValue("<%=property.getName()%>", props_<%=cid %><%=propInfo.fieldName%>.setValue("<%=property.getName()%>",
new org.apache.avro.Schema.Parser().parse(<%=component.getCodegenValue(property, property.getStringValue())%>)); new org.apache.avro.Schema.Parser().parse(sst_<%=cid%>_<%=schemaIndex%>.getSchemaValue()));
<% <%
} else if (!(value instanceof String) || !((String)value).equals("")) { // if } else if (!(value instanceof String) || !((String)value).equals("")) { // if
%> %>

View File

@@ -118,27 +118,52 @@ class IndexedRecordToRowStructGenerator {
dynamicMetadata_<%=cid%>.setName(childDynamic_<%=cid%>.name()); dynamicMetadata_<%=cid%>.setName(childDynamic_<%=cid%>.name());
dynamicMetadata_<%=cid%>.setDbName(childDynamic_<%=cid%>.name()); dynamicMetadata_<%=cid%>.setDbName(childDynamic_<%=cid%>.name());
String talendType_<%=cid%> = null; String talendType_<%=cid%> = null;
if (childDynamic_<%=cid%>.schema().getType() == org.apache.avro.Schema.Type.ARRAY) { org.apache.avro.Schema.Type type_<%=cid%> = childDynamic_<%=cid%>.schema().getType();
if(type_<%=cid%> == org.apache.avro.Schema.Type.UNION){
java.util.List<org.apache.avro.Schema> fieldTypes_<%=cid%> = childDynamic_<%=cid%>.schema().getTypes();
for(org.apache.avro.Schema fieldType_<%=cid%>:fieldTypes_<%=cid%>){
if(fieldType_<%=cid%>.getType() == org.apache.avro.Schema.Type.NULL){
dynamicMetadata_<%=cid%>.setNullable(true);
}else{
type_<%=cid%> = fieldType_<%=cid%>.getType();
}
}
}
if (type_<%=cid%> == org.apache.avro.Schema.Type.ARRAY) {
talendType_<%=cid%> = "<%=JavaTypesManager.LIST.getId()%>"; talendType_<%=cid%> = "<%=JavaTypesManager.LIST.getId()%>";
} else if (childDynamic_<%=cid%>.schema().getType() == org.apache.avro.Schema.Type.BOOLEAN) { } else if (type_<%=cid%> == org.apache.avro.Schema.Type.BOOLEAN) {
talendType_<%=cid%> = "<%=JavaTypesManager.BOOLEAN.getId()%>"; talendType_<%=cid%> = "<%=JavaTypesManager.BOOLEAN.getId()%>";
} else if (childDynamic_<%=cid%>.schema().getType() == org.apache.avro.Schema.Type.BYTES) { } else if (type_<%=cid%> == org.apache.avro.Schema.Type.BYTES) {
talendType_<%=cid%> = "<%=JavaTypesManager.BYTE_ARRAY.getId()%>"; talendType_<%=cid%> = "<%=JavaTypesManager.BYTE_ARRAY.getId()%>";
} else if (childDynamic_<%=cid%>.schema().getType() == org.apache.avro.Schema.Type.FIXED) { } else if (type_<%=cid%> == org.apache.avro.Schema.Type.FIXED) {
talendType_<%=cid%> = "<%=JavaTypesManager.BYTE_ARRAY.getId()%>"; talendType_<%=cid%> = "<%=JavaTypesManager.BYTE_ARRAY.getId()%>";
} else if (childDynamic_<%=cid%>.schema().getType() == org.apache.avro.Schema.Type.DOUBLE) { } else if (type_<%=cid%> == org.apache.avro.Schema.Type.DOUBLE) {
talendType_<%=cid%> = "<%=JavaTypesManager.DOUBLE.getId()%>"; talendType_<%=cid%> = "<%=JavaTypesManager.DOUBLE.getId()%>";
} else if (childDynamic_<%=cid%>.schema().getType() == org.apache.avro.Schema.Type.FLOAT) { } else if (type_<%=cid%> == org.apache.avro.Schema.Type.FLOAT) {
talendType_<%=cid%> = "<%=JavaTypesManager.FLOAT.getId()%>"; talendType_<%=cid%> = "<%=JavaTypesManager.FLOAT.getId()%>";
} else if (childDynamic_<%=cid%>.schema().getType() == org.apache.avro.Schema.Type.INT) { } else if (type_<%=cid%> == org.apache.avro.Schema.Type.INT) {
talendType_<%=cid%> = "<%=JavaTypesManager.INTEGER.getId()%>"; talendType_<%=cid%> = "<%=JavaTypesManager.INTEGER.getId()%>";
} else if (childDynamic_<%=cid%>.schema().getType() == org.apache.avro.Schema.Type.LONG) { } else if (type_<%=cid%> == org.apache.avro.Schema.Type.LONG) {
talendType_<%=cid%> = "<%=JavaTypesManager.LONG.getId()%>"; String pattern_<%=cid%> = childDynamic_<%=cid%>.getProp(org.talend.daikon.di.DiSchemaConstants.TALEND6_COLUMN_PATTERN);
} else if (childDynamic_<%=cid%>.schema().getType() == org.apache.avro.Schema.Type.ENUM) { if(pattern_<%=cid%>!=null && !pattern_<%=cid%>.trim().isEmpty()){
talendType_<%=cid%> = "<%=JavaTypesManager.DATE.getId()%>";
dynamicMetadata_<%=cid%>.setFormat(pattern_<%=cid%>);
}else{
talendType_<%=cid%> = "<%=JavaTypesManager.LONG.getId()%>";
}
} else if (type_<%=cid%> == org.apache.avro.Schema.Type.ENUM) {
talendType_<%=cid%> = "<%=JavaTypesManager.STRING.getId()%>"; talendType_<%=cid%> = "<%=JavaTypesManager.STRING.getId()%>";
} else if (childDynamic_<%=cid%>.schema().getType() == org.apache.avro.Schema.Type.STRING) { } else if (type_<%=cid%> == org.apache.avro.Schema.Type.STRING) {
talendType_<%=cid%> = "<%=JavaTypesManager.STRING.getId()%>"; talendType_<%=cid%> = "<%=JavaTypesManager.STRING.getId()%>";
} }
Object length_<%=cid%> = childDynamic_<%=cid%>.getProp(org.talend.daikon.di.DiSchemaConstants.TALEND6_COLUMN_LENGTH);
if(length_<%=cid%> != null){
dynamicMetadata_<%=cid%>.setLength(Integer.parseInt(String.valueOf(length_<%=cid%>)));
}
Object precision_<%=cid%> = childDynamic_<%=cid%>.getProp(org.talend.daikon.di.DiSchemaConstants.TALEND6_COLUMN_PRECISION);
if(precision_<%=cid%> != null){
dynamicMetadata_<%=cid%>.setPrecision(Integer.parseInt(String.valueOf(precision_<%=cid%>)));
}
dynamicMetadata_<%=cid%>.setType(talendType_<%=cid%>); dynamicMetadata_<%=cid%>.setType(talendType_<%=cid%>);
<%=codeVarDynamic%>.metadatas.add(dynamicMetadata_<%=cid%>); <%=codeVarDynamic%>.metadatas.add(dynamicMetadata_<%=cid%>);
} }

View File

@@ -304,6 +304,13 @@ public <%=JavaTypesManager.getTypeToGenerate(ctxParam.getType(),true)%> get<%=Ch
if(isRunInMultiThread || NodeUtil.containsMultiThreadComponent(process)){ if(isRunInMultiThread || NodeUtil.containsMultiThreadComponent(process)){
%> %>
private final java.util.Map<String, Object> globalMap = java.util.Collections.synchronizedMap(new java.util.HashMap<String, Object>()); private final java.util.Map<String, Object> globalMap = java.util.Collections.synchronizedMap(new java.util.HashMap<String, Object>());
<%
if(ProcessUtils.isTestContainer(process)) {
%>
private final static java.util.Map<String, Object> junitGlobalMap = java.util.Collections.synchronizedMap(new java.util.HashMap<String, Object>());
<%
}
%>
<% <%
} else { } else {
%> %>
@@ -480,6 +487,7 @@ private class TalendException extends Exception {
if(!(e instanceof TDieException)){ if(!(e instanceof TDieException)){
<% <%
boolean needCatchTalendException = false;
if (process.getNodesOfType("tLogCatcher").size() > 0) { if (process.getNodesOfType("tLogCatcher").size() > 0) {
List<INode> logCatchers = (List<INode>)process.getNodesOfType("tLogCatcher"); List<INode> logCatchers = (List<INode>)process.getNodesOfType("tLogCatcher");
for (INode logCatcher : logCatchers) { for (INode logCatcher : logCatchers) {
@@ -511,6 +519,7 @@ private class TalendException extends Exception {
if (ElementParameterParser.getValue(logCatcher, "__CATCH_JAVA_EXCEPTION__").equals("true")) { if (ElementParameterParser.getValue(logCatcher, "__CATCH_JAVA_EXCEPTION__").equals("true")) {
if(logCatcher!=virtualNCatchNode){ if(logCatcher!=virtualNCatchNode){
// 2) launch logCatcher subProcess // 2) launch logCatcher subProcess
needCatchTalendException = true;
%> %>
<%=logCatcher.getDesignSubjobStartNode().getUniqueName() %>Process(globalMap); <%=logCatcher.getDesignSubjobStartNode().getUniqueName() %>Process(globalMap);
<% <%
@@ -523,6 +532,7 @@ private class TalendException extends Exception {
<% <%
} }
if(virtualNCatchNode!=null){ if(virtualNCatchNode!=null){
needCatchTalendException = true;
%> %>
<%=virtualNCatchNode.getDesignSubjobStartNode().getUniqueName() %>Process(globalMap); <%=virtualNCatchNode.getDesignSubjobStartNode().getUniqueName() %>Process(globalMap);
<% <%
@@ -536,31 +546,13 @@ private class TalendException extends Exception {
%> %>
} }
<% <%
boolean needCatchTalendException = false;
if (process.getNodesOfType("tLogCatcher").size() > 0) {
for(INode node:process.getNodesOfType("tLogCatcher")){
if(ElementParameterParser.getValue(node, "__CATCH_JAVA_EXCEPTION__").equals("true")){
needCatchTalendException = true;
break;
}
}
}
if ((!needCatchTalendException) && (process.getNodesOfType("tAssertCatcher").size() > 0)) {
for(INode node:process.getNodesOfType("tAssertCatcher")){
if(ElementParameterParser.getValue(node, "__CATCH_JAVA_EXCEPTION__").equals("true")){
needCatchTalendException = true;
break;
}
}
}
if(needCatchTalendException) { if(needCatchTalendException) {
if (process.getNodesOfType("tLogCatcher").size() > 0) { //TODO should catch the TalendException in assertcatcher process? but before should not work too as use java reflect, this exception can't catch
%> %>
} catch (TalendException e) { } catch (TalendException e) {
// do nothing // do nothing
<% <%
}
} }
%> %>
} catch (Exception e) { } catch (Exception e) {

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>6.2.1-SNAPSHOT</version> <version>6.2.1</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.designer.codegen</artifactId> <artifactId>org.talend.designer.codegen</artifactId>

View File

@@ -20,6 +20,7 @@ import java.io.IOException;
import java.net.URL; import java.net.URL;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.Iterator; import java.util.Iterator;
@@ -99,7 +100,7 @@ public class ComponentsFactory implements IComponentsFactory {
private static Logger log = Logger.getLogger(ComponentsFactory.class); private static Logger log = Logger.getLogger(ComponentsFactory.class);
private static HashSet<IComponent> componentList = null; private static Set<IComponent> componentList = null;
private static HashSet<IComponent> customComponentList = null; private static HashSet<IComponent> customComponentList = null;
@@ -145,7 +146,7 @@ public class ComponentsFactory implements IComponentsFactory {
// TimeMeasure.measureActive = true; // TimeMeasure.measureActive = true;
// TimeMeasure.begin("initComponents"); // TimeMeasure.begin("initComponents");
componentList = new HashSet<IComponent>(); componentList = Collections.synchronizedSet(new HashSet<IComponent>());
customComponentList = new HashSet<IComponent>(); customComponentList = new HashSet<IComponent>();
skeletonList = new ArrayList<String>(); skeletonList = new ArrayList<String>();
userComponentList = new HashSet<IComponent>(); userComponentList = new HashSet<IComponent>();

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>6.2.1-SNAPSHOT</version> <version>6.2.1</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.designer.components.exchange</artifactId> <artifactId>org.talend.designer.components.exchange</artifactId>

View File

@@ -1,6 +1,7 @@
package com.talend.mdm.transaction.client; package com.talend.mdm.transaction.client;
import java.io.IOException; import java.io.IOException;
import java.util.List;
import org.apache.commons.httpclient.HttpClient; import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpException; import org.apache.commons.httpclient.HttpException;
@@ -10,98 +11,96 @@ import org.apache.commons.httpclient.auth.AuthScope;
import org.apache.commons.httpclient.methods.DeleteMethod; import org.apache.commons.httpclient.methods.DeleteMethod;
import org.apache.commons.httpclient.methods.PostMethod; import org.apache.commons.httpclient.methods.PostMethod;
@SuppressWarnings("nls")
public class MDMTransaction { public class MDMTransaction {
public static final String JVM_STICKY_SESSION = "sticky_session"; //$NON-NLS-1$ private String url;
public static final String DEFAULT_STICKY_SESSION = "JSESSIONID"; //$NON-NLS-1$
private String url; private String id;
private String id;
private String username;
private String password;
private String sessionId;
public void commit() throws IOException {
HttpClient client = new HttpClient();
client.getState().setCredentials(AuthScope.ANY,
new UsernamePasswordCredentials(username, password));
HttpMethod method = new PostMethod(url + "/" + id); private String username;
method.setDoAuthentication(true);
try {
method.setRequestHeader("Cookie", getStickySession() + "=" + sessionId); //$NON-NLS-1$ //$NON-NLS-2$
client.executeMethod(method);
} catch (HttpException e) {
throw e;
} catch (IOException e) {
throw e;
} finally {
method.releaseConnection();
}
int statuscode = method.getStatusCode(); private String password;
if (statuscode >= 400) {
throw new MDMTransactionException("Commit failed. The commit operation has returned the code " + statuscode + ".");
}
}
public void rollback() throws IOException { private List<String> cookies;
HttpClient client = new HttpClient();
client.getState().setCredentials(AuthScope.ANY,
new UsernamePasswordCredentials(username, password));
HttpMethod method = new DeleteMethod(url + "/" + id); public void commit() throws IOException {
method.setDoAuthentication(true); HttpClient client = new HttpClient();
try { client.getState().setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(username, password));
method.setRequestHeader("Cookie", getStickySession() + "=" + sessionId); //$NON-NLS-1$ //$NON-NLS-2$
client.executeMethod(method);
} catch (HttpException e) {
throw e;
} catch (IOException e) {
throw e;
} finally {
method.releaseConnection();
}
int statuscode = method.getStatusCode(); HttpMethod method = new PostMethod(url + "/" + id);
if (statuscode >= 400) { method.setDoAuthentication(true);
throw new MDMTransactionException("Rollback failed. The rollback operation has returned the code " + statuscode + "."); try {
} for (String cookie : cookies) {
} method.addRequestHeader("Cookie", cookie);
}
public void setUrl(String url) { client.executeMethod(method);
this.url = url; } catch (HttpException e) {
} throw e;
} catch (IOException e) {
public void setId(String id) { throw e;
this.id = id; } finally {
} method.releaseConnection();
}
public String getId() {
return id; int statuscode = method.getStatusCode();
} if (statuscode >= 400) {
throw new MDMTransactionException("Commit failed. The commit operation has returned the code " + statuscode + ".");
public void setUsername(String username) {
this.username = username;
}
public void setPassword(String password) {
this.password = password;
}
public String getSessionId() {
return sessionId;
}
public void setSessionId(String sessionId) {
this.sessionId = sessionId;
}
public static String getStickySession() {
String stickySession = System.getProperty(JVM_STICKY_SESSION);
if(stickySession == null) {
stickySession = DEFAULT_STICKY_SESSION;
} }
return stickySession;
} }
public void rollback() throws IOException {
HttpClient client = new HttpClient();
client.getState().setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(username, password));
HttpMethod method = new DeleteMethod(url + "/" + id);
method.setDoAuthentication(true);
try {
for (String cookie : cookies) {
method.addRequestHeader("Cookie", cookie);
}
client.executeMethod(method);
} catch (HttpException e) {
throw e;
} catch (IOException e) {
throw e;
} finally {
method.releaseConnection();
}
int statuscode = method.getStatusCode();
if (statuscode >= 400) {
throw new MDMTransactionException(
"Rollback failed. The rollback operation has returned the code " + statuscode + ".");
}
}
public void setUrl(String url) {
this.url = url;
}
public void setId(String id) {
this.id = id;
}
public String getId() {
return id;
}
public void setUsername(String username) {
this.username = username;
}
public void setPassword(String password) {
this.password = password;
}
public List<String> getCookies() {
return cookies;
}
public void setCookies(List<String> cookies) {
this.cookies = cookies;
}
} }

View File

@@ -1,6 +1,8 @@
package com.talend.mdm.transaction.client; package com.talend.mdm.transaction.client;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.httpclient.Header; import org.apache.commons.httpclient.Header;
import org.apache.commons.httpclient.HttpClient; import org.apache.commons.httpclient.HttpClient;
@@ -10,13 +12,10 @@ import org.apache.commons.httpclient.UsernamePasswordCredentials;
import org.apache.commons.httpclient.auth.AuthScope; import org.apache.commons.httpclient.auth.AuthScope;
import org.apache.commons.httpclient.methods.GetMethod; import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.commons.httpclient.methods.PutMethod; import org.apache.commons.httpclient.methods.PutMethod;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@SuppressWarnings("nls")
public class MDMTransactionClient { public class MDMTransactionClient {
private static final Log LOG = LogFactory.getLog(MDMTransactionClient.class);
public static MDMTransaction newTransaction(String url, String username, String password) throws IOException { public static MDMTransaction newTransaction(String url, String username, String password) throws IOException {
HttpClient client = new HttpClient(); HttpClient client = new HttpClient();
client.getState().setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(username, password)); client.getState().setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(username, password));
@@ -25,11 +24,11 @@ public class MDMTransactionClient {
PutMethod put = new PutMethod(url); PutMethod put = new PutMethod(url);
put.setDoAuthentication(true); put.setDoAuthentication(true);
String tid; String tid;
String sessionID; List<String> cookies;
try { try {
client.executeMethod(put); client.executeMethod(put);
tid = put.getResponseBodyAsString(); tid = put.getResponseBodyAsString();
sessionID = parseSessionID(put); cookies = parseCookies(put);
} catch (HttpException e) { } catch (HttpException e) {
throw e; throw e;
} catch (IOException e) { } catch (IOException e) {
@@ -43,30 +42,30 @@ public class MDMTransactionClient {
result.setId(tid); result.setId(tid);
result.setUsername(username); result.setUsername(username);
result.setPassword(password); result.setPassword(password);
result.setSessionId(sessionID); result.setCookies(cookies);
return result; return result;
} }
public static String getMDMTransactionURL(String url, boolean isNewServer) { public static String getMDMTransactionURL(String url, boolean isNewServer) {
if(url == null || "".equals(url)) { if (url == null || "".equals(url)) {
return ""; return "";
} }
int count = 3; int count = 3;
int i=0; int i = 0;
for(;i<url.length();i++) { for (; i < url.length(); i++) {
char c = url.charAt(i); char c = url.charAt(i);
if('/' == c) { if ('/' == c) {
count--; count--;
} }
if(count == 0) { if (count == 0) {
break; break;
} }
} }
String result = url.substring(0, i); String result = url.substring(0, i);
if(isNewServer){ if (isNewServer) {
result += "/talendmdm/services/rest/transactions"; result += "/talendmdm/services/rest/transactions";
} else { } else {
result += "/datamanager/services/transactions"; result += "/datamanager/services/transactions";
@@ -75,17 +74,17 @@ public class MDMTransactionClient {
return result; return result;
} }
public static String getSessionID(String url, String username, String password) throws IOException { public static List<String> getCookies(String url, String username, String password) throws IOException {
HttpClient client = new HttpClient(); HttpClient client = new HttpClient();
client.getState().setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(username, password)); client.getState().setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(username, password));
client.getParams().setAuthenticationPreemptive(true); client.getParams().setAuthenticationPreemptive(true);
GetMethod get = new GetMethod(url); GetMethod get = new GetMethod(url);
get.setDoAuthentication(true); get.setDoAuthentication(true);
String sessionID; List<String> cookies;
try { try {
client.executeMethod(get); client.executeMethod(get);
sessionID = parseSessionID(get); cookies = parseCookies(get);
} catch (HttpException e) { } catch (HttpException e) {
throw e; throw e;
} catch (IOException e) { } catch (IOException e) {
@@ -93,44 +92,16 @@ public class MDMTransactionClient {
} finally { } finally {
get.releaseConnection(); get.releaseConnection();
} }
return sessionID; return cookies;
} }
private static String parseSessionID(HttpMethod method) { private static List<String> parseCookies(HttpMethod method) {
String sessionID = null; List<String> cookies = new ArrayList<String>();
String stickySession = MDMTransaction.getStickySession(); Header[] setCookie = method.getResponseHeaders("Set-Cookie");
Header[] setCookie = method.getResponseHeaders("Set-Cookie"); //$NON-NLS-1$ for (Header header : setCookie) {
for(Header header : setCookie) { cookies.add(header.getValue());
String headerValue = header.getValue();
if(headerValue.startsWith(stickySession + "=")) { //$NON-NLS-1$
int beginIndex = (stickySession + "=").length(); //$NON-NLS-1$
int endIndex = headerValue.indexOf(";", beginIndex); //$NON-NLS-1$
sessionID = headerValue.substring(beginIndex, endIndex);
break;
}
} }
if(sessionID == null) { return cookies;
if(LOG.isDebugEnabled()) {
LOG.warn("Cookie for sticky session not found!"); //$NON-NLS-1$
}
sessionID = ""; //$NON-NLS-1$
}
return sessionID;
}
public static void main(String[] args) throws IOException {
String sessionID = MDMTransactionClient.getSessionID("http://localhost:8621/talendmdm/services/rest/transactions", "administrator", "administrator");
System.out.println(sessionID);
MDMTransaction mt = MDMTransactionClient.newTransaction("http://localhost:8180/talendmdm/services/rest/transactions", "administrator", "administrator");
mt.commit();
MDMTransaction mt1 = MDMTransactionClient.newTransaction("http://localhost:8180/talendmdm/services/rest/transactions", "administrator", "administrator");
mt1.rollback();
String url = "http://localhost:8180/talend/TalendPort";
String mdmurl = MDMTransactionClient.getMDMTransactionURL(url, true);
System.out.println(mdmurl);
} }
} }

View File

@@ -14,7 +14,7 @@
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<talend.nexus.url>http://newbuild.talend.com:8081</talend.nexus.url> <talend.nexus.url>https://artifacts-zl.talend.com</talend.nexus.url>
</properties> </properties>
<distributionManagement> <distributionManagement>

View File

@@ -15,7 +15,7 @@
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<cxf.version>3.1.1</cxf.version> <cxf.version>3.1.1</cxf.version>
<talend.nexus.url>http://newbuild.talend.com:8081</talend.nexus.url> <talend.nexus.url>https://artifacts-zl.talend.com</talend.nexus.url>
</properties> </properties>
<distributionManagement> <distributionManagement>

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>6.2.1-SNAPSHOT</version> <version>6.2.1</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.designer.components.libs</artifactId> <artifactId>org.talend.designer.components.libs</artifactId>

View File

@@ -36,33 +36,50 @@ String trans = "mdmTrans_" + connection;
org.talend.mdm.bulkload.client.BulkloadClient bulkloadClient_<%=cid %> = new org.talend.mdm.bulkload.client.BulkloadClient(<%=mdmUrl %>, <%=username %>, decryptedPassword_<%=cid %>, null, <%=dataCluster %> + "<%=isStaging?"#STAGING":""%>", <%=dataEntity %>, <%=dataModule %>); org.talend.mdm.bulkload.client.BulkloadClient bulkloadClient_<%=cid %> = new org.talend.mdm.bulkload.client.BulkloadClient(<%=mdmUrl %>, <%=username %>, decryptedPassword_<%=cid %>, null, <%=dataCluster %> + "<%=isStaging?"#STAGING":""%>", <%=dataEntity %>, <%=dataModule %>);
<%if(useTransaction) {%> <%if(useTransaction) {%>
String transKey_<%=cid %> = "<%=trans%>_" + Thread.currentThread().getThreadGroup().getName(); if(globalMap.get("useTransaction_<%=connection %>") != null && (Boolean)globalMap.get("useTransaction_<%=connection %>")) {
com.talend.mdm.transaction.client.MDMTransaction mdmTransaction_<%=cid %> = (com.talend.mdm.transaction.client.MDMTransaction)globalMap.get(transKey_<%=cid %>); String transKey_<%=cid %> = "<%=trans%>_" + Thread.currentThread().getThreadGroup().getName();
if(mdmTransaction_<%=cid %> == null) { com.talend.mdm.transaction.client.MDMTransaction mdmTransaction_<%=cid %> = (com.talend.mdm.transaction.client.MDMTransaction)globalMap.get(transKey_<%=cid %>);
String murl_<%=cid %> = (String)globalMap.get("mdmUrl_<%=connection %>"); if(mdmTransaction_<%=cid %> == null) {
if(murl_<%=cid %>.endsWith("?wsdl")) { Boolean transInitStart_<%=cid%> = false;
murl_<%=cid %> = murl_<%=cid %>.substring(0, murl_<%=cid %>.length() - 5); synchronized(globalMap){
if(globalMap.containsKey(transKey_<%=cid %> + "_initStart")){
transInitStart_<%=cid%> = true;
}else{
globalMap.put(transKey_<%=cid %> + "_initStart", true);
}
}
if(transInitStart_<%=cid%> == false){
String murl_<%=cid %> = (String)globalMap.get("mdmUrl_<%=connection %>");
if(murl_<%=cid %>.endsWith("?wsdl")) {
murl_<%=cid %> = murl_<%=cid %>.substring(0, murl_<%=cid %>.length() - 5);
}
String turl_<%=cid %> = com.talend.mdm.transaction.client.MDMTransactionClient.getMDMTransactionURL(murl_<%=cid %>, true);
String username_<%=cid %> = (String)globalMap.get("username_<%=connection %>");
String password_<%=cid %> = (String)globalMap.get("password_<%=connection %>");
if((Boolean)globalMap.get("useClientTranId_<%=connection %>")){
List<String> cookies_<%=cid%> = com.talend.mdm.transaction.client.MDMTransactionClient.getCookies(turl_<%=cid%>,username_<%=cid%>,password_<%=cid%>);
mdmTransaction_<%=cid %> = new com.talend.mdm.transaction.client.MDMTransaction();
mdmTransaction_<%=cid %>.setUrl(turl_<%=cid %>);
mdmTransaction_<%=cid %>.setId("<%=cid %>_" + java.util.UUID.randomUUID());
mdmTransaction_<%=cid %>.setUsername(username_<%=cid %>);
mdmTransaction_<%=cid %>.setPassword(password_<%=cid %>);
mdmTransaction_<%=cid %>.setCookies(cookies_<%=cid%>);
}else{
<% logUtil.debug("\"Attempt to get a remote transaction from url: \" + murl_" + cid);%>
mdmTransaction_<%=cid %> = com.talend.mdm.transaction.client.MDMTransactionClient.newTransaction(turl_<%=cid %>,username_<%=cid %>,password_<%=cid %>);
}
}else{
while(mdmTransaction_<%=cid %> == null){
Thread.sleep(10);
mdmTransaction_<%=cid %> = (com.talend.mdm.transaction.client.MDMTransaction)globalMap.get(transKey_<%=cid %>);
}
}
globalMap.put(transKey_<%=cid %>, mdmTransaction_<%=cid %>);
<% logUtil.debug("\"Got transaction successfully with key=\" + transKey_" + cid);%>
} }
String turl_<%=cid %> = com.talend.mdm.transaction.client.MDMTransactionClient.getMDMTransactionURL(murl_<%=cid %>, true); bulkloadClient_<%=cid %>.setTransactionId(mdmTransaction_<%=cid %>.getId());
String username_<%=cid %> = (String)globalMap.get("username_<%=connection %>"); bulkloadClient_<%=cid %>.setCookies(mdmTransaction_<%=cid%>.getCookies());
String password_<%=cid %> = (String)globalMap.get("password_<%=connection %>");
if((Boolean)globalMap.get("useClientTranId_<%=connection %>")) {
String sessionID_<%=cid %> = com.talend.mdm.transaction.client.MDMTransactionClient.getSessionID(turl_<%=cid %>,username_<%=cid %>,password_<%=cid %>);
mdmTransaction_<%=cid %> = new com.talend.mdm.transaction.client.MDMTransaction();
mdmTransaction_<%=cid %>.setUrl(turl_<%=cid %>);
mdmTransaction_<%=cid %>.setId("<%=cid %>_" + java.util.UUID.randomUUID());
mdmTransaction_<%=cid %>.setUsername(username_<%=cid %>);
mdmTransaction_<%=cid %>.setPassword(password_<%=cid %>);
mdmTransaction_<%=cid %>.setSessionId(sessionID_<%=cid %>);
} else {
<% logUtil.debug("\"Attempt to get a remote transaction from url: \" + murl_" + cid);%>
mdmTransaction_<%=cid %> = com.talend.mdm.transaction.client.MDMTransactionClient.newTransaction(turl_<%=cid %>,username_<%=cid %>,password_<%=cid %>);
}
globalMap.put(transKey_<%=cid %>, mdmTransaction_<%=cid %>);
<% logUtil.debug("\"Got transaction successfully with key=\" + transKey_" + cid);%>
} }
bulkloadClient_<%=cid %>.setTransactionId(mdmTransaction_<%=cid %>.getId());
bulkloadClient_<%=cid %>.setSessionId(mdmTransaction_<%=cid%>.getSessionId());
<%}%> <%}%>
bulkloadClient_<%=cid %>.startThreadCount(); bulkloadClient_<%=cid %>.startThreadCount();

View File

@@ -70,18 +70,34 @@ int nb_line_<%=cid %> = 0;
String turl_<%=cid %> = com.talend.mdm.transaction.client.MDMTransactionClient.getMDMTransactionURL(murl_<%=cid %>, true); String turl_<%=cid %> = com.talend.mdm.transaction.client.MDMTransactionClient.getMDMTransactionURL(murl_<%=cid %>, true);
com.talend.mdm.transaction.client.MDMTransaction mdmTransaction_<%=cid %> = (com.talend.mdm.transaction.client.MDMTransaction)globalMap.get(transKey_<%=cid %>); com.talend.mdm.transaction.client.MDMTransaction mdmTransaction_<%=cid %> = (com.talend.mdm.transaction.client.MDMTransaction)globalMap.get(transKey_<%=cid %>);
if(mdmTransaction_<%=cid %> == null){ if(mdmTransaction_<%=cid %> == null){
if((Boolean)globalMap.get("useClientTranId_<%=connection %>")){ Boolean transInitStart_<%=cid%> = false;
String sessionID_<%=cid%> = com.talend.mdm.transaction.client.MDMTransactionClient.getSessionID(turl_<%=cid%>,username_<%=cid%>,password_<%=cid%>); synchronized(globalMap){
mdmTransaction_<%=cid %> = new com.talend.mdm.transaction.client.MDMTransaction(); if(globalMap.containsKey(transKey_<%=cid %> + "_initStart")){
mdmTransaction_<%=cid %>.setUrl(turl_<%=cid %>); transInitStart_<%=cid%> = true;
mdmTransaction_<%=cid %>.setId("<%=cid %>_" + java.util.UUID.randomUUID()); }else{
mdmTransaction_<%=cid %>.setUsername(username_<%=cid %>); globalMap.put(transKey_<%=cid %> + "_initStart", true);
mdmTransaction_<%=cid %>.setPassword(password_<%=cid %>); }
mdmTransaction_<%=cid %>.setSessionId(sessionID_<%=cid%>);
}else{
<% logUtil.debug("\"Attempt to get a remote transaction from url: \" + murl_" + cid);%>
mdmTransaction_<%=cid %> = com.talend.mdm.transaction.client.MDMTransactionClient.newTransaction(turl_<%=cid %>,username_<%=cid %>,password_<%=cid %>);
} }
if(transInitStart_<%=cid%> == false){
if((Boolean)globalMap.get("useClientTranId_<%=connection %>")){
List<String> cookies_<%=cid%> = com.talend.mdm.transaction.client.MDMTransactionClient.getCookies(turl_<%=cid%>,username_<%=cid%>,password_<%=cid%>);
mdmTransaction_<%=cid %> = new com.talend.mdm.transaction.client.MDMTransaction();
mdmTransaction_<%=cid %>.setUrl(turl_<%=cid %>);
mdmTransaction_<%=cid %>.setId("<%=cid %>_" + java.util.UUID.randomUUID());
mdmTransaction_<%=cid %>.setUsername(username_<%=cid %>);
mdmTransaction_<%=cid %>.setPassword(password_<%=cid %>);
mdmTransaction_<%=cid %>.setCookies(cookies_<%=cid%>);
}else{
<% logUtil.debug("\"Attempt to get a remote transaction from url: \" + murl_" + cid);%>
mdmTransaction_<%=cid %> = com.talend.mdm.transaction.client.MDMTransactionClient.newTransaction(turl_<%=cid %>,username_<%=cid %>,password_<%=cid %>);
}
}else{
while(mdmTransaction_<%=cid %> == null){
Thread.sleep(10);
mdmTransaction_<%=cid %> = (com.talend.mdm.transaction.client.MDMTransaction)globalMap.get(transKey_<%=cid %>);
}
}
java.util.List<org.apache.cxf.headers.Header> soapHeaders_<%=cid %> = new java.util.ArrayList<org.apache.cxf.headers.Header>(); java.util.List<org.apache.cxf.headers.Header> soapHeaders_<%=cid %> = new java.util.ArrayList<org.apache.cxf.headers.Header>();
javax.xml.namespace.QName qName_<%=cid %> = new javax.xml.namespace.QName("http://www.talend.com/mdm", "transaction-id"); javax.xml.namespace.QName qName_<%=cid %> = new javax.xml.namespace.QName("http://www.talend.com/mdm", "transaction-id");
org.apache.cxf.databinding.DataBinding dataBinding_<%=cid %> = new org.apache.cxf.jaxb.JAXBDataBinding(String.class); org.apache.cxf.databinding.DataBinding dataBinding_<%=cid %> = new org.apache.cxf.jaxb.JAXBDataBinding(String.class);
@@ -89,8 +105,7 @@ int nb_line_<%=cid %> = 0;
context_<%=cid %>.put(org.apache.cxf.headers.Header.HEADER_LIST, soapHeaders_<%=cid %>); context_<%=cid %>.put(org.apache.cxf.headers.Header.HEADER_LIST, soapHeaders_<%=cid %>);
java.util.Map<String, java.util.List<String>> httpHeaders_<%=cid %> = new java.util.HashMap<String, java.util.List<String>>(); java.util.Map<String, java.util.List<String>> httpHeaders_<%=cid %> = new java.util.HashMap<String, java.util.List<String>>();
String cookie_<%=cid %> = com.talend.mdm.transaction.client.MDMTransaction.getStickySession() + "=" + mdmTransaction_<%=cid%>.getSessionId(); httpHeaders_<%=cid %>.put("Cookie", mdmTransaction_<%=cid %>.getCookies());
httpHeaders_<%=cid %>.put("Cookie", java.util.Arrays.asList(cookie_<%=cid %>));
context_<%=cid %>.put(org.apache.cxf.message.Message.PROTOCOL_HEADERS, httpHeaders_<%=cid %>); context_<%=cid %>.put(org.apache.cxf.message.Message.PROTOCOL_HEADERS, httpHeaders_<%=cid %>);
globalMap.put(transKey_<%=cid %>, mdmTransaction_<%=cid %>); globalMap.put(transKey_<%=cid %>, mdmTransaction_<%=cid %>);

View File

@@ -138,18 +138,34 @@ int nb_line_rejected_<%=cid %> = 0;
String turl_<%=cid %> = com.talend.mdm.transaction.client.MDMTransactionClient.getMDMTransactionURL(murl_<%=cid %>, true); String turl_<%=cid %> = com.talend.mdm.transaction.client.MDMTransactionClient.getMDMTransactionURL(murl_<%=cid %>, true);
com.talend.mdm.transaction.client.MDMTransaction mdmTransaction_<%=cid %> = (com.talend.mdm.transaction.client.MDMTransaction)globalMap.get(transKey_<%=cid %>); com.talend.mdm.transaction.client.MDMTransaction mdmTransaction_<%=cid %> = (com.talend.mdm.transaction.client.MDMTransaction)globalMap.get(transKey_<%=cid %>);
if(mdmTransaction_<%=cid %> == null){ if(mdmTransaction_<%=cid %> == null){
if((Boolean)globalMap.get("useClientTranId_<%=connection %>")){ Boolean transInitStart_<%=cid%> = false;
String sessionID_<%=cid%> = com.talend.mdm.transaction.client.MDMTransactionClient.getSessionID(turl_<%=cid%>,username_<%=cid%>,password_<%=cid%>); synchronized(globalMap){
mdmTransaction_<%=cid %> = new com.talend.mdm.transaction.client.MDMTransaction(); if(globalMap.containsKey(transKey_<%=cid %> + "_initStart")){
mdmTransaction_<%=cid %>.setUrl(turl_<%=cid %>); transInitStart_<%=cid%> = true;
mdmTransaction_<%=cid %>.setId("<%=cid %>_" + java.util.UUID.randomUUID()); }else{
mdmTransaction_<%=cid %>.setUsername(username_<%=cid %>); globalMap.put(transKey_<%=cid %> + "_initStart", true);
mdmTransaction_<%=cid %>.setPassword(password_<%=cid %>); }
mdmTransaction_<%=cid %>.setSessionId(sessionID_<%=cid%>);
}else{
<% logUtil.debug("\"Attempt to get a remote transaction from url: \" + murl_" + cid);%>
mdmTransaction_<%=cid %> = com.talend.mdm.transaction.client.MDMTransactionClient.newTransaction(turl_<%=cid %>,username_<%=cid %>,password_<%=cid %>);
} }
if(transInitStart_<%=cid%> == false){
if((Boolean)globalMap.get("useClientTranId_<%=connection %>")){
List<String> cookies_<%=cid%> = com.talend.mdm.transaction.client.MDMTransactionClient.getCookies(turl_<%=cid%>,username_<%=cid%>,password_<%=cid%>);
mdmTransaction_<%=cid %> = new com.talend.mdm.transaction.client.MDMTransaction();
mdmTransaction_<%=cid %>.setUrl(turl_<%=cid %>);
mdmTransaction_<%=cid %>.setId("<%=cid %>_" + java.util.UUID.randomUUID());
mdmTransaction_<%=cid %>.setUsername(username_<%=cid %>);
mdmTransaction_<%=cid %>.setPassword(password_<%=cid %>);
mdmTransaction_<%=cid %>.setCookies(cookies_<%=cid%>);
}else{
<% logUtil.debug("\"Attempt to get a remote transaction from url: \" + murl_" + cid);%>
mdmTransaction_<%=cid %> = com.talend.mdm.transaction.client.MDMTransactionClient.newTransaction(turl_<%=cid %>,username_<%=cid %>,password_<%=cid %>);
}
}else{
while(mdmTransaction_<%=cid %> == null){
Thread.sleep(10);
mdmTransaction_<%=cid %> = (com.talend.mdm.transaction.client.MDMTransaction)globalMap.get(transKey_<%=cid %>);
}
}
java.util.List<org.apache.cxf.headers.Header> soapHeaders_<%=cid %> = new java.util.ArrayList<org.apache.cxf.headers.Header>(); java.util.List<org.apache.cxf.headers.Header> soapHeaders_<%=cid %> = new java.util.ArrayList<org.apache.cxf.headers.Header>();
javax.xml.namespace.QName qName_<%=cid %> = new javax.xml.namespace.QName("http://www.talend.com/mdm", "transaction-id"); javax.xml.namespace.QName qName_<%=cid %> = new javax.xml.namespace.QName("http://www.talend.com/mdm", "transaction-id");
org.apache.cxf.databinding.DataBinding dataBinding_<%=cid %> = new org.apache.cxf.jaxb.JAXBDataBinding(String.class); org.apache.cxf.databinding.DataBinding dataBinding_<%=cid %> = new org.apache.cxf.jaxb.JAXBDataBinding(String.class);
@@ -157,8 +173,7 @@ int nb_line_rejected_<%=cid %> = 0;
context_<%=cid %>.put(org.apache.cxf.headers.Header.HEADER_LIST, soapHeaders_<%=cid %>); context_<%=cid %>.put(org.apache.cxf.headers.Header.HEADER_LIST, soapHeaders_<%=cid %>);
java.util.Map<String, java.util.List<String>> httpHeaders_<%=cid %> = new java.util.HashMap<String, java.util.List<String>>(); java.util.Map<String, java.util.List<String>> httpHeaders_<%=cid %> = new java.util.HashMap<String, java.util.List<String>>();
String cookie_<%=cid %> = com.talend.mdm.transaction.client.MDMTransaction.getStickySession() + "=" + mdmTransaction_<%=cid%>.getSessionId(); httpHeaders_<%=cid %>.put("Cookie", mdmTransaction_<%=cid %>.getCookies());
httpHeaders_<%=cid %>.put("Cookie", java.util.Arrays.asList(cookie_<%=cid %>));
context_<%=cid %>.put(org.apache.cxf.message.Message.PROTOCOL_HEADERS, httpHeaders_<%=cid %>); context_<%=cid %>.put(org.apache.cxf.message.Message.PROTOCOL_HEADERS, httpHeaders_<%=cid %>);
globalMap.put(transKey_<%=cid %>, mdmTransaction_<%=cid %>); globalMap.put(transKey_<%=cid %>, mdmTransaction_<%=cid %>);

View File

@@ -63,9 +63,11 @@ if(!usePartialUpdate){%>
<% <%
}else{%> }else{%>
if(miList_<%=cid %>.size() > 0){ if(miList_<%=cid %>.size() > 0){
org.talend.mdm.webservice.WSPutItemArray putItemArray = new org.talend.mdm.webservice.WSPutItemArray(miList_<%=cid %>);
<% logUtil.debug("\"Try to put item array.\"");%> <% logUtil.debug("\"Try to put item array.\"");%>
wspks_<%=cid %> = service_<%=cid %>.putItemArray(miList_<%=cid %>).getWsItemPK(); wspks_<%=cid %> = service_<%=cid %>.putItemArray(putItemArray).getWsItemPK();
<% logUtil.debug("\"Put item size:\"+wspks_"+cid+".size()");%> <% logUtil.debug("\"Put item size:\"+wspks_"+cid+".size()");%>

View File

@@ -113,18 +113,34 @@ if ((metadatas != null) && (metadatas.size() > 0)) {//1
String turl_<%=cid %> = com.talend.mdm.transaction.client.MDMTransactionClient.getMDMTransactionURL(murl_<%=cid %>, true); String turl_<%=cid %> = com.talend.mdm.transaction.client.MDMTransactionClient.getMDMTransactionURL(murl_<%=cid %>, true);
com.talend.mdm.transaction.client.MDMTransaction mdmTransaction_<%=cid %> = (com.talend.mdm.transaction.client.MDMTransaction)globalMap.get(transKey_<%=cid %>); com.talend.mdm.transaction.client.MDMTransaction mdmTransaction_<%=cid %> = (com.talend.mdm.transaction.client.MDMTransaction)globalMap.get(transKey_<%=cid %>);
if(mdmTransaction_<%=cid %> == null){ if(mdmTransaction_<%=cid %> == null){
if((Boolean)globalMap.get("useClientTranId_<%=connection %>")){ Boolean transInitStart_<%=cid%> = false;
String sessionID_<%=cid%> = com.talend.mdm.transaction.client.MDMTransactionClient.getSessionID(turl_<%=cid%>,username_<%=cid%>,password_<%=cid%>); synchronized(globalMap){
mdmTransaction_<%=cid %> = new com.talend.mdm.transaction.client.MDMTransaction(); if(globalMap.containsKey(transKey_<%=cid %> + "_initStart")){
mdmTransaction_<%=cid %>.setUrl(turl_<%=cid %>); transInitStart_<%=cid%> = true;
mdmTransaction_<%=cid %>.setId("<%=cid %>_" + java.util.UUID.randomUUID()); }else{
mdmTransaction_<%=cid %>.setUsername(username_<%=cid %>); globalMap.put(transKey_<%=cid %> + "_initStart", true);
mdmTransaction_<%=cid %>.setPassword(password_<%=cid %>); }
mdmTransaction_<%=cid %>.setSessionId(sessionID_<%=cid%>);
}else{
<% logUtil.debug("\"Attempt to get a remote transaction from url: \" + murl_" + cid);%>
mdmTransaction_<%=cid %> = com.talend.mdm.transaction.client.MDMTransactionClient.newTransaction(turl_<%=cid %>,username_<%=cid %>,password_<%=cid %>);
} }
if(transInitStart_<%=cid%> == false){
if((Boolean)globalMap.get("useClientTranId_<%=connection %>")){
List<String> cookies_<%=cid%> = com.talend.mdm.transaction.client.MDMTransactionClient.getCookies(turl_<%=cid%>,username_<%=cid%>,password_<%=cid%>);
mdmTransaction_<%=cid %> = new com.talend.mdm.transaction.client.MDMTransaction();
mdmTransaction_<%=cid %>.setUrl(turl_<%=cid %>);
mdmTransaction_<%=cid %>.setId("<%=cid %>_" + java.util.UUID.randomUUID());
mdmTransaction_<%=cid %>.setUsername(username_<%=cid %>);
mdmTransaction_<%=cid %>.setPassword(password_<%=cid %>);
mdmTransaction_<%=cid %>.setCookies(cookies_<%=cid%>);
}else{
<% logUtil.debug("\"Attempt to get a remote transaction from url: \" + murl_" + cid);%>
mdmTransaction_<%=cid %> = com.talend.mdm.transaction.client.MDMTransactionClient.newTransaction(turl_<%=cid %>,username_<%=cid %>,password_<%=cid %>);
}
}else{
while(mdmTransaction_<%=cid %> == null){
Thread.sleep(10);
mdmTransaction_<%=cid %> = (com.talend.mdm.transaction.client.MDMTransaction)globalMap.get(transKey_<%=cid %>);
}
}
java.util.List<org.apache.cxf.headers.Header> soapHeaders_<%=cid %> = new java.util.ArrayList<org.apache.cxf.headers.Header>(); java.util.List<org.apache.cxf.headers.Header> soapHeaders_<%=cid %> = new java.util.ArrayList<org.apache.cxf.headers.Header>();
javax.xml.namespace.QName qName_<%=cid %> = new javax.xml.namespace.QName("http://www.talend.com/mdm", "transaction-id"); javax.xml.namespace.QName qName_<%=cid %> = new javax.xml.namespace.QName("http://www.talend.com/mdm", "transaction-id");
org.apache.cxf.databinding.DataBinding dataBinding_<%=cid %> = new org.apache.cxf.jaxb.JAXBDataBinding(String.class); org.apache.cxf.databinding.DataBinding dataBinding_<%=cid %> = new org.apache.cxf.jaxb.JAXBDataBinding(String.class);
@@ -132,8 +148,7 @@ if ((metadatas != null) && (metadatas.size() > 0)) {//1
context_<%=cid %>.put(org.apache.cxf.headers.Header.HEADER_LIST, soapHeaders_<%=cid %>); context_<%=cid %>.put(org.apache.cxf.headers.Header.HEADER_LIST, soapHeaders_<%=cid %>);
java.util.Map<String, java.util.List<String>> httpHeaders_<%=cid %> = new java.util.HashMap<String, java.util.List<String>>(); java.util.Map<String, java.util.List<String>> httpHeaders_<%=cid %> = new java.util.HashMap<String, java.util.List<String>>();
String cookie_<%=cid %> = com.talend.mdm.transaction.client.MDMTransaction.getStickySession() + "=" + mdmTransaction_<%=cid%>.getSessionId(); httpHeaders_<%=cid %>.put("Cookie", mdmTransaction_<%=cid %>.getCookies());
httpHeaders_<%=cid %>.put("Cookie", java.util.Arrays.asList(cookie_<%=cid %>));
context_<%=cid %>.put(org.apache.cxf.message.Message.PROTOCOL_HEADERS, httpHeaders_<%=cid %>); context_<%=cid %>.put(org.apache.cxf.message.Message.PROTOCOL_HEADERS, httpHeaders_<%=cid %>);
globalMap.put(transKey_<%=cid %>, mdmTransaction_<%=cid %>); globalMap.put(transKey_<%=cid %>, mdmTransaction_<%=cid %>);

View File

@@ -75,18 +75,34 @@ int nb_line_<%=cid %> = 0;
String turl_<%=cid %> = com.talend.mdm.transaction.client.MDMTransactionClient.getMDMTransactionURL(murl_<%=cid %>, true); String turl_<%=cid %> = com.talend.mdm.transaction.client.MDMTransactionClient.getMDMTransactionURL(murl_<%=cid %>, true);
com.talend.mdm.transaction.client.MDMTransaction mdmTransaction_<%=cid %> = (com.talend.mdm.transaction.client.MDMTransaction)globalMap.get(transKey_<%=cid %>); com.talend.mdm.transaction.client.MDMTransaction mdmTransaction_<%=cid %> = (com.talend.mdm.transaction.client.MDMTransaction)globalMap.get(transKey_<%=cid %>);
if(mdmTransaction_<%=cid %> == null){ if(mdmTransaction_<%=cid %> == null){
if((Boolean)globalMap.get("useClientTranId_<%=connection %>")){ Boolean transInitStart_<%=cid%> = false;
String sessionID_<%=cid%> = com.talend.mdm.transaction.client.MDMTransactionClient.getSessionID(turl_<%=cid%>,username_<%=cid%>,password_<%=cid%>); synchronized(globalMap){
mdmTransaction_<%=cid %> = new com.talend.mdm.transaction.client.MDMTransaction(); if(globalMap.containsKey(transKey_<%=cid %> + "_initStart")){
mdmTransaction_<%=cid %>.setUrl(turl_<%=cid %>); transInitStart_<%=cid%> = true;
mdmTransaction_<%=cid %>.setId("<%=cid %>_" + java.util.UUID.randomUUID()); }else{
mdmTransaction_<%=cid %>.setUsername(username_<%=cid %>); globalMap.put(transKey_<%=cid %> + "_initStart", true);
mdmTransaction_<%=cid %>.setPassword(password_<%=cid %>); }
mdmTransaction_<%=cid %>.setSessionId(sessionID_<%=cid%>);
}else{
<% logUtil.debug("\"Attempt to get a remote transaction from url: \" + murl_" + cid);%>
mdmTransaction_<%=cid %> = com.talend.mdm.transaction.client.MDMTransactionClient.newTransaction(turl_<%=cid %>,username_<%=cid %>,password_<%=cid %>);
} }
if(transInitStart_<%=cid%> == false){
if((Boolean)globalMap.get("useClientTranId_<%=connection %>")){
List<String> cookies_<%=cid%> = com.talend.mdm.transaction.client.MDMTransactionClient.getCookies(turl_<%=cid%>,username_<%=cid%>,password_<%=cid%>);
mdmTransaction_<%=cid %> = new com.talend.mdm.transaction.client.MDMTransaction();
mdmTransaction_<%=cid %>.setUrl(turl_<%=cid %>);
mdmTransaction_<%=cid %>.setId("<%=cid %>_" + java.util.UUID.randomUUID());
mdmTransaction_<%=cid %>.setUsername(username_<%=cid %>);
mdmTransaction_<%=cid %>.setPassword(password_<%=cid %>);
mdmTransaction_<%=cid %>.setCookies(cookies_<%=cid%>);
}else{
<% logUtil.debug("\"Attempt to get a remote transaction from url: \" + murl_" + cid);%>
mdmTransaction_<%=cid %> = com.talend.mdm.transaction.client.MDMTransactionClient.newTransaction(turl_<%=cid %>,username_<%=cid %>,password_<%=cid %>);
}
}else{
while(mdmTransaction_<%=cid %> == null){
Thread.sleep(10);
mdmTransaction_<%=cid %> = (com.talend.mdm.transaction.client.MDMTransaction)globalMap.get(transKey_<%=cid %>);
}
}
java.util.List<org.apache.cxf.headers.Header> soapHeaders_<%=cid %> = new java.util.ArrayList<org.apache.cxf.headers.Header>(); java.util.List<org.apache.cxf.headers.Header> soapHeaders_<%=cid %> = new java.util.ArrayList<org.apache.cxf.headers.Header>();
javax.xml.namespace.QName qName_<%=cid %> = new javax.xml.namespace.QName("http://www.talend.com/mdm", "transaction-id"); javax.xml.namespace.QName qName_<%=cid %> = new javax.xml.namespace.QName("http://www.talend.com/mdm", "transaction-id");
org.apache.cxf.databinding.DataBinding dataBinding_<%=cid %> = new org.apache.cxf.jaxb.JAXBDataBinding(String.class); org.apache.cxf.databinding.DataBinding dataBinding_<%=cid %> = new org.apache.cxf.jaxb.JAXBDataBinding(String.class);
@@ -94,8 +110,7 @@ int nb_line_<%=cid %> = 0;
context_<%=cid %>.put(org.apache.cxf.headers.Header.HEADER_LIST, soapHeaders_<%=cid %>); context_<%=cid %>.put(org.apache.cxf.headers.Header.HEADER_LIST, soapHeaders_<%=cid %>);
java.util.Map<String, java.util.List<String>> httpHeaders_<%=cid %> = new java.util.HashMap<String, java.util.List<String>>(); java.util.Map<String, java.util.List<String>> httpHeaders_<%=cid %> = new java.util.HashMap<String, java.util.List<String>>();
String cookie_<%=cid %> = com.talend.mdm.transaction.client.MDMTransaction.getStickySession() + "=" + mdmTransaction_<%=cid%>.getSessionId(); httpHeaders_<%=cid %>.put("Cookie", mdmTransaction_<%=cid %>.getCookies());
httpHeaders_<%=cid %>.put("Cookie", java.util.Arrays.asList(cookie_<%=cid %>));
context_<%=cid %>.put(org.apache.cxf.message.Message.PROTOCOL_HEADERS, httpHeaders_<%=cid %>); context_<%=cid %>.put(org.apache.cxf.message.Message.PROTOCOL_HEADERS, httpHeaders_<%=cid %>);
globalMap.put(transKey_<%=cid %>, mdmTransaction_<%=cid %>); globalMap.put(transKey_<%=cid %>, mdmTransaction_<%=cid %>);

View File

@@ -68,18 +68,34 @@ int nb_line_<%=cid %> = 0;
String turl_<%=cid %> = com.talend.mdm.transaction.client.MDMTransactionClient.getMDMTransactionURL(murl_<%=cid %>, true); String turl_<%=cid %> = com.talend.mdm.transaction.client.MDMTransactionClient.getMDMTransactionURL(murl_<%=cid %>, true);
com.talend.mdm.transaction.client.MDMTransaction mdmTransaction_<%=cid %> = (com.talend.mdm.transaction.client.MDMTransaction)globalMap.get(transKey_<%=cid %>); com.talend.mdm.transaction.client.MDMTransaction mdmTransaction_<%=cid %> = (com.talend.mdm.transaction.client.MDMTransaction)globalMap.get(transKey_<%=cid %>);
if(mdmTransaction_<%=cid %> == null){ if(mdmTransaction_<%=cid %> == null){
if((Boolean)globalMap.get("useClientTranId_<%=connection %>")){ Boolean transInitStart_<%=cid%> = false;
String sessionID_<%=cid%> = com.talend.mdm.transaction.client.MDMTransactionClient.getSessionID(turl_<%=cid%>,username_<%=cid%>,password_<%=cid%>); synchronized(globalMap){
mdmTransaction_<%=cid %> = new com.talend.mdm.transaction.client.MDMTransaction(); if(globalMap.containsKey(transKey_<%=cid %> + "_initStart")){
mdmTransaction_<%=cid %>.setUrl(turl_<%=cid %>); transInitStart_<%=cid%> = true;
mdmTransaction_<%=cid %>.setId("<%=cid %>_" + java.util.UUID.randomUUID()); }else{
mdmTransaction_<%=cid %>.setUsername(username_<%=cid %>); globalMap.put(transKey_<%=cid %> + "_initStart", true);
mdmTransaction_<%=cid %>.setPassword(password_<%=cid %>); }
mdmTransaction_<%=cid %>.setSessionId(sessionID_<%=cid%>);
}else{
<% logUtil.debug("\"Attempt to get a remote transaction from url: \" + murl_" + cid);%>
mdmTransaction_<%=cid %> = com.talend.mdm.transaction.client.MDMTransactionClient.newTransaction(turl_<%=cid %>,username_<%=cid %>,password_<%=cid %>);
} }
if(transInitStart_<%=cid%> == false){
if((Boolean)globalMap.get("useClientTranId_<%=connection %>")){
List<String> cookies_<%=cid%> = com.talend.mdm.transaction.client.MDMTransactionClient.getCookies(turl_<%=cid%>,username_<%=cid%>,password_<%=cid%>);
mdmTransaction_<%=cid %> = new com.talend.mdm.transaction.client.MDMTransaction();
mdmTransaction_<%=cid %>.setUrl(turl_<%=cid %>);
mdmTransaction_<%=cid %>.setId("<%=cid %>_" + java.util.UUID.randomUUID());
mdmTransaction_<%=cid %>.setUsername(username_<%=cid %>);
mdmTransaction_<%=cid %>.setPassword(password_<%=cid %>);
mdmTransaction_<%=cid %>.setCookies(cookies_<%=cid%>);
}else{
<% logUtil.debug("\"Attempt to get a remote transaction from url: \" + murl_" + cid);%>
mdmTransaction_<%=cid %> = com.talend.mdm.transaction.client.MDMTransactionClient.newTransaction(turl_<%=cid %>,username_<%=cid %>,password_<%=cid %>);
}
}else{
while(mdmTransaction_<%=cid %> == null){
Thread.sleep(10);
mdmTransaction_<%=cid %> = (com.talend.mdm.transaction.client.MDMTransaction)globalMap.get(transKey_<%=cid %>);
}
}
java.util.List<org.apache.cxf.headers.Header> soapHeaders_<%=cid %> = new java.util.ArrayList<org.apache.cxf.headers.Header>(); java.util.List<org.apache.cxf.headers.Header> soapHeaders_<%=cid %> = new java.util.ArrayList<org.apache.cxf.headers.Header>();
javax.xml.namespace.QName qName_<%=cid %> = new javax.xml.namespace.QName("http://www.talend.com/mdm", "transaction-id"); javax.xml.namespace.QName qName_<%=cid %> = new javax.xml.namespace.QName("http://www.talend.com/mdm", "transaction-id");
org.apache.cxf.databinding.DataBinding dataBinding_<%=cid %> = new org.apache.cxf.jaxb.JAXBDataBinding(String.class); org.apache.cxf.databinding.DataBinding dataBinding_<%=cid %> = new org.apache.cxf.jaxb.JAXBDataBinding(String.class);
@@ -87,8 +103,7 @@ int nb_line_<%=cid %> = 0;
context_<%=cid %>.put(org.apache.cxf.headers.Header.HEADER_LIST, soapHeaders_<%=cid %>); context_<%=cid %>.put(org.apache.cxf.headers.Header.HEADER_LIST, soapHeaders_<%=cid %>);
java.util.Map<String, java.util.List<String>> httpHeaders_<%=cid %> = new java.util.HashMap<String, java.util.List<String>>(); java.util.Map<String, java.util.List<String>> httpHeaders_<%=cid %> = new java.util.HashMap<String, java.util.List<String>>();
String cookie_<%=cid %> = com.talend.mdm.transaction.client.MDMTransaction.getStickySession() + "=" + mdmTransaction_<%=cid%>.getSessionId(); httpHeaders_<%=cid %>.put("Cookie", mdmTransaction_<%=cid %>.getCookies());
httpHeaders_<%=cid %>.put("Cookie", java.util.Arrays.asList(cookie_<%=cid %>));
context_<%=cid %>.put(org.apache.cxf.message.Message.PROTOCOL_HEADERS, httpHeaders_<%=cid %>); context_<%=cid %>.put(org.apache.cxf.message.Message.PROTOCOL_HEADERS, httpHeaders_<%=cid %>);
globalMap.put(transKey_<%=cid %>, mdmTransaction_<%=cid %>); globalMap.put(transKey_<%=cid %>, mdmTransaction_<%=cid %>);

View File

@@ -111,18 +111,34 @@ if ((metadatas != null) && (metadatas.size() > 0)) {
String turl_<%=cid %> = com.talend.mdm.transaction.client.MDMTransactionClient.getMDMTransactionURL(murl_<%=cid %>, true); String turl_<%=cid %> = com.talend.mdm.transaction.client.MDMTransactionClient.getMDMTransactionURL(murl_<%=cid %>, true);
com.talend.mdm.transaction.client.MDMTransaction mdmTransaction_<%=cid %> = (com.talend.mdm.transaction.client.MDMTransaction)globalMap.get(transKey_<%=cid %>); com.talend.mdm.transaction.client.MDMTransaction mdmTransaction_<%=cid %> = (com.talend.mdm.transaction.client.MDMTransaction)globalMap.get(transKey_<%=cid %>);
if(mdmTransaction_<%=cid %> == null){ if(mdmTransaction_<%=cid %> == null){
if((Boolean)globalMap.get("useClientTranId_<%=connection %>")){ Boolean transInitStart_<%=cid%> = false;
String sessionID_<%=cid%> = com.talend.mdm.transaction.client.MDMTransactionClient.getSessionID(turl_<%=cid%>,username_<%=cid%>,password_<%=cid%>); synchronized(globalMap){
mdmTransaction_<%=cid %> = new com.talend.mdm.transaction.client.MDMTransaction(); if(globalMap.containsKey(transKey_<%=cid %> + "_initStart")){
mdmTransaction_<%=cid %>.setUrl(turl_<%=cid %>); transInitStart_<%=cid%> = true;
mdmTransaction_<%=cid %>.setId("<%=cid %>_" + java.util.UUID.randomUUID()); }else{
mdmTransaction_<%=cid %>.setUsername(username_<%=cid %>); globalMap.put(transKey_<%=cid %> + "_initStart", true);
mdmTransaction_<%=cid %>.setPassword(password_<%=cid %>); }
mdmTransaction_<%=cid %>.setSessionId(sessionID_<%=cid%>);
}else{
<% logUtil.debug("\"Attempt to get a remote transaction from url: \" + murl_" + cid);%>
mdmTransaction_<%=cid %> = com.talend.mdm.transaction.client.MDMTransactionClient.newTransaction(turl_<%=cid %>,username_<%=cid %>,password_<%=cid %>);
} }
if(transInitStart_<%=cid%> == false){
if((Boolean)globalMap.get("useClientTranId_<%=connection %>")){
List<String> cookies_<%=cid%> = com.talend.mdm.transaction.client.MDMTransactionClient.getCookies(turl_<%=cid%>,username_<%=cid%>,password_<%=cid%>);
mdmTransaction_<%=cid %> = new com.talend.mdm.transaction.client.MDMTransaction();
mdmTransaction_<%=cid %>.setUrl(turl_<%=cid %>);
mdmTransaction_<%=cid %>.setId("<%=cid %>_" + java.util.UUID.randomUUID());
mdmTransaction_<%=cid %>.setUsername(username_<%=cid %>);
mdmTransaction_<%=cid %>.setPassword(password_<%=cid %>);
mdmTransaction_<%=cid %>.setCookies(cookies_<%=cid%>);
}else{
<% logUtil.debug("\"Attempt to get a remote transaction from url: \" + murl_" + cid);%>
mdmTransaction_<%=cid %> = com.talend.mdm.transaction.client.MDMTransactionClient.newTransaction(turl_<%=cid %>,username_<%=cid %>,password_<%=cid %>);
}
}else{
while(mdmTransaction_<%=cid %> == null){
Thread.sleep(10);
mdmTransaction_<%=cid %> = (com.talend.mdm.transaction.client.MDMTransaction)globalMap.get(transKey_<%=cid %>);
}
}
java.util.List<org.apache.cxf.headers.Header> soapHeaders_<%=cid %> = new java.util.ArrayList<org.apache.cxf.headers.Header>(); java.util.List<org.apache.cxf.headers.Header> soapHeaders_<%=cid %> = new java.util.ArrayList<org.apache.cxf.headers.Header>();
javax.xml.namespace.QName qName_<%=cid %> = new javax.xml.namespace.QName("http://www.talend.com/mdm", "transaction-id"); javax.xml.namespace.QName qName_<%=cid %> = new javax.xml.namespace.QName("http://www.talend.com/mdm", "transaction-id");
org.apache.cxf.databinding.DataBinding dataBinding_<%=cid %> = new org.apache.cxf.jaxb.JAXBDataBinding(String.class); org.apache.cxf.databinding.DataBinding dataBinding_<%=cid %> = new org.apache.cxf.jaxb.JAXBDataBinding(String.class);
@@ -130,8 +146,7 @@ if ((metadatas != null) && (metadatas.size() > 0)) {
context_<%=cid %>.put(org.apache.cxf.headers.Header.HEADER_LIST, soapHeaders_<%=cid %>); context_<%=cid %>.put(org.apache.cxf.headers.Header.HEADER_LIST, soapHeaders_<%=cid %>);
java.util.Map<String, java.util.List<String>> httpHeaders_<%=cid %> = new java.util.HashMap<String, java.util.List<String>>(); java.util.Map<String, java.util.List<String>> httpHeaders_<%=cid %> = new java.util.HashMap<String, java.util.List<String>>();
String cookie_<%=cid %> = com.talend.mdm.transaction.client.MDMTransaction.getStickySession() + "=" + mdmTransaction_<%=cid%>.getSessionId(); httpHeaders_<%=cid %>.put("Cookie", mdmTransaction_<%=cid %>.getCookies());
httpHeaders_<%=cid %>.put("Cookie", java.util.Arrays.asList(cookie_<%=cid %>));
context_<%=cid %>.put(org.apache.cxf.message.Message.PROTOCOL_HEADERS, httpHeaders_<%=cid %>); context_<%=cid %>.put(org.apache.cxf.message.Message.PROTOCOL_HEADERS, httpHeaders_<%=cid %>);
globalMap.put(transKey_<%=cid %>, mdmTransaction_<%=cid %>); globalMap.put(transKey_<%=cid %>, mdmTransaction_<%=cid %>);

View File

@@ -142,18 +142,34 @@ int nb_line_rejected_<%=cid %> = 0;
String turl_<%=cid %> = com.talend.mdm.transaction.client.MDMTransactionClient.getMDMTransactionURL(murl_<%=cid %>, true); String turl_<%=cid %> = com.talend.mdm.transaction.client.MDMTransactionClient.getMDMTransactionURL(murl_<%=cid %>, true);
com.talend.mdm.transaction.client.MDMTransaction mdmTransaction_<%=cid %> = (com.talend.mdm.transaction.client.MDMTransaction)globalMap.get(transKey_<%=cid %>); com.talend.mdm.transaction.client.MDMTransaction mdmTransaction_<%=cid %> = (com.talend.mdm.transaction.client.MDMTransaction)globalMap.get(transKey_<%=cid %>);
if(mdmTransaction_<%=cid %> == null){ if(mdmTransaction_<%=cid %> == null){
if((Boolean)globalMap.get("useClientTranId_<%=connection %>")){ Boolean transInitStart_<%=cid%> = false;
String sessionID_<%=cid%> = com.talend.mdm.transaction.client.MDMTransactionClient.getSessionID(turl_<%=cid%>,username_<%=cid%>,password_<%=cid%>); synchronized(globalMap){
mdmTransaction_<%=cid %> = new com.talend.mdm.transaction.client.MDMTransaction(); if(globalMap.containsKey(transKey_<%=cid %> + "_initStart")){
mdmTransaction_<%=cid %>.setUrl(turl_<%=cid %>); transInitStart_<%=cid%> = true;
mdmTransaction_<%=cid %>.setId("<%=cid %>_" + java.util.UUID.randomUUID()); }else{
mdmTransaction_<%=cid %>.setUsername(username_<%=cid %>); globalMap.put(transKey_<%=cid %> + "_initStart", true);
mdmTransaction_<%=cid %>.setPassword(password_<%=cid %>); }
mdmTransaction_<%=cid %>.setSessionId(sessionID_<%=cid%>);
}else{
<% logUtil.debug("\"Attempt to get a remote transaction from url: \" + murl_" + cid);%>
mdmTransaction_<%=cid %> = com.talend.mdm.transaction.client.MDMTransactionClient.newTransaction(turl_<%=cid %>,username_<%=cid %>,password_<%=cid %>);
} }
if(transInitStart_<%=cid%> == false){
if((Boolean)globalMap.get("useClientTranId_<%=connection %>")){
List<String> cookies_<%=cid%> = com.talend.mdm.transaction.client.MDMTransactionClient.getCookies(turl_<%=cid%>,username_<%=cid%>,password_<%=cid%>);
mdmTransaction_<%=cid %> = new com.talend.mdm.transaction.client.MDMTransaction();
mdmTransaction_<%=cid %>.setUrl(turl_<%=cid %>);
mdmTransaction_<%=cid %>.setId("<%=cid %>_" + java.util.UUID.randomUUID());
mdmTransaction_<%=cid %>.setUsername(username_<%=cid %>);
mdmTransaction_<%=cid %>.setPassword(password_<%=cid %>);
mdmTransaction_<%=cid %>.setCookies(cookies_<%=cid%>);
}else{
<% logUtil.debug("\"Attempt to get a remote transaction from url: \" + murl_" + cid);%>
mdmTransaction_<%=cid %> = com.talend.mdm.transaction.client.MDMTransactionClient.newTransaction(turl_<%=cid %>,username_<%=cid %>,password_<%=cid %>);
}
}else{
while(mdmTransaction_<%=cid %> == null){
Thread.sleep(10);
mdmTransaction_<%=cid %> = (com.talend.mdm.transaction.client.MDMTransaction)globalMap.get(transKey_<%=cid %>);
}
}
java.util.List<org.apache.cxf.headers.Header> soapHeaders_<%=cid %> = new java.util.ArrayList<org.apache.cxf.headers.Header>(); java.util.List<org.apache.cxf.headers.Header> soapHeaders_<%=cid %> = new java.util.ArrayList<org.apache.cxf.headers.Header>();
javax.xml.namespace.QName qName_<%=cid %> = new javax.xml.namespace.QName("http://www.talend.com/mdm", "transaction-id"); javax.xml.namespace.QName qName_<%=cid %> = new javax.xml.namespace.QName("http://www.talend.com/mdm", "transaction-id");
org.apache.cxf.databinding.DataBinding dataBinding_<%=cid %> = new org.apache.cxf.jaxb.JAXBDataBinding(String.class); org.apache.cxf.databinding.DataBinding dataBinding_<%=cid %> = new org.apache.cxf.jaxb.JAXBDataBinding(String.class);
@@ -161,8 +177,7 @@ int nb_line_rejected_<%=cid %> = 0;
context_<%=cid %>.put(org.apache.cxf.headers.Header.HEADER_LIST, soapHeaders_<%=cid %>); context_<%=cid %>.put(org.apache.cxf.headers.Header.HEADER_LIST, soapHeaders_<%=cid %>);
java.util.Map<String, java.util.List<String>> httpHeaders_<%=cid %> = new java.util.HashMap<String, java.util.List<String>>(); java.util.Map<String, java.util.List<String>> httpHeaders_<%=cid %> = new java.util.HashMap<String, java.util.List<String>>();
String cookie_<%=cid %> = com.talend.mdm.transaction.client.MDMTransaction.getStickySession() + "=" + mdmTransaction_<%=cid%>.getSessionId(); httpHeaders_<%=cid %>.put("Cookie", mdmTransaction_<%=cid %>.getCookies());
httpHeaders_<%=cid %>.put("Cookie", java.util.Arrays.asList(cookie_<%=cid %>));
context_<%=cid %>.put(org.apache.cxf.message.Message.PROTOCOL_HEADERS, httpHeaders_<%=cid %>); context_<%=cid %>.put(org.apache.cxf.message.Message.PROTOCOL_HEADERS, httpHeaders_<%=cid %>);
globalMap.put(transKey_<%=cid %>, mdmTransaction_<%=cid %>); globalMap.put(transKey_<%=cid %>, mdmTransaction_<%=cid %>);

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>6.2.1-SNAPSHOT</version> <version>6.2.1</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.designer.components.localprovider</artifactId> <artifactId>org.talend.designer.components.localprovider</artifactId>

View File

@@ -114,6 +114,11 @@
name="widget.type.file" name="widget.type.file"
widgetType="widget.type.file"> widgetType="widget.type.file">
</Mapping> </Mapping>
<Mapping
mapFieldType="DIRECTORY"
name="widget.type.directory"
widgetType="widget.type.directory">
</Mapping>
</extension> </extension>
<extension <extension
point="org.talend.designer.core.generators"> point="org.talend.designer.core.generators">

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>6.2.1-SNAPSHOT</version> <version>6.2.1</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.designer.core.generic</artifactId> <artifactId>org.talend.designer.core.generic</artifactId>

View File

@@ -31,6 +31,7 @@ import org.talend.commons.exception.BusinessException;
import org.talend.components.api.component.ComponentDefinition; import org.talend.components.api.component.ComponentDefinition;
import org.talend.components.api.component.ComponentImageType; import org.talend.components.api.component.ComponentImageType;
import org.talend.components.api.component.Connector; import org.talend.components.api.component.Connector;
import org.talend.components.api.component.OutputComponentDefinition;
import org.talend.components.api.component.PropertyPathConnector; import org.talend.components.api.component.PropertyPathConnector;
import org.talend.components.api.component.VirtualComponentDefinition; import org.talend.components.api.component.VirtualComponentDefinition;
import org.talend.components.api.properties.ComponentProperties; import org.talend.components.api.properties.ComponentProperties;
@@ -942,6 +943,18 @@ public class Component extends AbstractBasicComponent {
addStandardType(listConnector, EConnectionType.ON_COMPONENT_ERROR, parentNode); addStandardType(listConnector, EConnectionType.ON_COMPONENT_ERROR, parentNode);
addStandardType(listConnector, EConnectionType.ON_SUBJOB_OK, parentNode); addStandardType(listConnector, EConnectionType.ON_SUBJOB_OK, parentNode);
addStandardType(listConnector, EConnectionType.ON_SUBJOB_ERROR, parentNode); addStandardType(listConnector, EConnectionType.ON_SUBJOB_ERROR, parentNode);
// 1.Any component can have outgoing iterate connector
// 2.Only standalone and input components can have incoming iterate connector
// 3.No transformer component was created in 6.2, so ignore this situation
boolean isOutputComponent = componentDefinition instanceof OutputComponentDefinition || componentDefinition instanceof VirtualComponentDefinition;
INodeConnector iterateConnector = addStandardType(listConnector, EConnectionType.ITERATE, parentNode);
iterateConnector.setMaxLinkOutput(-1);
if (isOutputComponent) {
iterateConnector.setMaxLinkInput(0);
} else {
iterateConnector.setMaxLinkInput(1);
}
for (int i = 0; i < EConnectionType.values().length; i++) { for (int i = 0; i < EConnectionType.values().length; i++) {
EConnectionType currentType = EConnectionType.values()[i]; EConnectionType currentType = EConnectionType.values()[i];

View File

@@ -30,6 +30,8 @@ import org.talend.commons.exception.ExceptionHandler;
import org.talend.components.api.component.Connector; import org.talend.components.api.component.Connector;
import org.talend.components.api.properties.ComponentProperties; import org.talend.components.api.properties.ComponentProperties;
import org.talend.components.api.service.ComponentService; import org.talend.components.api.service.ComponentService;
import org.talend.core.model.components.EComponentType;
import org.talend.core.model.components.IComponent;
import org.talend.core.model.metadata.IMetadataTable; import org.talend.core.model.metadata.IMetadataTable;
import org.talend.core.model.metadata.MetadataToolAvroHelper; import org.talend.core.model.metadata.MetadataToolAvroHelper;
import org.talend.core.model.metadata.MetadataToolHelper; import org.talend.core.model.metadata.MetadataToolHelper;
@@ -302,18 +304,33 @@ public class GenericElementParameter extends ElementParameter {
if ((!mainTable.sameMetadataAs(newTable) || !newTable.sameMetadataAs(mainTable))) { if ((!mainTable.sameMetadataAs(newTable) || !newTable.sameMetadataAs(mainTable))) {
mainTable.setListColumns(newTable.getListColumns()); mainTable.setListColumns(newTable.getListColumns());
if (this.askPropagate == null && node.getOutgoingConnections().size() != 0) { if (this.askPropagate == null && node.getOutgoingConnections().size() != 0) {
Display.getDefault().syncExec(new Runnable() { boolean hasPropagation = false;
for (IConnection connection : node.getOutgoingConnections()) {
@Override if (connector.getName().equals(connection.getConnectorName())) {
public void run() { if (isSchemaPropagated(connection.getTarget())) {
askPropagate = ChangeMetadataCommand.askPropagate(); hasPropagation = true;
break;
}
} }
}); }
if (hasPropagation) {
Display.getDefault().syncExec(new Runnable() {
@Override
public void run() {
askPropagate = ChangeMetadataCommand.askPropagate();
}
});
}
} }
if (this.askPropagate != null && this.askPropagate) { if (this.askPropagate != null && this.askPropagate) {
for (IConnection connection : node.getOutgoingConnections()) { for (IConnection connection : node.getOutgoingConnections()) {
if (connector.getName().equals(connection.getConnectorName())) { if (connector.getName().equals(connection.getConnectorName())) {
ChangeMetadataCommand cmd = new ChangeMetadataCommand(connection.getTarget(), null, null, INode target = connection.getTarget();
if (!isSchemaPropagated(target)) {
continue;
}
ChangeMetadataCommand cmd = new ChangeMetadataCommand(target, null, null,
newTable, null); newTable, null);
cmd.setPropagate(true); cmd.setPropagate(true);
IProcess process = node.getProcess(); IProcess process = node.getProcess();
@@ -333,7 +350,22 @@ public class GenericElementParameter extends ElementParameter {
} }
} }
private String getParameterName() { private boolean isSchemaPropagated(INode node) {
if (node == null) {
return false;
}
IComponent component = node.getComponent();
if (component == null) {
return false;
}
// Always consider it is true for the new component.
if (EComponentType.GENERIC.equals(component.getComponentType())) {
return true;
}
return component.isSchemaAutoPropagated();
}
public String getParameterName() {
String paramName = getName(); String paramName = getName();
if (paramName.indexOf(IGenericConstants.EXP_SEPARATOR) != -1) { if (paramName.indexOf(IGenericConstants.EXP_SEPARATOR) != -1) {
paramName = paramName.substring(paramName.lastIndexOf(IGenericConstants.EXP_SEPARATOR) + 1); paramName = paramName.substring(paramName.lastIndexOf(IGenericConstants.EXP_SEPARATOR) + 1);

View File

@@ -3,6 +3,7 @@
tSalesforceConnection=tSalesforceConnection tSalesforceConnection=tSalesforceConnection
tSalesforceConnection.loginType=LOGIN_TYPE tSalesforceConnection.loginType=LOGIN_TYPE
tSalesforceConnection.endpoint=ENDPOINT tSalesforceConnection.endpoint=ENDPOINT
tSalesforceConnection.apiVersion=API_VERSION
tSalesforceConnection.oauth.clientId=OAUTH_CLIENT_ID tSalesforceConnection.oauth.clientId=OAUTH_CLIENT_ID
tSalesforceConnection.oauth.clientSecret=OAUTH_CLIENT_SECRET tSalesforceConnection.oauth.clientSecret=OAUTH_CLIENT_SECRET
tSalesforceConnection.oauth.callbackHost=OAUTH_CALLBACK_HOST tSalesforceConnection.oauth.callbackHost=OAUTH_CALLBACK_HOST
@@ -14,7 +15,9 @@ tSalesforceConnection.userPassword.securityKey=
tSalesforceConnection.bulkConnection=BULK_CONNECTION tSalesforceConnection.bulkConnection=BULK_CONNECTION
tSalesforceConnection.needCompression=NEED_COMPRESSION tSalesforceConnection.needCompression=NEED_COMPRESSION
tSalesforceConnection.httpTraceMessage=HTTP_TRACEMESSAGE tSalesforceConnection.httpTraceMessage=HTTP_TRACEMESSAGE
tSalesforceConnection.httpChunked=USE_HTTP_CHUNKED tSalesforceConnection.httpChunked=USE_HTTP_CHUNKED
tSalesforceConnection.reuseSession=USE_SAVE_SESSION
tSalesforceConnection.sessionDirectory=SESSION_DIRECTORY
tSalesforceConnection.clientId=CLIENT_ID tSalesforceConnection.clientId=CLIENT_ID
tSalesforceConnection.timeout=TIMEOUT tSalesforceConnection.timeout=TIMEOUT
tSalesforceConnection.proxy.useProxy=USE_PROXY tSalesforceConnection.proxy.useProxy=USE_PROXY
@@ -29,6 +32,7 @@ tSalesforceInput=tSalesforceInput
tSalesforceInput.connection.referencedComponent=CONNECTION tSalesforceInput.connection.referencedComponent=CONNECTION
tSalesforceInput.connection.loginType=LOGIN_TYPE tSalesforceInput.connection.loginType=LOGIN_TYPE
tSalesforceInput.connection.endpoint=ENDPOINT tSalesforceInput.connection.endpoint=ENDPOINT
tSalesforceInput.connection.apiVersion=API_VERSION
tSalesforceInput.connection.oauth.clientId=OAUTH_CLIENT_ID tSalesforceInput.connection.oauth.clientId=OAUTH_CLIENT_ID
tSalesforceInput.connection.oauth.clientSecret=OAUTH_CLIENT_SECRET tSalesforceInput.connection.oauth.clientSecret=OAUTH_CLIENT_SECRET
tSalesforceInput.connection.oauth.callbackHost=OAUTH_CALLBACK_HOST tSalesforceInput.connection.oauth.callbackHost=OAUTH_CALLBACK_HOST
@@ -51,6 +55,8 @@ tSalesforceInput.connection.bulkConnection=CONNECTION
tSalesforceInput.connection.needCompression=NEED_COMPRESSION tSalesforceInput.connection.needCompression=NEED_COMPRESSION
tSalesforceInput.connection.httpTraceMessage=HTTP_TRACEMESSAGE tSalesforceInput.connection.httpTraceMessage=HTTP_TRACEMESSAGE
tSalesforceInput.connection.httpChunked=USE_HTTP_CHUNKED tSalesforceInput.connection.httpChunked=USE_HTTP_CHUNKED
tSalesforceInput.connection.reuseSession=USE_SAVE_SESSION
tSalesforceInput.connection.sessionDirectory=SESSION_DIRECTORY
tSalesforceInput.connection.clientId=CLIENT_ID tSalesforceInput.connection.clientId=CLIENT_ID
tSalesforceInput.connection.timeout=TIMEOUT tSalesforceInput.connection.timeout=TIMEOUT
tSalesforceInput.connection.proxy.useProxy=USE_PROXY tSalesforceInput.connection.proxy.useProxy=USE_PROXY
@@ -68,6 +74,7 @@ tSalesforceOutput=tSalesforceOutput
tSalesforceOutput.connection.referencedComponent=CONNECTION tSalesforceOutput.connection.referencedComponent=CONNECTION
tSalesforceOutput.connection.loginType=LOGIN_TYPE tSalesforceOutput.connection.loginType=LOGIN_TYPE
tSalesforceOutput.connection.endpoint=ENDPOINT tSalesforceOutput.connection.endpoint=ENDPOINT
tSalesforceOutput.connection.apiVersion=API_VERSION
tSalesforceOutput.connection.oauth.clientId=OAUTH_CLIENT_ID tSalesforceOutput.connection.oauth.clientId=OAUTH_CLIENT_ID
tSalesforceOutput.connection.oauth.clientSecret=OAUTH_CLIENT_SECRET tSalesforceOutput.connection.oauth.clientSecret=OAUTH_CLIENT_SECRET
tSalesforceOutput.connection.oauth.callbackHost=OAUTH_CALLBACK_HOST tSalesforceOutput.connection.oauth.callbackHost=OAUTH_CALLBACK_HOST
@@ -87,6 +94,8 @@ tSalesforceOutput.connection.bulkConnection=CONNECTION
tSalesforceOutput.connection.needCompression=NEED_COMPRESSION tSalesforceOutput.connection.needCompression=NEED_COMPRESSION
tSalesforceOutput.connection.httpTraceMessage=HTTP_TRACEMESSAGE tSalesforceOutput.connection.httpTraceMessage=HTTP_TRACEMESSAGE
tSalesforceOutput.connection.httpChunked=USE_HTTP_CHUNKED tSalesforceOutput.connection.httpChunked=USE_HTTP_CHUNKED
tSalesforceOutput.connection.reuseSession=USE_SAVE_SESSION
tSalesforceOutput.connection.sessionDirectory=SESSION_DIRECTORY
tSalesforceOutput.connection.clientId=CLIENT_ID tSalesforceOutput.connection.clientId=CLIENT_ID
tSalesforceOutput.connection.timeout=TIMEOUT tSalesforceOutput.connection.timeout=TIMEOUT
tSalesforceOutput.connection.proxy.useProxy=USE_PROXY tSalesforceOutput.connection.proxy.useProxy=USE_PROXY
@@ -113,6 +122,7 @@ tSalesforceBulkExec=tSalesforceBulkExec
tSalesforceBulkExec.connection.referencedComponent=CONNECTION tSalesforceBulkExec.connection.referencedComponent=CONNECTION
tSalesforceBulkExec.connection.loginType=LOGIN_TYPE tSalesforceBulkExec.connection.loginType=LOGIN_TYPE
tSalesforceBulkExec.connection.endpoint=ENDPOINT tSalesforceBulkExec.connection.endpoint=ENDPOINT
tSalesforceBulkExec.connection.apiVersion=API_VERSION
tSalesforceBulkExec.connection.oauth.clientId=OAUTH_CLIENT_ID tSalesforceBulkExec.connection.oauth.clientId=OAUTH_CLIENT_ID
tSalesforceBulkExec.connection.oauth.clientSecret=OAUTH_CLIENT_SECRET tSalesforceBulkExec.connection.oauth.clientSecret=OAUTH_CLIENT_SECRET
tSalesforceBulkExec.connection.oauth.callbackHost=OAUTH_CALLBACK_HOST tSalesforceBulkExec.connection.oauth.callbackHost=OAUTH_CALLBACK_HOST
@@ -157,6 +167,7 @@ tSalesforceGetDeleted=tSalesforceGetDeleted
tSalesforceGetDeleted.connection.referencedComponent=CONNECTION tSalesforceGetDeleted.connection.referencedComponent=CONNECTION
tSalesforceGetDeleted.connection.loginType=LOGIN_TYPE tSalesforceGetDeleted.connection.loginType=LOGIN_TYPE
tSalesforceGetDeleted.connection.endpoint=ENDPOINT tSalesforceGetDeleted.connection.endpoint=ENDPOINT
tSalesforceGetDeleted.connection.apiVersion=API_VERSION
tSalesforceGetDeleted.connection.oauth.clientId=OAUTH_CLIENT_ID tSalesforceGetDeleted.connection.oauth.clientId=OAUTH_CLIENT_ID
tSalesforceGetDeleted.connection.oauth.clientSecret=OAUTH_CLIENT_SECRET tSalesforceGetDeleted.connection.oauth.clientSecret=OAUTH_CLIENT_SECRET
tSalesforceGetDeleted.connection.oauth.callbackHost=OAUTH_CALLBACK_HOST tSalesforceGetDeleted.connection.oauth.callbackHost=OAUTH_CALLBACK_HOST
@@ -174,6 +185,8 @@ tSalesforceGetDeleted.connection.bulkConnection=CONNECTION
tSalesforceGetDeleted.connection.needCompression=NEED_COMPRESSION tSalesforceGetDeleted.connection.needCompression=NEED_COMPRESSION
tSalesforceGetDeleted.connection.httpTraceMessage=HTTP_TRACEMESSAGE tSalesforceGetDeleted.connection.httpTraceMessage=HTTP_TRACEMESSAGE
tSalesforceGetDeleted.connection.httpChunked=USE_HTTP_CHUNKED tSalesforceGetDeleted.connection.httpChunked=USE_HTTP_CHUNKED
tSalesforceGetDeleted.connection.reuseSession=USE_SAVE_SESSION
tSalesforceGetDeleted.connection.sessionDirectory=SESSION_DIRECTORY
tSalesforceGetDeleted.connection.clientId=CLIENT_ID tSalesforceGetDeleted.connection.clientId=CLIENT_ID
tSalesforceGetDeleted.connection.timeout=TIMEOUT tSalesforceGetDeleted.connection.timeout=TIMEOUT
tSalesforceGetDeleted.connection.proxy.useProxy=USE_PROXY tSalesforceGetDeleted.connection.proxy.useProxy=USE_PROXY
@@ -188,6 +201,7 @@ tSalesforceGetUpdated=tSalesforceGetUpdated
tSalesforceGetUpdated.connection.referencedComponent=CONNECTION tSalesforceGetUpdated.connection.referencedComponent=CONNECTION
tSalesforceGetUpdated.connection.loginType=LOGIN_TYPE tSalesforceGetUpdated.connection.loginType=LOGIN_TYPE
tSalesforceGetUpdated.connection.endpoint=ENDPOINT tSalesforceGetUpdated.connection.endpoint=ENDPOINT
tSalesforceGetUpdated.connection.apiVersion=API_VERSION
tSalesforceGetUpdated.connection.oauth.clientId=OAUTH_CLIENT_ID tSalesforceGetUpdated.connection.oauth.clientId=OAUTH_CLIENT_ID
tSalesforceGetUpdated.connection.oauth.clientSecret=OAUTH_CLIENT_SECRET tSalesforceGetUpdated.connection.oauth.clientSecret=OAUTH_CLIENT_SECRET
tSalesforceGetUpdated.connection.oauth.callbackHost=OAUTH_CALLBACK_HOST tSalesforceGetUpdated.connection.oauth.callbackHost=OAUTH_CALLBACK_HOST
@@ -205,6 +219,8 @@ tSalesforceGetUpdated.connection.bulkConnection=CONNECTION
tSalesforceGetUpdated.connection.needCompression=NEED_COMPRESSION tSalesforceGetUpdated.connection.needCompression=NEED_COMPRESSION
tSalesforceGetUpdated.connection.httpTraceMessage=HTTP_TRACEMESSAGE tSalesforceGetUpdated.connection.httpTraceMessage=HTTP_TRACEMESSAGE
tSalesforceGetUpdated.connection.httpChunked=USE_HTTP_CHUNKED tSalesforceGetUpdated.connection.httpChunked=USE_HTTP_CHUNKED
tSalesforceGetUpdated.connection.reuseSession=USE_SAVE_SESSION
tSalesforceGetUpdated.connection.sessionDirectory=SESSION_DIRECTORY
tSalesforceGetUpdated.connection.clientId=CLIENT_ID tSalesforceGetUpdated.connection.clientId=CLIENT_ID
tSalesforceGetUpdated.connection.timeout=TIMEOUT tSalesforceGetUpdated.connection.timeout=TIMEOUT
tSalesforceGetUpdated.connection.proxy.useProxy=USE_PROXY tSalesforceGetUpdated.connection.proxy.useProxy=USE_PROXY
@@ -219,6 +235,7 @@ tSalesforceOutputBulkExec=tSalesforceOutputBulkExec
tSalesforceOutputBulkExec.connection.referencedComponent=CONNECTION tSalesforceOutputBulkExec.connection.referencedComponent=CONNECTION
tSalesforceOutputBulkExec.connection.loginType=LOGIN_TYPE tSalesforceOutputBulkExec.connection.loginType=LOGIN_TYPE
tSalesforceOutputBulkExec.connection.endpoint=ENDPOINT tSalesforceOutputBulkExec.connection.endpoint=ENDPOINT
tSalesforceOutputBulkExec.connection.apiVersion=API_VERSION
tSalesforceOutputBulkExec.connection.oauth.clientId=OAUTH_CLIENT_ID tSalesforceOutputBulkExec.connection.oauth.clientId=OAUTH_CLIENT_ID
tSalesforceOutputBulkExec.connection.oauth.clientSecret=OAUTH_CLIENT_SECRET tSalesforceOutputBulkExec.connection.oauth.clientSecret=OAUTH_CLIENT_SECRET
tSalesforceOutputBulkExec.connection.oauth.callbackHost=OAUTH_CALLBACK_HOST tSalesforceOutputBulkExec.connection.oauth.callbackHost=OAUTH_CALLBACK_HOST
@@ -265,6 +282,7 @@ tSalesforceGetServerTimestamp=tSalesforceGetServerTimestamp
tSalesforceGetServerTimestamp.connection.referencedComponent=CONNECTION tSalesforceGetServerTimestamp.connection.referencedComponent=CONNECTION
tSalesforceGetServerTimestamp.connection.loginType=LOGIN_TYPE tSalesforceGetServerTimestamp.connection.loginType=LOGIN_TYPE
tSalesforceGetServerTimestamp.connection.endpoint=ENDPOINT tSalesforceGetServerTimestamp.connection.endpoint=ENDPOINT
tSalesforceGetServerTimestamp.connection.apiVersion=API_VERSION
tSalesforceGetServerTimestamp.connection.oauth.clientId=OAUTH_CLIENT_ID tSalesforceGetServerTimestamp.connection.oauth.clientId=OAUTH_CLIENT_ID
tSalesforceGetServerTimestamp.connection.oauth.clientSecret=OAUTH_CLIENT_SECRET tSalesforceGetServerTimestamp.connection.oauth.clientSecret=OAUTH_CLIENT_SECRET
tSalesforceGetServerTimestamp.connection.oauth.callbackHost=OAUTH_CALLBACK_HOST tSalesforceGetServerTimestamp.connection.oauth.callbackHost=OAUTH_CALLBACK_HOST
@@ -277,6 +295,8 @@ tSalesforceGetServerTimestamp.module.main.schema=SCHEMA
tSalesforceGetServerTimestamp.module.main.schema.connector=FLOW->MAIN tSalesforceGetServerTimestamp.module.main.schema.connector=FLOW->MAIN
tSalesforceGetServerTimestamp.connection.needCompression=NEED_COMPRESSION tSalesforceGetServerTimestamp.connection.needCompression=NEED_COMPRESSION
tSalesforceGetServerTimestamp.connection.httpChunked=USE_HTTP_CHUNKED tSalesforceGetServerTimestamp.connection.httpChunked=USE_HTTP_CHUNKED
tSalesforceGetServerTimestamp.connection.reuseSession=USE_SAVE_SESSION
tSalesforceGetServerTimestamp.connection.sessionDirectory=SESSION_DIRECTORY
tSalesforceGetServerTimestamp.connection.clientId=CLIENT_ID tSalesforceGetServerTimestamp.connection.clientId=CLIENT_ID
tSalesforceGetServerTimestamp.connection.timeout=TIMEOUT tSalesforceGetServerTimestamp.connection.timeout=TIMEOUT
tSalesforceGetServerTimestamp.connection.proxy.useProxy=USE_PROXY tSalesforceGetServerTimestamp.connection.proxy.useProxy=USE_PROXY

View File

@@ -272,7 +272,8 @@ public class ComponentsUtils {
Property property = (Property) widgetProperty; Property property = (Property) widgetProperty;
param.setRequired(property.isRequired()); param.setRequired(property.isRequired());
param.setValue(getParameterValue(element, property, fieldType, isInitializing)); param.setValue(getParameterValue(element, property, fieldType, isInitializing));
if (EParameterFieldType.NAME_SELECTION_AREA.equals(fieldType)) { boolean isNameProperty = IGenericConstants.NAME_PROPERTY.equals(param.getParameterName());
if (EParameterFieldType.NAME_SELECTION_AREA.equals(fieldType) || isNameProperty) {
// Disable context support for this filed type. // Disable context support for this filed type.
param.setSupportContext(false); param.setSupportContext(false);
} else { } else {
@@ -587,13 +588,21 @@ public class ComponentsUtils {
} }
public static ComponentProperties getComponentPropertiesFromSerialized(String serialized, Connection connection) { public static ComponentProperties getComponentPropertiesFromSerialized(String serialized, Connection connection) {
return getComponentPropertiesFromSerialized(serialized, connection, true);
}
public static ComponentProperties getComponentPropertiesFromSerialized(String serialized, Connection connection,
boolean withEvaluator) {
if (serialized != null) { if (serialized != null) {
SerializerDeserializer.Deserialized<ComponentProperties> fromSerialized = Properties.Helper.fromSerializedPersistent(serialized, SerializerDeserializer.Deserialized<ComponentProperties> fromSerialized = Properties.Helper
ComponentProperties.class, new PostDeserializeSetup() { .fromSerializedPersistent(serialized, ComponentProperties.class, new PostDeserializeSetup() {
@Override @Override
public void setup(Object properties) { public void setup(Object properties) {
((Properties)properties).setValueEvaluator(new MetadataContextPropertyValueEvaluator(connection)); if (withEvaluator) {
((Properties) properties)
.setValueEvaluator(new MetadataContextPropertyValueEvaluator(connection));
}
} }
}); });
if (fromSerialized != null) { if (fromSerialized != null) {

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>6.2.1-SNAPSHOT</version> <version>6.2.1</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.designer.core</artifactId> <artifactId>org.talend.designer.core</artifactId>

View File

@@ -226,4 +226,8 @@ public abstract class AbstractProcessProvider implements IReplaceNodeInProcess {
AbstractProcessProvider.componentProcess = componentProcess; AbstractProcessProvider.componentProcess = componentProcess;
} }
public boolean canHandleNode(INode node) {
return false;
}
} }

View File

@@ -483,6 +483,10 @@ public abstract class Processor implements IProcessor, IEclipseProcessor, Talend
// do something... // do something...
} }
public void generateCode(boolean statistics, boolean trace, boolean properties, int option) throws ProcessorException {
generateCode(statistics, trace, properties);
}
/* /*
* (non-Javadoc) * (non-Javadoc)
* *

View File

@@ -77,7 +77,8 @@ public class SetupProcessDependenciesRoutinesAction extends AContextualAction {
} else if (ERepositoryObjectType.PROCESS_MR != null && node.getObjectType().equals(ERepositoryObjectType.PROCESS_MR)) { } else if (ERepositoryObjectType.PROCESS_MR != null && node.getObjectType().equals(ERepositoryObjectType.PROCESS_MR)) {
canWork = true; canWork = true;
} else if (node.getObjectType() != ERepositoryObjectType.PROCESS } else if (node.getObjectType() != ERepositoryObjectType.PROCESS
&& node.getObjectType() != ERepositoryObjectType.JOBLET) { && node.getObjectType() != ERepositoryObjectType.JOBLET
&& node.getObjectType() != ERepositoryObjectType.PROCESS_ROUTE) {
canWork = false; canWork = false;
} }
break; break;

View File

@@ -419,7 +419,7 @@ public class StandAloneTalendJavaEditor extends CompilationUnitEditor implements
if (!isEditable()) { if (!isEditable()) {
return false; return false;
} }
return propertyIsDirty || super.isDirty(); return super.isDirty();
} }
@Override @Override
@@ -562,14 +562,12 @@ public class StandAloneTalendJavaEditor extends CompilationUnitEditor implements
private FileItem item; private FileItem item;
private boolean propertyIsDirty;
private final AdapterImpl dirtyListener = new AdapterImpl() { private final AdapterImpl dirtyListener = new AdapterImpl() {
@Override @Override
public void notifyChanged(Notification notification) { public void notifyChanged(Notification notification) {
if (notification.getEventType() != Notification.REMOVING_ADAPTER) { if (notification.getEventType() != Notification.REMOVING_ADAPTER) {
propertyIsDirty = true;
Display.getDefault().syncExec(new Runnable() { Display.getDefault().syncExec(new Runnable() {
@Override @Override
@@ -611,7 +609,6 @@ public class StandAloneTalendJavaEditor extends CompilationUnitEditor implements
ICompilationUnit unit = (ICompilationUnit) this.getInputJavaElement(); ICompilationUnit unit = (ICompilationUnit) this.getInputJavaElement();
String newName = item.getProperty().getLabel(); String newName = item.getProperty().getLabel();
propertyIsDirty = false;
try { try {
boolean noError = true; boolean noError = true;
// String newName2 = newName + SuffixConstants.SUFFIX_STRING_java; // String newName2 = newName + SuffixConstants.SUFFIX_STRING_java;

View File

@@ -20,7 +20,9 @@ import java.util.Map;
import org.apache.commons.lang.ArrayUtils; import org.apache.commons.lang.ArrayUtils;
import org.eclipse.gef.commands.Command; import org.eclipse.gef.commands.Command;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.talend.commons.utils.threading.ExecutionLimiter; import org.talend.commons.utils.threading.ExecutionLimiter;
import org.talend.commons.utils.threading.ExecutionLimiterImproved; import org.talend.commons.utils.threading.ExecutionLimiterImproved;
import org.talend.core.GlobalServiceRegister; import org.talend.core.GlobalServiceRegister;
@@ -84,7 +86,7 @@ public class PropertyChangeCommand extends Command {
// private ChangeMetadataCommand changeMetadataCommand; // private ChangeMetadataCommand changeMetadataCommand;
private List<ChangeMetadataCommand> changeMetadataCommands; private List<ChangeMetadataCommand> changeMetadataCommands;
private Command updateELTMapComponentCommand; private Command updateELTMapComponentCommand;
private String propertyTypeName; private String propertyTypeName;
@@ -246,6 +248,22 @@ public class PropertyChangeCommand extends Command {
oldValue = elem.getPropertyValue(propName); oldValue = elem.getPropertyValue(propName);
elem.setPropertyValue(propName, newValue); elem.setPropertyValue(propName, newValue);
if (currentParam.getFieldType().equals(EParameterFieldType.CONNECTION_LIST) && currentParam.getContext() != null
&& (elem instanceof Node)) {
String connParaname = currentParam.getContext() + ":" + currentParam.getName();
if (connParaname.equals(propName)) {
IConnection selectedConn = null;
for (IConnection conn : ((Node) elem).getIncomingConnections()) {
if (conn.getUniqueName().equals(newValue)) {
selectedConn = conn;
break;
}
}
if (selectedConn != null && getTakeSchema()) {
((Node) selectedConn.getSource()).takeSchemaFrom((Node) elem, currentParam.getContext());
}
}
}
if ("ELT_TABLE_NAME".equals(propName) || "ELT_SCHEMA_NAME".equals(propName)) { //$NON-NLS-1$ //$NON-NLS-2$ if ("ELT_TABLE_NAME".equals(propName) || "ELT_SCHEMA_NAME".equals(propName)) { //$NON-NLS-1$ //$NON-NLS-2$
String oldELTValue = ""; //$NON-NLS-1$ String oldELTValue = ""; //$NON-NLS-1$
String newELTValue = ""; //$NON-NLS-1$ String newELTValue = ""; //$NON-NLS-1$
@@ -264,12 +282,12 @@ public class PropertyChangeCommand extends Command {
String tableName = TalendQuoteUtils.removeQuotes((String) elem.getPropertyValue("ELT_TABLE_NAME")); //$NON-NLS-1$ String tableName = TalendQuoteUtils.removeQuotes((String) elem.getPropertyValue("ELT_TABLE_NAME")); //$NON-NLS-1$
if (oldParamValue != null && !"".equals(oldParamValue.trim())) { if (oldParamValue != null && !"".equals(oldParamValue.trim())) {
oldELTValue = oldParamValue + "."; //$NON-NLS-1$ oldELTValue = oldParamValue + "."; //$NON-NLS-1$
} }
if (newParamValue != null && !"".equals(newParamValue.trim())) { if (newParamValue != null && !"".equals(newParamValue.trim())) {
newELTValue = newParamValue + "."; //$NON-NLS-1$ newELTValue = newParamValue + "."; //$NON-NLS-1$
} }
oldELTValue = oldELTValue + tableName; //$NON-NLS-1$ oldELTValue = oldELTValue + tableName; // $NON-NLS-1$
newELTValue = newELTValue + tableName; //$NON-NLS-1$ newELTValue = newELTValue + tableName; // $NON-NLS-1$
} }
List<? extends IConnection> connections = ((Node) elem).getOutgoingConnections(); List<? extends IConnection> connections = ((Node) elem).getOutgoingConnections();
for (IConnection connection : connections) { for (IConnection connection : connections) {
@@ -279,7 +297,8 @@ public class PropertyChangeCommand extends Command {
if (GlobalServiceRegister.getDefault().isServiceRegistered(IDbMapDesignerService.class)) { if (GlobalServiceRegister.getDefault().isServiceRegistered(IDbMapDesignerService.class)) {
IDbMapDesignerService service = (IDbMapDesignerService) GlobalServiceRegister.getDefault() IDbMapDesignerService service = (IDbMapDesignerService) GlobalServiceRegister.getDefault()
.getService(IDbMapDesignerService.class); .getService(IDbMapDesignerService.class);
updateELTMapComponentCommand = service.getUpdateELTMapComponentCommand(targetNode, connection, oldELTValue, newELTValue); updateELTMapComponentCommand = service.getUpdateELTMapComponentCommand(targetNode, connection,
oldELTValue, newELTValue);
updateELTMapComponentCommand.execute(); updateELTMapComponentCommand.execute();
} }
} }
@@ -295,13 +314,12 @@ public class PropertyChangeCommand extends Command {
Node node = (Node) elem; Node node = (Node) elem;
for (IElementParameter param : node.getElementParameters()) { for (IElementParameter param : node.getElementParameters()) {
String repositoryValue = param.getRepositoryValue(); String repositoryValue = param.getRepositoryValue();
if ((repositoryValue != null) if ((repositoryValue != null) && (!param.getName().equals(EParameterName.PROPERTY_TYPE.getName()))
&& (!param.getName().equals(EParameterName.PROPERTY_TYPE.getName()))
&& param.getFieldType() != EParameterFieldType.MEMO_SQL && param.getFieldType() != EParameterFieldType.MEMO_SQL
&& !("tMDMReceive".equals(node.getComponent().getName()) && "XPATH_PREFIX".equals(param //$NON-NLS-1$ //$NON-NLS-2$ && !("tMDMReceive".equals(node.getComponent().getName()) && "XPATH_PREFIX".equals(param //$NON-NLS-1$ //$NON-NLS-2$
.getRepositoryValue())) .getRepositoryValue()))
&& !("tSAPOutput".equals(node.getComponent().getName()) && param.getName().equals( && !("tSAPOutput".equals(node.getComponent().getName())
UpdatesConstants.MAPPING)) && param.getName().equals(UpdatesConstants.MAPPING))
&& !("tFileInputEBCDIC".equals(node.getComponent().getName()) && "DATA_FILE".equals(repositoryValue))) { && !("tFileInputEBCDIC".equals(node.getComponent().getName()) && "DATA_FILE".equals(repositoryValue))) {
param.setRepositoryValueUsed(true); param.setRepositoryValueUsed(true);
if (!(EParameterName.DB_VERSION.getName()).equals(param.getName())) { if (!(EParameterName.DB_VERSION.getName()).equals(param.getName())) {
@@ -423,10 +441,10 @@ public class PropertyChangeCommand extends Command {
JobSettingVersionUtil.setDbVersion(elementParameter, dbType, true); JobSettingVersionUtil.setDbVersion(elementParameter, dbType, true);
DesignerUtilities.setSchemaDB(schemaParameter, newValue); DesignerUtilities.setSchemaDB(schemaParameter, newValue);
} else if (propName.equals(JobSettingsConstants.getExtraParameterName(EParameterName.DB_TYPE.getName()))) { } else if (propName.equals(JobSettingsConstants.getExtraParameterName(EParameterName.DB_TYPE.getName()))) {
IElementParameter elementParameter = elem.getElementParameter(JobSettingsConstants IElementParameter elementParameter = elem
.getExtraParameterName(EParameterName.DB_VERSION.getName())); .getElementParameter(JobSettingsConstants.getExtraParameterName(EParameterName.DB_VERSION.getName()));
schemaParameter = elem.getElementParameter(JobSettingsConstants.getExtraParameterName(EParameterName.SCHEMA_DB schemaParameter = elem
.getName())); .getElementParameter(JobSettingsConstants.getExtraParameterName(EParameterName.SCHEMA_DB.getName()));
JobSettingVersionUtil.setDbVersion(elementParameter, dbType, true); JobSettingVersionUtil.setDbVersion(elementParameter, dbType, true);
DesignerUtilities.setSchemaDB(schemaParameter, newValue); DesignerUtilities.setSchemaDB(schemaParameter, newValue);
} }
@@ -435,13 +453,12 @@ public class PropertyChangeCommand extends Command {
&& !schemaParameter.getValue().equals("")) { && !schemaParameter.getValue().equals("")) {
schemaParameter.setValue(""); schemaParameter.setValue("");
} }
if (!toUpdate if (!toUpdate && (currentParam.getFieldType().equals(EParameterFieldType.RADIO)
&& (currentParam.getFieldType().equals(EParameterFieldType.RADIO) || currentParam.getFieldType().equals(EParameterFieldType.CLOSED_LIST)
|| currentParam.getFieldType().equals(EParameterFieldType.CLOSED_LIST) || currentParam.getFieldType().equals(EParameterFieldType.OPENED_LIST)
|| currentParam.getFieldType().equals(EParameterFieldType.OPENED_LIST) || currentParam.getFieldType().equals(EParameterFieldType.CHECK)
|| currentParam.getFieldType().equals(EParameterFieldType.CHECK) || currentParam.getFieldType().equals(EParameterFieldType.AS400_CHECK)
|| currentParam.getFieldType().equals(EParameterFieldType.AS400_CHECK) || currentParam.getFieldType() || currentParam.getFieldType().equals(EParameterFieldType.COMPONENT_LIST))) {
.equals(EParameterFieldType.COMPONENT_LIST))) {
toUpdate = false; toUpdate = false;
setDefaultValues(currentParam, elem); setDefaultValues(currentParam, elem);
} }
@@ -700,8 +717,8 @@ public class PropertyChangeCommand extends Command {
oldElementValues.put(testedParam, testedParam.getValue()); oldElementValues.put(testedParam, testedParam.getValue());
// if the field is not a schema type, then use standard "set value". // if the field is not a schema type, then use standard "set value".
if (!(testedParam.getFieldType().equals(EParameterFieldType.SCHEMA_TYPE) || testedParam.getFieldType().equals( if (!(testedParam.getFieldType().equals(EParameterFieldType.SCHEMA_TYPE)
EParameterFieldType.SCHEMA_REFERENCE))) { || testedParam.getFieldType().equals(EParameterFieldType.SCHEMA_REFERENCE))) {
String oldMapping = ""; //$NON-NLS-1$ String oldMapping = ""; //$NON-NLS-1$
if (!testedParam.getFieldType().equals(EParameterFieldType.CHECK) if (!testedParam.getFieldType().equals(EParameterFieldType.CHECK)
&& !testedParam.getFieldType().equals(EParameterFieldType.RADIO)) { && !testedParam.getFieldType().equals(EParameterFieldType.RADIO)) {
@@ -729,8 +746,8 @@ public class PropertyChangeCommand extends Command {
// for feature 0014652 // for feature 0014652
boolean isBuiltIn = false; boolean isBuiltIn = false;
final IElementParameter elementParameter = testedParam.getChildParameters().get( final IElementParameter elementParameter = testedParam.getChildParameters()
EParameterFieldType.SCHEMA_TYPE.getName()); .get(EParameterFieldType.SCHEMA_TYPE.getName());
if (elementParameter != null) { if (elementParameter != null) {
Object value = elementParameter.getValue(); Object value = elementParameter.getValue();
if ("BUILT_IN".equals(value.toString())) {//$NON-NLS-1$ if ("BUILT_IN".equals(value.toString())) {//$NON-NLS-1$
@@ -844,7 +861,7 @@ public class PropertyChangeCommand extends Command {
} }
if (updateELTMapComponentCommand != null) { if (updateELTMapComponentCommand != null) {
updateELTMapComponentCommand.undo(); updateELTMapComponentCommand.undo();
} }
CodeView.refreshCodeView(elem); CodeView.refreshCodeView(elem);
ComponentSettings.switchToCurComponentSettingsView(); ComponentSettings.switchToCurComponentSettingsView();
JobSettings.switchToCurJobSettingsView(); JobSettings.switchToCurJobSettingsView();
@@ -905,7 +922,7 @@ public class PropertyChangeCommand extends Command {
} }
if (updateELTMapComponentCommand != null) { if (updateELTMapComponentCommand != null) {
updateELTMapComponentCommand.redo(); updateELTMapComponentCommand.redo();
} }
CodeView.refreshCodeView(elem); CodeView.refreshCodeView(elem);
ComponentSettings.switchToCurComponentSettingsView(); ComponentSettings.switchToCurComponentSettingsView();
JobSettings.switchToCurJobSettingsView(); JobSettings.switchToCurJobSettingsView();
@@ -929,8 +946,8 @@ public class PropertyChangeCommand extends Command {
private void refreshResumingConnections() { private void refreshResumingConnections() {
if (propName.equals(EParameterName.RESUMING_CHECKPOINT.getName()) && this.elem instanceof Connection) { if (propName.equals(EParameterName.RESUMING_CHECKPOINT.getName()) && this.elem instanceof Connection) {
if (((Connection) this.elem).getConnectionTrace() != null && !propName.equals(EParameterName.CONDITION)) { if (((Connection) this.elem).getConnectionTrace() != null && !propName.equals(EParameterName.CONDITION)) {
((Connection) this.elem).getConnectionTrace() ((Connection) this.elem).getConnectionTrace().setPropertyValue(EParameterName.RESUMING_CHECKPOINT.getName(),
.setPropertyValue(EParameterName.RESUMING_CHECKPOINT.getName(), true); true);
} }
} }
} }
@@ -1007,4 +1024,8 @@ public class PropertyChangeCommand extends Command {
} }
private boolean getTakeSchema() {
return MessageDialog.openQuestion(new Shell(), "", Messages.getString("Node.getSchemaOrNot")); //$NON-NLS-1$ //$NON-NLS-2$
}
} }

View File

@@ -669,7 +669,24 @@ public class Connection extends Element implements IConnection, IPerformance {
IConnection.TRACE_SCHEMA_COLUMN_CONDITION }; IConnection.TRACE_SCHEMA_COLUMN_CONDITION };
param.setListItemsDisplayCodeName(columns); param.setListItemsDisplayCodeName(columns);
param.setListItemsDisplayName(columns); param.setListItemsDisplayName(columns);
param.setListItemsValue(new ElementParameter[0]);
ElementParameter traceColumn = new ElementParameter(this);
traceColumn.setName(IConnection.TRACE_SCHEMA_COLUMN);
traceColumn.setDisplayName(""); //$NON-NLS-1$
traceColumn.setFieldType(EParameterFieldType.TEXT);
traceColumn.setValue(""); //$NON-NLS-1$
ElementParameter traceColumnChecked = new ElementParameter(this);
traceColumnChecked.setName(IConnection.TRACE_SCHEMA_COLUMN_CHECKED);
traceColumnChecked.setDisplayName(""); //$NON-NLS-1$
traceColumnChecked.setFieldType(EParameterFieldType.CHECK);
traceColumnChecked.setValue(true);
ElementParameter traceColumnCondition = new ElementParameter(this);
traceColumnCondition.setName(IConnection.TRACE_SCHEMA_COLUMN_CHECKED);
traceColumnCondition.setDisplayName(""); //$NON-NLS-1$
traceColumnCondition.setFieldType(EParameterFieldType.TEXT);
traceColumnCondition.setValue(""); //$NON-NLS-1$
ElementParameter[] listItemsValue = new ElementParameter[] { traceColumn, traceColumnChecked, traceColumnCondition };
param.setListItemsValue(listItemsValue);
param.setValue(new ArrayList<Map<String, Object>>()); param.setValue(new ArrayList<Map<String, Object>>());
param.setCategory(EComponentCategory.ADVANCED); param.setCategory(EComponentCategory.ADVANCED);
param.setShow(false); param.setShow(false);

View File

@@ -3289,12 +3289,12 @@ public class Process extends Element implements IProcess2, IGEFProcess, ILastVer
*/ */
@Override @Override
public void checkProcess() { public void checkProcess() {
if (isActivate()) { if (isActivate() && !isDuplicate()) {
checkProblems(); checkProblems();
} }
} }
private void checkProblems() { protected void checkProblems() {
Problems.removeProblemsByProcess(this); Problems.removeProblemsByProcess(this);
for (INode node : nodes) { for (INode node : nodes) {

View File

@@ -78,6 +78,7 @@ import org.talend.core.model.components.ComponentCategory;
import org.talend.core.model.components.ComponentUtilities; import org.talend.core.model.components.ComponentUtilities;
import org.talend.core.model.components.IComponent; import org.talend.core.model.components.IComponent;
import org.talend.core.model.components.IComponentsService; import org.talend.core.model.components.IComponentsService;
import org.talend.core.model.general.Project;
import org.talend.core.model.metadata.IEbcdicConstant; import org.talend.core.model.metadata.IEbcdicConstant;
import org.talend.core.model.metadata.IHL7Constant; import org.talend.core.model.metadata.IHL7Constant;
import org.talend.core.model.metadata.IMetadataTable; import org.talend.core.model.metadata.IMetadataTable;
@@ -191,6 +192,7 @@ import org.talend.designer.core.ui.preferences.TalendDesignerPrefConstants;
import org.talend.designer.core.utils.DesignerUtilities; import org.talend.designer.core.utils.DesignerUtilities;
import org.talend.designer.core.utils.ValidationRulesUtil; import org.talend.designer.core.utils.ValidationRulesUtil;
import org.talend.metadata.managment.ui.utils.ConnectionContextHelper; import org.talend.metadata.managment.ui.utils.ConnectionContextHelper;
import org.talend.repository.ProjectManager;
import org.talend.repository.RepositoryPlugin; import org.talend.repository.RepositoryPlugin;
import org.talend.repository.model.IProxyRepositoryFactory; import org.talend.repository.model.IProxyRepositoryFactory;
import org.talend.repository.model.IRepositoryNode; import org.talend.repository.model.IRepositoryNode;
@@ -626,7 +628,8 @@ public class TalendEditorDropTargetListener extends TemplateTransferDropTargetLi
} }
Item subItem = repositoryNode.getObject().getProperty().getItem(); Item subItem = repositoryNode.getObject().getProperty().getItem();
Item hadoopClusterItem = hadoopClusterService.getHadoopClusterBySubitemId(subItem.getProperty().getId()); Item hadoopClusterItem = hadoopClusterService.getHadoopClusterBySubitemId(
new Project(ProjectManager.getInstance().getProject(subItem)), subItem.getProperty().getId());
String hadoopClusterId = hadoopClusterItem.getProperty().getId(); String hadoopClusterId = hadoopClusterItem.getProperty().getId();
String propertyParamName = MR_PROPERTY_PREFIX + EParameterName.PROPERTY_TYPE.getName(); String propertyParamName = MR_PROPERTY_PREFIX + EParameterName.PROPERTY_TYPE.getName();

View File

@@ -16,8 +16,6 @@ import java.beans.PropertyChangeEvent;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.eclipse.core.runtime.Assert;
import org.eclipse.emf.common.util.EList;
import org.eclipse.gef.commands.Command; import org.eclipse.gef.commands.Command;
import org.eclipse.jface.fieldassist.DecoratedField; import org.eclipse.jface.fieldassist.DecoratedField;
import org.eclipse.jface.fieldassist.FieldDecoration; import org.eclipse.jface.fieldassist.FieldDecoration;
@@ -36,36 +34,22 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Text; import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants; import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
import org.talend.commons.exception.PersistenceException;
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
import org.talend.commons.ui.runtime.image.ImageProvider; import org.talend.commons.ui.runtime.image.ImageProvider;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.IESBService;
import org.talend.core.model.metadata.builder.connection.Connection; import org.talend.core.model.metadata.builder.connection.Connection;
import org.talend.core.model.metadata.builder.connection.DatabaseConnection;
import org.talend.core.model.metadata.builder.connection.QueriesConnection;
import org.talend.core.model.metadata.builder.connection.Query;
import org.talend.core.model.metadata.builder.database.ExtractMetaDataUtils; import org.talend.core.model.metadata.builder.database.ExtractMetaDataUtils;
import org.talend.core.model.process.EParameterFieldType; import org.talend.core.model.process.EParameterFieldType;
import org.talend.core.model.process.IElementParameter; import org.talend.core.model.process.IElementParameter;
import org.talend.core.model.properties.ConnectionItem; import org.talend.core.model.properties.ConnectionItem;
import org.talend.core.model.properties.DatabaseConnectionItem;
import org.talend.core.model.properties.FileItem;
import org.talend.core.model.properties.Item; import org.talend.core.model.properties.Item;
import org.talend.core.model.properties.LinkRulesItem;
import org.talend.core.model.properties.RulesItem;
import org.talend.core.model.repository.ERepositoryObjectType;
import org.talend.core.model.repository.IRepositoryViewObject; import org.talend.core.model.repository.IRepositoryViewObject;
import org.talend.core.ui.CoreUIPlugin; import org.talend.core.ui.CoreUIPlugin;
import org.talend.core.ui.properties.tab.IDynamicProperty; import org.talend.core.ui.properties.tab.IDynamicProperty;
import org.talend.designer.core.DesignerPlugin;
import org.talend.designer.core.model.components.EParameterName; import org.talend.designer.core.model.components.EParameterName;
import org.talend.designer.core.model.components.EmfComponent; import org.talend.designer.core.model.components.EmfComponent;
import org.talend.designer.core.ui.editor.cmd.ChangeMetadataCommand; import org.talend.designer.core.ui.editor.cmd.ChangeMetadataCommand;
import org.talend.designer.core.ui.editor.nodes.Node; import org.talend.designer.core.ui.editor.nodes.Node;
import org.talend.designer.core.ui.editor.properties.controllers.creator.SelectAllTextControlCreator; import org.talend.designer.core.ui.editor.properties.controllers.creator.SelectAllTextControlCreator;
import org.talend.repository.UpdateRepositoryUtils; import org.talend.repository.UpdateRepositoryUtils;
import org.talend.repository.model.IProxyRepositoryFactory;
/** /**
* DOC nrousseau class global comment. Detailled comment * DOC nrousseau class global comment. Detailled comment
@@ -76,6 +60,8 @@ public abstract class AbstractRepositoryController extends AbstractElementProper
protected static final int STANDARD_REPOSITORY_WIDTH = 250; protected static final int STANDARD_REPOSITORY_WIDTH = 250;
protected ControllerRepositoryValueHander repositoryValueHander;
/** /**
* DOC nrousseau AbstractRepositoryController constructor comment. * DOC nrousseau AbstractRepositoryController constructor comment.
* *
@@ -83,6 +69,7 @@ public abstract class AbstractRepositoryController extends AbstractElementProper
*/ */
public AbstractRepositoryController(IDynamicProperty dp) { public AbstractRepositoryController(IDynamicProperty dp) {
super(dp); super(dp);
repositoryValueHander = new ControllerRepositoryValueHander();
} }
protected abstract String getRepositoryTypeParamName(); protected abstract String getRepositoryTypeParamName();
@@ -321,204 +308,8 @@ public abstract class AbstractRepositoryController extends AbstractElementProper
return initialSize.y + ITabbedPropertyConstants.VSPACE; return initialSize.y + ITabbedPropertyConstants.VSPACE;
} }
protected ConnectionItem lastItemUsed;
private FileItem lastFileItemUsed; // hywang add for 6484
private LinkRulesItem lastLinkItem;
private void fastRepositoryUpdateProperty(IElementParameter param) {
if (param != null && param.getValue() != null) {
IProxyRepositoryFactory factory = DesignerPlugin.getDefault().getProxyRepositoryFactory();
String linkedRepository = (String) param.getValue();
// value stored is the id, so we can get this item directly
Item item;
String displayName = "";
try {
IRepositoryViewObject object = factory.getLastVersion(linkedRepository.split(" - ")[0]);
if (object == null) {
return;
}
item = object.getProperty().getItem();
// Assert.isTrue(item instanceof ConnectionItem);
IESBService service = null;
if (GlobalServiceRegister.getDefault().isServiceRegistered(IESBService.class)) {
service = (IESBService) GlobalServiceRegister.getDefault().getService(IESBService.class);
}
if (service != null && ERepositoryObjectType.getItemType(item) == service.getServicesType()) {
lastItemUsed = (ConnectionItem) item;
displayName = "Service:" + service.getServiceLabel(item, linkedRepository);
} else if (item instanceof ConnectionItem) {
lastItemUsed = (ConnectionItem) item;
displayName = dynamicProperty.getRepositoryAliasName(lastItemUsed) + ":" //$NON-NLS-1$
+ lastItemUsed.getProperty().getLabel();
}
if (item instanceof FileItem) { // hywang add for 6484
lastFileItemUsed = (FileItem) item;
if (lastFileItemUsed instanceof RulesItem) {
displayName = "Rules:" //$NON-NLS-1$
+ lastFileItemUsed.getProperty().getLabel();
}
}
if (item instanceof LinkRulesItem) {
lastLinkItem = (LinkRulesItem) item;
displayName = "Rules:" //$NON-NLS-1$
+ lastLinkItem.getProperty().getLabel();
}
} catch (PersistenceException e) {
ExceptionHandler.process(e);
}
param.setListItemsDisplayName(new String[] { displayName });
param.setListItemsValue(new String[] { (String) param.getValue() });
}
}
private void fastRepositoryUpdateSchema(IElementParameter param) {
if (param != null && param.getValue() != null) {
String queryIdAndName = (String) param.getValue();
String[] names = queryIdAndName.split(" - "); //$NON-NLS-1$
if (names.length < 2) {
return;
}
String linkedRepository = names[0];
String tableName = null;
if (names.length == 2) {
tableName = names[1];
} else if (names.length > 2) {
tableName = queryIdAndName.substring(linkedRepository.length() + 3);
}
if (lastItemUsed != null) {
if (!linkedRepository.equals(lastItemUsed.getProperty().getId())) {
lastItemUsed = null;
}
}
if (lastItemUsed == null) {
IProxyRepositoryFactory factory = DesignerPlugin.getDefault().getProxyRepositoryFactory();
Item item;
try {
IRepositoryViewObject object = factory.getLastVersion(linkedRepository);
if (object == null) {
return;
}
item = object.getProperty().getItem();
Assert.isTrue(item instanceof ConnectionItem);
lastItemUsed = (ConnectionItem) item;
} catch (PersistenceException e) {
ExceptionHandler.process(e);
}
}
// EList<MetadataTable> tableList = lastItemUsed.getConnection().getTables();
// for (MetadataTable table )
String displayName = dynamicProperty.getRepositoryAliasName(lastItemUsed) + ":" //$NON-NLS-1$
+ lastItemUsed.getProperty().getLabel() + " - " + tableName; //$NON-NLS-1$
IElementParameter infoObjectTypeParam = param.getElement().getElementParameter("INFO_OBJECT_TYPE"); //$NON-NLS-1$
if (infoObjectTypeParam != null) {
String innerIOType = (String) infoObjectTypeParam.getValue();
if (innerIOType != null) {
displayName = displayName + " (" + innerIOType + ")"; //$NON-NLS-1$ //$NON-NLS-2$
}
}
param.setListItemsDisplayName(new String[] { displayName });
param.setListItemsValue(new String[] { (String) param.getValue() });
}
}
private void fastRepositoryUpdateQuery(IElementParameter param) {
if (param != null && param.getValue() != null) {
String queryIdAndName = (String) param.getValue();
String[] names = queryIdAndName.split(" - "); //$NON-NLS-1$
if (names.length < 2) {
return;
}
String linkedRepository = names[0];
String queryName = null;
if (names.length == 2) {
queryName = names[1];
} else if (names.length > 2) {
queryName = queryIdAndName.substring(linkedRepository.length() + 3);
}
if (lastItemUsed != null) {
if (!linkedRepository.equals(lastItemUsed.getProperty().getId())) {
lastItemUsed = null;
}
}
if (lastItemUsed == null) {
IProxyRepositoryFactory factory = DesignerPlugin.getDefault().getProxyRepositoryFactory();
Item item;
try {
IRepositoryViewObject object = factory.getLastVersion(linkedRepository);
if (object == null) {
return;
}
item = object.getProperty().getItem();
lastItemUsed = (ConnectionItem) item;
} catch (PersistenceException e) {
ExceptionHandler.process(e);
}
}
Assert.isTrue(lastItemUsed instanceof DatabaseConnectionItem);
QueriesConnection queriesConnection = ((DatabaseConnection) lastItemUsed.getConnection()).getQueries();
EList<Query> queries = queriesConnection.getQuery();
String repositoryAliasName = dynamicProperty.getRepositoryAliasName(lastItemUsed);
for (Query currentQuery : queries) {
if (currentQuery.getLabel().equals(queryName)) {
String displayName = repositoryAliasName + ":" //$NON-NLS-1$
+ lastItemUsed.getProperty().getLabel() + " - " + currentQuery.getLabel(); //$NON-NLS-1$
param.setListItemsDisplayName(new String[] { displayName });
param.setListItemsValue(new String[] { (String) param.getValue() });
/* query cache should be deleted ,bug 16969 */
// dynamicProperty.getRepositoryQueryStoreMap().clear();
// dynamicProperty.getRepositoryQueryStoreMap().put((String) param.getValue(), currentQuery);
}
}
}
}
protected void fastInitializeRepositoryNames(IElementParameter param) {
lastItemUsed = null;
if (param.getValue() == null || param.getValue().equals("")) {
return;
}
if (param.getName().equals(EParameterName.REPOSITORY_PROPERTY_TYPE.getName())) {
fastRepositoryUpdateProperty(param);
} else if (param.getName().equals(EParameterName.REPOSITORY_SCHEMA_TYPE.getName())) {
fastRepositoryUpdateSchema(param);
} else if (param.getName().equals(EParameterName.REPOSITORY_QUERYSTORE_TYPE.getName())) {
fastRepositoryUpdateQuery(param);
}
}
protected String getDisplayNameFromValue(IElementParameter param, String value) { protected String getDisplayNameFromValue(IElementParameter param, String value) {
// to load informations from repository only if needed. return repositoryValueHander.getDisplayNameFromValue(param, value);
int index = param.getIndexOfItemFromList(value);
IElementParameter infoObjectParam = param.getElement().getElementParameter("INFO_OBJECT_TYPE"); //$NON-NLS-1$
if (infoObjectParam != null && infoObjectParam.getValue() != null) {
index = -1;
}
if (index == -1) {
fastInitializeRepositoryNames(param);
// if even after the initialize there is nothing, just return an empty string
if (param.getListItemsDisplayName().length == 0) {
return ""; //$NON-NLS-1$
}
index = param.getIndexOfItemFromList(value);
if (index == -1) {
return ""; //$NON-NLS-1$
}
}
return param.getListItemsDisplayName()[index];
} }
/* /*
@@ -585,4 +376,12 @@ public abstract class AbstractRepositoryController extends AbstractElementProper
} }
/**
* Getter for repositoryValueHander.
*
* @return the repositoryValueHander
*/
public ControllerRepositoryValueHander getRepositoryValueHander() {
return this.repositoryValueHander;
}
} }

View File

@@ -203,8 +203,11 @@ public class ComponentListController extends AbstractElementPropertySectionContr
for (Node curNode : nodesToUpdate) { for (Node curNode : nodesToUpdate) {
for (IElementParameter curParam : curNode.getElementParameters()) { for (IElementParameter curParam : curNode.getElementParameters()) {
if (curParam.getFieldType().equals(EParameterFieldType.COMPONENT_LIST)) { if (curParam.getFieldType().equals(EParameterFieldType.COMPONENT_LIST)) {
String value = (String)curParam.getValue();
if (oldConnectionName.equals(curParam.getValue())) { if (oldConnectionName.equals(curParam.getValue())) {
curParam.setValue(newConnectionName); curParam.setValue(newConnectionName);
} else if (value != null && value.startsWith(oldConnectionName + "_")) {
curParam.setValue(value.replaceFirst(oldConnectionName + "_", newConnectionName + "_"));
} }
} else if (curParam.getFieldType().equals(EParameterFieldType.TABLE)) { } else if (curParam.getFieldType().equals(EParameterFieldType.TABLE)) {
final Object[] itemsValue = curParam.getListItemsValue(); final Object[] itemsValue = curParam.getListItemsValue();
@@ -220,6 +223,8 @@ public class ComponentListController extends AbstractElementPropertySectionContr
if (connectionName.equals(oldConnectionName)) { if (connectionName.equals(oldConnectionName)) {
// note: change from "Integer" value stored to "String" value // note: change from "Integer" value stored to "String" value
curLine.put(param.getName(), newConnectionName); curLine.put(param.getName(), newConnectionName);
}else if (connectionName != null && connectionName.startsWith(oldConnectionName + "_")) {
curParam.setValue(connectionName.replaceFirst(oldConnectionName + "_", newConnectionName + "_"));
} }
} else if (value instanceof String) { } else if (value instanceof String) {
curLine.put(param.getName(), newConnectionName); curLine.put(param.getName(), newConnectionName);

View File

@@ -369,6 +369,12 @@ public class ConnectionListController extends AbstractElementPropertySectionCont
} }
curLine.put(newConnectionName, newValue); curLine.put(newConnectionName, newValue);
} }
}else if(curParam.getFieldType().equals(EParameterFieldType.SCHEMA_TYPE)){
Map<String, IElementParameter> children = curParam.getChildParameters();
IElementParameter ele = children.get(EParameterName.CONNECTION.getName());
if(ele!=null && ele.getFieldType().equals(EParameterFieldType.CONNECTION_LIST) && ele.getValue().equals(oldConnectionName)){
ele.setValue(newConnectionName);
}
} }
} }
} }

View File

@@ -0,0 +1,258 @@
// ============================================================================
//
// Copyright (C) 2006-2014 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.core.ui.editor.properties.controllers;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.core.runtime.Assert;
import org.eclipse.emf.common.util.EList;
import org.talend.commons.exception.PersistenceException;
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.IESBService;
import org.talend.core.model.metadata.builder.connection.DatabaseConnection;
import org.talend.core.model.metadata.builder.connection.QueriesConnection;
import org.talend.core.model.metadata.builder.connection.Query;
import org.talend.core.model.process.EParameterFieldType;
import org.talend.core.model.process.IElementParameter;
import org.talend.core.model.properties.ConnectionItem;
import org.talend.core.model.properties.DatabaseConnectionItem;
import org.talend.core.model.properties.FileItem;
import org.talend.core.model.properties.Item;
import org.talend.core.model.properties.LinkRulesItem;
import org.talend.core.model.properties.RulesItem;
import org.talend.core.model.repository.ERepositoryObjectType;
import org.talend.core.model.repository.IRepositoryViewObject;
import org.talend.designer.core.DesignerPlugin;
import org.talend.designer.core.model.components.EParameterName;
import org.talend.designer.core.model.metadata.RepositoryObjectHelper;
import org.talend.repository.model.IProxyRepositoryFactory;
/**
* created by wchen on Aug 23, 2016 Detailled comment
*
*/
public class ControllerRepositoryValueHander {
private static Map<EParameterFieldType, ControllerRepositoryValueHander> repositoryValueHandlerMap = new HashMap<EParameterFieldType, ControllerRepositoryValueHander>();
protected ConnectionItem lastItemUsed;
private FileItem lastFileItemUsed; // hywang add for 6484
private LinkRulesItem lastLinkItem;
public String getDisplayNameFromValue(IElementParameter param, String value) {
// to load informations from repository only if needed.
int index = param.getIndexOfItemFromList(value);
IElementParameter infoObjectParam = param.getElement().getElementParameter("INFO_OBJECT_TYPE"); //$NON-NLS-1$
if (infoObjectParam != null && infoObjectParam.getValue() != null) {
index = -1;
}
if (index == -1) {
fastInitializeRepositoryNames(param);
// if even after the initialize there is nothing, just return an empty string
if (param.getListItemsDisplayName().length == 0) {
return ""; //$NON-NLS-1$
}
index = param.getIndexOfItemFromList(value);
if (index == -1) {
return ""; //$NON-NLS-1$
}
}
return param.getListItemsDisplayName()[index];
}
protected void fastInitializeRepositoryNames(IElementParameter param) {
lastItemUsed = null;
if (param.getValue() == null || param.getValue().equals("")) {
return;
}
if (param.getName().equals(EParameterName.REPOSITORY_PROPERTY_TYPE.getName())) {
fastRepositoryUpdateProperty(param);
} else if (param.getName().equals(EParameterName.REPOSITORY_SCHEMA_TYPE.getName())) {
fastRepositoryUpdateSchema(param);
} else if (param.getName().equals(EParameterName.REPOSITORY_QUERYSTORE_TYPE.getName())) {
fastRepositoryUpdateQuery(param);
}
}
private void fastRepositoryUpdateProperty(IElementParameter param) {
if (param != null && param.getValue() != null) {
IProxyRepositoryFactory factory = DesignerPlugin.getDefault().getProxyRepositoryFactory();
String linkedRepository = (String) param.getValue();
// value stored is the id, so we can get this item directly
Item item;
String displayName = "";
try {
IRepositoryViewObject object = factory.getLastVersion(linkedRepository.split(" - ")[0]);
if (object == null) {
return;
}
item = object.getProperty().getItem();
// Assert.isTrue(item instanceof ConnectionItem);
IESBService service = null;
if (GlobalServiceRegister.getDefault().isServiceRegistered(IESBService.class)) {
service = (IESBService) GlobalServiceRegister.getDefault().getService(IESBService.class);
}
if (service != null && ERepositoryObjectType.getItemType(item) == service.getServicesType()) {
lastItemUsed = (ConnectionItem) item;
displayName = "Service:" + service.getServiceLabel(item, linkedRepository);
} else if (item instanceof ConnectionItem) {
lastItemUsed = (ConnectionItem) item;
displayName = RepositoryObjectHelper.getRepositoryAliasName(lastItemUsed) + ":" //$NON-NLS-1$
+ lastItemUsed.getProperty().getLabel();
}
if (item instanceof FileItem) { // hywang add for 6484
lastFileItemUsed = (FileItem) item;
if (lastFileItemUsed instanceof RulesItem) {
displayName = "Rules:" //$NON-NLS-1$
+ lastFileItemUsed.getProperty().getLabel();
}
}
if (item instanceof LinkRulesItem) {
lastLinkItem = (LinkRulesItem) item;
displayName = "Rules:" //$NON-NLS-1$
+ lastLinkItem.getProperty().getLabel();
}
} catch (PersistenceException e) {
ExceptionHandler.process(e);
}
param.setListItemsDisplayName(new String[] { displayName });
param.setListItemsValue(new String[] { (String) param.getValue() });
}
}
private void fastRepositoryUpdateSchema(IElementParameter param) {
if (param != null && param.getValue() != null) {
String queryIdAndName = (String) param.getValue();
String[] names = queryIdAndName.split(" - "); //$NON-NLS-1$
if (names.length < 2) {
return;
}
String linkedRepository = names[0];
String tableName = null;
if (names.length == 2) {
tableName = names[1];
} else if (names.length > 2) {
tableName = queryIdAndName.substring(linkedRepository.length() + 3);
}
if (lastItemUsed != null) {
if (!linkedRepository.equals(lastItemUsed.getProperty().getId())) {
lastItemUsed = null;
}
}
if (lastItemUsed == null) {
IProxyRepositoryFactory factory = DesignerPlugin.getDefault().getProxyRepositoryFactory();
Item item;
try {
IRepositoryViewObject object = factory.getLastVersion(linkedRepository);
if (object == null) {
return;
}
item = object.getProperty().getItem();
Assert.isTrue(item instanceof ConnectionItem);
lastItemUsed = (ConnectionItem) item;
} catch (PersistenceException e) {
ExceptionHandler.process(e);
}
}
// EList<MetadataTable> tableList = lastItemUsed.getConnection().getTables();
// for (MetadataTable table )
String displayName = RepositoryObjectHelper.getRepositoryAliasName(lastItemUsed) + ":" //$NON-NLS-1$
+ lastItemUsed.getProperty().getLabel() + " - " + tableName; //$NON-NLS-1$
IElementParameter infoObjectTypeParam = param.getElement().getElementParameter("INFO_OBJECT_TYPE"); //$NON-NLS-1$
if (infoObjectTypeParam != null) {
String innerIOType = (String) infoObjectTypeParam.getValue();
if (innerIOType != null) {
displayName = displayName + " (" + innerIOType + ")"; //$NON-NLS-1$ //$NON-NLS-2$
}
}
param.setListItemsDisplayName(new String[] { displayName });
param.setListItemsValue(new String[] { (String) param.getValue() });
}
}
private void fastRepositoryUpdateQuery(IElementParameter param) {
if (param != null && param.getValue() != null) {
String queryIdAndName = (String) param.getValue();
String[] names = queryIdAndName.split(" - "); //$NON-NLS-1$
if (names.length < 2) {
return;
}
String linkedRepository = names[0];
String queryName = null;
if (names.length == 2) {
queryName = names[1];
} else if (names.length > 2) {
queryName = queryIdAndName.substring(linkedRepository.length() + 3);
}
if (lastItemUsed != null) {
if (!linkedRepository.equals(lastItemUsed.getProperty().getId())) {
lastItemUsed = null;
}
}
if (lastItemUsed == null) {
IProxyRepositoryFactory factory = DesignerPlugin.getDefault().getProxyRepositoryFactory();
Item item;
try {
IRepositoryViewObject object = factory.getLastVersion(linkedRepository);
if (object == null) {
return;
}
item = object.getProperty().getItem();
lastItemUsed = (ConnectionItem) item;
} catch (PersistenceException e) {
ExceptionHandler.process(e);
}
}
Assert.isTrue(lastItemUsed instanceof DatabaseConnectionItem);
QueriesConnection queriesConnection = ((DatabaseConnection) lastItemUsed.getConnection()).getQueries();
EList<Query> queries = queriesConnection.getQuery();
String repositoryAliasName = RepositoryObjectHelper.getRepositoryAliasName(lastItemUsed);
for (Query currentQuery : queries) {
if (currentQuery.getLabel().equals(queryName)) {
String displayName = repositoryAliasName + ":" //$NON-NLS-1$
+ lastItemUsed.getProperty().getLabel() + " - " + currentQuery.getLabel(); //$NON-NLS-1$
param.setListItemsDisplayName(new String[] { displayName });
param.setListItemsValue(new String[] { (String) param.getValue() });
/* query cache should be deleted ,bug 16969 */
// dynamicProperty.getRepositoryQueryStoreMap().clear();
// dynamicProperty.getRepositoryQueryStoreMap().put((String) param.getValue(), currentQuery);
}
}
}
}
/**
* Getter for repositoryValueHandlerMap.
*
* @return the repositoryValueHandlerMap
*/
public static Map<EParameterFieldType, ControllerRepositoryValueHander> getRepositoryValueHandlerMap() {
return repositoryValueHandlerMap;
}
}

View File

@@ -14,6 +14,7 @@ package org.talend.designer.core.ui.editor.properties.controllers;
import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeEvent;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.Path;
import org.eclipse.gef.commands.Command; import org.eclipse.gef.commands.Command;
import org.eclipse.jface.fieldassist.DecoratedField; import org.eclipse.jface.fieldassist.DecoratedField;
@@ -45,9 +46,9 @@ import org.talend.designer.core.ui.editor.properties.controllers.creator.SelectA
/** /**
* DOC yzhang class global comment. Detailled comment <br/> * DOC yzhang class global comment. Detailled comment <br/>
* *
* $Id: talend-code-templates.xml 1 2006-09-29 17:06:40 +0000 (星期五, 29 九月 2006) nrousseau $ * $Id: talend-code-templates.xml 1 2006-09-29 17:06:40 +0000 (星期五, 29 九月 2006) nrousseau $
* *
*/ */
public class DirectoryController extends AbstractElementPropertySectionController { public class DirectoryController extends AbstractElementPropertySectionController {
@@ -55,7 +56,7 @@ public class DirectoryController extends AbstractElementPropertySectionControlle
/** /**
* DOC yzhang DirectoryController constructor comment. * DOC yzhang DirectoryController constructor comment.
* *
* @param parameterBean * @param parameterBean
*/ */
public DirectoryController(IDynamicProperty dp) { public DirectoryController(IDynamicProperty dp) {
@@ -65,7 +66,7 @@ public class DirectoryController extends AbstractElementPropertySectionControlle
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
* @see java.beans.PropertyChangeListener#propertyChange(java.beans.PropertyChangeEvent) * @see java.beans.PropertyChangeListener#propertyChange(java.beans.PropertyChangeEvent)
*/ */
@Override @Override
@@ -75,7 +76,7 @@ public class DirectoryController extends AbstractElementPropertySectionControlle
/** /**
* DOC yzhang Comment method "setCommand". * DOC yzhang Comment method "setCommand".
* *
* @param propertyName * @param propertyName
*/ */
private Command createCommand(SelectionEvent event) { private Command createCommand(SelectionEvent event) {
@@ -84,23 +85,20 @@ public class DirectoryController extends AbstractElementPropertySectionControlle
String propertyName = (String) btn.getData(PARAMETER_NAME); String propertyName = (String) btn.getData(PARAMETER_NAME);
Text dirPathText = (Text) hashCurControls.get(propertyName); Text dirPathText = (Text) hashCurControls.get(propertyName);
String directory = dial.open(); String directory = dial.open();
if (directory != null) { if (StringUtils.isNotBlank(directory) && !directory.equals(elem.getPropertyValue(propertyName))) {
if (!directory.equals("")) { //$NON-NLS-1$ String portableValue = Path.fromOSString(directory).toPortableString();
if (!elem.getPropertyValue(propertyName).equals(directory)) { if (!isInWizard()) {
String portableValue = Path.fromOSString(directory).toPortableString(); portableValue = TalendTextUtils.addQuotes(portableValue);
dirPathText.setText(TalendTextUtils.addQuotes(portableValue));
return new PropertyChangeCommand(elem, propertyName, TalendTextUtils.addQuotes(portableValue));
}
} }
dirPathText.setText(portableValue);
return new PropertyChangeCommand(elem, propertyName, portableValue);
} }
return null; return null;
} }
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
* @see org.talend.designer.core.ui.editor.properties2.editors.AbstractElementPropertySectionController# * @see org.talend.designer.core.ui.editor.properties2.editors.AbstractElementPropertySectionController#
* createControl( org.eclipse.swt.widgets.Composite, org.talend.core.model.process.IElementParameter, int, int, int, * createControl( org.eclipse.swt.widgets.Composite, org.talend.core.model.process.IElementParameter, int, int, int,
* org.eclipse.swt.widgets.Control) * org.eclipse.swt.widgets.Control)
@@ -202,10 +200,9 @@ public class DirectoryController extends AbstractElementPropertySectionControlle
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
* @see * @see org.talend.designer.core.ui.editor.properties.controllers.AbstractElementPropertySectionController#
* org.talend.designer.core.ui.editor.properties.controllers.AbstractElementPropertySectionController#estimateRowSize * estimateRowSize (org.eclipse.swt.widgets.Composite, org.talend.core.model.process.IElementParameter)
* (org.eclipse.swt.widgets.Composite, org.talend.core.model.process.IElementParameter)
*/ */
@Override @Override
public int estimateRowSize(Composite subComposite, IElementParameter param) { public int estimateRowSize(Composite subComposite, IElementParameter param) {

View File

@@ -241,40 +241,25 @@ public class GuessSchemaProcess {
if (ConnectionUtils.isVertica(info.getUrl())) { if (ConnectionUtils.isVertica(info.getUrl())) {
createStatament = "conn.createStatement()"; createStatament = "conn.createStatement()";
} }
codeStart = systemProperty if (EDatabaseTypeName.GENERAL_JDBC.getXmlName().equals(info.getDbType())
+ "java.lang.Class.forName(\"" + info.getDriverClassName() + "\");\r\n" + "String url = \"" + info.getUrl() //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ && "com.sap.db.jdbc.Driver".equals(info.getDriverClassName())
+ "\";\r\n" + "java.sql.Connection conn = java.sql.DriverManager.getConnection(url, \"" + info.getUsername() //$NON-NLS-1$ //$NON-NLS-2$ || EDatabaseTypeName.SAPHana.getXmlName().equals(info.getDbType())) {
+ "\", \"" + info.getPwd() + "\");\r\n" + "java.sql.Statement stm = " + createStatament + ";\r\n" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ createStatament = "conn.createStatement()";
+ "try {\r\nstm.setFetchSize(" + fetchSize + ");\r\n} catch (Exception e) {\r\n// Exception is thrown if db don't support, no need to catch exception here\r\n} \r\n" //$NON-NLS-1$ //$NON-NLS-2$ }
+ "java.sql.ResultSet rs = stm.executeQuery(" + memoSQL + ");\r\n" //$NON-NLS-1$ //$NON-NLS-2$ codeStart = systemProperty + getCodeStart(connectionNode, createStatament, fetchSize);
+ "java.sql.ResultSetMetaData rsmd = rs.getMetaData();\r\n" + "int numbOfColumn = rsmd.getColumnCount();\r\n" //$NON-NLS-1$ //$NON-NLS-2$
+ "\r\n" + "String fileName = (new java.io.File(\r\n" + " \"" + temppath //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ "\")).getAbsolutePath().replace(\r\n" + " \"\\\\\", \"/\");\r\n" //$NON-NLS-1$ //$NON-NLS-2$
+ "com.talend.csv.CSVWriter csvWriter = new com.talend.csv.CSVWriter(\r\n" //$NON-NLS-1$
+ " new java.io.BufferedWriter(new java.io.OutputStreamWriter(\r\n" //$NON-NLS-1$
+ " new java.io.FileOutputStream(\r\n" //$NON-NLS-1$
+ " fileName, false),\r\n" //$NON-NLS-1$
+ " \"GBK\")));\r\n" + " \r\n" //$NON-NLS-1$ //$NON-NLS-2$
+ "csvWriter.setSeparator(';');\r\n" + "csvWriter.setQuoteStatus(com.talend.csv.CSVWriter.QuoteStatus.FORCE);\r\n" + "int nbRows = 0;\r\n" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ "String[] columnNames = new String[numbOfColumn];\r\n" + "String[] nullables = new String[numbOfColumn];\r\n" //$NON-NLS-1$ //$NON-NLS-2$
+ "String[] lengths = new String[numbOfColumn];\r\n" + "String[] precisions = new String[numbOfColumn];\r\n" //$NON-NLS-1$ //$NON-NLS-2$
+ "String[] dbtypes = new String[numbOfColumn];\r\n" //$NON-NLS-1$
+ "for(int i = 1;i<=numbOfColumn;i++){\r\n" + "columnNames[i-1] = rsmd.getColumnName(i);\r\n" //$NON-NLS-1$ //$NON-NLS-2$
+ "nullables[i-1] = rsmd.isNullable(i) == 0? \"false\" : \"true\";\r\n" //$NON-NLS-1$
+ "lengths[i-1] = Integer.toString(rsmd.getScale(i));\r\n" //$NON-NLS-1$
+ "precisions[i-1] = Integer.toString(rsmd.getPrecision(i));" //$NON-NLS-1$
+ "dbtypes[i-1] = rsmd.getColumnTypeName(i);\r\n" + "}\r\n" //$NON-NLS-1$ //$NON-NLS-2$
+ "csvWriter.writeNext(columnNames);\r\n" + "csvWriter.writeNext(nullables);\r\n" //$NON-NLS-1$ //$NON-NLS-2$
+ "csvWriter.writeNext(lengths);\r\n" + "csvWriter.writeNext(precisions);\r\n" //$NON-NLS-1$ //$NON-NLS-2$
+ "csvWriter.writeNext(dbtypes);\r\n" + "while (rs.next()) {"; //$NON-NLS-1$ //$NON-NLS-2$
codeMain = "String[] dataOneRow = new String[numbOfColumn];\r\n" + "for (int i = 1; i <= numbOfColumn; i++) {\r\n" //$NON-NLS-1$ //$NON-NLS-2$ codeMain = "String[] dataOneRow = new String[numbOfColumn];\r\n" + "for (int i = 1; i <= numbOfColumn; i++) {\r\n" //$NON-NLS-1$ //$NON-NLS-2$
+ " \r\n" + " try{\r\n" + " String tempStr = rs.getString(i);\r\n" + " dataOneRow[i-1] = tempStr;\r\n" + " } catch (java.sql.SQLException e) {\r\n" + "}\r\n" + "}\r\n" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ + " \r\n" + " try{\r\n" + " String tempStr = rs.getString(i);\r\n" + " dataOneRow[i-1] = tempStr;\r\n" + " } catch (java.sql.SQLException e) {\r\n" + "}\r\n" + "}\r\n" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ "csvWriter.writeNext(dataOneRow);"; //$NON-NLS-1$ + "csvWriter.writeNext(dataOneRow);"; //$NON-NLS-1$
codeEnd = "nbRows++;\r\n" + " if (nbRows > " + maximumRowsToPreview + ") break;\r\n" + "}\r\n" + "stm.close();\r\n" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
+ "conn.close();\r\n" + "csvWriter.close();\r\n"; //$NON-NLS-1$ //$NON-NLS-2$ if(EDatabaseTypeName.REDSHIFT.getXmlName().equals(info.getDbType())){
codeEnd = "nbRows++;\r\n" + " if (nbRows > " + maximumRowsToPreview + ") break;\r\n" + "}\r\n" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ "conn.close();\r\n" + "csvWriter.close();\r\n"; //$NON-NLS-1$ //$NON-NLS-2$
}else{
codeEnd = "nbRows++;\r\n" + " if (nbRows > " + maximumRowsToPreview + ") break;\r\n" + "}\r\n" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ "conn.close();\r\n" + "csvWriter.close();\r\n"; //$NON-NLS-1$ //$NON-NLS-2$
}
IComponent component = null; IComponent component = null;
switch (LanguageManager.getCurrentLanguage()) { switch (LanguageManager.getCurrentLanguage()) {
@@ -295,6 +280,101 @@ public class GuessSchemaProcess {
process.addNodeContainer(new NodeContainer(flexNode)); process.addNodeContainer(new NodeContainer(flexNode));
} }
private String getCodeStart(INode connectionNode, String createStatament, int fetchSize){
String codeStart = null;
if(EDatabaseTypeName.REDSHIFT.getXmlName().equals(info.getDbType())){
String tableName = (String) node.getElementParameter("TABLE").getValue();
String dbName = null;
String schema = null;
if(connectionNode!=null){
if(connectionNode.getElementParameter("DBNAME")!=null){
dbName = (String) connectionNode.getElementParameter("DBNAME").getValue();
}
if(connectionNode.getElementParameter("SCHEMA_DB")!=null){
schema = (String) connectionNode.getElementParameter("SCHEMA_DB").getValue();
}
}else{
if(node.getElementParameter("DBNAME")!=null){
dbName = (String) node.getElementParameter("DBNAME").getValue();
}
if(node.getElementParameter("SCHEMA_DB")!=null){
schema = (String) node.getElementParameter("SCHEMA_DB").getValue();
}
}
codeStart = "java.lang.Class.forName(\"" + info.getDriverClassName() + "\");\r\n" + "String url = \"" + info.getUrl() //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ "\";\r\n" + "java.sql.Connection conn = java.sql.DriverManager.getConnection(url, \"" + info.getUsername() //$NON-NLS-1$ //$NON-NLS-2$
+ "\", \"" + info.getPwd() + "\");\r\n" + "java.sql.DatabaseMetaData metaData = conn.getMetaData();\r\n" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ "java.sql.ResultSet rs = metaData.getColumns(" + dbName + "," + schema + "," + tableName + ",null);\r\n" //$NON-NLS-1$ //$NON-NLS-2$
+ "\r\n" + "String fileName = (new java.io.File(\r\n" + " \"" + temppath //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ "\")).getAbsolutePath().replace(\r\n" + " \"\\\\\", \"/\");\r\n" //$NON-NLS-1$ //$NON-NLS-2$
+ "com.talend.csv.CSVWriter csvWriter = new com.talend.csv.CSVWriter(\r\n" //$NON-NLS-1$
+ " new java.io.BufferedWriter(new java.io.OutputStreamWriter(\r\n" //$NON-NLS-1$
+ " new java.io.FileOutputStream(\r\n" //$NON-NLS-1$
+ " fileName, false),\r\n" //$NON-NLS-1$
+ " \"GBK\")));\r\n" + " \r\n" //$NON-NLS-1$ //$NON-NLS-2$
+ "csvWriter.setSeparator(';');\r\n" + "csvWriter.setQuoteStatus(com.talend.csv.CSVWriter.QuoteStatus.FORCE);\r\n" + "int nbRows = 0;\r\n" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ "java.util.List<String> columnNameList= new java.util.ArrayList<String>();\r\n" + "java.util.List<String> nullableList= new java.util.ArrayList<String>();\r\n" //$NON-NLS-1$ //$NON-NLS-2$
+ "java.util.List<String> lengthList= new java.util.ArrayList<String>();\r\n" + "java.util.List<String> precisionList= new java.util.ArrayList<String>();\r\n" //$NON-NLS-1$ //$NON-NLS-2$
+ "java.util.List<String> dbtypeList= new java.util.ArrayList<String>();\r\n" //$NON-NLS-1$
+"while (rs.next()) {\r\n" //$NON-NLS-1$
+"columnNameList.add(rs.getString(\"COLUMN_NAME\"));\r\n" //$NON-NLS-1$
+"nullableList.add(rs.getBoolean(\"NULLABLE\") ? \"true\" : \"false\");\r\n" //$NON-NLS-1$
+"lengthList.add(Integer.toString(rs.getInt(\"COLUMN_SIZE\")));\r\n" //$NON-NLS-1$
+"precisionList.add(Integer.toString(rs.getInt(\"NUM_PREC_RADIX\")));\r\n" //$NON-NLS-1$
+"dbtypeList.add(rs.getString(\"TYPE_NAME\"));\r\n" //$NON-NLS-1$
+"}\r\n" //$NON-NLS-1$
+"int numbOfColumn = columnNameList.size();" //$NON-NLS-1$
+ "String[] columnNames = new String[numbOfColumn];\r\n" + "String[] nullables = new String[numbOfColumn];\r\n" //$NON-NLS-1$ //$NON-NLS-2$
+ "String[] lengths = new String[numbOfColumn];\r\n" + "String[] precisions = new String[numbOfColumn];\r\n" //$NON-NLS-1$ //$NON-NLS-2$
+ "String[] dbtypes = new String[numbOfColumn];\r\n" //$NON-NLS-1$
+ "for(int i = 0;i<=numbOfColumn-1;i++){\r\n" + "columnNames[i] = columnNameList.get(i);\r\n" //$NON-NLS-1$ //$NON-NLS-2$
+ "nullables[i] = nullableList.get(i);\r\n" //$NON-NLS-1$
+ "lengths[i] = lengthList.get(i);\r\n" //$NON-NLS-1$
+ "precisions[i] = precisionList.get(i);" //$NON-NLS-1$
+ "dbtypes[i] = dbtypeList.get(i);\r\n" + "}\r\n" //$NON-NLS-1$ //$NON-NLS-2$
+ "csvWriter.writeNext(columnNames);\r\n" + "csvWriter.writeNext(nullables);\r\n" //$NON-NLS-1$ //$NON-NLS-2$
+ "csvWriter.writeNext(lengths);\r\n" + "csvWriter.writeNext(precisions);\r\n" //$NON-NLS-1$ //$NON-NLS-2$
+ "csvWriter.writeNext(dbtypes);\r\n" + "while (rs.next()) {"; //$NON-NLS-1$ //$NON-NLS-2$
}else{
codeStart = "java.lang.Class.forName(\"" + info.getDriverClassName() + "\");\r\n" + "String url = \"" + info.getUrl() //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ "\";\r\n" + "java.sql.Connection conn = java.sql.DriverManager.getConnection(url, \"" + info.getUsername() //$NON-NLS-1$ //$NON-NLS-2$
+ "\", \"" + info.getPwd() + "\");\r\n" + "java.sql.Statement stm = " + createStatament + ";\r\n" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ "try {\r\nstm.setFetchSize(" + fetchSize + ");\r\n} catch (Exception e) {\r\n// Exception is thrown if db don't support, no need to catch exception here\r\n} \r\n" //$NON-NLS-1$ //$NON-NLS-2$
+ "java.sql.ResultSet rs = stm.executeQuery(" + memoSQL + ");\r\n" //$NON-NLS-1$ //$NON-NLS-2$
+ "java.sql.ResultSetMetaData rsmd = rs.getMetaData();\r\n" + "int numbOfColumn = rsmd.getColumnCount();\r\n" //$NON-NLS-1$ //$NON-NLS-2$
+ "\r\n" + "String fileName = (new java.io.File(\r\n" + " \"" + temppath //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ "\")).getAbsolutePath().replace(\r\n" + " \"\\\\\", \"/\");\r\n" //$NON-NLS-1$ //$NON-NLS-2$
+ "com.talend.csv.CSVWriter csvWriter = new com.talend.csv.CSVWriter(\r\n" //$NON-NLS-1$
+ " new java.io.BufferedWriter(new java.io.OutputStreamWriter(\r\n" //$NON-NLS-1$
+ " new java.io.FileOutputStream(\r\n" //$NON-NLS-1$
+ " fileName, false),\r\n" //$NON-NLS-1$
+ " \"GBK\")));\r\n" + " \r\n" //$NON-NLS-1$ //$NON-NLS-2$
+ "csvWriter.setSeparator(';');\r\n" + "csvWriter.setQuoteStatus(com.talend.csv.CSVWriter.QuoteStatus.FORCE);\r\n" + "int nbRows = 0;\r\n" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ "String[] columnNames = new String[numbOfColumn];\r\n" + "String[] nullables = new String[numbOfColumn];\r\n" //$NON-NLS-1$ //$NON-NLS-2$
+ "String[] lengths = new String[numbOfColumn];\r\n" + "String[] precisions = new String[numbOfColumn];\r\n" //$NON-NLS-1$ //$NON-NLS-2$
+ "String[] dbtypes = new String[numbOfColumn];\r\n" //$NON-NLS-1$
+ "for(int i = 1;i<=numbOfColumn;i++){\r\n" + "columnNames[i-1] = rsmd.getColumnName(i);\r\n" //$NON-NLS-1$ //$NON-NLS-2$
+ "nullables[i-1] = rsmd.isNullable(i) == 0? \"false\" : \"true\";\r\n" //$NON-NLS-1$
+ "lengths[i-1] = Integer.toString(rsmd.getScale(i));\r\n" //$NON-NLS-1$
+ "precisions[i-1] = Integer.toString(rsmd.getPrecision(i));" //$NON-NLS-1$
+ "dbtypes[i-1] = rsmd.getColumnTypeName(i);\r\n" + "}\r\n" //$NON-NLS-1$ //$NON-NLS-2$
+ "csvWriter.writeNext(columnNames);\r\n" + "csvWriter.writeNext(nullables);\r\n" //$NON-NLS-1$ //$NON-NLS-2$
+ "csvWriter.writeNext(lengths);\r\n" + "csvWriter.writeNext(precisions);\r\n" //$NON-NLS-1$ //$NON-NLS-2$
+ "csvWriter.writeNext(dbtypes);\r\n" + "while (rs.next()) {"; //$NON-NLS-1$ //$NON-NLS-2$
}
return codeStart;
}
// write content to a temp .csv file // write content to a temp .csv file
private IPath buildTempCSVFilename() { private IPath buildTempCSVFilename() {

View File

@@ -43,15 +43,12 @@ import org.talend.commons.ui.runtime.exception.ExceptionHandler;
import org.talend.commons.ui.runtime.image.ImageProvider; import org.talend.commons.ui.runtime.image.ImageProvider;
import org.talend.commons.utils.VersionUtils; import org.talend.commons.utils.VersionUtils;
import org.talend.core.GlobalServiceRegister; import org.talend.core.GlobalServiceRegister;
import org.talend.core.language.ECodeLanguage;
import org.talend.core.language.LanguageManager;
import org.talend.core.model.process.EParameterFieldType; import org.talend.core.model.process.EParameterFieldType;
import org.talend.core.model.process.IElementParameter; import org.talend.core.model.process.IElementParameter;
import org.talend.core.model.properties.Item; import org.talend.core.model.properties.Item;
import org.talend.core.model.properties.ProcessItem; import org.talend.core.model.properties.ProcessItem;
import org.talend.core.model.repository.ERepositoryObjectType; import org.talend.core.model.repository.ERepositoryObjectType;
import org.talend.core.model.repository.IRepositoryViewObject; import org.talend.core.model.repository.IRepositoryViewObject;
import org.talend.core.model.utils.PerlResourcesHelper;
import org.talend.core.ui.CoreUIPlugin; import org.talend.core.ui.CoreUIPlugin;
import org.talend.core.ui.branding.IBrandingService; import org.talend.core.ui.branding.IBrandingService;
import org.talend.core.ui.properties.tab.IDynamicProperty; import org.talend.core.ui.properties.tab.IDynamicProperty;
@@ -64,7 +61,6 @@ import org.talend.designer.core.ui.editor.properties.controllers.creator.SelectA
import org.talend.designer.runprocess.ItemCacheManager; import org.talend.designer.runprocess.ItemCacheManager;
import org.talend.designer.runprocess.ProcessorUtilities; import org.talend.designer.runprocess.ProcessorUtilities;
import org.talend.repository.model.RepositoryNode; import org.talend.repository.model.RepositoryNode;
import org.talend.repository.model.RepositoryNodeUtilities;
import org.talend.repository.ui.dialog.RepositoryReviewDialog; import org.talend.repository.ui.dialog.RepositoryReviewDialog;
import org.talend.repository.ui.dialog.UseDynamicJobSelectionDialog; import org.talend.repository.ui.dialog.UseDynamicJobSelectionDialog;
@@ -173,10 +169,6 @@ public class ProcessController extends AbstractElementPropertySectionController
Point initialSize = dField.getLayoutControl().computeSize(SWT.DEFAULT, SWT.DEFAULT); Point initialSize = dField.getLayoutControl().computeSize(SWT.DEFAULT, SWT.DEFAULT);
boolean addVersionCombo = true;
if (LanguageManager.getCurrentLanguage() == ECodeLanguage.PERL) {
addVersionCombo = PerlResourcesHelper.USE_VERSIONING;
}
// feature 19312 // feature 19312
IElementParameter useDynamicJobParameter = param.getElement().getElementParameter( IElementParameter useDynamicJobParameter = param.getElement().getElementParameter(
EParameterName.USE_DYNAMIC_JOB.getName()); EParameterName.USE_DYNAMIC_JOB.getName());
@@ -190,7 +182,7 @@ public class ProcessController extends AbstractElementPropertySectionController
IBrandingService brandingService = (IBrandingService) GlobalServiceRegister.getDefault().getService( IBrandingService brandingService = (IBrandingService) GlobalServiceRegister.getDefault().getService(
IBrandingService.class); IBrandingService.class);
boolean allowVerchange = brandingService.getBrandingConfiguration().isAllowChengeVersion(); boolean allowVerchange = brandingService.getBrandingConfiguration().isAllowChengeVersion();
if (addVersionCombo && allowVerchange) { if (allowVerchange) {
lastControlUsed = addJobVersionCombo(subComposite, lastControlUsed = addJobVersionCombo(subComposite,
param.getChildParameters().get(EParameterName.PROCESS_TYPE_VERSION.getName()), lastControlUsed, numInRow + 1, param.getChildParameters().get(EParameterName.PROCESS_TYPE_VERSION.getName()), lastControlUsed, numInRow + 1,
nbInRow, top); nbInRow, top);
@@ -547,20 +539,10 @@ public class ProcessController extends AbstractElementPropertySectionController
if (elem != null && elem instanceof Node) { if (elem != null && elem instanceof Node) {
Node runJobNode = (Node) elem; Node runJobNode = (Node) elem;
String paramName = (String) button.getData(PARAMETER_NAME); String paramName = (String) button.getData(PARAMETER_NAME);
String jobIds = (String) runJobNode.getPropertyValue(paramName); // .getElementParameter(name).getValue(); String jobIds = (String) runJobNode.getPropertyValue(paramName);
if (StringUtils.isNotEmpty(jobIds)) { if (StringUtils.isNotEmpty(jobIds)) {
String[] jobsArr = jobIds.split(ProcessController.COMMA); String[] jobsArr = jobIds.split(ProcessController.COMMA);
List<RepositoryNode> repositoryNodeList = new ArrayList<RepositoryNode>(); dialog.setNeedCheckedjobs(jobsArr);
for (String id : jobsArr) {
if (StringUtils.isNotEmpty(id)) {
// if user have selected jobs
RepositoryNode node = RepositoryNodeUtilities.getRepositoryNode(id);
repositoryNodeList.add(node);
}
}
if (repositoryNodeList != null || repositoryNodeList.size() != 0) {
dialog.setRepositoryNodes(repositoryNodeList);
}
} }
} }
} catch (Throwable e) { } catch (Throwable e) {

View File

@@ -32,6 +32,7 @@ import org.talend.core.repository.model.ProxyRepositoryFactory;
import org.talend.core.ui.properties.tab.IDynamicProperty; import org.talend.core.ui.properties.tab.IDynamicProperty;
import org.talend.designer.core.model.components.EParameterName; import org.talend.designer.core.model.components.EParameterName;
import org.talend.designer.core.model.components.EmfComponent; import org.talend.designer.core.model.components.EmfComponent;
import org.talend.designer.core.model.metadata.RepositoryObjectHelper;
import org.talend.designer.core.ui.editor.cmd.ChangeValuesFromRepository; import org.talend.designer.core.ui.editor.cmd.ChangeValuesFromRepository;
import org.talend.designer.core.ui.editor.cmd.PropertyChangeCommand; import org.talend.designer.core.ui.editor.cmd.PropertyChangeCommand;
import org.talend.designer.core.utils.ValidationRulesUtil; import org.talend.designer.core.utils.ValidationRulesUtil;
@@ -46,6 +47,7 @@ public class ValidationRuleTypeController extends AbstractRepositoryController {
public ValidationRuleTypeController(IDynamicProperty dp) { public ValidationRuleTypeController(IDynamicProperty dp) {
super(dp); super(dp);
repositoryValueHander = new ValidationRuleValueHander();
} }
@Override @Override
@@ -127,42 +129,6 @@ public class ValidationRuleTypeController extends AbstractRepositoryController {
} }
@Override
protected void fastInitializeRepositoryNames(IElementParameter param) {
super.fastInitializeRepositoryNames(param);
if (param.getName().equals(EParameterName.REPOSITORY_VALIDATION_RULE_TYPE.getName())) {
fastRepositoryUpdateValidationRule(param);
}
}
private void fastRepositoryUpdateValidationRule(IElementParameter param) {
if (param != null && param.getValue() != null) {
IProxyRepositoryFactory factory = ProxyRepositoryFactory.getInstance();
String linkedRepository = (String) param.getValue();
Item item;
String displayName = "";
try {
IRepositoryViewObject object = factory.getLastVersion(linkedRepository);
if (object == null) {
return;
}
item = object.getProperty().getItem();
if (item instanceof ConnectionItem) {
lastItemUsed = (ConnectionItem) item;
displayName = dynamicProperty.getRepositoryAliasName(lastItemUsed) + ":" //$NON-NLS-1$
+ lastItemUsed.getProperty().getLabel();
}
} catch (PersistenceException e) {
ExceptionHandler.process(e);
}
param.setListItemsDisplayName(new String[] { displayName });
param.setListItemsValue(new String[] { (String) param.getValue() });
}
}
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
@@ -209,4 +175,41 @@ public class ValidationRuleTypeController extends AbstractRepositoryController {
} }
} }
private class ValidationRuleValueHander extends ControllerRepositoryValueHander {
@Override
protected void fastInitializeRepositoryNames(IElementParameter param) {
if (param.getName().equals(EParameterName.REPOSITORY_VALIDATION_RULE_TYPE.getName())) {
fastRepositoryUpdateValidationRule(param);
}
}
private void fastRepositoryUpdateValidationRule(IElementParameter param) {
if (param != null && param.getValue() != null) {
IProxyRepositoryFactory factory = ProxyRepositoryFactory.getInstance();
String linkedRepository = (String) param.getValue();
Item item;
String displayName = "";
try {
IRepositoryViewObject object = factory.getLastVersion(linkedRepository);
if (object == null) {
return;
}
item = object.getProperty().getItem();
if (item instanceof ConnectionItem) {
lastItemUsed = (ConnectionItem) item;
displayName = RepositoryObjectHelper.getRepositoryAliasName(lastItemUsed) + ":" //$NON-NLS-1$
+ lastItemUsed.getProperty().getLabel();
}
} catch (PersistenceException e) {
ExceptionHandler.process(e);
}
param.setListItemsDisplayName(new String[] { displayName });
param.setListItemsValue(new String[] { (String) param.getValue() });
}
}
}
} }

View File

@@ -121,10 +121,14 @@ public class UpdateJobletNodeCommand extends Command {
Node currentNode = getOriginalNodeFromProcess(node); Node currentNode = getOriginalNodeFromProcess(node);
boolean neesPro = needPropagate(currentNode); boolean neesPro = needPropagate(currentNode);
if (currentNode.isJoblet() || currentNode.isMapReduce()) {// maybe no need modify if (currentNode.isJoblet() || currentNode.isMapReduce()) {// maybe no need modify
List<IElementParameter> tempList = new ArrayList<IElementParameter>(currentNode.getElementParameters());
if (result.isNeedReloadJoblet()) { if (result.isNeedReloadJoblet()) {
reloadNode(currentNode, newComponent); reloadNode(currentNode, newComponent);
} }
if (currentNode.getNodeContainer() instanceof JobletContainer) { if (currentNode.getNodeContainer() instanceof JobletContainer) {
for(IElementParameter para : tempList){
currentNode.getElementParameter(para.getName()).setValue(para.getValue());
}
((JobletContainer) currentNode.getNodeContainer()).updateJobletNodes(true); ((JobletContainer) currentNode.getNodeContainer()).updateJobletNodes(true);
} }
} else { } else {

View File

@@ -23,6 +23,8 @@ import org.talend.commons.ui.runtime.exception.ExceptionHandler;
import org.talend.core.model.process.EParameterFieldType; import org.talend.core.model.process.EParameterFieldType;
import org.talend.core.ui.properties.tab.IDynamicProperty; import org.talend.core.ui.properties.tab.IDynamicProperty;
import org.talend.designer.core.ui.editor.properties.controllers.AbstractElementPropertySectionController; import org.talend.designer.core.ui.editor.properties.controllers.AbstractElementPropertySectionController;
import org.talend.designer.core.ui.editor.properties.controllers.AbstractRepositoryController;
import org.talend.designer.core.ui.editor.properties.controllers.ControllerRepositoryValueHander;
import org.talend.designer.core.ui.editor.properties.controllers.generator.IControllerGenerator; import org.talend.designer.core.ui.editor.properties.controllers.generator.IControllerGenerator;
/** /**
@@ -49,8 +51,7 @@ public class DynamicPropertyGenerator {
public void initController(IDynamicProperty dp) { public void initController(IDynamicProperty dp) {
if (!initialized) { if (!initialized) {
for (int i = 0; i < extensionElements.length; i++) { for (IConfigurationElement element : extensionElements) {
IConfigurationElement element = extensionElements[i];
try { try {
String controllerName = element.getAttribute("mapping"); //$NON-NLS-1$ String controllerName = element.getAttribute("mapping"); //$NON-NLS-1$
EParameterFieldType key = EParameterFieldType.getFieldTypeByName(controllerName); EParameterFieldType key = EParameterFieldType.getFieldTypeByName(controllerName);
@@ -63,6 +64,11 @@ public class DynamicPropertyGenerator {
generator.setDynamicProperty(dp); generator.setDynamicProperty(dp);
AbstractElementPropertySectionController controller = generator.generate(); AbstractElementPropertySectionController controller = generator.generate();
dtpControls.put(key, controller); dtpControls.put(key, controller);
if (controller instanceof AbstractRepositoryController) {
ControllerRepositoryValueHander repositoryValueHander = ((AbstractRepositoryController) controller)
.getRepositoryValueHander();
ControllerRepositoryValueHander.getRepositoryValueHandlerMap().put(key, repositoryValueHander);
}
} }
} catch (CoreException e) { } catch (CoreException e) {
ExceptionHandler.process(e); ExceptionHandler.process(e);

View File

@@ -708,7 +708,7 @@ public class MultipleThreadDynamicComposite extends ScrolledComposite implements
} }
private final Listener resizeListener = new Listener() { protected final Listener resizeListener = new Listener() {
@Override @Override
public void handleEvent(Event event) { public void handleEvent(Event event) {
@@ -726,13 +726,7 @@ public class MultipleThreadDynamicComposite extends ScrolledComposite implements
@Override @Override
public void run() { public void run() {
if (!isDisposed() && !getParent().isDisposed()) { handleResize();
int currentSize = getParent().getClientArea().height;
if (getLastCompositeSize() != currentSize) {
addComponents(true);
refresh();
}
}
} }
}); });
@@ -740,6 +734,17 @@ public class MultipleThreadDynamicComposite extends ScrolledComposite implements
} }
}; };
protected void handleResize() {
if (!isDisposed() && !getParent().isDisposed()) {
int currentSize = getParent().getClientArea().height;
if (getLastCompositeSize() != currentSize) {
addComponents(true);
refresh();
}
}
}
/** /**
* Getter for isCompactView. * Getter for isCompactView.
* *

View File

@@ -244,14 +244,13 @@ public class JavaProcessUtil {
addNodeRelatedModules(node.getProcess(), modulesNeeded, node, forMR); addNodeRelatedModules(node.getProcess(), modulesNeeded, node, forMR);
// for children job // for children job
if (withChildrens) { if (withChildrens) {
modulesNeeded.addAll(getChildrenModules(node, searchItems, withChildrens, forMR)); modulesNeeded.addAll(getChildrenModules(node, searchItems, forMR));
} }
return new HashSet<ModuleNeeded>(modulesNeeded); return new HashSet<ModuleNeeded>(modulesNeeded);
} }
static List<ModuleNeeded> getChildrenModules(final INode node, Set<ProcessItem> searchItems, boolean withChildrens, static List<ModuleNeeded> getChildrenModules(final INode node, Set<ProcessItem> searchItems, boolean forMR) {
boolean forMR) {
List<ModuleNeeded> modulesNeeded = new ArrayList<ModuleNeeded>(); List<ModuleNeeded> modulesNeeded = new ArrayList<ModuleNeeded>();
if (node.getComponent().getName().equals("tRunJob")) { //$NON-NLS-1$ if (node.getComponent().getName().equals("tRunJob")) { //$NON-NLS-1$
IElementParameter processIdparam = node.getElementParameter("PROCESS_TYPE_PROCESS"); //$NON-NLS-1$ IElementParameter processIdparam = node.getElementParameter("PROCESS_TYPE_PROCESS"); //$NON-NLS-1$
@@ -267,16 +266,16 @@ public class JavaProcessUtil {
String context = (String) node.getElementParameter("PROCESS_TYPE_CONTEXT").getValue(); //$NON-NLS-1$ String context = (String) node.getElementParameter("PROCESS_TYPE_CONTEXT").getValue(); //$NON-NLS-1$
if (processItem != null && !searchItems.contains(processItem)) { if (processItem != null && !searchItems.contains(processItem)) {
boolean independent = getBooleanParamValue(node, "USE_INDEPENDENT_PROCESS") //$NON-NLS-1$ boolean seperated = getBooleanParamValue(node, "USE_INDEPENDENT_PROCESS") //$NON-NLS-1$
|| getBooleanParamValue(node, "USE_DYNAMIC_JOB"); //$NON-NLS-1$ || getBooleanParamValue(node, "USE_DYNAMIC_JOB"); //$NON-NLS-1$
if (withChildrens || !independent) { if (!seperated) {
// avoid dead loop of method call // avoid dead loop of method call
searchItems.add(processItem); searchItems.add(processItem);
JobInfo subJobInfo = new JobInfo(processItem, context); JobInfo subJobInfo = new JobInfo(processItem, context);
IDesignerCoreService service = CorePlugin.getDefault().getDesignerCoreService(); IDesignerCoreService service = CorePlugin.getDefault().getDesignerCoreService();
IProcess child = service.getProcessFromItem(subJobInfo.getProcessItem()); IProcess child = service.getProcessFromItem(subJobInfo.getProcessItem());
getNeededModules(child, withChildrens, searchItems, modulesNeeded, forMR); getNeededModules(child, true, searchItems, modulesNeeded, forMR);
} }
} }
} }
@@ -517,6 +516,7 @@ public class JavaProcessUtil {
if (var.equals(paramName)) { if (var.equals(paramName)) {
ModuleNeeded module = getModuleNeededForContextParam(contextPara); ModuleNeeded module = getModuleNeededForContextParam(contextPara);
if (module != null && !modulesNeeded.contains(module)) { if (module != null && !modulesNeeded.contains(module)) {
module.setDynamic(true);
modulesNeeded.add(module); modulesNeeded.add(module);
} }
} }
@@ -524,6 +524,7 @@ public class JavaProcessUtil {
} }
} else { } else {
ModuleNeeded module = new ModuleNeeded(null, TalendTextUtils.removeQuotes(text), null, true); ModuleNeeded module = new ModuleNeeded(null, TalendTextUtils.removeQuotes(text), null, true);
module.setDynamic(true);
modulesNeeded.add(module); modulesNeeded.add(module);
} }
} }

View File

@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>org.talend.studio</groupId> <groupId>org.talend.studio</groupId>
<artifactId>tdi-studio-se</artifactId> <artifactId>tdi-studio-se</artifactId>
<version>6.2.1-SNAPSHOT</version> <version>6.2.1</version>
<relativePath>../../../</relativePath> <relativePath>../../../</relativePath>
</parent> </parent>
<artifactId>org.talend.designer.dbmap</artifactId> <artifactId>org.talend.designer.dbmap</artifactId>

View File

@@ -119,5 +119,82 @@ public class ExternalDbMapData implements IExternalData {
// TODO Auto-generated method stub // TODO Auto-generated method stub
return null; return null;
} }
/*
* (non-Javadoc)
*
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final ExternalDbMapData other = (ExternalDbMapData) obj;
if(this.inputTables.size() != other.inputTables.size()){
return false;
}
if(this.outputTables.size() != other.outputTables.size()){
return false;
}
if(this.varsTables.size() != other.varsTables.size()){
return false;
}
for(ExternalDbMapTable inTable:inputTables){
boolean found = false;
for(ExternalDbMapTable otherTable:other.inputTables){
if(inTable.getName().equals(otherTable.getName())){
found = true;
if(!inTable.equals(otherTable)){
return false;
}
break;
}
}
if(found == false){
return false;
}
}
for(ExternalDbMapTable outTable:outputTables){
boolean found = false;
for(ExternalDbMapTable otherTable:other.outputTables){
if(outTable.getName().equals(otherTable.getName())){
found = true;
if(!outTable.equals(otherTable)){
return false;
}
break;
}
}
if(found == false){
return false;
}
}
for(ExternalDbMapTable varTable:varsTables){
boolean found = false;
for(ExternalDbMapTable var:other.varsTables){
if(varTable.getName().equals(var.getName())){
found = true;
if(!varTable.equals(var)){
return false;
}
break;
}
}
if(found == false){
return false;
}
}
return true;
}
} }

View File

@@ -127,5 +127,40 @@ public class ExternalDbMapEntry implements IExternalMapEntry, Serializable, Clon
public Object clone() throws CloneNotSupportedException { public Object clone() throws CloneNotSupportedException {
return super.clone(); return super.clone();
} }
/*
* (non-Javadoc)
*
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
final ExternalDbMapEntry other = (ExternalDbMapEntry) obj;
if (this.expression == null) {
if (other.expression != null)
return false;
} else if (!this.expression.equals(other.expression))
return false;
if (this.name == null) {
if (other.name != null)
return false;
} else if (!this.name.equals(other.name))
return false;
if (this.isJoin() != other.isJoin())
return false;
if (this.operator == null) {
if (other.operator != null)
return false;
} else if (!this.operator.equals(other.operator))
return false;
return true;
}
} }

View File

@@ -194,5 +194,154 @@ public class ExternalDbMapTable extends AbstractExternalMapTable implements Seri
} }
return cloned; return cloned;
} }
/*
* (non-Javadoc)
*
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final ExternalDbMapTable other = (ExternalDbMapTable) obj;
if (this.minimized != other.minimized) {
return false;
}
if (this.name == null) {
if (other.name != null) {
return false;
}
} else if (!this.name.equals(other.name)) {
return false;
}
if (this.joinType == null) {
if (other.joinType != null) {
return false;
}
} else if (!this.joinType.equals(other.joinType)) {
return false;
}
if (this.alias == null) {
if (other.alias != null) {
return false;
}
} else if (!this.alias.equals(other.alias)) {
return false;
}
if (this.tableName == null) {
if (other.tableName != null) {
return false;
}
} else if (!this.tableName.equals(other.tableName)) {
return false;
}
List<ExternalDbMapEntry> this_customOtherConditionsEntries = null;
if(this.customOtherConditionsEntries == null){
this_customOtherConditionsEntries = new ArrayList<ExternalDbMapEntry>();
}else{
this_customOtherConditionsEntries = new ArrayList<ExternalDbMapEntry>(this.customOtherConditionsEntries);
}
List<ExternalDbMapEntry> this_metadataTableEntries = null;
if(this.metadataTableEntries == null){
this_metadataTableEntries = new ArrayList<ExternalDbMapEntry>();
}else{
this_metadataTableEntries = new ArrayList<ExternalDbMapEntry>(this.metadataTableEntries);
}
List<ExternalDbMapEntry> this_customWhereConditionsEntries = null;
if(this.customWhereConditionsEntries == null){
this_customWhereConditionsEntries = new ArrayList<ExternalDbMapEntry>();
}else{
this_customWhereConditionsEntries = new ArrayList<ExternalDbMapEntry>(this.customWhereConditionsEntries);
}
List<ExternalDbMapEntry> other_customOtherConditionsEntries = null;
if(other.customOtherConditionsEntries == null){
other_customOtherConditionsEntries = new ArrayList<ExternalDbMapEntry>();
}else{
other_customOtherConditionsEntries = new ArrayList<ExternalDbMapEntry>(other.customOtherConditionsEntries);
}
List<ExternalDbMapEntry> other_metadataTableEntries = null;
if(other.metadataTableEntries == null){
other_metadataTableEntries = new ArrayList<ExternalDbMapEntry>();
}else{
other_metadataTableEntries = new ArrayList<ExternalDbMapEntry>(other.metadataTableEntries);
}
List<ExternalDbMapEntry> other_customWhereConditionsEntries = null;
if(other.customWhereConditionsEntries == null){
other_customWhereConditionsEntries = new ArrayList<ExternalDbMapEntry>();
}else{
other_customWhereConditionsEntries = new ArrayList<ExternalDbMapEntry>(other.customWhereConditionsEntries);
}
if(this_customOtherConditionsEntries.size() != other_customOtherConditionsEntries.size()){
return false;
}
for(ExternalDbMapEntry oriObj:this_customOtherConditionsEntries){
boolean found = false;
for(ExternalDbMapEntry otherObj:other_customOtherConditionsEntries){
if(oriObj.getName().equals(otherObj.getName())){
found = true;
if(!oriObj.equals(otherObj)){
return false;
}
break;
}
}
if(found == false){
return false;
}
}
if(this_customWhereConditionsEntries.size() != other_customWhereConditionsEntries.size()){
return false;
}
for(ExternalDbMapEntry oriObj:this_customWhereConditionsEntries){
boolean found = false;
for(ExternalDbMapEntry otherObj:other_customWhereConditionsEntries){
if(oriObj.getName().equals(otherObj.getName())){
found = true;
if(!oriObj.equals(otherObj)){
return false;
}
break;
}
}
if(found == false){
return false;
}
}
if(this_metadataTableEntries.size() != other_metadataTableEntries.size()){
return false;
}
for(ExternalDbMapEntry oriObj:this_metadataTableEntries){
boolean found = false;
for(ExternalDbMapEntry otherObj:other_metadataTableEntries){
if(oriObj.getName().equals(otherObj.getName())){
found = true;
if(!oriObj.equals(otherObj)){
return false;
}
break;
}
}
if(found == false){
return false;
}
}
return true;
}
} }

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