Compare commits

...

65 Commits

Author SHA1 Message Date
apoltavtsev@gmail.com
1e665f76ae TESB-25418 Missing commons-parent dependency is added for TOS 2019-04-11 01:05:49 +03:00
Mike Yan
040cf2dee6 fix(TESB-24789): Remove spring-boot plugin in TOS for microservice (#2342) 2019-04-10 17:57:44 +08:00
Jane Ding
cde7238840 fix(TUP-22182)Non-default Artifactory context path, not working (#2338)
* fix(TUP-22182)Non-default Artifactory context path, not working
https://jira.talendforge.org/browse/TUP-22182

* fix(TUP-22182)Non-default Artifactory context path, not working
https://jira.talendforge.org/browse/TUP-22182
2019-04-10 11:20:47 +08:00
kjwang-talend
b281dcef45 TUP-21308 Fix SSLUtils TLS configuration (#2292)
* TUP-21308 Fix SSLUtils TLS configuration
https://jira.talendforge.org/browse/TUP-21308

* TUP-21308 Fix SSLUtils TLS configuration
https://jira.talendforge.org/browse/TUP-21308

* TUP-21308 Fix SSLUtils TLS configuration
https://jira.talendforge.org/browse/TUP-21308

* TUP-21308 Fix SSLUtils TLS configuration
https://jira.talendforge.org/browse/TUP-21308

* TUP-21308 Fix SSLUtils TLS configuration
https://jira.talendforge.org/browse/TUP-21308

* TUP-21308 Fix SSLUtils TLS configuration
https://jira.talendforge.org/browse/TUP-21308
2019-04-10 11:18:58 +08:00
Chao MENG
50f87d7d92 item(TUP-22610): update tacokit to version 1.1.9 (#2339)
* item(TUP-22610): update tacokit to version 1.1.8

https://jira.talendforge.org/browse/TUP-22610

* Update pom.xml

Update to 1.1.9-SNAPSHOT
2019-04-09 18:23:49 +08:00
kuanwang
5668a651b2 TUP-22549 ProjectPreferenceManagerTest.testReload (#2340) 2019-04-09 17:50:16 +08:00
nrousseau
0ec10cc9c3 chore(TUP-22343) add public 2019-04-08 17:54:22 +08:00
hcyi
cf74274d63 fix(TUP-22012):Upgrade Teradata driver 16.20 or latest (#2333) 2019-04-08 10:41:48 +08:00
TKaczynski
eb33120cac fix(TBD-7687): tFileInputDelimited issue with separator (#2314)
* fix(TBD-7687): tFileInputDelimited issue with separator

add a null instead of delete the column

* Update StringUtils.java

* Update StringUtils.java

* Update StringUtils.java

* Update StringUtils.java
2019-04-04 13:53:30 +02:00
jiezhang-tlnd
003a31b361 feat(TUP-21678)Provide external JDBC parameters to all our connectors (#2329)
* feat(TUP-21678)Provide external JDBC parameters to all our connectors

* fix(TUP-21678)Provide external JDBC parameters to all our connectors
2019-04-04 18:22:30 +08:00
Jane Ding
fda3573d7c fix(TUP-21920)Nullpointer on build job (#2309)
https://jira.talendforge.org/browse/TUP-21920
Loop dependency classpath issue caused main class not found
2019-04-03 14:59:13 +08:00
hcyi
eecc481d67 fix(TUP-22400):Classcastexception When Retrieving Db BigInt Column Value (#2321)
With tHiveInput Component.
2019-04-03 10:49:22 +08:00
hcyi
113db9246f fix(TUP-22012):Upgrade Teradata driver 16.20 or latest. (#2324) 2019-04-03 10:36:33 +08:00
Liu Xinquan
bfcdd968ed TDQ-16354 TOP i18n preference page (#2311) 2019-04-02 16:35:02 +08:00
nrousseau
f542ab5779 feat(TDI-41943) add missing dependency 2019-04-02 13:37:22 +08:00
kjwang-talend
2a0d494f49 Kjwang/fix tup 22425 stackoverflow (#2322)
* Fix TUP-22425 [7.1.1] Stackoverflow issue in studio
https://jira.talendforge.org/browse/TUP-22425

* Fix TUP-22425 [7.1.1] Stackoverflow issue in studio
https://jira.talendforge.org/browse/TUP-22425
2019-04-02 10:15:23 +08:00
kjwang-talend
fe0eab22bd Fix TUP-22469 Nexus3.15: studio can't detect patch for 701/711 release (#2320)
* Fix TUP-22469 Nexus3.15: studio can't detect patch for 701/711 release
https://jira.talendforge.org/browse/TUP-22469

* Fix TUP-22469 Nexus3.15: studio can't detect patch for 701/711 release
https://jira.talendforge.org/browse/TUP-22469

* Fix TUP-22469 Nexus3.15: studio can't detect patch for 701/711 release
https://jira.talendforge.org/browse/TUP-22469

* Fix TUP-22469 Nexus3.15: studio can't detect patch for 701/711 release
https://jira.talendforge.org/browse/TUP-22469
2019-04-01 16:59:10 +08:00
jiezhang-tlnd
12b9a4eee9 fix(TUP-17925)Sybase connection can check successfully even if a wrong db filled (#2214)
* fix(TUP-17925)Sybase connection can check successfully even if a wrong
db filled

* fix(TUP-17925)check database right or not

* fix(TUP-17925)check the database right or not

* fix(TUP-17925)check the database exist or not

* fix(TUP-17928)check the database existed or not

* fix(TUP-17925)connection can check successfully even if a wrong db
filled

* fix(TUP-17925)Sybase connection can check successfully even if a wrong
db filled
2019-04-01 09:50:42 +08:00
nrousseau
f0e07897a5 feat(TDI-41943) update tcomp/daikon dependencies 2019-03-29 18:00:45 +08:00
dmytroshekera
bb001061e8 fix(TDI-41876):Importing job from 6.2.1 to 7.1.1 is throwing error. (#2310)
apache AVRO schema have default values.
2019-03-28 10:35:09 +02:00
jiezhang-tlnd
bdd9a601b9 fix(TUP-22333)Cannot Edit Context Value in Job->Contexts View (#2316) 2019-03-27 18:27:44 +08:00
zshen-talend
3646a1bcd9 feat(TDQ-16567): support amazon aurora for DQ side (#2295) 2019-03-27 16:00:48 +08:00
kjwang-talend
9125f27236 Kjwang/fix tup 22281 missing jar 2 (#2315)
* TUP-22281 Missing jar in lib folder for Job Server(Solution 2)
https://jira.talendforge.org/browse/TUP-22281

* TUP-22281 Missing jar in lib folder for Job Server(Solution 2)
https://jira.talendforge.org/browse/TUP-22281

* TUP-22281 Missing jar in lib folder for Job Server(Solution 2)
https://jira.talendforge.org/browse/TUP-22281
2019-03-27 10:44:07 +08:00
jiezhang-tlnd
df4ac3fdf9 fix(TUP-22367)View documentation does not work after eclipse upgrade (#2304) 2019-03-26 10:49:52 +08:00
jiezhang-tlnd
52a0eb81b5 fix(TUP-22410)Can't import item which locate at root of disk after eclipse upgrade (#2312)
* fix(TUP-22410)Can't import item which locate at root of disk after
eclipse upgrade

* fix(TUP-22410)Can't import item which locate at root of disk after
eclipse upgrade

* fix(TUP-22410)Can't import item which locate at root of disk after
eclipse upgrade
2019-03-26 10:48:43 +08:00
jiezhang-tlnd
68d06f763c fix(TUP-22420)Exchange should not be in toolbar if (#2313)
-Dtalend.disable.internet=true
2019-03-25 17:17:11 +08:00
jiezhang-tlnd
c42d3d6813 fix(TUP-21678)Provide external JDBC parameters to all our connectors (#2275) 2019-03-25 15:52:11 +08:00
jiezhang-tlnd
c813075602 fix(TUP-22333)Cannot Edit Context Value in Job Contexts View (#2306) 2019-03-25 15:50:35 +08:00
Tao Tao
80f8202381 fix(TUP-21925):Empty pop-up error message when moving a folder (#2261)
* fix(TUP-21925):Empty pop-up error message when moving a folder
containing an already open job to another folder

https://jira.talendforge.org/browse/TUP-21925

* fix(TUP-21925):Empty pop-up error message when moving a folder
containing an already open job to another folder

https://jira.talendforge.org/browse/TUP-21925

* fix(TUP-21925):Empty pop-up error message when moving a folder (Improved
code)

* fix(TUP-21925):Empty pop-up error message when moving a folder (Improved
code)
2019-03-25 15:44:42 +08:00
kjwang-talend
cd2c0b2ae8 TUP-22340 Missing jobs after importing with studio build after eclipse (#2308)
upgrade
https://jira.talendforge.org/browse/TUP-22340
2019-03-25 10:33:43 +08:00
Stella Coëpeau
3a23afc4b5 feat(TBD-6291): Implement Dataset component detection (#2250) 2019-03-22 12:03:05 +01:00
jiezhang-tlnd
2caeecc4a5 fix(TUP-22357)Cannot edit properties for joblet (#2305) 2019-03-22 11:23:53 +08:00
Roman
5c1e36ceee fix(TDI-41790): change mapping for numbers (#2264)
* fix(TDI-41790): change mapping for numbers
2019-03-21 14:08:16 +02:00
jiezhang-tlnd
762f33c0a1 fix(TUP-22357)Cannot edit properties for joblet (#2302) 2019-03-21 11:27:20 +08:00
chmyga
82f48b9ec9 fix(TDI-41681): fix XMLHelper (#2263) 2019-03-19 10:09:41 +02:00
chmyga
353fdab095 fix(TDI-41951): special chars in column comment (#2293)
* Add util method to escape special symbols
2019-03-18 15:21:20 +02:00
sbliu
f3bbbe1801 TMDM-13127 Add xml-apis.jar and xercesImpl.jar to resolve problem that can not found class 'SAXParser' and 'XMLSerializer' when import into/export from mdm server in mdm studio. 2019-03-18 15:35:48 +08:00
sbliu
dc76cea51f TMDM-11900 Update schema of UpdateReport, add 'UUID' field for standalone mode. 2019-03-18 14:48:53 +08:00
Zhiwei Xue
74df10d837 fix(TUP-21999):SAP Hana Metadata Wizard does not work properly (#2273) 2019-03-13 16:00:24 +08:00
Chao MENG
eeba861872 feat(TUP-18064): [Studio] Update to more recent Eclipse (4.10) (#2278) (#2289)
* feat(TUP-18064): [Studio] Update to more recent Eclipse (4.10) (#2278)

https://jira.talendforge.org/browse/TUP-18064

* feat(TUP-18064): [Studio] Update to more recent Eclipse (4.10) (#2278)

https://jira.talendforge.org/browse/TUP-18064
2019-03-12 10:31:32 +08:00
Tao Tao
59d48b14d5 fix(TUP-21903):tSalesForceConnection JWT flow does not work with Context (#2248)
* fix(TUP-21903):tSalesForceConnection JWT flow does not work with Context
group variable set for connection type Oauth.

https://jira.talendforge.org/browse/TUP-21903

* fix(TUP-21903):tSalesForceConnection JWT flow does not work with Context
group variable set for connection type Oauth.

https://jira.talendforge.org/browse/TUP-21903

* fix(TUP-21903):tSalesForceConnection JWT flow does not work with Context
group variable set for connection type Oauth.

https://jira.talendforge.org/browse/TUP-21903

* fix(TUP-21903):tSalesForceConnection JWT flow does not work with Context
group variable set for connection type Oauth.

https://jira.talendforge.org/browse/TUP-21903

* fix(TUP-21903):tSalesForceConnection JWT flow does not work with Context
group variable set for connection type Oauth.

https://jira.talendforge.org/browse/TUP-21903
2019-03-08 15:11:48 +08:00
hcyi
1c60748d49 feat(TUP-21495):Support MFA on studio for the Cloud. (#2246) 2019-03-08 10:31:35 +08:00
Jane Ding
cd2e2484e3 fix(TUP-21920)Nullpointer on build job (#2253) 2019-03-07 17:27:53 +08:00
Dmytro Sylaiev
a101784871 Dsylaiev/tdi 41808 fix showing pass nzload (#2276)
* fix(TDI-41808): Add password for logging constant

* fix(TDI-41808): Rename constant

* chore(TDI-41808): Update year in copyright
2019-03-07 11:12:46 +02:00
Chao MENG
b400ebc0f4 feat(TUP-18064): [Studio] Update to more recent Eclipse (4.10) (#2278)
https://jira.talendforge.org/browse/TUP-18064
2019-03-07 10:32:49 +08:00
Chao MENG
642c17e4ab Studio upgrade/eclipse 4.10.0 (#2277)
* fix(TUP-19969): Eclipse upgrade - TOS need to work with eclipse 4.7.0
https://jira.talendforge.org/browse/TUP-19969

Conflicts:
	main/plugins/org.talend.libraries.nattable.glazedlist/META-INF/MANIFEST.MF
	main/plugins/org.talend.libraries.nattable.glazedlist/pom.xml
	main/plugins/org.talend.libraries.nattable/META-INF/MANIFEST.MF
	main/plugins/org.talend.libraries.nattable/pom.xml

* fix(TUP-19969): Eclipse upgrade - TOS need to work with eclipse 4.7.0
https://jira.talendforge.org/browse/TUP-19969

* fix(TUP-19969): Eclipse upgrade - TOS need to work with eclipse 4.7.0
https://jira.talendforge.org/browse/TUP-19969

* fix(TUP-19969): Eclipse upgrade - TOS need to work with eclipse 4.7.0
https://jira.talendforge.org/browse/TUP-19969

Remove x86 and unsupported platform

* feat(TUP-19969): Eclipse upgrade

Fix the update of maven resolver for configuration

Conflicts:
	main/plugins/org.talend.core.runtime/src/main/java/org/talend/core/nexus/TalendMavenResolver.java

* Fix :TUP-21173 Make compilation test with Java 11
https://jira.talendforge.org/browse/TUP-21173
Fix :TUP-21173 Make compilation test with Java 11
https://jira.talendforge.org/browse/TUP-21173
Fix :TUP-21173 Make compilation test with Java 11
https://jira.talendforge.org/browse/TUP-21173

* item(TUP-21339): Eclipse upgrade - TOS need to work with eclipse 4.10.0

https://jira.talendforge.org/browse/TUP-21339

* item(TUP-21339): Eclipse upgrade - TOS need to work with eclipse 4.10.0

https://jira.talendforge.org/browse/TUP-21339

* item(TUP-21339): Eclipse upgrade - TOS need to work with eclipse 4.10.0

https://jira.talendforge.org/browse/TUP-21339

* item(TUP-21339): Eclipse upgrade - TOS need to work with eclipse 4.10.0

https://jira.talendforge.org/browse/TUP-21339

* item(TUP-21339): Eclipse upgrade - TOS need to work with eclipse 4.10.0

https://jira.talendforge.org/browse/TUP-21339

* item(TUP-21731): Fix button font color issue for mac / linux

https://jira.talendforge.org/browse/TUP-21731

* item(TUP-21701): Eclipse upgrade - make core part of EE product building

https://jira.talendforge.org/browse/TUP-21701

* item(TUP-21701): Eclipse upgrade - make core part of EE product building

https://jira.talendforge.org/browse/TUP-21701

* item(TUP-21731): Fix button font color issue for mac / linux

https://jira.talendforge.org/browse/TUP-21731

* item(TUP-21731): Fix button font color issue for mac / linux

https://jira.talendforge.org/browse/TUP-21731

* item(TUP-21736): Font style of tab changed after clicked one tab on
Windows

https://jira.talendforge.org/browse/TUP-21736

* item(TUP-21987): Studio can't load components after upgrade studio (#2245)

target platform
https://jira.talendforge.org/browse/TUP-21987

* fix(TUP-22042): A blank shell is opened when saving job

https://jira.talendforge.org/browse/TUP-22042
I checked the api of Shell on Linux and Windows (Eclipse 4.10)
On Linux, the open method of Shell will open it's parent shell, seems no
way to avoid it.
On Windows, the open method of Shell won't open parent shell.

I think the only way to avoid empty shell on Linux is changing all the
codes which creating empty shell, I think we can even give a null if no
active shell found.

* fix(TUP-22042): A blank shell is opened when saving job

https://jira.talendforge.org/browse/TUP-22042
I checked the api of Shell on Linux and Windows (Eclipse 4.10)
On Linux, the open method of Shell will open it's parent shell, seems no
way to avoid it.
On Windows, the open method of Shell won't open parent shell.

I think the only way to avoid empty shell on Linux is changing all the
codes which creating empty shell, I think we can even give a null if no
active shell found.

* item(TUP-21732): Fix basic maven repository

https://jira.talendforge.org/browse/TUP-21732

* feat(TUP-18064): [Studio] Update to more recent Eclipse (4.10)

https://jira.talendforge.org/browse/TUP-18064

* Jzhang/bugfix/tup 21737 coolbar can't fully display on windows (#2258)

* fix(TUP-21737)Coolbar can't fully display on Windows

* fix(TUP-21737)Coolbar can't fully display on Windows

* fix(TUP-21737)Coolbar can't fully display on Windows

* fix(TUP-21737)Coolbar can't fully display on Windows

* fix(TUP-21737)Coolbar can't fully display on Windows

* fix(TUP-21737)Coolbar can't fully display on Windows

* fix(TUP-21737)Coolbar can't fully display on Windows

* fix(TUP-21737)Coolbar can't fully display on Windows

* fix(TUP-21737)Coolbar can't fully display on Windows

* fix(TUP-21737)Coolbar can't fully display on Windows

* fix(TUP-21737)Coolbar can't fully display on Windows

* fix(TUP-21737)Coolbar can't fully display on Windows

* fix(TUP-21737)Coolbar can't fully display on Windows

* fix(TUP-21737)Coolbar can't fully display on Windows

* fix(TUP-21737)Coolbar can't fully display on Windows

* fix(TUP-22145)Error pops up after clicked accept license when (#2271)

* fix(TUP-22145)Error pops up after clicked accept license when
downloading jars

* fix(TUP-22145)Error pops up after clicked accept license when
downloading jars

* fix(TUP-22145)Error pops up after clicked accept license when
downloading jars
2019-03-07 10:20:30 +08:00
jiezhang-tlnd
f31f959981 fix(TUP-21998)JDBC Connection doesn't work well (#2272) 2019-03-05 10:18:23 +08:00
Laurent BOURGEOIS
5c2eaea6f2 Fix(TBD-8109):High CVE Vulnerability found in Talend Components (#2237) 2019-03-04 17:40:17 +01:00
kjwang-talend
958f8f59a5 kjwang/Fix TUP-22005 Unexpected Empty Contexts Variable Values (#2262)
https://jira.talendforge.org/browse/TUP-22005
2019-03-01 19:11:42 +08:00
hwang-talend
185cfbc8ef bugfix(TDI-41803):Job migrated from 6.5.1 to 7.1.1 throwing (#2255)
bugfix(TDI-41803):Job migrated from 6.5.1 to 7.1.1 throwing UNEXPECTED_EXCEPTION
2019-03-01 16:22:19 +08:00
jiezhang-tlnd
458b26655b feat(TUP-21678)Provide external JDBC parameters to all our connectors (#2254) 2019-02-27 18:25:57 +08:00
jiezhang-tlnd
a3a2d71edc fix(TUP-22027)It's very slow when create an output xml metadata using (#2251)
attached file
2019-02-27 18:22:39 +08:00
jiezhang-tlnd
afe3ba63d1 fix(TUP-5535)rename JDBC connection,the new name can't be reload in job (#2233) 2019-02-26 17:05:29 +08:00
Zhiwei Xue
697b4e8a5f fix(TUP-22015):fix thread safe problem. (#2247) 2019-02-26 16:04:36 +08:00
Stéphane Bouchet
b6c36db750 TESB-24834 : fixed NPE (#2252) 2019-02-22 10:38:03 +01:00
kjwang-talend
d62d3dbc80 Fix TUP-21911 Build job takes about 4 minutes while Run job takes > 40 (#2242)
minutes to start
https://jira.talendforge.org/browse/TUP-21911
2019-02-18 10:25:35 +08:00
jiezhang-tlnd
141ef2a542 fix(TUP-21922)Commit to Git frequently without any user action (#2240) 2019-02-14 11:33:06 +08:00
Tao Tao
b1e1375da3 fix(TUP-21880):Quick tour page is blank when launch studio using ESB (#2239)
* fix(TUP-21880):Quick tour page is blank when launch studio using ESB
license

For the html file DocumentBuilderfactory, we shouldn't set
XMLConstants.FEATURE_SECURE_PROCESSING feature to true.
https://jira.talendforge.org/browse/TUP-21880
2019-02-12 18:53:10 +08:00
iwangtalend
0f0ba6b81f Revert "TUP-21308 Fix SSLUtils TLS configuration (#2200)" (#2238)
This reverts commit 430b425626.
2019-02-06 15:08:15 +01:00
zshen-talend
a0ae46180e fix(TDQ-16414): make sure "character" contain by JavaType String (#2232) 2019-02-01 11:23:51 +08:00
hcyi
56fba7594a fix(TUP-21777):[7.0.1] Metadata Wizard with SSL cannot retrieve cluster (#2225)
settings
2019-01-31 18:22:24 +08:00
msjian
c9403a8617 chore(TDQ-16563): for redshift(SSO), only keep "Generate an ETL Job to (#2231)
handle rows"
2019-01-31 18:13:21 +08:00
kjwang-talend
430b425626 TUP-21308 Fix SSLUtils TLS configuration (#2200)
* TUP-21308 Fix SSLUtils TLS configuration
https://jira.talendforge.org/browse/TUP-21308

* TUP-21308 Fix SSLUtils TLS configuration
https://jira.talendforge.org/browse/TUP-21308

* TUP-21308 Fix SSLUtils TLS configuration
https://jira.talendforge.org/browse/TUP-21308

* TUP-21308 Fix SSLUtils TLS configuration
https://jira.talendforge.org/browse/TUP-21308

* TUP-21308 Fix SSLUtils TLS configuration
https://jira.talendforge.org/browse/TUP-21308

* TUP-21308 Fix SSLUtils TLS configuration
https://jira.talendforge.org/browse/TUP-21308

* TUP-21308 Fix SSLUtils TLS configuration
https://jira.talendforge.org/browse/TUP-21308
2019-01-30 15:42:03 +08:00
Zhiwei Xue
b8957b035c fix(TUP-21871):job run well on studio but failed after build. (#2224) 2019-01-30 13:30:06 +08:00
hwang-talend
e3a8f326e0 Hwang/tup 21711 junit master (#2222)
* bugfix(TUP-21711):Incorrect DataType retrieved when guess schema option
is used in MSSQL Connection in Studio
2019-01-30 11:03:46 +08:00
194 changed files with 4224 additions and 1531 deletions

View File

@@ -9,8 +9,8 @@
</url>
<requires>
<import feature="org.talend.model.migration.feature" version="0.0.0" match="greaterOrEqual"/>
<import plugin="bcprov" version="0.0.0" match="greaterOrEqual"/>
<import plugin="com.fasterxml.jackson.core.jackson-databind" version="2.9.5" match="greaterOrEqual"/>
<import plugin="org.bouncycastle.bcprov" version="0.0.0" match="greaterOrEqual"/>
<import plugin="com.fasterxml.jackson.core.jackson-databind" version="2.9.8" match="greaterOrEqual"/>
<import plugin="jackson-core-asl" version="0.0.0" match="greaterOrEqual"/>
<import plugin="jackson-mapper-asl" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.apache.xalan" version="0.0.0" match="greaterOrEqual"/>

View File

@@ -26,7 +26,9 @@
<import feature="org.talend.utils.feature" version="0.0.0" match="greaterOrEqual"/>
<import plugin="javax.activation" version="0.0.0" match="greaterOrEqual"/>
<import plugin="javax.mail" version="0.0.0" match="greaterOrEqual"/>
<import plugin="javax.xml.bind" version="0.0.0" match="greaterOrEqual"/>
<import plugin="javax.xml.soap" version="0.0.0" match="greaterOrEqual"/>
<import plugin="javax.xml.ws" version="0.0.0" match="greaterOrEqual"/>
<import plugin="net.jeeeyul.eclipse.themes" version="0.0.0" match="greaterOrEqual"/>
<import plugin="net.jeeeyul.swtend" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.apache.commons.collections" version="0.0.0" match="greaterOrEqual"/>
@@ -34,15 +36,9 @@
<import plugin="org.apache.commons.io" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.apache.httpcomponents.httpclient" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.apache.httpcomponents.httpcore" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.aether.api" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.aether.connector.basic" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.aether.impl" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.aether.spi" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.aether.transport.file" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.aether.transport.http" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.aether.util" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.compare" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.compare.core" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.m2m.atl.emftvm.trace" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.ops4j.pax.url.mvn" version="0.0.0" match="greaterOrEqual"/>
</requires>
<plugin id="org.talend.core" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
@@ -70,8 +66,8 @@
<plugin id="org.talend.model" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
<plugin id="org.talend.model.edit" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
<plugin id="org.talend.model.edit.nl" download-size="0" install-size="0" version="0.0.0" fragment="true" unpack="false"/>
<plugin download-size="0" install-size="0" version="0.0.0" unpack="false" id="org.talend.model.migration"/>
<plugin download-size="0" install-size="0" version="0.0.0" unpack="false" id="org.talend.model.migration.nl"/>
<plugin id="org.talend.model.migration" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
<plugin id="org.talend.model.migration.nl" download-size="0" install-size="0" version="0.0.0" fragment="true" unpack="false"/>
<plugin id="org.talend.model.nl" download-size="0" install-size="0" version="0.0.0" fragment="true" unpack="false"/>
<plugin id="org.talend.osgi.lib.loader" download-size="0" install-size="0" version="0.0.0" unpack="false" fragment="true"/>
<plugin id="org.talend.resources" download-size="0" install-size="0" version="0.0.0"/>

View File

@@ -16,13 +16,6 @@
[Enter License Description here.]
</license>
<plugin
id="org.talend.libraries.nattable.glazedlist"
download-size="0"
install-size="0"
version="0.0.0"
fragment="true"/>
<plugin
id="org.talend.developpement"
download-size="0"

View File

@@ -5,7 +5,8 @@
<copyright url="http://www.example.com/copyright">[Enter Copyright Description here.]</copyright>
<license url="http://www.example.com/license">[Enter License Description here.]</license>
<requires>
<import plugin="org.codehaus.groovy" version="0.0.0" match="greaterOrEqual"/>
<!-- bonita requires org.codehaus.groovy version 2.4.16.xx-201812291959-e2018-12-RELEASE -->
<import plugin="org.codehaus.groovy" version="2.4.16.xx-201812291959-e2018-12-RELEASE" match="perfect"/>
<import plugin="org.eclipse.ant.launching" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.ant.ui" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.jdt" version="0.0.0" match="greaterOrEqual"/>
@@ -30,6 +31,6 @@
<import plugin="org.hamcrest.core" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.junit" version="0.0.0" match="greaterOrEqual"/>
</requires>
<plugin id="org.eclipse.jdt.launching.macosx" os="macosx" download-size="17" install-size="28" version="3.2.300.v20130801-1441" unpack="false"/>
<plugin id="org.eclipse.jdt.launching.ui.macosx" os="macosx" download-size="55" install-size="101" version="1.0.300.v20130801-1441" unpack="false"/>
<plugin id="org.eclipse.jdt.launching.macosx" os="macosx" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
<plugin id="org.eclipse.jdt.launching.ui.macosx" os="macosx" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
</feature>

View File

@@ -5,6 +5,7 @@
<copyright url="http://www.example.com/copyright">[Enter Copyright Description here.]</copyright>
<license url="http://www.example.com/license">[Enter License Description here.]</license>
<requires>
<import feature="org.eclipse.equinox.p2.discovery.feature" version="0.0.0" match="greaterOrEqual"/>
<import feature="org.eclipse.wst.common.fproj" version="0.0.0" match="greaterOrEqual"/>
<import feature="org.eclipse.wst.common_core.feature" version="0.0.0" match="greaterOrEqual"/>
<import feature="org.eclipse.wst.xml_core.feature" version="0.0.0" match="greaterOrEqual"/>
@@ -18,6 +19,7 @@
<import plugin="org.eclipse.m2e.archetype.common" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.m2e.core" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.m2e.core.ui" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.m2e.discovery" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.m2e.editor" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.m2e.editor.xml" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.m2e.jdt" version="0.0.0" match="greaterOrEqual"/>
@@ -32,7 +34,9 @@
<import plugin="org.eclipse.m2e.profiles.ui" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.m2e.refactoring" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.m2e.scm" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.m2e.workspace.cli" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.slf4j.api" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.slf4j.impl.log4j12" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.wst.server.discovery" version="0.0.0" match="greaterOrEqual"/>
</requires>
</feature>

View File

@@ -7,6 +7,6 @@
<requires>
<import feature="org.eclipse.m2m.atl" version="0.0.0" match="greaterOrEqual"/>
<import feature="org.talend.utils.feature" version="0.0.0" match="greaterOrEqual"/>
<import plugin="bcprov" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.bouncycastle.bcprov" version="0.0.0" match="greaterOrEqual"/>
</requires>
</feature>

View File

@@ -18,8 +18,6 @@
<import plugin="org.eclipse.core.filesystem" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.core.net" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.core.resources" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.core.runtime.compatibility" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.core.runtime.compatibility.registry" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.core.variables" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.debug.core" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.debug.ui" version="0.0.0" match="greaterOrEqual"/>
@@ -47,6 +45,7 @@
<import plugin="org.eclipse.ui.ide" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.ui.ide.application" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.ui.intro" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.ui.intro.quicklinks" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.ui.intro.universal" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.ui.navigator" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.ui.navigator.resources" version="0.0.0" match="greaterOrEqual"/>
@@ -56,28 +55,15 @@
<import plugin="org.eclipse.ui.views.properties.tabbed" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.ui.workbench.texteditor" version="0.0.0" match="greaterOrEqual"/>
</requires>
<plugin id="org.eclipse.compare.win32" os="win32" download-size="38" install-size="71" version="1.0.200.v20130514-1224" unpack="false"/>
<plugin id="org.eclipse.core.filesystem.aix.ppc" os="aix" arch="ppc" download-size="9" install-size="17" version="1.1.0.v20140124-1940" fragment="true" unpack="false"/>
<plugin id="org.eclipse.core.filesystem.aix.ppc64" os="aix" arch="ppc64" download-size="9" install-size="18" version="1.1.0.v20140124-1940" fragment="true" unpack="false"/>
<plugin id="org.eclipse.core.filesystem.hpux.ia64" os="hpux" arch="ia64" download-size="20" install-size="102" version="1.1.0.v20140124-1940" fragment="true" unpack="false"/>
<plugin id="org.eclipse.core.filesystem.linux.ppc" os="linux" arch="ppc" download-size="22" install-size="52" version="1.0.200.v20140124-1940" fragment="true" unpack="false"/>
<plugin id="org.eclipse.core.filesystem.linux.ppc64" os="linux" arch="ppc64" download-size="10" install-size="21" version="1.4.0.v20140124-1940" fragment="true" unpack="false"/>
<plugin id="org.eclipse.core.filesystem.linux.ppc64le" os="linux" arch="ppc64le" download-size="10" install-size="20" version="1.4.0.v20140808-1353" fragment="true" unpack="false"/>
<plugin id="org.eclipse.core.filesystem.linux.x86" os="linux" arch="x86" download-size="10" install-size="17" version="1.4.200.v20140124-1940" fragment="true" unpack="false"/>
<plugin id="org.eclipse.core.filesystem.linux.x86_64" os="linux" arch="x86_64" download-size="10" install-size="19" version="1.2.200.v20140124-1940" fragment="true" unpack="false"/>
<plugin id="org.eclipse.core.filesystem.macosx" os="macosx" download-size="13" install-size="64" version="1.3.0.v20140124-1940" fragment="true" unpack="false"/>
<plugin id="org.eclipse.core.filesystem.solaris.sparc" os="solaris" arch="sparc" download-size="9" install-size="16" version="1.2.0.v20140124-1940" fragment="true" unpack="false"/>
<plugin id="org.eclipse.core.filesystem.win32.x86" os="win32" arch="x86" download-size="26" install-size="54" version="1.4.0.v20140124-1940" fragment="true" unpack="false"/>
<plugin id="org.eclipse.core.filesystem.win32.x86_64" os="win32" arch="x86_64" download-size="31" install-size="64" version="1.4.0.v20140124-1940" fragment="true" unpack="false"/>
<plugin id="org.eclipse.core.net.linux.x86" os="linux" arch="x86" download-size="36" install-size="95" version="1.1.300.v20140124-2013" fragment="true" unpack="false"/>
<plugin id="org.eclipse.core.net.linux.x86_64" os="linux" arch="x86_64" download-size="37" install-size="100" version="1.1.100.v20140124-2013" fragment="true" unpack="false"/>
<plugin id="org.eclipse.core.net.win32.x86" os="win32" arch="x86" download-size="29" install-size="54" version="1.0.100.v20140124-2013" fragment="true" unpack="false"/>
<plugin id="org.eclipse.core.net.win32.x86_64" os="win32" arch="x86_64" download-size="28" install-size="54" version="1.0.100.v20140124-2013" fragment="true" unpack="false"/>
<plugin id="org.eclipse.core.resources.win32.x86" os="win32" arch="x86" download-size="17" install-size="42" version="3.5.100.v20140124-1940" fragment="true" unpack="false"/>
<plugin id="org.eclipse.core.resources.win32.x86_64" os="win32" arch="x86_64" download-size="26" install-size="53" version="3.5.0.v20140124-1940" fragment="true" unpack="false"/>
<plugin id="org.eclipse.equinox.security.macosx" os="macosx" download-size="16" install-size="58" version="1.100.200.v20130327-1442" fragment="true" unpack="false"/>
<plugin id="org.eclipse.equinox.security.win32.x86" os="win32" arch="x86" download-size="22" install-size="47" version="1.0.300.v20130327-1442" fragment="true" unpack="false"/>
<plugin id="org.eclipse.equinox.security.win32.x86_64" os="win32" arch="x86_64" download-size="34" install-size="65" version="1.0.100.v20130327-1442" fragment="true" unpack="false"/>
<plugin id="org.eclipse.ui.win32" os="win32" download-size="24" install-size="48" version="3.2.400.v20140423-2207" fragment="true" unpack="false"/>
<plugin id="org.eclipse.compare.win32" os="win32" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
<plugin id="org.eclipse.core.filesystem.linux.x86_64" os="linux" arch="x86_64" download-size="0" install-size="0" version="0.0.0" fragment="true" unpack="false"/>
<plugin id="org.eclipse.core.filesystem.macosx" os="macosx" download-size="0" install-size="0" version="0.0.0" fragment="true" unpack="false"/>
<plugin id="org.eclipse.core.filesystem.win32.x86_64" os="win32" arch="x86_64" download-size="0" install-size="0" version="0.0.0" fragment="true" unpack="false"/>
<plugin id="org.eclipse.core.net.linux.x86_64" os="linux" arch="x86_64" download-size="0" install-size="0" version="0.0.0" fragment="true" unpack="false"/>
<plugin id="org.eclipse.core.net.win32.x86_64" os="win32" arch="x86_64" download-size="0" install-size="0" version="0.0.0" fragment="true" unpack="false"/>
<plugin id="org.eclipse.core.resources.win32.x86_64" os="win32" arch="x86_64" download-size="0" install-size="0" version="0.0.0" fragment="true" unpack="false"/>
<plugin id="org.eclipse.equinox.security.macosx" os="macosx" download-size="0" install-size="0" version="0.0.0" fragment="true" unpack="false"/>
<plugin id="org.eclipse.equinox.security.win32.x86_64" os="win32" arch="x86_64" download-size="0" install-size="0" version="0.0.0" fragment="true" unpack="false"/>
<plugin id="org.eclipse.ui.win32" os="win32" download-size="0" install-size="0" version="0.0.0" fragment="true" unpack="false"/>
<plugin id="org.talend.platform.logging" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
</feature>

View File

@@ -13,6 +13,7 @@
<import plugin="net.jeeeyul.eclipse.themes" version="0.0.0" match="greaterOrEqual"/>
<import plugin="net.jeeeyul.swtend" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.ui.views.log" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.urischeme" version="0.0.0" match="greaterOrEqual"/>
</requires>
<plugin id="org.talend.rcp" download-size="0" install-size="0" version="0.0.0"/>
<plugin id="org.talend.rcp.nl" download-size="0" install-size="0" version="0.0.0" fragment="true" unpack="false"/>

View File

@@ -5,10 +5,10 @@
<copyright url="http://www.example.com/copyright">[Enter Copyright Description here.]</copyright>
<license url="http://www.example.com/license">[Enter License Description here.]</license>
<requires>
<import plugin="bcprov" version="0.0.0" match="greaterOrEqual"/>
<import plugin="org.bouncycastle.bcprov" version="0.0.0" match="greaterOrEqual"/>
<import plugin="com.cedarsoftware.json-io" version="0.0.0" match="greaterOrEqual"/>
<import plugin="com.fasterxml.jackson.core.jackson-annotations" version="2.9.0" match="greaterOrEqual"/>
<import plugin="com.fasterxml.jackson.core.jackson-core" version="2.9.5" match="greaterOrEqual"/>
<import plugin="com.fasterxml.jackson.core.jackson-core" version="2.9.8" match="greaterOrEqual"/>
<import plugin="com.thoughtworks.paranamer" version="0.0.0" match="greaterOrEqual"/>
<import plugin="jackson-core-asl" version="0.0.0" match="greaterOrEqual"/>
<import plugin="jackson-mapper-asl" version="0.0.0" match="greaterOrEqual"/>
@@ -22,5 +22,6 @@
<import plugin="org.slf4j.api" version="0.0.0" match="greaterOrEqual"/>
</requires>
<plugin id="org.talend.daikon" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
<plugin id="org.talend.daikon.exception" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
<plugin id="org.talend.utils" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
</feature>

View File

@@ -54,9 +54,7 @@ public final class MessageBoxExceptionHandler {
@Override
public void run() {
Shell shell = display.getActiveShell() == null ? new Shell() : display.getActiveShell();
process(ex, shell);
process(ex, display.getActiveShell());
}
});
}

View File

@@ -23,6 +23,7 @@ import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.ImageData;
import org.eclipse.swt.graphics.ImageDataProvider;
import org.eclipse.swt.graphics.ImageLoader;
import org.eclipse.swt.graphics.Point;
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
@@ -103,7 +104,7 @@ public class ImageUtils {
* RAP.
*/
public static Image scale(Image image, int percent) {
float scale = (float) percent / 100f;
float scale = percent / 100f;
int newWidth = (int) (scale * image.getImageData().width);
int newHeight = (int) (scale * image.getImageData().height);
ImageData imageData = image.getImageData().scaledTo(newWidth, newHeight);
@@ -143,7 +144,7 @@ public class ImageUtils {
return imageDes;
}
private static Map<byte[], ImageData> imageFromDataCachedImages = new HashMap<byte[], ImageData>();
private static Map<byte[], ImageDataProvider> imageFromDataCachedImages = new HashMap<byte[], ImageDataProvider>();
/**
* By default, keep in memory the .
@@ -154,13 +155,14 @@ public class ImageUtils {
*/
public static ImageDescriptor createImageFromData(byte[] data, boolean... keepInMemory) {
if (data != null) {
ImageData img = imageFromDataCachedImages.get(data);
if (img == null) {
ImageDataProvider imageProvider = imageFromDataCachedImages.get(data);
if (imageProvider == null) {
ByteArrayInputStream bais = new ByteArrayInputStream(data);
img = new ImageData(bais);
imageFromDataCachedImages.put(data, img);
ImageData img = new ImageData(bais);
imageProvider = new TalendImageProvider(img);
imageFromDataCachedImages.put(data, imageProvider);
}
return ImageDescriptor.createFromImageData(img);
return ImageDescriptor.createFromImageDataProvider(imageProvider);
}
return null;
}
@@ -283,11 +285,11 @@ public class ImageUtils {
// if width is mort than height.
if (w > h) {
newSize.x = requiredSize.x;
newSize.y = (int) (w >= 1 ? Math.round(originalSize.y / w) : Math.round(originalSize.y * w));
newSize.y = w >= 1 ? Math.round(originalSize.y / w) : Math.round(originalSize.y * w);
}
// if width is less than height.
else if (w < h) {
newSize.x = (int) (h >= 1 ? Math.round(originalSize.x / h) : Math.round(originalSize.x * h));
newSize.x = h >= 1 ? Math.round(originalSize.x / h) : Math.round(originalSize.x * h);
newSize.y = requiredSize.y;
}
// if equal

View File

@@ -0,0 +1,22 @@
package org.talend.commons.ui.runtime.image;
import org.eclipse.swt.graphics.ImageData;
import org.eclipse.swt.graphics.ImageDataProvider;
public class TalendImageProvider implements ImageDataProvider {
private ImageData imageData;
public TalendImageProvider(ImageData imageData) {
this.imageData = imageData;
}
@Override
public ImageData getImageData(int zoom) {
if (zoom == 100) {
return imageData;
}
return null;
}
}

View File

@@ -0,0 +1,175 @@
// ============================================================================
//
// Copyright (C) 2006-2018 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.commons.ui.runtime.utils;
/**
* DOC Administrator class global comment. Detailled comment
*/
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Enumeration;
import java.util.jar.JarEntry;
import java.util.jar.JarOutputStream;
import org.apache.tools.zip.ZipEntry;
import org.apache.tools.zip.ZipFile;
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
public class ZipFileUtils {
private static int bufSize = 2048; // size of bytes
public static String zip(String zipDirectory) {
File zipDir = new File(zipDirectory);
return zip(zipDirectory, zipDir.getPath(), false);
}
public static String zip(String zipDirectory, String zipFileName, boolean includeSelfDir) {
File zipDir = new File(zipDirectory);
File[] willZipFileArr;
if (includeSelfDir || zipDir.isFile()) {
willZipFileArr = new File[] { zipDir };
} else {
willZipFileArr = zipDir.listFiles();
}
return zip(willZipFileArr, zipFileName);
}
public static String zip(File[] files, String zipFileName) {
JarOutputStream jarOutput = null;
try {
jarOutput = new JarOutputStream(new FileOutputStream(zipFileName));
for (File file : files) {
zipFiles(file, jarOutput, "");
}
} catch (Exception e) {
ExceptionHandler.process(e);
} finally {
if (jarOutput != null) {
try {
jarOutput.close();
} catch (IOException e) {
ExceptionHandler.process(e);
}
}
}
return null;
}
private static void zipFiles(File file, JarOutputStream jos, String pathName) throws Exception {
String fileName = pathName + file.getName();
if (file.isDirectory()) {
fileName = fileName + "/";
jos.putNextEntry(new JarEntry(fileName));
String fileNames[] = file.list();
if (fileNames != null) {
for (int i = 0; i < fileNames.length; i++) {
zipFiles(new File(file, fileNames[i]), jos, fileName);
}
jos.closeEntry();
}
} else {
JarEntry jarEntry = new JarEntry(fileName);
BufferedInputStream in = new BufferedInputStream(new FileInputStream(file));
jos.putNextEntry(jarEntry);
byte[] buf = new byte[bufSize];
int len;
while ((len = in.read(buf)) >= 0) {
jos.write(buf, 0, len);
}
in.close();
jos.closeEntry();
}
}
public static String unZip(File unZipFile) {
return unZip(unZipFile.getPath(), null);
}
public static String unZip(File unZipFile, String destFileName) {
return unZip(unZipFile.getPath(), destFileName);
}
public static String unZip(String unZipFileName) {
return unZip(unZipFileName, null);
}
public static String unZip(String unZipFileName, String destFileName) {
File unzipFile = new File(unZipFileName);
if (destFileName == null || destFileName.trim().length() == 0) {
destFileName = unzipFile.getParent();
}
File destFile;
ZipFile zipFile = null;
try {
zipFile = new ZipFile(unzipFile, "GBK");
for (Enumeration entries = zipFile.getEntries(); entries.hasMoreElements();) {
ZipEntry entry = (ZipEntry) entries.nextElement();
destFile = new File(destFileName, entry.getName());
unZipFile(destFile, zipFile, entry);
}
} catch (Exception e) {
ExceptionHandler.process(e);
return e.getMessage();
} finally {
try {
assert zipFile != null;
zipFile.close();
} catch (Exception e) {
ExceptionHandler.process(e);
}
}
return null;
}
private static void unZipFile(File destFile, ZipFile zipFile, ZipEntry entry) throws IOException {
InputStream inputStream;
FileOutputStream fileOut;
if (entry.isDirectory()) {
destFile.mkdirs();
} else {
File parent = destFile.getParentFile();
if (parent != null && !parent.exists()) {
parent.mkdirs();
}
inputStream = zipFile.getInputStream(entry);
fileOut = new FileOutputStream(destFile);
byte[] buf = new byte[bufSize];
int readedBytes;
while ((readedBytes = inputStream.read(buf)) > 0) {
fileOut.write(buf, 0, readedBytes);
}
fileOut.close();
inputStream.close();
}
}
public void setBufSize(int bufSize) {
ZipFileUtils.bufSize = bufSize;
}
}

View File

@@ -11,7 +11,6 @@ Require-Bundle: org.apache.log4j;visibility:=reexport,
org.eclipse.core.runtime,
org.eclipse.emf.ecore.xmi,
org.talend.libraries.apache,
org.apache.xerces,
com.ibm.icu,
org.apache.commons.io,
org.talend.utils
@@ -61,3 +60,4 @@ Bundle-ClassPath: .,
fakejdbc_driver.jar
Bundle-Vendor: .Talend SA.
Bundle-ActivationPolicy: lazy
Import-Package: org.apache.xerces.jaxp

View File

@@ -17,8 +17,10 @@ import java.io.InputStream;
import java.net.URL;
import org.apache.commons.lang.ArrayUtils;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.preferences.InstanceScope;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
@@ -160,4 +162,13 @@ public class CommonsPlugin implements BundleActivator {
InstanceScope.INSTANCE.getNode("org.eclipse.m2e.core").putBoolean("eclipse.m2.offline", state);
}
public static URL getBundleRealURL(String bundleId) throws Exception {
Bundle bundle = Platform.getBundle(bundleId);
if (bundle == null) {
return null;
}
URL entry = bundle.getEntry("/"); //$NON-NLS-1$
return FileLocator.toFileURL(entry);
}
}

View File

@@ -123,6 +123,10 @@ public class FileCopyUtils {
if (!resFolder.exists()) {
return;
}
if (resFolder.getAbsolutePath().equals(destFolder.getAbsolutePath())) {// If the source path and target path are
// same, don't copy
return;
}
destFolder.mkdirs();
String[] file = resFolder.list();
File temp = null;

View File

@@ -15,6 +15,7 @@ package org.talend.commons.runtime.xml;
import java.io.File;
import java.io.IOException;
import javax.xml.XMLConstants;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
@@ -38,11 +39,17 @@ public class XSDValidator {
private static final String SCHEMA_VALIDATOR = "http://java.sun.com/xml/jaxp/properties/schemaSource"; //$NON-NLS-1$
private static final String PROTOCOL_PLATFORM = "platform"; //$NON-NLS-1$
private static final String PROTOCOL_FILE = "file"; //$NON-NLS-1$
public static Document checkXSD(File fileToCheck, File fileXSD) throws IOException, ParserConfigurationException,
SAXException {
final DocumentBuilderFactory fabrique = XmlUtils.getSecureDocumentBuilderFactory(false);
fabrique.setAttribute(SCHEMA_LANGUAGE, "http://www.w3.org/2001/XMLSchema"); //$NON-NLS-1$
fabrique.setAttribute(SCHEMA_VALIDATOR, fileXSD);
fabrique.setAttribute(XMLConstants.ACCESS_EXTERNAL_SCHEMA, PROTOCOL_PLATFORM);
fabrique.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, PROTOCOL_FILE);
fabrique.setValidating(true);
Document document = null;

View File

@@ -120,33 +120,41 @@ public class SAPHanaDataBaseMetadata extends FakeDatabaseMetaData {
public ResultSet getTables(String catalog, String schemaPattern, String tableNamePattern, String[] types)
throws SQLException {
String[] neededTypes = getNeededTypes(types);
ResultSet rs = connection.getMetaData().getTables(catalog, schemaPattern, tableNamePattern, neededTypes);
List<String[]> list = new ArrayList<String[]>();
while (rs.next()) {
String name = rs.getString("TABLE_NAME"); //$NON-NLS-1$
String schema = rs.getString("TABLE_SCHEM"); //$NON-NLS-1$
String type = rs.getString("TABLE_TYPE"); //$NON-NLS-1$
// has other types which is not Calculation View
if (neededTypes.length > 1 || !ArrayUtils.contains(neededTypes, NEEDED_TYPES[3])) {
ResultSet rs = connection.getMetaData().getTables(catalog, schemaPattern, tableNamePattern, neededTypes);
while (rs.next()) {
String name = rs.getString("TABLE_NAME"); //$NON-NLS-1$
String schema = rs.getString("TABLE_SCHEM"); //$NON-NLS-1$
String type = rs.getString("TABLE_TYPE"); //$NON-NLS-1$
String id = ""; //$NON-NLS-1$
String remarks = ""; //$NON-NLS-1$
try {
remarks = rs.getString("REMARKS"); //$NON-NLS-1$
} catch (Exception e) {
// nothing
}
String id = ""; //$NON-NLS-1$
String remarks = ""; //$NON-NLS-1$
try {
remarks = rs.getString("REMARKS"); //$NON-NLS-1$
} catch (Exception e) {
// nothing
}
if (ArrayUtils.contains(neededTypes, type)) {
// check if the type is contained is in the types needed.
// since sybase can return some system views as "SYSTEM VIEW" instead of "VIEW/TABLE" from the request.
String[] r = new String[] { id, schema, name, type, remarks, null };
list.add(r);
if (ArrayUtils.contains(neededTypes, type)) {
// check if the type is contained is in the types needed.
// since sybase can return some system views as "SYSTEM VIEW" instead of "VIEW/TABLE" from the
// request.
String[] r = new String[] { id, schema, name, type, remarks, null };
list.add(r);
}
}
}
// For Calculation View
if (ArrayUtils.contains(neededTypes, NEEDED_TYPES[3])) {
// check if the type is contained is in the types needed.
String sqlcv = "SELECT CATALOG_NAME,SCHEMA_NAME,CUBE_NAME, COLUMN_OBJECT,CUBE_TYPE,DESCRIPTION from _SYS_BI.BIMC_CUBES"; //$NON-NLS-1$
String sqlcv = "SELECT OBJECT_NAME,PACKAGE_ID FROM _SYS_REPO.ACTIVE_OBJECT WHERE OBJECT_SUFFIX = 'calculationview'"; //$NON-NLS-1$
if (tableNamePattern != null && !tableNamePattern.equals("%")) { //$NON-NLS-1$
sqlcv += " AND (OBJECT_NAME LIKE '" + tableNamePattern + "'"; //$NON-NLS-1$ //$NON-NLS-2$
sqlcv += " OR PACKAGE_ID LIKE '" + tableNamePattern + "')"; //$NON-NLS-1$ //$NON-NLS-2$
}
ResultSet rscv = null;
Statement stmtcv = null;
List<String[]> listcv = new ArrayList<String[]>();
@@ -154,25 +162,16 @@ public class SAPHanaDataBaseMetadata extends FakeDatabaseMetaData {
stmtcv = connection.createStatement();
rscv = stmtcv.executeQuery(sqlcv);
while (rscv.next()) {
String catalogName = rscv.getString("CATALOG_NAME"); //$NON-NLS-1$
if (catalogName != null) {
catalogName = catalogName.trim();
String objectName = rscv.getString("OBJECT_NAME"); //$NON-NLS-1$
if (objectName != null) {
objectName = objectName.trim();
}
String schemaName = rscv.getString("SCHEMA_NAME"); //$NON-NLS-1$
if (schemaName != null) {
schemaName = schemaName.trim();
String packageId = rscv.getString("PACKAGE_ID"); //$NON-NLS-1$
if (packageId != null) {
packageId = packageId.trim();
}
String cubeName = rscv.getString("CUBE_NAME"); //$NON-NLS-1$
if (cubeName != null) {
cubeName = cubeName.trim();
}
String id = ""; //$NON-NLS-1$
// String type = rscv.getString("CUBE_TYPE"); //$NON-NLS-1$
String remarks = rscv.getString("DESCRIPTION"); //$NON-NLS-1$
String name = catalogName + "/" + cubeName;//$NON-NLS-1$
String[] r = new String[] { id, schemaName, name, NEEDED_TYPES[3], remarks, catalogName };
String name = packageId + "/" + objectName; //$NON-NLS-1$
String[] r = new String[] { "", "_SYS_BIC", name, NEEDED_TYPES[3], "", packageId }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
listcv.add(r);
}
} catch (SQLException e) {

View File

@@ -56,6 +56,10 @@ public class DisplayUtils {
* @since 1.2
*/
public static Shell getDefaultShell() {
return getDefaultShell(false);
}
public static Shell getDefaultShell(boolean createIfNotExist) {
Shell shell = null;
try {
@@ -67,7 +71,11 @@ public class DisplayUtils {
try {
if (shell == null) {
if (!PlatformUI.isWorkbenchRunning()) {
return new Shell();
if (createIfNotExist) {
return new Shell();
} else {
return null;
}
}
IWorkbenchWindow activeWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if (activeWindow != null) {
@@ -81,7 +89,11 @@ public class DisplayUtils {
if (shell == null) {
if (!PlatformUI.isWorkbenchRunning()) {
return new Shell();
if (createIfNotExist) {
return new Shell();
} else {
return null;
}
}
IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows();
for (int i = 0; shell == null && i < windows.length; i++) {

View File

@@ -18,8 +18,8 @@ import java.net.MalformedURLException;
import java.net.URL;
import java.util.Properties;
import org.apache.commons.lang.StringUtils;
import org.eclipse.ui.internal.intro.impl.util.Log;
import org.eclipse.ui.internal.intro.impl.util.StringUtil;
/**
* DOC talend class global comment. Detailled comment
@@ -165,12 +165,12 @@ public class DynamicURLParser {
if (query.indexOf("&amp;") != -1) {
query = query.replaceAll("&amp;", "&");
}
params = StringUtil.split(query, "&"); //$NON-NLS-1$
params = StringUtils.split(query, "&"); //$NON-NLS-1$
for (String param : params) {
// for every parameter, ie: key=value pair, create a property
// entry. we know we have the key as the first string in the array,
// and the value as the second array.
String[] keyValuePair = StringUtil.split(param, "="); //$NON-NLS-1$
String[] keyValuePair = StringUtils.split(param, "="); //$NON-NLS-1$
if (keyValuePair.length != 2) {
Log.warning("Ignoring the following Intro URL parameter: " //$NON-NLS-1$
+ param);

View File

@@ -28,6 +28,7 @@ import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import org.talend.commons.ui.gmf.util.DisplayUtils;
import org.talend.commons.ui.runtime.i18n.Messages;
public class SSLDialog extends Dialog {
@@ -144,15 +145,18 @@ public class SSLDialog extends Dialog {
@Override
protected void okPressed() {
if (keyStoreText.getText().equals("")) {
MessageDialog.openError(new Shell(), getShell().getText(), Messages.getString("SSLConfirmDialog.KeyStore")); //$NON-NLS-1$
MessageDialog.openError(DisplayUtils.getDefaultShell(false), getShell().getText(),
Messages.getString("SSLConfirmDialog.KeyStore")); //$NON-NLS-1$
return;
}
if (passwordText.getText().equals("")) {
MessageDialog.openError(new Shell(), getShell().getText(), Messages.getString("SSLConfirmDialog.TrustStore")); //$NON-NLS-1$
MessageDialog.openError(DisplayUtils.getDefaultShell(false), getShell().getText(),
Messages.getString("SSLConfirmDialog.TrustStore")); //$NON-NLS-1$
return;
}
if (trustStoreText.getText().equals("")) {
MessageDialog.openError(new Shell(), getShell().getText(), Messages.getString("SSLConfirmDialog.Password")); //$NON-NLS-1$
MessageDialog.openError(DisplayUtils.getDefaultShell(false), getShell().getText(),
Messages.getString("SSLConfirmDialog.Password")); //$NON-NLS-1$
return;
}
keyStorePath = keyStoreText.getText();
@@ -191,7 +195,7 @@ public class SSLDialog extends Dialog {
dialog.setFilterPath("");
dialog.setText("select keyStore");
dialog.setFileName("");
dialog.setFilterExtensions(new String[] { "*.jks" });// 设置文件扩展名
dialog.setFilterExtensions(new String[] { "*.jks" });// set file extension
String fileName = dialog.open();//
if (fileName != null) {
@@ -205,7 +209,7 @@ public class SSLDialog extends Dialog {
dialog.setFilterPath("");
dialog.setText("select trustStore");
dialog.setFileName("");
dialog.setFilterExtensions(new String[] { "*.jks" });// 设置文件扩展名
dialog.setFilterExtensions(new String[] { "*.jks" });// set file extension
String fileName = dialog.open();//
if (fileName != null) {
trustStoreText.setText(fileName);

View File

@@ -30,7 +30,7 @@ import org.eclipse.swt.graphics.FontData;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.talend.commons.ui.gmf.util.DisplayUtils;
/**
* Figure managing some simple HTML styles. <br/>
@@ -267,7 +267,7 @@ public class SimpleHtmlFigure extends Figure {
} while (font == null && f != null);
if (font == null) {
GC gc = new GC(new Shell());
GC gc = new GC(DisplayUtils.getDefaultShell(true));
font = gc.getFont();
gc.dispose();
}

View File

@@ -1,4 +1,5 @@
Manifest-Version: 1.0
Automatic-Module-Name: org.talend.core.repository
Bundle-ManifestVersion: 2
Bundle-Name: Core Repository Plug-in
Bundle-SymbolicName: org.talend.core.repository;singleton:=true

View File

@@ -182,7 +182,6 @@ ProjectRepositoryNode.sapContentExtractor=SAP BI Content Extractor
RepositoryDropAdapter_copyingItems=Copying items...
RepositoryDropAdapter_errorMsg=This directory contains the locked item,it can not be moved now
RepositoryDropAdapter_folder=Folder
RepositoryDropAdapter_lockedByOthers=This item is locked by other users, it can not be moved now.
RepositoryDropAdapter_lockedByYou=This item is locked by you, it can not be moved now.
RepositoryDropAdapter_moveTitle=Move

View File

@@ -6,7 +6,7 @@ import org.apache.log4j.Logger;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.swt.widgets.Shell;
import org.talend.commons.ui.gmf.util.DisplayUtils;
import org.talend.core.GlobalServiceRegister;
import org.talend.login.AbstractLoginTask;
import org.talend.repository.model.IRepositoryService;
@@ -21,7 +21,7 @@ public class ReadOnlyProjectConfirm extends AbstractLoginTask implements IRunnab
SubMonitor subMonitor = SubMonitor.convert(monitor, 1);
subMonitor.setTaskName("ReadOnly confirm.");
IRepositoryService service = (IRepositoryService) GlobalServiceRegister.getDefault().getService(IRepositoryService.class);
service.openReadOnlyDialog(new Shell());
service.openReadOnlyDialog(DisplayUtils.getDefaultShell(false));
subMonitor.done();
}

View File

@@ -67,6 +67,7 @@ import org.talend.commons.exception.PersistenceException;
import org.talend.commons.exception.SystemException;
import org.talend.commons.runtime.model.repository.ERepositoryStatus;
import org.talend.commons.runtime.service.ITaCoKitService;
import org.talend.commons.ui.gmf.util.DisplayUtils;
import org.talend.commons.ui.runtime.CommonUIPlugin;
import org.talend.commons.ui.runtime.exception.MessageBoxExceptionHandler;
import org.talend.commons.utils.data.container.RootContainer;
@@ -407,7 +408,7 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
public void run() {
Shell currentShell = tmpDisplay.getActiveShell();
if (currentShell == null) {
currentShell = new Shell();
currentShell = DisplayUtils.getDefaultShell(false);
}
MessageBox box = new MessageBox(currentShell, SWT.ICON_WARNING | SWT.OK | SWT.CANCEL);
box.setText(Messages.getString("ProxyRepositoryFactory.JobNameErroe")); //$NON-NLS-1$

View File

@@ -27,10 +27,9 @@ import javax.net.ssl.SSLSocketFactory;
import org.apache.log4j.Logger;
import org.talend.core.repository.i18n.Messages;
import com.sun.net.ssl.KeyManagerFactory;
import com.sun.net.ssl.SSLContext;
import com.sun.net.ssl.TrustManager;
import com.sun.net.ssl.internal.ssl.Provider;
import javax.net.ssl.KeyManagerFactory;
import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManager;
/**
* This class is used for LDAP. <br/>
@@ -219,7 +218,7 @@ public class AdvancedSocketFactory extends SSLSocketFactory {
*/
private void init(KeyStore ks, char password[]) {
SSLContext ctx = null;
com.sun.net.ssl.KeyManager keyManagers[] = null;
javax.net.ssl.KeyManager keyManagers[] = null;
TrustManager trustManagers[] = null;
try {
if (ks != null) {
@@ -238,6 +237,6 @@ public class AdvancedSocketFactory extends SSLSocketFactory {
}
static {
Security.addProvider(new Provider());
Security.addProvider(java.security.Security.getProvider("SUN"));
}
}

View File

@@ -24,13 +24,15 @@ import java.net.URLConnection;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import org.apache.log4j.Logger;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.core.repository.i18n.Messages;
import com.sun.net.ssl.TrustManagerFactory;
import com.sun.net.ssl.X509TrustManager;
import javax.net.ssl.TrustManagerFactory;
import javax.net.ssl.X509TrustManager;
/**
* This class is used for verifying CA for LDAP connection.
@@ -74,26 +76,6 @@ public class LDAPCATruster implements X509TrustManager {
init();
}
/**
* Comment method "deleteCert".
*
* @param id
* @return
*/
private boolean deleteCert(String id) {
try {
ks.deleteEntry(id);
} catch (KeyStoreException ex) {
return false;
}
return true;
}
/*
* (non-Javadoc)
*
* @see com.sun.net.ssl.X509TrustManager#getAcceptedIssuers()
*/
public X509Certificate[] getAcceptedIssuers() {
if (trustManager == null)
return null;
@@ -177,7 +159,7 @@ public class LDAPCATruster implements X509TrustManager {
TrustManagerFactory trustManagerFactory = null;
trustManagerFactory = TrustManagerFactory.getInstance("SunX509"); //$NON-NLS-1$
trustManagerFactory.init(ks);
com.sun.net.ssl.TrustManager trusts[] = trustManagerFactory.getTrustManagers();
javax.net.ssl.TrustManager trusts[] = trustManagerFactory.getTrustManagers();
return (X509TrustManager) trusts[0];
}
@@ -192,29 +174,24 @@ public class LDAPCATruster implements X509TrustManager {
return false;
}
/*
* (non-Javadoc)
*
* @see com.sun.net.ssl.X509TrustManager#isClientTrusted(java.security.cert.X509Certificate[])
*/
public boolean isClientTrusted(X509Certificate chain[]) {
if (trustManager == null)
return false;
else
return trustManager.isClientTrusted(chain);
}
/*
* (non-Javadoc)
*
* @see com.sun.net.ssl.X509TrustManager#isServerTrusted(java.security.cert.X509Certificate[])
*/
public boolean isServerTrusted(X509Certificate chain[]) {
if (trustManager != null) {
boolean rs = trustManager.isServerTrusted(chain);
if (rs)
return rs;
}
public boolean isServerTrusted(X509Certificate chain[], String authType) {
boolean isTrusted = false;
if (trustManager != null) {
try {
trustManager.checkServerTrusted(chain, authType);
isTrusted = true;
}catch (CertificateException e) {
ExceptionHandler.process(e);
}
}
if (isTrusted) {
return true;
}
X509Certificate ca = getCACert(chain);
if (ca != null) {
if (isAccepted(ca)) {
@@ -230,7 +207,16 @@ public class LDAPCATruster implements X509TrustManager {
log.error(Messages.getString("LDAPCATruster.failedCreateTmp") + e.getMessage()); //$NON-NLS-1$
return false;
}
if (tmpTrustManager.isServerTrusted(chain)) {
boolean isTmpTrusted = false;
if (tmpTrustManager != null) {
try {
tmpTrustManager.checkServerTrusted(chain, authType);
isTmpTrusted = true;
}catch (CertificateException e) {
ExceptionHandler.process(e);
}
}
if (isTmpTrusted) {
if (this.isSaveCA) {
saveStore();
trustManager = tmpTrustManager;
@@ -279,4 +265,19 @@ public class LDAPCATruster implements X509TrustManager {
}
}
}
@Override
public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {
if (trustManager == null) {
throw new CertificateException(Messages.getString("LDAPCATruster.failedInitialTrust"));
}
trustManager.checkClientTrusted(chain, authType);
}
@Override
public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {
if (!isServerTrusted(chain, authType)) {
throw new CertificateException(Messages.getString("LDAPCATruster.sslError1"));
}
}
}

View File

@@ -48,6 +48,7 @@ import org.eclipse.ui.actions.ActionFactory;
import org.talend.commons.exception.BusinessException;
import org.talend.commons.exception.PersistenceException;
import org.talend.commons.runtime.model.repository.ERepositoryStatus;
import org.talend.commons.ui.gmf.util.DisplayUtils;
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
import org.talend.commons.ui.runtime.exception.MessageBoxExceptionHandler;
import org.talend.commons.ui.runtime.image.EImage;
@@ -1241,7 +1242,8 @@ public class DeleteAction extends AContextualAction {
@Override
public void run() {
MessageDialog dialog = new MessageDialog(new Shell(), title, null, lockMessage, MessageDialog.ERROR,
MessageDialog dialog = new MessageDialog(DisplayUtils.getDefaultShell(false), title, null, lockMessage,
MessageDialog.ERROR,
new String[] { IDialogConstants.OK_LABEL }, 0);
dialog.open();
}
@@ -1372,7 +1374,7 @@ public class DeleteAction extends AContextualAction {
+ " " + Messages.getString("DeleteAction.dialog.message0") + "\n" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ Messages.getString("DeleteAction.dialog.message2"); //$NON-NLS-1$
confirmFromDialog = MessageDialog.openQuestion(new Shell(), title, message);
confirmFromDialog = MessageDialog.openQuestion(DisplayUtils.getDefaultShell(false), title, message);
}
});
confirm = confirmFromDialog;
@@ -1839,7 +1841,7 @@ public class DeleteAction extends AContextualAction {
}
}
if (shell == null) {
shell = new Shell();
shell = DisplayUtils.getDefaultShell(false);
}
return shell;
}

View File

@@ -27,9 +27,9 @@ import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.talend.commons.exception.PersistenceException;
import org.talend.commons.runtime.model.repository.ERepositoryStatus;
import org.talend.commons.ui.gmf.util.DisplayUtils;
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
import org.talend.commons.ui.runtime.image.EImage;
import org.talend.commons.ui.runtime.image.ImageProvider;
@@ -157,8 +157,8 @@ public class DeleteTableAction extends AContextualAction {
@Override
public void run() {
MessageDialog dialog = new MessageDialog(new Shell(), title, null, message, MessageDialog.ERROR,
new String[] { IDialogConstants.OK_LABEL }, 0);
MessageDialog dialog = new MessageDialog(DisplayUtils.getDefaultShell(false), title, null,
message, MessageDialog.ERROR, new String[] { IDialogConstants.OK_LABEL }, 0);
dialog.open();
}
});

View File

@@ -40,6 +40,7 @@ import org.eclipse.ui.PlatformUI;
import org.talend.commons.exception.BusinessException;
import org.talend.commons.exception.PersistenceException;
import org.talend.commons.runtime.model.repository.ERepositoryStatus;
import org.talend.commons.ui.gmf.util.DisplayUtils;
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
import org.talend.commons.ui.runtime.exception.MessageBoxExceptionHandler;
import org.talend.commons.ui.runtime.image.ECoreImage;
@@ -258,7 +259,7 @@ public class EmptyRecycleBinAction extends AContextualAction {
}
}
if (shell == null) {
shell = new Shell();
shell = DisplayUtils.getDefaultShell(false);
}
return shell;
}

View File

@@ -18,11 +18,11 @@ import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TreeSelection;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.actions.ActionFactory;
import org.talend.commons.exception.BusinessException;
import org.talend.commons.exception.CommonExceptionHandler;
import org.talend.commons.runtime.model.repository.ERepositoryStatus;
import org.talend.commons.ui.gmf.util.DisplayUtils;
import org.talend.commons.ui.runtime.exception.MessageBoxExceptionHandler;
import org.talend.commons.ui.runtime.image.EImage;
import org.talend.commons.ui.runtime.image.ImageProvider;
@@ -116,8 +116,9 @@ public class PasteAction extends AContextualAction {
if (copyObjectAction.validateAction((RepositoryNode) currentSource, target)) {
copyObjectAction.execute((RepositoryNode) currentSource, target);
} else {
MessageDialog.openWarning(new Shell(), Messages.getString("PasteObjectAction.error.title"), Messages //$NON-NLS-1$
.getString("PasteObjectAction.error.labelAlreadyExists")); //$NON-NLS-1$
MessageDialog.openWarning(DisplayUtils.getDefaultShell(false),
Messages.getString("PasteObjectAction.error.title"), Messages //$NON-NLS-1$
.getString("PasteObjectAction.error.labelAlreadyExists")); //$NON-NLS-1$
}
} catch (BusinessException e) {
MessageBoxExceptionHandler.process(e);

View File

@@ -121,8 +121,7 @@ public class RepositoryDropAdapter extends PluginDropAdapter {
boolean isLock = MoveObjectAction.getInstance().isLock(sourceNode);
if (isLock) {
String errorMsg = null;
if (sourceNode.getObjectType().getType()
.equalsIgnoreCase(Messages.getString("RepositoryDropAdapter_folder"))) { //$NON-NLS-1$
if (sourceNode.getObjectType().getType().equals(ERepositoryObjectType.FOLDER.getType())) {
errorMsg = Messages.getString("RepositoryDropAdapter_errorMsg"); //$NON-NLS-1$
}
if (ProxyRepositoryFactory.getInstance().getStatus(repositoryObject) == ERepositoryStatus.LOCK_BY_USER) {
@@ -653,7 +652,7 @@ public class RepositoryDropAdapter extends PluginDropAdapter {
IRepositoryViewObject objectToCopy = repositoryNode.getObject();
// TDI-14680 add a warning message when move a directory that it has locked jobs.
IRepositoryNode node = objectToCopy.getRepositoryNode();
if (node.getObjectType().getType().equalsIgnoreCase(Messages.getString("RepositoryDropAdapter_folder"))) { //$NON-NLS-1$
if (node.getObjectType().getType().equals(ERepositoryObjectType.FOLDER.getType())) {
errorMsg = Messages.getString("RepositoryDropAdapter_errorMsg"); //$NON-NLS-1$
}
if (ProxyRepositoryFactory.getInstance().getStatus(objectToCopy) == ERepositoryStatus.LOCK_BY_USER) {

View File

@@ -0,0 +1,280 @@
<?xml version="1.0"?>
<mapping>
<dbms product="AMAZON_AURORA" id="amazon_aurora_id" label="Mapping AMAZON_AURORA"
default="true">
<dbTypes>
<dbType type="BIGINT" ignorePre="true"/>
<dbType type="BIGINT UNSIGNED" ignoreLen="true" ignorePre="true" />
<dbType type="BINARY" ignorePre="true"/>
<dbType type="BIT" ignorePre="true" />
<dbType type="BLOB" ignoreLen="true" ignorePre="true" />
<dbType type="CHAR" defaultLength="200" ignorePre="true"/>
<dbType type="DATE" ignoreLen="true" ignorePre="true" />
<dbType type="DATETIME" ignoreLen="true" ignorePre="true" />
<dbType type="DECIMAL" defaultLength="20" defaultPrecision="10" preBeforelen="false"/>
<dbType type="DOUBLE" defaultLength="20" defaultPrecision="10"/>
<dbType type="DOUBLE UNSIGNED" ignoreLen="true" ignorePre="true" />
<dbType type="ENUM" ignoreLen="true" ignorePre="true" />
<dbType type="FLOAT" defaultPrecision="2"/>
<dbType type="FLOAT UNSIGNED" ignoreLen="true" ignorePre="true" />
<dbType type="GEOMETRY" ignoreLen="true" ignorePre="true" />
<dbType type="GEOMETRYCOLLECTION" ignoreLen="true" ignorePre="true" />
<dbType type="INT" ignorePre="true" />
<dbType type="INT UNSIGNED" ignoreLen="true" ignorePre="true" />
<dbType type="LINESTRING" ignoreLen="true" ignorePre="true" />
<dbType type="LONGTEXT" ignoreLen="true" ignorePre="true" />
<dbType type="LONGBLOB" ignoreLen="true" ignorePre="true"/>
<dbType type="MEDIUMBLOB" ignoreLen="true" ignorePre="true" />
<dbType type="MEDIUMINT" ignorePre="true" />
<dbType type="MEDIUMINT UNSIGNED" ignoreLen="true" ignorePre="true" />
<dbType type="MEDIUMTEXT" ignoreLen="true" ignorePre="true" />
<dbType type="MULTILINESTRING" ignoreLen="true" ignorePre="true" />
<dbType type="MULTIPOINT" ignoreLen="true" ignorePre="true" />
<dbType type="MULTIPOLYGON" ignoreLen="true" ignorePre="true" />
<dbType type="POINT" ignoreLen="true" ignorePre="true" />
<dbType type="POLYGON" ignoreLen="true" ignorePre="true" />
<dbType type="SMALLINT" ignorePre="true" />
<dbType type="SMALLINT UNSIGNED" ignoreLen="true" ignorePre="true" />
<dbType type="SET" ignoreLen="true" ignorePre="true" />
<dbType type="TEXT" ignoreLen="true" ignorePre="true" />
<dbType type="TIME" ignoreLen="true" ignorePre="true" />
<dbType type="TIMESTAMP" ignoreLen="true" ignorePre="true" />
<dbType type="TINYBLOB" ignoreLen="true" ignorePre="true" />
<dbType type="TINYINT" ignorePre="true" />
<dbType type="TINYINT UNSIGNED" ignoreLen="true" ignorePre="true" />
<dbType type="TINYTEXT" ignoreLen="true" ignorePre="true" />
<dbType type="VARBINARY" ignorePre="true" />
<dbType type="VARCHAR" default="true" defaultLength="100" ignorePre="true"/>
<dbType type="YEAR" ignorePre="true"/>
</dbTypes>
<language name="java">
<talendToDbTypes><!-- Adviced mappings -->
<talendType type="id_List"/>
<talendType type="id_Boolean">
<dbType type="BIT" default="true" />
</talendType>
<talendType type="id_Byte">
<dbType type="TINYINT" default="true" />
<dbType type="BIGINT" />
<dbType type="INT" />
<dbType type="MEDIUMINT" />
<dbType type="SMALLINT" />
</talendType>
<talendType type="id_byte[]">
</talendType>
<talendType type="id_Character">
<dbType type="CHAR" default="true" />
<dbType type="VARCHAR"/>
</talendType>
<talendType type="id_Date">
<dbType type="DATE" />
<dbType type="DATETIME" default="true" />
<dbType type="TIME" />
<dbType type="YEAR" />
<dbType type="TIMESTAMP" />
</talendType>
<talendType type="id_BigDecimal">
<dbType type="DECIMAL" default="true" />
<dbType type="FLOAT"/>
<dbType type="DOUBLE" />
</talendType>
<talendType type="id_Double">
<dbType type="DOUBLE" default="true" />
<dbType type="FLOAT"/>
<dbType type="DECIMAL" />
</talendType>
<talendType type="id_Float">
<dbType type="FLOAT" default="true" />
<dbType type="DOUBLE"/>
<dbType type="DECIMAL" />
</talendType>
<talendType type="id_Integer">
<dbType type="INT" default="true" />
<dbType type="BIGINT" />
</talendType>
<talendType type="id_Long">
<dbType type="BIGINT" default="true" />
</talendType>
<talendType type="id_Object">
<dbType type="BLOB" default="true"/>
<dbType type="ENUM" />
<dbType type="GEOMETRY" />
<dbType type="GEOMETRYCOLLECTION" />
<dbType type="MEDIUMINT" />
<dbType type="LONGBLOB" />
<dbType type="MEDIUMBLOB" />
<dbType type="MULTIPOINT" />
<dbType type="MULTIPOLYGON" />
<dbType type="POINT" />
<dbType type="POLYGON" />
<dbType type="SET" />
<dbType type="TINYBLOB" />
</talendType>
<talendType type="id_Short">
<dbType type="SMALLINT" default="true" />
<dbType type="INT" />
<dbType type="BIGINT"/>
<dbType type="MEDIUMINT" />
</talendType>
<talendType type="id_String">
<dbType type="VARCHAR" default="true" />
<dbType type="LINESTRING" />
<dbType type="LONGTEXT"/>
<dbType type="MEDIUMTEXT" />
<dbType type="MULTILINESTRING" />
<dbType type="TEXT" />
<dbType type="TINYTEXT" />
</talendType>
</talendToDbTypes>
<dbToTalendTypes>
<dbType type="BIGINT">
<talendType type="id_Long" default="true" />
</dbType>
<dbType type="BINARY">
<talendType type="id_Boolean" default="true" />
</dbType>
<dbType type="BIT">
<talendType type="id_Boolean" default="true" />
</dbType>
<dbType type="BLOB">
<talendType type="id_Object" default="true" />
</dbType>
<dbType type="CHAR">
<talendType type="id_String" default="true" />
</dbType>
<dbType type="DATE">
<talendType type="id_Date" default="true" />
</dbType>
<dbType type="DATETIME">
<talendType type="id_Date" default="true" />
</dbType>
<dbType type="DECIMAL">
<talendType type="id_Float"/>
<talendType type="id_Double"/>
<talendType type="id_BigDecimal" default="true"/>
</dbType>
<dbType type="DOUBLE">
<talendType type="id_Double" default="true" />
<talendType type="id_BigDecimal"/>
</dbType>
<dbType type="ENUM">
<talendType type="id_Object" default="true" />
</dbType>
<dbType type="FLOAT">
<talendType type="id_Float" default="true" />
<talendType type="id_Double"/>
<talendType type="id_BigDecimal"/>
</dbType>
<dbType type="GEOMETRY">
<talendType type="id_Object" default="true" />
</dbType>
<dbType type="GEOMETRYCOLLECTION">
<talendType type="id_Object" default="true" />
</dbType>
<dbType type="INT">
<talendType type="id_Integer" default="true" />
<talendType type="id_Long"/>
</dbType>
<dbType type="LINESTRING">
<talendType type="id_String" default="true" />
</dbType>
<dbType type="LONGTEXT">
<talendType type="id_String" default="true" />
</dbType>
<dbType type="LONGBLOB">
<talendType type="id_Object" default="true" />
</dbType>
<dbType type="MEDIUMBLOB">
<talendType type="id_Object" default="true" />
</dbType>
<dbType type="MEDIUMINT">
<talendType type="id_Integer" default="true" />
<talendType type="id_Long"/>
</dbType>
<dbType type="MEDIUMTEXT">
<talendType type="id_String" default="true" />
</dbType>
<dbType type="MULTILINESTRING">
<talendType type="id_String" default="true" />
</dbType>
<dbType type="MULTIPOINT">
<talendType type="id_Object" default="true" />
</dbType>
<dbType type="MULTIPOLYGON">
<talendType type="id_Object" default="true" />
</dbType>
<dbType type="POINT">
<talendType type="id_Object" default="true" />
</dbType>
<dbType type="POLYGON">
<talendType type="id_Object" default="true" />
</dbType>
<dbType type="SMALLINT">
<talendType type="id_Short" default="true" />
<talendType type="id_Long"/>
<talendType type="id_Integer"/>
</dbType>
<dbType type="SET">
<talendType type="id_Object" default="true" />
</dbType>
<dbType type="TEXT">
<talendType type="id_String" default="true" />
</dbType>
<dbType type="TIME">
<talendType type="id_Date" default="true" />
</dbType>
<dbType type="TIMESTAMP">
<talendType type="id_Date" default="true" />
</dbType>
<dbType type="TINYBLOB">
<talendType type="id_Object" default="true" />
</dbType>
<dbType type="TINYINT">
<talendType type="id_Byte" default="true" />
<talendType type="id_Integer"/>
<talendType type="id_Long"/>
<talendType type="id_Short"/>
</dbType>
<dbType type="TINYTEXT">
<talendType type="id_String" default="true" />
</dbType>
<dbType type="VARBINARY">
</dbType>
<dbType type="VARCHAR">
<talendType type="id_String" default="true" />
</dbType>
<dbType type="YEAR">
<talendType type="id_Date" default="true" />
</dbType>
<dbType type="BIGINT UNSIGNED" >
</dbType>
<dbType type="DOUBLE UNSIGNED" >
<talendType type="id_Double" default="true" />
<talendType type="id_BigDecimal"/>
</dbType>
<dbType type="FLOAT UNSIGNED" >
<talendType type="id_Double" default="true" />
<talendType type="id_BigDecimal"/>
</dbType>
<dbType type="INT UNSIGNED" >
<talendType type="id_Long" default="true" />
</dbType>
<dbType type="MEDIUMINT UNSIGNED" >
<talendType type="id_Integer" default="true" />
<talendType type="id_Long" />
</dbType>
<dbType type="SMALLINT UNSIGNED" >
<talendType type="id_Integer" default="true" />
<talendType type="id_Long" />
</dbType>
<dbType type="TINYINT UNSIGNED" >
<talendType type="id_Short" default="true" />
<talendType type="id_Integer" />
<talendType type="id_Long" />
</dbType>
</dbToTalendTypes>
</language>
</dbms>
</mapping>

View File

@@ -88,10 +88,8 @@
<talendType type="id_BigDecimal" default="true"/>
</dbType>
<dbType type="BIGINT">
<talendType type="id_BigDecimal" default="true"/>
<talendType type="id_Byte"/>
<talendType type="id_Long" default="true"/>
<talendType type="id_Integer"/>
<talendType type="id_Long"/>
</dbType>
<dbType type="INT">
<talendType type="id_Integer" default="true"/>

View File

@@ -32,7 +32,8 @@
<dbType type="BOOLEAN" default="true"/>
</talendType>
<talendType type="id_Byte">
<dbType type="INTEGER" default="true" />
<dbType type="BIGINT" default="true" />
<dbType type="INTEGER"/>
</talendType>
<talendType type="id_byte[]">
<dbType type="BINARY" default="true"/>
@@ -55,7 +56,8 @@
<dbType type="FLOAT8"/>
</talendType>
<talendType type="id_Integer">
<dbType type="INTEGER" default="true" />
<dbType type="BIGINT" default="true" />
<dbType type="INTEGER"/>
<dbType type="INT8" />
</talendType>
<talendType type="id_Long">
@@ -64,7 +66,8 @@
<talendType type="id_Object">
</talendType>
<talendType type="id_Short">
<dbType type="INTEGER" default="true" />
<dbType type="BIGINT" default="true" />
<dbType type="INTEGER" />
</talendType>
<talendType type="id_String">
<dbType type="VARCHAR" default="true" />
@@ -88,12 +91,14 @@
<talendType type="id_String" default="true" />
</dbType>
<dbType type="INTEGER">
<talendType type="id_Integer" default="true" />
<talendType type="id_Long" default="true" />
<talendType type="id_Integer" />
<talendType type="id_Short" />
<talendType type="id_Byte" />
</dbType>
<dbType type="INT8">
<talendType type="id_Integer" default="true" />
<talendType type="id_Long" default="true" />
<talendType type="id_Integer" />
<talendType type="id_Short" />
<talendType type="id_Byte" />
</dbType>

View File

@@ -139,7 +139,7 @@ public class GlobalServiceRegister {
* @param klass the Service type you want to get
* @return IService IService
*/
public IService getService(Class klass) {
public <T extends IService> T getService(Class<T> klass) {
IService service = services.get(klass);
if (service == null && getConfigurationElements() != null) {
service = findService(klass);
@@ -149,7 +149,7 @@ public class GlobalServiceRegister {
}
services.put(klass, service);
}
return service;
return (T) service;
}
/**
@@ -158,7 +158,7 @@ public class GlobalServiceRegister {
* @param klass the interface type want to find.
* @return IService
*/
private IService findService(Class klass) {
private <T extends IService> T findService(Class<T> klass) {
String key = klass.getName();
IConfigurationElement[] configElements = getConfigurationElements();
if (configElements != null) {
@@ -171,7 +171,7 @@ public class GlobalServiceRegister {
try {
Object service = element.createExecutableExtension("class"); //$NON-NLS-1$
if (klass.isInstance(service)) {
return (IService) service;
return (T) service;
}
} catch (CoreException e) {
ExceptionHandler.process(e);

View File

@@ -16,7 +16,7 @@ import org.talend.core.model.metadata.IMetadataConnection;
import org.talend.core.model.metadata.builder.connection.DatabaseConnection;
import org.talend.core.model.metadata.builder.connection.FileConnection;
public interface IRepositoryContextService {
public interface IRepositoryContextService extends IService {
public DatabaseConnection cloneOriginalValueConnection(DatabaseConnection dbConn);

View File

@@ -18,7 +18,6 @@ import java.net.URL;
import org.apache.log4j.Logger;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Plugin;
import org.osgi.framework.Bundle;
/**
@@ -145,10 +144,6 @@ public class PluginChecker {
return isJobLetPluginLoaded();
}
public static Plugin getWSDLPlugin() {
return Platform.getPlugin(WSDL_PLUGIN_ID);
}
public static boolean isRefProjectLoaded() {
return isPluginLoaded(REF_PROJECT_PLUGIN_ID);
}

View File

@@ -44,6 +44,8 @@ public class RepositoryContext {
private Map<String, String> fields;
private boolean token = false;
/**
* DOC smallet RepositoryContext constructor comment.
*
@@ -246,4 +248,12 @@ public class RepositoryContext {
public void setNoUpdateWhenLogon(boolean noUpdateWhenLogon) {
this.noUpdateWhenLogon = noUpdateWhenLogon;
}
public boolean isToken() {
return this.token;
}
public void setToken(boolean token) {
this.token = token;
}
}

View File

@@ -22,98 +22,105 @@ import org.talend.core.runtime.projectsetting.IProjectSettingPreferenceConstants
*/
public enum EDatabaseTypeName {
MYSQL(
"MySQL", "MySQL", Boolean.FALSE, "MYSQL", "MYSQL", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.None), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
"MySQL", "MySQL", Boolean.FALSE, "MYSQL", "MYSQL", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.None), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
AMAZON_AURORA(
"Amazon Aurora", "Amazon Aurora", Boolean.FALSE, "AMAZON_AURORA", "AMAZON_AURORA", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.None), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
"Amazon Aurora", "Amazon Aurora", Boolean.FALSE, "AMAZON_AURORA", "AMAZON_AURORA", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.None), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
PSQL(
"PostgreSQL", "PostgreSQL", Boolean.TRUE, "POSTGRESQL", "POSTGRE", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.Schema), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
"PostgreSQL", "PostgreSQL", Boolean.TRUE, "POSTGRESQL", "POSTGRE", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.Schema), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
PLUSPSQL(
"PostgresPlus", "PostgresPlus", Boolean.TRUE, "POSTGRESPLUS", "POSTGREPLUS", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.Schema), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
"PostgresPlus", "PostgresPlus", Boolean.TRUE, "POSTGRESPLUS", "POSTGREPLUS", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.Schema), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
ORACLEFORSID(
"ORACLE_SID", "Oracle with SID", Boolean.TRUE, "ORACLE", "DBORACLE", EDatabaseSchemaOrCatalogMapping.None, EDatabaseSchemaOrCatalogMapping.Schema), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
"ORACLE_SID", "Oracle with SID", Boolean.TRUE, "ORACLE", "DBORACLE", EDatabaseSchemaOrCatalogMapping.None, EDatabaseSchemaOrCatalogMapping.Schema), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
ORACLESN(
"ORACLE_SERVICE_NAME", "Oracle with service name", Boolean.TRUE, "ORACLE", "DBORACLE", EDatabaseSchemaOrCatalogMapping.None, EDatabaseSchemaOrCatalogMapping.Schema), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
"ORACLE_SERVICE_NAME", "Oracle with service name", Boolean.TRUE, "ORACLE", "DBORACLE", EDatabaseSchemaOrCatalogMapping.None, EDatabaseSchemaOrCatalogMapping.Schema), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
ORACLE_OCI(
"ORACLE_OCI", "Oracle OCI", Boolean.TRUE, "ORACLE", "DBORACLE", EDatabaseSchemaOrCatalogMapping.None, EDatabaseSchemaOrCatalogMapping.Schema), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
"ORACLE_OCI", "Oracle OCI", Boolean.TRUE, "ORACLE", "DBORACLE", EDatabaseSchemaOrCatalogMapping.None, EDatabaseSchemaOrCatalogMapping.Schema), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
ORACLE_CUSTOM(
"ORACLE_CUSTOM", "Oracle Custom", Boolean.TRUE, "ORACLE", "DBORACLE", EDatabaseSchemaOrCatalogMapping.None, EDatabaseSchemaOrCatalogMapping.Schema), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
"ORACLE_CUSTOM", "Oracle Custom", Boolean.TRUE, "ORACLE", "DBORACLE", EDatabaseSchemaOrCatalogMapping.None, EDatabaseSchemaOrCatalogMapping.Schema), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
/**
* @deprecated odbc is not supported in java8
*/
GODBC(
"Generic ODBC", "Generic ODBC (Unsupported)", Boolean.FALSE, "ODBC", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.None), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
"Generic ODBC", "Generic ODBC (Unsupported)", Boolean.FALSE, "ODBC", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.None), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
/**
* @deprecated odbc is not supported in java8
*/
MSODBC(
"Microsoft SQL (Odbc driver)", "Microsoft SQL Server (Odbc driver, Unsupported)", Boolean.FALSE, "ODBC", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.None), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
"Microsoft SQL (Odbc driver)", "Microsoft SQL Server (Odbc driver, Unsupported)", Boolean.FALSE, "ODBC", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.None), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
IBMDB2(
"IBM DB2", "IBM DB2", Boolean.TRUE, "IBM_DB2", "DB2", EDatabaseSchemaOrCatalogMapping.None, EDatabaseSchemaOrCatalogMapping.Schema), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
"IBM DB2", "IBM DB2", Boolean.TRUE, "IBM_DB2", "DB2", EDatabaseSchemaOrCatalogMapping.None, EDatabaseSchemaOrCatalogMapping.Schema), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
IBMDB2ZOS(
"IBM DB2 ZOS", "IBM DB2 ZOS", Boolean.TRUE, "IBM_DB2", "DB2", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.Schema), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
"IBM DB2 ZOS", "IBM DB2 ZOS", Boolean.TRUE, "IBM_DB2", "DB2", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.Schema), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
SYBASEASE(
"SybaseASE", "Sybase (ASE and IQ)", Boolean.TRUE, "SYBASE", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.None), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
"SybaseASE", "Sybase (ASE and IQ)", Boolean.TRUE, "SYBASE", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.None), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
// this Sybase IQ not used.
SYBASEIQ(
"Sybase IQ", "Sybase IQ", Boolean.TRUE, "SYBASE", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.None), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
"Sybase IQ", "Sybase IQ", Boolean.TRUE, "SYBASE", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.None), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
MSSQL(
"MSSQL", "Microsoft SQL Server", Boolean.TRUE, "SQL_SERVER", "MSSQL", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.Schema), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
"MSSQL", "Microsoft SQL Server", Boolean.TRUE, "SQL_SERVER", "MSSQL", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.Schema), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
MSSQL05_08(
"MSSQL", "Microsoft SQL Server 2005/2008", Boolean.TRUE, "SQL_SERVER", "MSSQL", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.Schema), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
"MSSQL", "Microsoft SQL Server 2005/2008", Boolean.TRUE, "SQL_SERVER", "MSSQL", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.Schema), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
// this don't use in Branch 2.0
HSQLDB("HSQLDB", "HSQLDB", Boolean.FALSE, "HSQLDB", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.None), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
HSQLDB(
"HSQLDB", "HSQLDB", Boolean.FALSE, "HSQLDB", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.None), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
HSQLDB_SERVER(
"HSQLDB Server", "HSQLDB Server", Boolean.FALSE, "HSQLDB", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.None), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
"HSQLDB Server", "HSQLDB Server", Boolean.FALSE, "HSQLDB", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.None), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
HSQLDB_WEBSERVER(
"HSQLDB WebServer", "HSQLDB WebServer", Boolean.FALSE, "HSQLDB", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.None), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
"HSQLDB WebServer", "HSQLDB WebServer", Boolean.FALSE, "HSQLDB", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.None), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
HSQLDB_IN_PROGRESS(
"HSQLDB In-Process", "HSQLDB In-Process", Boolean.FALSE, "HSQLDB", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.None), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
"HSQLDB In-Process", "HSQLDB In-Process", Boolean.FALSE, "HSQLDB", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.None), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
JAVADB("JavaDB", "JavaDB", Boolean.FALSE, "JAVADB", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.None), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
JAVADB(
"JavaDB", "JavaDB", Boolean.FALSE, "JAVADB", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.None), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
INGRES(
"Ingres", "Ingres", Boolean.FALSE, "INGRES", EDatabaseSchemaOrCatalogMapping.None, EDatabaseSchemaOrCatalogMapping.Schema), // "INGRES"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
"Ingres", "Ingres", Boolean.FALSE, "INGRES", EDatabaseSchemaOrCatalogMapping.None, EDatabaseSchemaOrCatalogMapping.Schema), // "INGRES"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
INTERBASE(
"Interbase", "Interbase", Boolean.FALSE, "INTERBASE", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.None), // "INTERBASE"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
SQLITE("SQLite", "SQLite", Boolean.FALSE, "SQLITE", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.None), // "SQLITE"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
"Interbase", "Interbase", Boolean.FALSE, "INTERBASE", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.None), // "INTERBASE"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
SQLITE(
"SQLite", "SQLite", Boolean.FALSE, "SQLITE", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.None), // "SQLITE"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
FIREBIRD(
"FireBird", "FireBird", Boolean.FALSE, "FIREBIRD", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.None), // "FIREBIRD"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
"FireBird", "FireBird", Boolean.FALSE, "FIREBIRD", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.None), // "FIREBIRD"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
INFORMIX(
"Informix", "Informix", Boolean.TRUE, "INFORMIX", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.None), // "INFORMIX"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
"Informix", "Informix", Boolean.TRUE, "INFORMIX", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.None), // "INFORMIX"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
VECTORWISE(
"VectorWise", "VectorWise", Boolean.FALSE, "VECTORWISE", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.None), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
"VectorWise", "VectorWise", Boolean.FALSE, "VECTORWISE", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.None), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
ACCESS(
"Access", "Access", Boolean.FALSE, "ACCESS", EDatabaseSchemaOrCatalogMapping.None, EDatabaseSchemaOrCatalogMapping.Default_Name), // "ACCESS"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
"Access", "Access", Boolean.FALSE, "ACCESS", EDatabaseSchemaOrCatalogMapping.None, EDatabaseSchemaOrCatalogMapping.Default_Name), // "ACCESS"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
TERADATA(
"Teradata", "Teradata", Boolean.TRUE, "TERADATA", EDatabaseSchemaOrCatalogMapping.None, EDatabaseSchemaOrCatalogMapping.Schema), // "TERADATA"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
AS400("AS400", "AS400", Boolean.FALSE, "AS400", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.Login), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
"Teradata", "Teradata", Boolean.TRUE, "TERADATA", EDatabaseSchemaOrCatalogMapping.None, EDatabaseSchemaOrCatalogMapping.Schema), // "TERADATA"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
AS400(
"AS400", "AS400", Boolean.FALSE, "AS400", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.Login), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
JAVADB_EMBEDED(
"JavaDB Embeded", "JavaDB Embeded", Boolean.FALSE, "JAVADB", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.None), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
"JavaDB Embeded", "JavaDB Embeded", Boolean.FALSE, "JAVADB", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.None), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
JAVADB_JCCJDBC(
"JavaDB JCCJDBC", "JavaDB JCCJDBC", Boolean.FALSE, "JAVADB", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.None), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
"JavaDB JCCJDBC", "JavaDB JCCJDBC", Boolean.FALSE, "JAVADB", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.None), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
JAVADB_DERBYCLIENT(
"JavaDB DerbyClient", "JavaDB DerbyClient", Boolean.FALSE, "JAVADB", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.None), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
"JavaDB DerbyClient", "JavaDB DerbyClient", Boolean.FALSE, "JAVADB", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.None), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
VERTICA(
"Vertica", "Vertica", Boolean.TRUE, "VERTICA", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.Schema), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
MAXDB("MAXDB", "MaxDB", Boolean.FALSE, "MAXDB", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.None), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
MAXDB(
"MAXDB", "MaxDB", Boolean.FALSE, "MAXDB", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.None), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
GREENPLUM(
"Greenplum", "Greenplum", Boolean.TRUE, "GREENPLUM", "GREENPLUM", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.Schema), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
"Greenplum", "Greenplum", Boolean.TRUE, "GREENPLUM", "GREENPLUM", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.Schema), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
PARACCEL(
"ParAccel", "ParAccel", Boolean.TRUE, "PARACCEL", "PARACCEL", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.Schema), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
"ParAccel", "ParAccel", Boolean.TRUE, "PARACCEL", "PARACCEL", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.Schema), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
NETEZZA(
"Netezza", "Netezza", Boolean.FALSE, "NETEZZA", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.None), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
SAS("SAS", "SAS", Boolean.TRUE, "SAS", EDatabaseSchemaOrCatalogMapping.None, EDatabaseSchemaOrCatalogMapping.Schema), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
// General JDBC not support schema defalut
GENERAL_JDBC(
"General JDBC", "General JDBC", Boolean.FALSE, "JDBC", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.None), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
EXASOL("Exasol", "Exasol", Boolean.TRUE, "Exasol", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.None), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
"General JDBC", "General JDBC", Boolean.FALSE, "JDBC", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.None), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
EXASOL(
"Exasol", "Exasol", Boolean.TRUE, "Exasol", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.None), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
HIVE("Hive", "Hive", Boolean.FALSE, "HIVE", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.None), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
HIVE(
"Hive", "Hive", Boolean.FALSE, "HIVE", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.None), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
SAPHana(
"SAPHana", "SAPHana", Boolean.TRUE, "SAPHANA", EDatabaseSchemaOrCatalogMapping.None, EDatabaseSchemaOrCatalogMapping.Schema), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
@@ -121,24 +128,23 @@ public enum EDatabaseTypeName {
H2("H2", "H2", Boolean.FALSE, "H2", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.None), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
REDSHIFT(
"Redshift", "Redshift", Boolean.TRUE, "REDSHIFT", "REDSHIFT", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.Schema), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
REDSHIFT_SSO(
"Redshift SSO", //$NON-NLS-1$
"Redshift SSO", //$NON-NLS-1$
Boolean.TRUE,
"REDSHIFT", //$NON-NLS-1$
"REDSHIFT SSO", //$NON-NLS-1$
EDatabaseSchemaOrCatalogMapping.Sid,
EDatabaseSchemaOrCatalogMapping.Schema),
"Redshift", "Redshift", Boolean.TRUE, "REDSHIFT", "REDSHIFT", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.Schema), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
REDSHIFT_SSO("Redshift SSO", //$NON-NLS-1$
"Redshift SSO", //$NON-NLS-1$
Boolean.TRUE,
"REDSHIFT", //$NON-NLS-1$
"REDSHIFT SSO", //$NON-NLS-1$
EDatabaseSchemaOrCatalogMapping.Sid,
EDatabaseSchemaOrCatalogMapping.Schema),
IMPALA(
"IMPALA", "Impala", Boolean.TRUE, "IMPALA", EDatabaseSchemaOrCatalogMapping.None, EDatabaseSchemaOrCatalogMapping.Schema), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
"IMPALA", "Impala", Boolean.TRUE, "IMPALA", EDatabaseSchemaOrCatalogMapping.None, EDatabaseSchemaOrCatalogMapping.Schema), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
HBASE(
"HBase", "HBase", Boolean.FALSE, "HBASE", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.Column_Family, true), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
"HBase", "HBase", Boolean.FALSE, "HBASE", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.Column_Family, true), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
MAPRDB(
"MapRDB", "MapRDB", Boolean.FALSE, "MAPRDB", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.Column_Family, true);//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
"MapRDB", "MapRDB", Boolean.FALSE, "MAPRDB", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.Column_Family, true);//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
// displayName is used in Java code.
private String displayName;
@@ -322,11 +328,24 @@ public enum EDatabaseTypeName {
boolean isSupport = true;
if (EDatabaseTypeName.GODBC == this || EDatabaseTypeName.MSODBC == this) {
boolean isSupportODBC = CoreRuntimePlugin.getInstance().getProjectPreferenceManager()
.getBoolean(IProjectSettingPreferenceConstants.METADATA_DBCONNECTION_ODBC_ENABLE);
boolean isSupportODBC =
CoreRuntimePlugin
.getInstance()
.getProjectPreferenceManager()
.getBoolean(IProjectSettingPreferenceConstants.METADATA_DBCONNECTION_ODBC_ENABLE);
isSupport = isSupportODBC;
}
return isSupport;
}
/**
* Getter for dbType.
*
* @return the dbType
*/
public String getDbType() {
return this.dbType;
}
}

View File

@@ -93,30 +93,30 @@ public enum EDatabaseConnTemplate {
"jdbc:sybase:Tds:<host>:<port>/<sid>?<property>", //$NON-NLS-1$
"5001")), //$NON-NLS-1$
SYBASEASE_16_SA(new DbConnStr(EDatabaseTypeName.SYBASEASE, //
"jdbc:sqlanywhere:Host=<host>:<port>;DatabaseName=<sid>", //$NON-NLS-1$
"jdbc:sqlanywhere:Host=<host>:<port>;DatabaseName=<sid>;<property>", //$NON-NLS-1$
"2638")), //$NON-NLS-1$
IBMDB2(new DbConnStr(EDatabaseTypeName.IBMDB2, //
"jdbc:db2://<host>:<port>/<sid>", //$NON-NLS-1$
"jdbc:db2://<host>:<port>/<sid>:<property>", //$NON-NLS-1$
"50000")), //$NON-NLS-1$
IBMDB2_ZOS(new DbConnStr(EDatabaseTypeName.IBMDB2ZOS, //
"jdbc:db2://<host>:<port>/<sid>", //$NON-NLS-1$
"jdbc:db2://<host>:<port>/<sid>:<property>", //$NON-NLS-1$
"557")), //$NON-NLS-1$
SQLITE(new DbConnStr(EDatabaseTypeName.SQLITE, //
"jdbc:sqlite:/<filename>")), //$NON-NLS-1$
INGRES(new DbConnStr(EDatabaseTypeName.INGRES, //
"jdbc:ingres://<host>:<port>/<sid>", //$NON-NLS-1$
"jdbc:ingres://<host>:<port>/<sid>;<property>", //$NON-NLS-1$
"II7")), //$NON-NLS-1$
VECTORWISE(new DbConnStr(EDatabaseTypeName.VECTORWISE, //
"jdbc:ingres://<host>:<port>/<sid>", //$NON-NLS-1$
"jdbc:ingres://<host>:<port>/<sid>;<property>", //$NON-NLS-1$
"II7")), //$NON-NLS-1$
INTERBASE(new DbConnStr(EDatabaseTypeName.INTERBASE, //
"jdbc:interbase://<host>/<sid>")), //$NON-NLS-1$
"jdbc:interbase://<host>/<sid>?<property>")), //$NON-NLS-1$
FIREBIRD(new DbConnStr(EDatabaseTypeName.FIREBIRD, //
"jdbc:firebirdsql:<host>/<port>:<filename>", //$NON-NLS-1$
"jdbc:firebirdsql:<host>/<port>:<filename>?<property>", //$NON-NLS-1$
"3050")), //$NON-NLS-1$
INFORMIX(new DbConnStr(EDatabaseTypeName.INFORMIX, //
@@ -134,22 +134,22 @@ public enum EDatabaseConnTemplate {
"prompt=false")), //$NON-NLS-1$
JAVADB_EMBEDED(new DbConnStr(EDatabaseTypeName.JAVADB_EMBEDED, //
"jdbc:derby:<dbRootPath>")), //$NON-NLS-1$
"jdbc:derby:<dbRootPath>;<property>")), //$NON-NLS-1$
JAVADB_JCCJDBC(new DbConnStr(EDatabaseTypeName.JAVADB_JCCJDBC, //
"jdbc:derby:net://<host>:<port>/<sid>", //$NON-NLS-1$
"jdbc:derby:net://<host>:<port>/<sid>;<property>", //$NON-NLS-1$
"1527")), //$NON-NLS-1$
JAVADB_DERBYCLIENT(new DbConnStr(EDatabaseTypeName.JAVADB_DERBYCLIENT, //
"jdbc:derby://<host>:<port>/<sid>", //$NON-NLS-1$
"jdbc:derby://<host>:<port>/<sid>;<property>", //$NON-NLS-1$
"1527")), //$NON-NLS-1$
HSQLDB_SERVER(new DbConnStr(EDatabaseTypeName.HSQLDB_SERVER, //
"jdbc:hsqldb:hsql://<host>:<port>/<sid>", //$NON-NLS-1$
"jdbc:hsqldb:hsql://<host>:<port>/<sid>;<property>", //$NON-NLS-1$
"9001")), //$NON-NLS-1$
HSQLDB_WEBSERVER(new DbConnStr(EDatabaseTypeName.HSQLDB_WEBSERVER, //
"jdbc:hsqldb:http://<host>:<port>/<sid>", //$NON-NLS-1$
"jdbc:hsqldb:http://<host>:<port>/<sid>;<property>", //$NON-NLS-1$
"9001")), //$NON-NLS-1$
HSQLDB_IN_PROGRESS(new DbConnStr(EDatabaseTypeName.HSQLDB_IN_PROGRESS, //
@@ -157,7 +157,7 @@ public enum EDatabaseConnTemplate {
null, "ifexists=true")), //$NON-NLS-1$
MAXDB(new DbConnStr(EDatabaseTypeName.MAXDB, //
"jdbc:sapdb://<host>:<port>/<sid>", //$NON-NLS-1$
"jdbc:sapdb://<host>:<port>/<sid>?<property>", //$NON-NLS-1$
"7210")), //$NON-NLS-1$
SAS(new DbConnStr(EDatabaseTypeName.SAS, //
@@ -170,11 +170,11 @@ public enum EDatabaseConnTemplate {
"")), //$NON-NLS-1$
PARACCEL(new DbConnStr(EDatabaseTypeName.PARACCEL, //
"jdbc:paraccel://<host>:<port>/<sid>", //$NON-NLS-1$
"jdbc:paraccel://<host>:<port>/<sid>?<property>", //$NON-NLS-1$
"5439")), //$NON-NLS-1$
REDSHIFT(new DbConnStr(EDatabaseTypeName.REDSHIFT, //
"jdbc:redshift://<host>:<port>/<sid>", //$NON-NLS-1$
"jdbc:redshift://<host>:<port>/<sid>?<property>", //$NON-NLS-1$
"5439",//$NON-NLS-1$
"")), //$NON-NLS-1$
REDSHIFT_SSO(new DbConnStr(EDatabaseTypeName.REDSHIFT_SSO, //
@@ -182,7 +182,7 @@ public enum EDatabaseConnTemplate {
"5439",//$NON-NLS-1$
"")), //$NON-NLS-1$
NETEZZA(new DbConnStr(EDatabaseTypeName.NETEZZA, //
"jdbc:netezza://<host>:<port>/<sid>", //$NON-NLS-1$
"jdbc:netezza://<host>:<port>/<sid>;<property>", //$NON-NLS-1$
"5480")), //$NON-NLS-1$
VERTICA(new DbConnStr(EDatabaseTypeName.VERTICA, //
@@ -306,7 +306,7 @@ public enum EDatabaseConnTemplate {
List<ERepositoryObjectType> extraTypes = new ArrayList<ERepositoryObjectType>();
IGenericDBService dbService = null;
if (GlobalServiceRegister.getDefault().isServiceRegistered(IGenericDBService.class)) {
dbService = (IGenericDBService) GlobalServiceRegister.getDefault().getService(
dbService = GlobalServiceRegister.getDefault().getService(
IGenericDBService.class);
}
if(dbService != null){
@@ -411,6 +411,20 @@ public enum EDatabaseConnTemplate {
case PSQL:
case PLUSPSQL:
case GREENPLUM:
case PARACCEL:
case INGRES:
case VECTORWISE:
case INTERBASE:
case FIREBIRD:
case JAVADB_EMBEDED:
case JAVADB_JCCJDBC:
case JAVADB_DERBYCLIENT:
case MAXDB:
case IBMDB2:
case IBMDB2_ZOS:
case HSQLDB_SERVER:
case HSQLDB_WEBSERVER:
case NETEZZA:
return true;
default:
}

View File

@@ -64,7 +64,7 @@ public enum EDatabaseVersion4Drivers {
SQLITE(new DbVersion4Drivers(EDatabaseTypeName.SQLITE, "sqlitejdbc-v056.jar")), //$NON-NLS-1$
FIREBIRD(new DbVersion4Drivers(EDatabaseTypeName.FIREBIRD, "jaybird-full-2.1.1.jar")), //$NON-NLS-1$
TERADATA(new DbVersion4Drivers(EDatabaseTypeName.TERADATA,
new String[] { "terajdbc4-15.10.00.14.jar", "tdgssconfig-15.10.00.14.jar" })), //$NON-NLS-1$ //$NON-NLS-2$
new String[] { "terajdbc4-16.20.00.02.jar", "tdgssconfig-16.20.00.02.jar" })), //$NON-NLS-1$ //$NON-NLS-2$
JAVADB_DERBYCLIENT(new DbVersion4Drivers(EDatabaseTypeName.JAVADB_DERBYCLIENT, "derbyclient.jar")), //$NON-NLS-1$
NETEZZA(new DbVersion4Drivers(EDatabaseTypeName.NETEZZA, "nzjdbc.jar")), //$NON-NLS-1$
INFORMIX(new DbVersion4Drivers(EDatabaseTypeName.INFORMIX, "ifxjdbc.jar")), //$NON-NLS-1$

View File

@@ -47,6 +47,7 @@ import org.talend.core.ILibraryManagerService;
import org.talend.core.model.general.ILibrariesService;
import org.talend.core.runtime.i18n.Messages;
import org.talend.repository.ProjectManager;
import org.talend.utils.files.FileUtils;
import org.talend.utils.xml.XmlUtils;
import org.w3c.dom.Attr;
import org.w3c.dom.Document;
@@ -58,9 +59,6 @@ import org.xml.sax.ErrorHandler;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
import com.sun.org.apache.xml.internal.serialize.OutputFormat;
import com.sun.org.apache.xml.internal.serialize.XMLSerializer;
/**
* created by wchen on 2013-3-27 Detailled comment
*
@@ -239,14 +237,15 @@ public class HadoopCustomLibrariesUtil {
// save index
if (document != null) {
XMLSerializer serializer = new XMLSerializer();
OutputFormat outputFormat = new OutputFormat();
outputFormat.setIndenting(true);
serializer.setOutputFormat(outputFormat);
// XMLSerializer serializer = new XMLSerializer();
// OutputFormat outputFormat = new OutputFormat();
// outputFormat.setIndenting(true);
// serializer.setOutputFormat(outputFormat);
output = new OutputStreamWriter(new FileOutputStream(indexFile), "UTF-8"); //$NON-NLS-1$
serializer.setOutputCharStream(output);
serializer.serialize(document);
// serializer.setOutputCharStream(output);
// serializer.serialize(document);
FileUtils.writeXMLFile(document, output);
toExport.put(indexFile.getAbsoluteFile(), new Path(indexFileName));
}
} finally {

View File

@@ -54,6 +54,8 @@ public class ConnectionBean implements Cloneable {
private Map<String, String> dynamicFields = new HashMap<String, String>();
private static final String TOKEN = "token"; //$NON-NLS-1$
/**
* DOC smallet ConnectionBean constructor comment.
*/
@@ -281,6 +283,25 @@ public class ConnectionBean implements Cloneable {
}
}
public boolean isToken() {
try {
if (conDetails.has(TOKEN)) {
return (Boolean) conDetails.get(TOKEN);
}
} catch (JSONException e) {
ExceptionHandler.process(e);
}
return false;
}
public void setToken(boolean token) {
try {
conDetails.put(TOKEN, token);
} catch (JSONException e) {
ExceptionHandler.process(e);
}
}
@Override
public ConnectionBean clone() throws CloneNotSupportedException {
return writeFromJSON(this.getConDetails());
@@ -303,6 +324,7 @@ public class ConnectionBean implements Cloneable {
toReturn.setPassword(st[i++]);
toReturn.setWorkSpace(st[i++]);
toReturn.setComplete(new Boolean(st[i++]));
toReturn.setToken(new Boolean(st[i++]));
JSONObject dynamicJson = new JSONObject();
toReturn.getConDetails().put(DYNAMICFIELDS, dynamicJson);
while (i < st.length) {

View File

@@ -434,9 +434,9 @@ public class ModuleNeeded {
if (this.getModuleLocaion() != null) {
hashCode *= this.getModuleLocaion().hashCode();
}
hashCode *= this.getDefaultMavenURI().hashCode();
if(this.getDefaultMavenURI() != null){
hashCode *= this.getDefaultMavenURI().hashCode();
}
return hashCode;
}
@@ -519,8 +519,16 @@ public class ModuleNeeded {
}
// maven uri
if (!other.getDefaultMavenURI().equals(this.getDefaultMavenURI())) {
return false;
if (other.getDefaultMavenURI() == null) {
if (this.getDefaultMavenURI() != null) {
return false;
}
} else {
if (this.getDefaultMavenURI() == null) {
return false;
} else if (!other.getDefaultMavenURI().equals(this.getDefaultMavenURI())) {
return false;
}
}
return true;

View File

@@ -16,6 +16,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import org.apache.commons.collections.MultiMap;
@@ -334,7 +335,7 @@ public class MappingTypeRetriever {
return mappingType.getDbType();
}
/**
* Getter for the current loaded dbms.
*

View File

@@ -16,6 +16,7 @@ import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashSet;
@@ -37,6 +38,7 @@ import org.talend.core.model.metadata.builder.connection.ConnectionFactory;
import org.talend.core.model.metadata.builder.connection.SchemaTarget;
import org.talend.core.model.metadata.types.PerlTypesManager;
import org.talend.cwm.helper.TaggedValueHelper;
import org.talend.utils.files.FileUtils;
import org.talend.utils.xml.XmlUtils;
import org.w3c.dom.Attr;
import org.w3c.dom.Document;
@@ -48,9 +50,6 @@ import org.xml.sax.ErrorHandler;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
import com.sun.org.apache.xml.internal.serialize.OutputFormat;
import com.sun.org.apache.xml.internal.serialize.XMLSerializer;
import orgomg.cwm.objectmodel.core.TaggedValue;
/**
@@ -673,9 +672,9 @@ public class MetadataSchema {
}
// use specific Xerces class to write DOM-data to a file:
XMLSerializer serializer = new XMLSerializer();
serializer.setOutputCharStream(new java.io.FileWriter(file));
serializer.serialize(document);
Writer writer = new java.io.FileWriter(file);
FileUtils.writeXMLFile(document, writer);
writer.close();
return true;
}
return false;
@@ -864,10 +863,7 @@ public class MetadataSchema {
return;
}
// use specific Xerces class to write DOM-data to a file:
XMLSerializer serializer = new XMLSerializer();
OutputFormat outputFormat = new OutputFormat();
outputFormat.setIndenting(true);
serializer.setOutputFormat(outputFormat);
// java.io.FileWriter fileWriter = new java.io.FileWriter(file);
// serializer.setOutputCharStream(fileWriter);
@@ -886,9 +882,7 @@ public class MetadataSchema {
// fileWriter.close();
// fileWriter = null;
OutputStreamWriter output = new OutputStreamWriter(new FileOutputStream(file), "UTF-8"); //$NON-NLS-1$
serializer.setOutputCharStream(output);
serializer.serialize(document);
FileUtils.writeXMLFile(document, output);
output.close();
}
}

View File

@@ -153,7 +153,7 @@ public class MetadataTable implements IMetadataTable, Cloneable {
List<IMetadataColumn> temp = new ArrayList<IMetadataColumn>();
temp.addAll(this.listColumns);
temp.addAll(this.unusedColumns);
if (isRepository && originalColumns != null) {
if (originalColumns != null) {
Collections.sort(temp, new Comparator<IMetadataColumn>() {
@Override

View File

@@ -213,6 +213,7 @@ public final class MetadataToolAvroHelper {
//ignore it now as we can't process the complex expression for the default value, and the default value is not useful for runtime like the old javajet tjdbcxxx
//TODO support the expression calculate, not sure it's necessary and sometimes, more complex like globalMap.get(xxx) which only have meaning after running the job.
ExceptionHandler.process(e, Level.WARN);
defaultValue = null;
}
// Types with Document/Unknown elements, store as binary

View File

@@ -614,7 +614,12 @@ public final class MetadataToolHelper {
target.getListColumns().addAll(columnsTAdd);
target.sortCustomColumns();
target.setLabel(source.getLabel());
target.setOriginalColumns(source.getOriginalColumns());
List<String> originalColumnsList = null;
if (source.getOriginalColumns() != null) {
originalColumnsList = new ArrayList<String>();
originalColumnsList.addAll(source.getOriginalColumns());
}
target.setOriginalColumns(originalColumnsList);
Map<String, String> targetProperties = target.getAdditionalProperties();
Map<String, String> sourceProperties = source.getAdditionalProperties();
for (Entry<String, String> entry : sourceProperties.entrySet()) {

View File

@@ -94,8 +94,8 @@ public final class JavaTypesManager {
public static final JavaType PASSWORD = new JavaType(String.class, true, "Password"); //$NON-NLS-1$
public static final JavaType[] JAVA_TYPES = new JavaType[] { BOOLEAN, BYTE, BYTE_ARRAY, CHARACTER, DATE, DOUBLE, FLOAT,
BIGDECIMAL, INTEGER, LONG, OBJECT, SHORT, STRING, LIST };
public static final JavaType[] JAVA_TYPES = new JavaType[] { BOOLEAN, BYTE, BYTE_ARRAY, CHARACTER, DATE, DOUBLE,
FLOAT, BIGDECIMAL, INTEGER, LONG, OBJECT, SHORT, STRING, LIST };
private static Map<String, Map<String, List<DBTypeUtil>>> javaTypeMappingFromExtension;
@@ -144,12 +144,16 @@ public final class JavaTypesManager {
for (IConfigurationElement configurationElement : configurationElements) {
try {
String className = configurationElement.getAttribute("nullableClass");
Class myClass = Platform.getBundle(configurationElement.getContributor().getName()).loadClass(
className);
boolean isGenerateWithCanonicalName = configurationElement.getAttribute("generateWithCanonicalName") == null ? false
: Boolean.valueOf(configurationElement.getAttribute("generateWithCanonicalName"));
boolean isObjectBased = configurationElement.getAttribute("objectBased") == null ? false : Boolean
.valueOf(configurationElement.getAttribute("objectBased"));
Class myClass =
Platform.getBundle(configurationElement.getContributor().getName()).loadClass(
className);
boolean isGenerateWithCanonicalName =
configurationElement.getAttribute("generateWithCanonicalName") == null ? false
: Boolean.valueOf(configurationElement
.getAttribute("generateWithCanonicalName"));
boolean isObjectBased =
configurationElement.getAttribute("objectBased") == null ? false : Boolean
.valueOf(configurationElement.getAttribute("objectBased"));
JavaType javaType = new JavaType(myClass, isGenerateWithCanonicalName, isObjectBased);
addJavaType(javaType);
@@ -160,14 +164,18 @@ public final class JavaTypesManager {
IConfigurationElement[] dbTypeElements = dbMappingElement.getChildren();
List<DBTypeUtil> dbTypes = new ArrayList<DBTypeUtil>();
for (IConfigurationElement dbTypeElement : dbTypeElements) {
boolean isDefault = dbTypeElement.getAttribute("default") == null ? false : Boolean
.valueOf(dbTypeElement.getAttribute("default"));
boolean isIgnoreLen = dbTypeElement.getAttribute("ignoreLen") == null ? false : Boolean
.valueOf(dbTypeElement.getAttribute("ignoreLen"));
boolean isIgnorePre = dbTypeElement.getAttribute("ignorePre") == null ? false : Boolean
.valueOf(dbTypeElement.getAttribute("ignorePre"));
DBTypeUtil dbType = new DBTypeUtil(dbTypeElement.getAttribute("DbType"), isDefault,
isIgnoreLen, isIgnorePre);
boolean isDefault =
dbTypeElement.getAttribute("default") == null ? false : Boolean
.valueOf(dbTypeElement.getAttribute("default"));
boolean isIgnoreLen =
dbTypeElement.getAttribute("ignoreLen") == null ? false : Boolean
.valueOf(dbTypeElement.getAttribute("ignoreLen"));
boolean isIgnorePre =
dbTypeElement.getAttribute("ignorePre") == null ? false : Boolean
.valueOf(dbTypeElement.getAttribute("ignorePre"));
DBTypeUtil dbType =
new DBTypeUtil(dbTypeElement.getAttribute("DbType"), isDefault,
isIgnoreLen, isIgnorePre);
dbTypes.add(dbType);
}
dbAndDBType.put(mappingId, dbTypes);
@@ -519,16 +527,16 @@ public final class JavaTypesManager {
/**
* the numerical types with id_.
*/
public final static String[] NUMBERS = new String[] { JavaTypesManager.INTEGER.getId(), JavaTypesManager.FLOAT.getId(),
JavaTypesManager.DOUBLE.getId(), JavaTypesManager.LONG.getId(), JavaTypesManager.SHORT.getId(),
JavaTypesManager.BIGDECIMAL.getId(), JavaTypesManager.BYTE.getId() };
public final static String[] NUMBERS = new String[] { JavaTypesManager.INTEGER.getId(),
JavaTypesManager.FLOAT.getId(), JavaTypesManager.DOUBLE.getId(), JavaTypesManager.LONG.getId(),
JavaTypesManager.SHORT.getId(), JavaTypesManager.BIGDECIMAL.getId(), JavaTypesManager.BYTE.getId() };
public static boolean isNumber(String type) {
return ArrayUtils.contains(NUMBERS, type);
}
public static boolean isString(String type) {
return JavaTypesManager.STRING.getId().equals(type);
return JavaTypesManager.STRING.getId().equals(type) || JavaTypesManager.CHARACTER.getId().equals(type);
}
public static boolean isBoolean(String type) {

View File

@@ -29,13 +29,13 @@ import org.talend.core.model.metadata.MetadataTable;
*/
public class BigDataNode extends AbstractNode implements IBigDataNode {
private boolean dummy = false;
protected boolean dummy = false;
private String outputType = null;
protected String outputType = null;
private String inputType = null;
protected String inputType = null;
private Map<String, List<IMetadataColumn>> keyList = new java.util.HashMap<String, List<IMetadataColumn>>();
protected Map<String, List<IMetadataColumn>> keyList = new HashMap<String, List<IMetadataColumn>>();
/**
* Default constructor for the BigDataNode
@@ -149,7 +149,7 @@ public class BigDataNode extends AbstractNode implements IBigDataNode {
return "IDENTITY".equals(getRequiredInputType()) && "IDENTITY".equals(getRequiredOutputType()); //$NON-NLS-1$ //$NON-NLS-2$
}
private IElementParameter getNodeElemForList(IElementParameter parTableNode) {
protected IElementParameter getNodeElemForList(IElementParameter parTableNode) {
// Iterate over the table columns and make sure one of them is a COLUMN_LIST or a CHECKBOX.
for (Object nodeItemList : parTableNode.getListItemsValue()) {
if (((IElementParameter) nodeItemList).getFieldType().equals(EParameterFieldType.PREV_COLUMN_LIST)
@@ -161,7 +161,7 @@ public class BigDataNode extends AbstractNode implements IBigDataNode {
return null;
}
private IElementParameter getPartitionTableNode(IBigDataNode bigDataNode, String rootPartitionKey) {
protected IElementParameter getPartitionTableNode(IBigDataNode bigDataNode, String rootPartitionKey) {
// if the partition key is valid, get the first element of the key, which must be a table.
IElementParameter partitionTableNode = bigDataNode.getElementParameter(rootPartitionKey);
if (partitionTableNode == null) {
@@ -346,4 +346,19 @@ public class BigDataNode extends AbstractNode implements IBigDataNode {
public void addOutput(IConnection connection) {
((List<IConnection>) getOutgoingConnections()).add(connection);
}
@Override
public boolean shouldGenerateDatasetCode() {
return false;
}
@Override
public void loadDatasetConditions(){
// BigDataNode does not do anything related to Dataset, only anabled from SparkNode
}
@Override
public void processDatasetConditions(){
// BigDataNode does not do anything related to Dataset, only anabled from SparkNode
}
}

View File

@@ -122,5 +122,24 @@ public interface IBigDataNode extends INode {
* @param dummy true if this node has to be declared as a dummy, else false.
*/
public void setDummy(boolean dummy);
/**
* Returns if node will generate Dataset or RDD code.
*
* @return a boolean telling if Dataset code will be generated.
*/
public boolean shouldGenerateDatasetCode();
/**
* Method to load Dataset conditions.
*/
public void loadDatasetConditions();
/**
* Method to process previously loaded Dataset conditions and determine if Dataset code can be generated.
*
* Loading and processing should be separated because conditions can be dependent on future component (in subjob order)
*/
public void processDatasetConditions();
}

View File

@@ -12,6 +12,7 @@
// ============================================================================
package org.talend.core.model.process;
import org.talend.daikon.properties.property.Property;
/**
* DOC cmeng class global comment. Detailled comment
@@ -20,4 +21,5 @@ public interface IGenericElementParameter extends IElementParameter {
public void setAskPropagate(Boolean askPropagate);
public Property getProperty();
}

View File

@@ -23,6 +23,7 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Level;
@@ -129,8 +130,6 @@ public class RelationshipItemBuilder {
private Map<Relation, Set<Relation>> referencesItemsRelations;
private Map<String, String> hadoopItemReferences = new HashMap<String, String>();
private boolean loaded = false;
private boolean loading = false;
@@ -670,8 +669,8 @@ public class RelationshipItemBuilder {
return;
}
loading = true;
currentProjectItemsRelations = new HashMap<Relation, Set<Relation>>();
referencesItemsRelations = new HashMap<Relation, Set<Relation>>();
currentProjectItemsRelations = new ConcurrentHashMap<Relation, Set<Relation>>();
referencesItemsRelations = new ConcurrentHashMap<Relation, Set<Relation>>();
loadRelations(currentProjectItemsRelations, getAimProject());
@@ -1126,10 +1125,11 @@ public class RelationshipItemBuilder {
Map<Relation, Set<Relation>> relations = handler.find(item);
mergeRelationship(itemRelations, relations);
}
if (oldProjectRelations != null) {
// check if there is any changes on the relations.
Set<Relation> newProjectRelations = currentProjectItemsRelations.get(relation);
// check if there is any changes on the relations.
Set<Relation> newProjectRelations = currentProjectItemsRelations.get(relation);
if (oldProjectRelations == null && newProjectRelations == null) {
relationsModified = false;
} else if (oldProjectRelations != null) {
if (oldProjectRelations.size() == newProjectRelations.size()) {
relationsModified = false;
for (Relation newRelation : newProjectRelations) {

View File

@@ -79,6 +79,11 @@ public class ArtifactRepositoryBean implements Cloneable {
if (index > 0) {
nexusUrl = url.substring(0, index + ARTIFACT_MIDDLE_PATH.length());
repoId = StringUtilities.removeEndingString(url.substring(index + ARTIFACT_MIDDLE_PATH.length()), "/");
} else {
// can be non-default contextpath or root
String tempurl = StringUtilities.removeEndingString(url, "/");
repoId = tempurl.substring(tempurl.lastIndexOf("/") + 1);
nexusUrl = url.substring(0, url.indexOf(repoId));
}
}
return new String[] { nexusUrl, repoId };

View File

@@ -14,6 +14,7 @@ package org.talend.core.nexus;
import java.io.File;
import java.io.IOException;
import java.util.Collection;
import java.util.Dictionary;
import java.util.Hashtable;
@@ -84,15 +85,18 @@ public class TalendMavenResolver {
props = new Hashtable<String, String>();
}
final BundleContext context = CoreRuntimePlugin.getInstance().getBundle().getBundleContext();
ServiceReference<ManagedService> managedServiceRef = context.getServiceReference(ManagedService.class);
if (managedServiceRef != null) {
ManagedService managedService = context.getService(managedServiceRef);
Collection<ServiceReference<ManagedService>> managedServiceRefs = context.getServiceReferences(ManagedService.class,
"(service.pid=org.ops4j.pax.url.mvn)");
for (ServiceReference<ManagedService> managedServiceRef : managedServiceRefs) {
if (managedServiceRef != null) {
ManagedService managedService = context.getService(managedServiceRef);
managedService.updated(props);
talendResolverKey = resolverKey;
mavenResolver = null;
} else {
throw new RuntimeException("Failed to load the service :" + ManagedService.class.getCanonicalName()); //$NON-NLS-1$
managedService.updated(props);
talendResolverKey = resolverKey;
mavenResolver = null;
} else {
throw new RuntimeException("Failed to load the service :" + ManagedService.class.getCanonicalName()); //$NON-NLS-1$
}
}
}

View File

@@ -44,7 +44,7 @@ public/* final */class BuildExportManager {
return instance;
}
IBuildExportDependenciesProvider[] getDependenciesProviders() {
public IBuildExportDependenciesProvider[] getDependenciesProviders() {
return reader.getDependenciesProviders();
}

View File

@@ -24,12 +24,14 @@ Require-Bundle: org.apache.commons.lang,
org.talend.core.repository,
org.eclipse.nebula.widgets.nattable.core,
org.eclipse.nebula.widgets.nattable.extension.glazedlists,
org.talend.libraries.nattable,
org.eclipse.e4.core.di.extensions,
org.talend.librariesmanager,
org.eclipse.e4.ui.services,
org.eclipse.ui.workbench,
org.talend.themes.core
org.talend.themes.core,
ca.odell.glazedlists,
org.talend.core,
org.apache.commons.io
Import-Package: org.eclipse.jdt.internal.ui.workingsets
Export-Package: org.talend.core.ui,
org.talend.core.ui.actions,

View File

@@ -613,3 +613,10 @@ WorkspaceDlg.browse.folder.title=Select a workspace folder
WorkspaceDlg.use.this.as.default.cb.message=&Use this workspace as the default and do not ask again
PerspectiveMenuManager.dummy=Dummy
PerspectiveMenuManager.perspectiveLabel=&Perspective
I18nPreferencePage.needRestart=Local Language(need restart)
I18nPreferencePage.translationInformation=Test translation with Babili (works only for current language,other language selection needs restart)
I18nPreferencePage.importBabili=Import Translation from Babili
I18nPreferencePage.restart=Restart
I18nPreferencePage.restartButton=Need to restart to take effect.
I18nPreferencePage.restoreDefault=Restore default
I18nPreferencePage.wait_process=Process will hold on several minutes, please wait...

View File

@@ -30,6 +30,7 @@ import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.MessageBox;
import org.eclipse.swt.widgets.Shell;
import org.talend.commons.ui.gmf.util.DisplayUtils;
import org.talend.commons.ui.runtime.image.ECoreImage;
import org.talend.commons.ui.runtime.image.ImageProvider;
import org.talend.core.model.context.JobContext;
@@ -170,7 +171,8 @@ public class ContextSetConfigurationDialog extends ObjectSelectionDialog<IContex
private boolean validateContextName(String name) {
if (name.equals("") || !name.matches(RepositoryConstants.CODE_ITEM_PATTERN)) { //$NON-NLS-1$
MessageDialog.openWarning(new Shell(), Messages.getString(Messages.getString("ContextProcessSection.50")), Messages //$NON-NLS-1$
MessageDialog.openWarning(DisplayUtils.getDefaultShell(false),
Messages.getString(Messages.getString("ContextProcessSection.50")), Messages //$NON-NLS-1$
.getString(Messages.getString("ContextProcessSection.51"))); //$NON-NLS-1$
return false;
}

View File

@@ -142,6 +142,8 @@ public class ContextTreeTable {
private final static int fixedTypeWidth = 90;
private final static int fixedHidePromptWidth = 1;
public ContextTreeTable(IContextModelManager manager) {
this.manager = manager;
}
@@ -395,7 +397,7 @@ public class ContextTreeTable {
RepositoryNode relateNode = new RepositoryNode(contextObj, null, ENodeType.REPOSITORY_ELEMENT);
contextObj.setRepositoryNode(relateNode);
if (GlobalServiceRegister.getDefault().isServiceRegistered(IMetadataManagmentUiService.class)) {
IMetadataManagmentUiService mmUIService = (IMetadataManagmentUiService) GlobalServiceRegister
IMetadataManagmentUiService mmUIService = GlobalServiceRegister
.getDefault().getService(IMetadataManagmentUiService.class);
mmUIService.openRepositoryContextWizard(relateNode);
}
@@ -454,7 +456,8 @@ public class ContextTreeTable {
} else {
int typeColumnPos = dataLayer.getColumnPositionByIndex(1);
int leftWidth = maxWidth - fixedTypeWidth - fixedCheckBoxWidth * checkColumnsPos.size() - cornerWidth * 2;
int leftWidth = maxWidth - fixedTypeWidth - fixedCheckBoxWidth * checkColumnsPos.size() - cornerWidth * 2
- fixedHidePromptWidth;
int currentColumnsCount = dataColumnsCount - hideColumnsPos.size() - checkColumnsPos.size() - 1;
int averageWidth = leftWidth / currentColumnsCount;
@@ -469,7 +472,7 @@ public class ContextTreeTable {
for (int hidePos : hideColumnsPos) {
if (hidePos == i) {
findHide = true;
dataLayer.setColumnWidthByPosition(i, 0);
dataLayer.setColumnWidthByPosition(i, fixedHidePromptWidth);
}
}
for (int checkPos : checkColumnsPos) {

View File

@@ -16,7 +16,7 @@ import java.util.ArrayList;
import java.util.List;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.widgets.Shell;
import org.talend.commons.ui.gmf.util.DisplayUtils;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.ILibraryManagerUIService;
import org.talend.core.model.context.ContextUtils;
@@ -172,7 +172,7 @@ public class ContextNatTableUtils {
if (!manager.getContextManager().checkValidParameterName(oldParamName, newParamName)) {
MessageDialog
.openError(
new Shell(),
DisplayUtils.getDefaultShell(false),
Messages.getString("ContextProcessSection.errorTitle"), Messages.getString("ContextProcessSection.ParameterNameIsNotValid")); //$NON-NLS-1$ //$NON-NLS-2$
return false;
}
@@ -181,7 +181,7 @@ public class ContextNatTableUtils {
if (newParamName.length() > 255) {
MessageDialog
.openError(
new Shell(),
DisplayUtils.getDefaultShell(false),
Messages.getString("ContextProcessSection.errorTitle"), Messages.getString("ContextTemplateComposite.ParamterLengthInvilid")); //$NON-NLS-1$ //$NON-NLS-2$
return false;
}

View File

@@ -25,8 +25,8 @@ import org.eclipse.jface.window.Window;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Table;
import org.talend.commons.ui.gmf.util.DisplayUtils;
import org.talend.commons.ui.swt.advanced.dataeditor.AbstractDataTableEditorView;
import org.talend.commons.ui.swt.extended.table.AbstractExtendedTableViewer;
import org.talend.commons.ui.swt.tableviewer.TableViewerCreator;
@@ -283,8 +283,8 @@ public class SchemaCellEditor extends DialogCellEditor {
originalCurrentOutTable = new MetadataTable();
originalCurrentOutTable.setListColumns(listColumns);
// 2.open metadataDialog,set finalOutTable
metaDialog = new MetadataDialog(new Shell(), originalInputTable, inputNode, originalCurrentOutTable,
outputNode, tableEditorView.getTableViewerCreator().getCommandStack());
metaDialog = new MetadataDialog(DisplayUtils.getDefaultShell(false), originalInputTable, inputNode,
originalCurrentOutTable, outputNode, tableEditorView.getTableViewerCreator().getCommandStack());
if (metaDialog.open() == Window.OK) {
finalInputTable = metaDialog.getInputMetaData().clone();
finalOutTable = metaDialog.getOutputMetaData().clone();
@@ -660,8 +660,9 @@ public class SchemaCellEditor extends DialogCellEditor {
// originalCurrentOutTable = new MetadataTable();
// originalCurrentOutTable.setListColumns(listColumns);
// 2.open metadataDialog,set finalOutTable
MetadataDialog metaDialog = new MetadataDialog(new Shell(), originalInputTable, inputNode,
tableToEdit.clone(), node, tableEditorView.getTableViewerCreator().getCommandStack());
MetadataDialog metaDialog = new MetadataDialog(DisplayUtils.getDefaultShell(false),
originalInputTable, inputNode, tableToEdit.clone(), node,
tableEditorView.getTableViewerCreator().getCommandStack());
if (metaDialog.open() == Window.OK) {
finalInputTable = metaDialog.getInputMetaData().clone();
finalOutTable = metaDialog.getOutputMetaData().clone();
@@ -712,8 +713,9 @@ public class SchemaCellEditor extends DialogCellEditor {
// originalCurrentOutTable = new MetadataTable();
// originalCurrentOutTable.setListColumns(listColumns);
// 2.open metadataDialog,set finalOutTable
MetadataDialog metaDialog = new MetadataDialog(new Shell(), originalInputTable, inputNode,
tableToEdit.clone(), node, tableEditorView.getTableViewerCreator().getCommandStack());
MetadataDialog metaDialog = new MetadataDialog(DisplayUtils.getDefaultShell(false),
originalInputTable, inputNode, tableToEdit.clone(), node,
tableEditorView.getTableViewerCreator().getCommandStack());
if (metaDialog.open() == Window.OK) {
finalInputTable = metaDialog.getInputMetaData().clone();
finalOutTable = metaDialog.getOutputMetaData().clone();

View File

@@ -725,6 +725,8 @@ public class MetadataDialog extends Dialog {
}
IDesignerCoreService designerCoreService = CoreUIPlugin.getDefault().getDesignerCoreService();
updateTableOriginalColumns(outputTable);
updateTableOriginalColumns(inputTable);
designerCoreService.setTraceFilterParameters(outputNode, outputTable, preOutputColumnSet, changedNameColumnsForOutput);
designerCoreService.setTraceFilterParameters(inputNode, inputTable, preInputColumnSet, changedNameColumnsForInput);
if (outputTable != null && inputTable != null) {
@@ -745,6 +747,16 @@ public class MetadataDialog extends Dialog {
}
}
}
private void updateTableOriginalColumns(IMetadataTable table) {
if (table != null && table.getListColumns() != null) {
List<String> columnNames = new ArrayList<String>();
for (IMetadataColumn column : table.getListColumns()) {
columnNames.add(column.getLabel());
}
table.setOriginalColumns(columnNames);
}
}
/**
* DOC wzhang Comment method "getPreColumnsSet".

View File

@@ -18,9 +18,9 @@ import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.gef.commands.Command;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI;
import org.talend.commons.exception.PersistenceException;
import org.talend.commons.ui.gmf.util.DisplayUtils;
import org.talend.commons.ui.swt.extended.table.ExtendedTableModel;
import org.talend.core.model.metadata.IMetadataColumn;
import org.talend.core.model.metadata.IMetadataTable;
@@ -43,6 +43,7 @@ import org.talend.cwm.helper.PackageHelper;
import org.talend.repository.model.IMetadataService;
import org.talend.repository.model.IProxyRepositoryFactory;
import org.talend.repository.model.RepositoryNode;
import orgomg.cwm.objectmodel.core.Package;
/**
@@ -92,8 +93,8 @@ public class SaveAsGenericSchemaCommand extends Command {
if (metadataService == null) {
return;
}
WizardDialog dialog = metadataService.getGenericSchemaWizardDialog(new Shell(), PlatformUI.getWorkbench(), false,
null, null, true);
WizardDialog dialog = metadataService.getGenericSchemaWizardDialog(DisplayUtils.getDefaultShell(false),
PlatformUI.getWorkbench(), false, null, null, true);
dialog.setPageSize(WIZARD_WIDTH, WIZARD_HEIGHT);
dialog.create();
Property property = null;

View File

@@ -0,0 +1,652 @@
package org.talend.core.ui.preference;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.lang.reflect.InvocationTargetException;
import java.net.URL;
import java.nio.channels.FileChannel;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Properties;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.adaptor.EclipseStarter;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.preference.FieldEditor;
import org.eclipse.jface.preference.FieldEditorPreferencePage;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
import org.eclipse.ui.PlatformUI;
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
import org.talend.commons.ui.runtime.utils.ZipFileUtils;
import org.talend.commons.ui.swt.advanced.dataeditor.LabelFieldEditor;
import org.talend.commons.ui.utils.workbench.preferences.OneLineComboFieldEditor;
import org.talend.commons.utils.VersionUtils;
import org.talend.core.CorePlugin;
import org.talend.core.model.genhtml.FileCopyUtils;
import org.talend.core.prefs.ITalendCorePrefConstants;
import org.talend.core.ui.i18n.Messages;
public abstract class I18nPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
private OneLineComboFieldEditor languageSelectionEditor;
private String fs = System.getProperties().getProperty("file.separator"); //$NON-NLS-1$
private List<FieldEditor> fields = new ArrayList<FieldEditor>();
private static Logger log = Logger.getLogger(I18nPreferencePage.class);
private static final Pattern VERSION_PATTERN = Pattern.compile("(\\d+)\\.(\\d+)\\.(\\d+)(\\.(RC|M)\\d+)?_r\\d+"); //$NON-NLS-1$
private static final Pattern DEFAULT_PATTERN = Pattern.compile("(\\d+)\\.(\\d+)\\.*(\\d*)"); //$NON-NLS-1$
private boolean updateCompleted;
private boolean isBabiliButtonClicked = false;
/**
* Construct a new I18nPreferencePage.
*/
public I18nPreferencePage() {
super(GRID);
// Set the preference store for the preference page.
IPreferenceStore store = CorePlugin.getDefault().getPreferenceStore();
setPreferenceStore(store);
}
@Override
public void init(IWorkbench workbench) {
// nothing to do
}
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
*/
@Override
protected void createFieldEditors() {
// Adds a combo for language selection.
String spanish = "Espa\u00F1ol"; //$NON-NLS-1$
byte[] utf8Bytes;
try {
utf8Bytes = spanish.getBytes("UTF8"); //$NON-NLS-1$
spanish = new String(utf8Bytes, "UTF8"); //$NON-NLS-1$
} catch (UnsupportedEncodingException e1) {
// could be translated, but it's only in case of error when change UTF8 characters.
spanish = "Spanish"; //$NON-NLS-1$
}
String russian = "\u0420\u0443\u0441\u0441\u043A\u0438\u0439"; //$NON-NLS-1$
try {
utf8Bytes = russian.getBytes("UTF8"); //$NON-NLS-1$
russian = new String(utf8Bytes, "UTF8"); //$NON-NLS-1$
} catch (UnsupportedEncodingException e1) {
// could be translated, but it's only in case of error when change UTF8 characters.
russian = "Russian"; //$NON-NLS-1$
}
String greek = "\u0395\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ac"; //$NON-NLS-1$
try {
utf8Bytes = greek.getBytes("UTF8"); //$NON-NLS-1$
greek = new String(utf8Bytes, "UTF8"); //$NON-NLS-1$
} catch (UnsupportedEncodingException e1) {
// could be translated, but it's only in case of error when change UTF8 characters.
greek = "Greek"; //$NON-NLS-1$
}
String arabic = "\u0627\u0644\u0639\u0631\u0628\u064a\u0647"; //$NON-NLS-1$
try {
utf8Bytes = arabic.getBytes("UTF8"); //$NON-NLS-1$
arabic = new String(utf8Bytes, "UTF8"); //$NON-NLS-1$
} catch (UnsupportedEncodingException e1) {
// could be translated, but it's only in case of error when change UTF8 characters.
arabic = "Arabic"; //$NON-NLS-1$
}
String serbian = "\u0421\u0440\u043f\u0441\u043a\u0438"; //$NON-NLS-1$
try {
utf8Bytes = serbian.getBytes("UTF8"); //$NON-NLS-1$
serbian = new String(utf8Bytes, "UTF8"); //$NON-NLS-1$
} catch (UnsupportedEncodingException e1) {
// could be translated, but it's only in case of error when change UTF8 characters.
serbian = "Serbian"; //$NON-NLS-1$
}
String[][] entryNamesAndValues =
{ { Locale.ENGLISH.getDisplayLanguage(Locale.ENGLISH), Locale.ENGLISH.getLanguage() },
{ Locale.FRENCH.getDisplayLanguage(Locale.FRENCH), Locale.FRENCH.getLanguage() },
{ Locale.CHINESE.getDisplayLanguage(Locale.CHINESE), "zh_CN" },
{ Locale.GERMAN.getDisplayLanguage(Locale.GERMAN), Locale.GERMAN.getLanguage() },
{ Locale.JAPANESE.getDisplayLanguage(Locale.JAPANESE), Locale.JAPANESE.getLanguage() },
{ Locale.ITALIAN.getDisplayLanguage(Locale.ITALIAN), Locale.ITALIAN.getLanguage() },
{ "Brasil", "pt_BR" }, //$NON-NLS-1$ //$NON-NLS-2$
{ spanish, "es" }, { russian, "ru" }, //$NON-NLS-1$ //$NON-NLS-2$
{ Locale.KOREA.getDisplayLanguage(Locale.KOREA), "kr" }, { "Turkish", "tr" }, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
{ greek, "el" }, { "Hrvatski", "hr" }, { arabic, "ar" }, { serbian, "sr" }, { "Polski", "pl" },
{ "Romanian", "ro" }, { "Netherlands", "nl" } }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
// // /$NON-NLS-7$
languageSelectionEditor = new OneLineComboFieldEditor(ITalendCorePrefConstants.LANGUAGE_SELECTOR,
Messages.getString("I18nPreferencePage.needRestart"), entryNamesAndValues, getFieldEditorParent()); //$NON-NLS-1$
addField(languageSelectionEditor);
Composite composite = getFieldEditorParent();
LabelFieldEditor importAll =
new LabelFieldEditor(Messages.getString("I18nPreferencePage.translationInformation"), //$NON-NLS-1$
composite);
addField(importAll);
Button allUpdate = new Button(composite, SWT.FLAT);
allUpdate.setText(Messages.getString("I18nPreferencePage.importBabili")); //$NON-NLS-1$
allUpdate.setLayoutData(new GridData());
allUpdate.addSelectionListener(new SelectionListener() {
@Override
public void widgetSelected(SelectionEvent e) {
// import all update from Babili
// select the .zip file
FileDialog fd =
new FileDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), SWT.OPEN);
fd.setText("Open"); //$NON-NLS-1$
fd.setFilterPath("C:" + fs); //$NON-NLS-1$
String[] filterExtensions = { "*.zip" }; //$NON-NLS-1$
fd.setFilterExtensions(filterExtensions);
String selected = fd.open();
if (selected != null) {
isBabiliButtonClicked = true;
runProgressMonitorDialog(selected);
if (MessageDialog
.openConfirm(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
Messages.getString("I18nPreferencePage.restart"), //$NON-NLS-1$
Messages.getString("I18nPreferencePage.restartButton"))) {
PlatformUI.getWorkbench().restart();
}
}
}
@Override
public void widgetDefaultSelected(SelectionEvent e) {
// Nothing to do
}
});
// added by nma
Button restoredefault = new Button(composite, SWT.FLAT);
restoredefault.setText("Restore Defaults"); //$NON-NLS-1$
restoredefault.setLayoutData(new GridData());
restoredefault.addSelectionListener(new SelectionListener() {
@Override
public void widgetDefaultSelected(SelectionEvent e) {
// Nothing to do
}
@Override
public void widgetSelected(SelectionEvent e) {
isBabiliButtonClicked = true;
runProgressMonitorDialog(Messages.getString("I18nPreferencePage.restoreDefault")); //$NON-NLS-1$
if (MessageDialog
.openConfirm(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
Messages.getString("I18nPreferencePage.restart"),
Messages.getString("I18nPreferencePage.restartButton"))) {
PlatformUI.getWorkbench().restart();
}
}
});
}
private void applyBabiliResource(String zipFileName) {
String jarFolderPath = System.getProperty("user.dir") + fs + "jarTemp"; //$NON-NLS-1$ //$NON-NLS-2$
String zipFolderPath = System.getProperty("user.dir") + fs + "zipTemp"; //$NON-NLS-1$ //$NON-NLS-2$
File jarFolderPathFile = new File(jarFolderPath);
File zipFolderPathFile = new File(zipFolderPath);
if (!jarFolderPathFile.exists()) {
jarFolderPathFile.mkdir();
}
if (!zipFolderPathFile.exists()) {
zipFolderPathFile.mkdir();
}
String pluginPath = System.getProperty("user.dir") + fs + "plugins"; //$NON-NLS-1$ //$NON-NLS-2$
HashMap jarFileMap = new HashMap();
File file = new File(pluginPath);
if (file.isDirectory()) {
String[] fileNameList = file.list();
final int length = fileNameList.length;
File[] fileList = file.listFiles();
final int length2 = fileList.length;
for (File f : fileList) {
if (f.getName().startsWith("net.sourceforge.sqlexplorer.nl")) { //$NON-NLS-1$
jarFileMap.put("net.sourceforge.sqlexplorer.nl", f); //$NON-NLS-1$
}
if (f.getName().startsWith("org.talend.designer.components.localprovider")) { //$NON-NLS-1$
jarFileMap.put("org.talend.designer.components.localprovider", f); //$NON-NLS-1$
}
if (f.getName().startsWith("org.talend.designer.components.tdqprovider")) { //$NON-NLS-1$
jarFileMap.put("org.talend.designer.components.tdqprovider", f); //$NON-NLS-1$
}
if (f.getName().startsWith("org.talend.designer.components.tisprovider")) { //$NON-NLS-1$
jarFileMap.put("org.talend.designer.components.tisprovider", f); //$NON-NLS-1$
}
if (f.getName().startsWith("org.talend.designer.components.tispeprovider")) { //$NON-NLS-1$
jarFileMap.put("org.talend.designer.components.tispeprovider", f); //$NON-NLS-1$
}
if (f.getName().endsWith(".jar") && f.getName().indexOf("nl") != -1 //$NON-NLS-1$ //$NON-NLS-2$
&& f.getName().indexOf("talend") != -1) { //$NON-NLS-1$
String[] fileNameArr = f.getName().split("_"); //$NON-NLS-1$
jarFileMap.put(fileNameArr[0], f);
}
}
}
if (zipFileName.equals("Restore default")) { //$NON-NLS-1$
Iterator iter = jarFileMap.entrySet().iterator();
while (iter.hasNext()) {
Map.Entry entry = (Map.Entry) iter.next();
Object key = entry.getKey();
File currentFileToBak = (File) entry.getValue();
if (key.toString().endsWith(".nl") //$NON-NLS-1$
|| key.toString().startsWith("org.talend.designer.components.localprovider") //$NON-NLS-1$
|| key.toString().startsWith("org.talend.designer.components.tdqprovider") //$NON-NLS-1$
|| key.toString().startsWith("org.talend.designer.components.tisprovider") //$NON-NLS-1$
|| key.toString().startsWith("org.talend.designer.components.tispeprovider") //$NON-NLS-1$
|| key.toString().startsWith("net.sourceforge.sqlexplorer.nl")) { //$NON-NLS-1$
if (currentFileToBak.toString().endsWith(".jar")) { //$NON-NLS-1$
ZipFileUtils.unZip(currentFileToBak, jarFolderPath + fs + currentFileToBak.getName());
} else {
FileCopyUtils
.copyFolder(currentFileToBak.getAbsolutePath(),
jarFolderPath + fs + currentFileToBak.getName());
}
File jarFiles = new File(jarFolderPath + fs + currentFileToBak.getName());
File[] jarSubFiles = jarFiles.listFiles();
for (File subJarf : jarSubFiles) {
if (subJarf.isFile()) {
if (subJarf.getName().endsWith(".original")) { //$NON-NLS-1$
String subjarfPath = subJarf
.getAbsolutePath()
.substring(0, subJarf.getAbsolutePath().indexOf(".original")); //$NON-NLS-1$
File subjarfPathFile = new File(subjarfPath);
if (subjarfPathFile.exists()) {
subjarfPathFile.delete();
}
subJarf.renameTo(subjarfPathFile);
}
} else {
if (subJarf.getName().equals("components")) { //$NON-NLS-1$
File[] componentFiles = subJarf.listFiles();
for (File componentFile : componentFiles) {
if (componentFile.isDirectory()) {
File[] comFiles = componentFile.listFiles();
if (comFiles != null) {
for (File com : comFiles) {
if (com.isFile() && com.getName().endsWith(".original")) { //$NON-NLS-1$
String comPath = com
.getAbsolutePath()
.substring(0, com.getAbsolutePath().indexOf(".original")); //$NON-NLS-1$
File comPathFile = new File(comPath);
if (comPathFile.exists()) {
comPathFile.delete();
}
com.renameTo(comPathFile);
}
}
}
}
}
}
}
}
String writeJarFileName = jarFolderPath + fs + currentFileToBak.getName();
if (currentFileToBak.exists()) {
if (currentFileToBak.isDirectory()) {
try {
org.apache.commons.io.FileUtils.deleteDirectory(currentFileToBak);
} catch (IOException e) {
e.printStackTrace();
}
} else {
currentFileToBak.delete();
}
}
if (currentFileToBak.toString().endsWith(".jar")) { //$NON-NLS-1$
ZipFileUtils.zip(writeJarFileName, currentFileToBak.getAbsolutePath(), false);
} else {
FileCopyUtils.copyFolder(writeJarFileName, currentFileToBak.getAbsolutePath());
}
}
}
} else {
ZipFileUtils.unZip(zipFileName, zipFolderPath);
File zipFile = new File(zipFolderPath);
File[] zipFiles = zipFile.listFiles()[0].listFiles();
for (File f : zipFiles) {
if (f.getName().endsWith(".nl") //$NON-NLS-1$
|| f.getName().startsWith("org.talend.designer.components.localprovider") //$NON-NLS-1$
|| f.getName().startsWith("org.talend.designer.components.tdqprovider") //$NON-NLS-1$
|| f.getName().startsWith("org.talend.designer.components.tisprovider") //$NON-NLS-1$
|| f.getName().startsWith("org.talend.designer.components.tispeprovider") //$NON-NLS-1$
|| f.getName().startsWith("net.sourceforge.sqlexplorer.nl")) { //$NON-NLS-1$
File writeJarFile = (File) jarFileMap.get(f.getName());
if (writeJarFile == null) {
continue;
}
String jarFilePath = writeJarFile.getAbsolutePath();
// for bug 13620
if (writeJarFile.toString().endsWith(".jar")) {//$NON-NLS-1$
ZipFileUtils.unZip(writeJarFile, jarFolderPath + fs + writeJarFile.getName());
} else {
FileCopyUtils.copyFolder(jarFilePath, jarFolderPath + fs + writeJarFile.getName());
}
File[] zipSubFiles = f.listFiles();
File jarFiles = new File(jarFolderPath + fs + writeJarFile.getName());
File[] jarSubFiles = jarFiles.listFiles();
boolean flag = false;
boolean componentFlag = false;
for (File subJarf : jarSubFiles) {
if (subJarf.isFile()) {
if (subJarf.getName().endsWith(".original")) { //$NON-NLS-1$
flag = true;
break;
}
} // specific bug if .properties for components, since structure of babili resource is different
// with local plugin
else {
if (subJarf.getName().equals("components")) { //$NON-NLS-1$
File[] componentFiles = subJarf.listFiles();
if (componentFiles != null) {
for (File componentFile : componentFiles) {
if (componentFile.isDirectory()) {
File[] comFiles = componentFile.listFiles();
if (comFiles != null) {
for (File com : comFiles) {
if (com.getName().endsWith(".original")) { //$NON-NLS-1$
componentFlag = true;
break;
}
}
}
}
}
}
}
}
}
for (File subf : zipSubFiles) {
boolean subfNotExistBool = true;
for (File subJarf : jarSubFiles) {
if (subJarf.isDirectory() && subJarf.getName().equals("components")) { //$NON-NLS-1$
if (subf.getName().startsWith("t") && subf.getName().endsWith(".properties")) { //$NON-NLS-1$ //$NON-NLS-2$
File[] componentFiles = subJarf.listFiles();
for (File componentFile : componentFiles) {
if (componentFile
.getName()
.equals(subf.getName().substring(0, subf.getName().indexOf("_")))) { //$NON-NLS-1$
File[] comFiles = componentFile.listFiles();
if (comFiles != null) {
for (File com : comFiles) {
if (subf.getName().equals(com.getName())) {
transferFile(subf, com, componentFlag);
subfNotExistBool = false;
break;
}
}
}
}
}
}
} else {
if (subf.getName().equals(subJarf.getName())) {
transferFile(subf, subJarf, flag);
subfNotExistBool = false;
break;
}
}
}
}
String writeJarFileName = jarFolderPath + fs + writeJarFile.getName();
writeJarFile.delete();
if (writeJarFileName.endsWith(".jar")) {//$NON-NLS-1$
ZipFileUtils.zip(writeJarFileName, jarFilePath, false);
} else {
FileCopyUtils.copyFolder(writeJarFileName, jarFilePath);
}
}
}
}
updateCompleted = true;
try {
if (zipFolderPathFile.exists()) {
org.apache.commons.io.FileUtils.deleteDirectory(zipFolderPathFile);
}
if (jarFolderPathFile.exists()) {
org.apache.commons.io.FileUtils.deleteDirectory(jarFolderPathFile);
}
} catch (IOException e) {
ExceptionHandler.process(e);
}
}
private void transferFile(File sourceFile, File targetFile, boolean changed) {
String targetPath = targetFile.getAbsolutePath();
File newTargetFile = new File(targetPath + ".original"); //$NON-NLS-1$
if (!newTargetFile.exists() && changed == false) {
targetFile.renameTo(newTargetFile);
}
transferStream(sourceFile, targetFile);
}
private void transferStream(File sourceFile, File targetFile) {
if (!sourceFile.exists()) {
return;
}
try {
FileChannel sourceChannel = new FileInputStream(sourceFile.getAbsoluteFile()).getChannel();
FileChannel targetChannel = new FileOutputStream(targetFile.getAbsoluteFile()).getChannel();
targetChannel.transferFrom(sourceChannel, 0, sourceChannel.size());
sourceChannel.close();
targetChannel.close();
} catch (IOException e) {
e.printStackTrace();
}
}
/**
*
* DOC wzhang Comment method "runProgressMonitorDialog".
*
* @param validated
*/
public void runProgressMonitorDialog(final String zipFileName) {
updateCompleted = false;
ProgressMonitorDialog progressDialog = new ProgressMonitorDialog(getFieldEditorParent().getShell());
IRunnableWithProgress runnable = new IRunnableWithProgress() {
@Override
public void run(IProgressMonitor monitor) {
try {
monitor.beginTask(Messages.getString("I18nPreferencePage.wait_process"), IProgressMonitor.UNKNOWN); //$NON-NLS-1$
applyBabiliResource(zipFileName);
} catch (Exception e1) {
ExceptionHandler.process(e1);
} finally {
monitor.done();
}
}
};
try {
progressDialog.run(true, true, runnable);
} catch (InvocationTargetException e1) {
ExceptionHandler.process(e1);
} catch (InterruptedException e1) {
ExceptionHandler.process(e1);
}
if (updateCompleted) {
} else {
}
}
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.preference.FieldEditorPreferencePage#performOk()
*/
@Override
public boolean performOk() {
boolean ok = super.performOk();
saveLanguageType();
CorePlugin.getDefault().savePluginPreferences();
if (isBabiliButtonClicked) {
refreshAll();
}
return ok;
}
abstract protected void refreshAll();
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.preference.PreferencePage#performApply()
*/
@Override
protected void performApply() {
saveLanguageType();
CorePlugin.getDefault().savePluginPreferences();
}
/**
*
* DOC wzhang Comment method "saveLanguageType".
*/
private void saveLanguageType() {
FileInputStream fin = null;
FileOutputStream fout = null;
try {
URL url = Platform.getConfigurationLocation().getURL();
log(url.getFile());
Properties p = new Properties();
// load the file configuration/config.ini
File iniFile = new File(url.getFile(), "config.ini"); //$NON-NLS-1$
fin = new FileInputStream(iniFile);
p.load(fin);
String languageType = CorePlugin
.getDefault()
.getPluginPreferences()
.getString(ITalendCorePrefConstants.LANGUAGE_SELECTOR);
if (languageType.equals(p.getProperty(EclipseStarter.PROP_NL))) {
return;
}
p.setProperty(EclipseStarter.PROP_NL, languageType);
fout = new FileOutputStream(iniFile);
p.store(fout, "#Configuration File"); //$NON-NLS-1$
fout.flush();
} catch (Exception e) {
ExceptionHandler.process(e);
} finally {
if (fin != null) {
try {
fin.close();
} catch (Exception e) {
// do nothing
}
}
if (fout != null) {
try {
fout.close();
} catch (Exception e) {
// do nothing
}
}
}
}
/**
*
* DOC wzhang Comment method "getCurrentTosVersion".
*
* @param normalize
* @return
*/
public static String getCurrentTosVersion(boolean normalize) {
String version = VersionUtils.getVersion();
if (normalize) {
version = normalizeVersion(version);
}
return version;
}
/**
*
* DOC wzhang Comment method "normalizeVersion".
*
* @param version
* @return
*/
public static String normalizeVersion(String version) {
Matcher matcher = VERSION_PATTERN.matcher(version);
if (matcher.matches()) {
String str = version.substring(0, version.indexOf("_r")); //$NON-NLS-1$
return str.replaceAll("\\.RC", "RC").replaceAll("\\.M", "M"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
} else {
// try again, ignore M, RC
matcher = DEFAULT_PATTERN.matcher(version);
matcher.find();
return matcher.group();
}
}
private void log(String s) {
log.log(Level.INFO, s);
}
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.preference.FieldEditorPreferencePage#addField(org.eclipse.jface.preference.FieldEditor)
*/
@Override
protected void addField(FieldEditor editor) {
super.addField(editor);
fields.add(editor);
}
}

View File

@@ -1,4 +1,5 @@
Manifest-Version: 1.0
Automatic-Module-Name: org.talend.core
Bundle-ManifestVersion: 2
Bundle-Name: Core Plug-in
Bundle-SymbolicName: org.talend.core;singleton:=true
@@ -13,14 +14,13 @@ Require-Bundle: org.eclipse.debug.core,
org.apache.commons.lang,
org.apache.commons.collections,
org.apache.log4j,
org.talend.libraries.dom4j-jaxen,
org.eclipse.jface,
org.talend.common.ui.runtime,
org.talend.metadata.managment,
org.talend.libraries.apache,
org.talend.model,
org.talend.core.runtime;visibility:=reexport,
org.talend.core.repository,
org.eclipse.jface,
org.talend.libraries.apache,
org.talend.core.runtime,
org.talend.utils
Bundle-Vendor: .Talend SA.
Export-Package: org.talend.core,
@@ -53,3 +53,6 @@ Export-Package: org.talend.core,
org.talend.core.services.resource,
org.talend.core.views,
org.talend.designer.runprocess
Import-Package: org.apache.commons.collections4.map,
org.dom4j,
org.dom4j.io

View File

@@ -494,6 +494,10 @@ public class TalendTextUtils {
return PASS_COVER;
}
public static String escapeJavaText(final String text) {
return StringEscapeUtils.escapeJava(text);
}
public static String filterSpecialChar(String input) { // for 8115
if (input != null && !"".equals(input)) {
for (int i = 0; i < input.length();) {

View File

@@ -167,6 +167,8 @@ public class ProcessorUtilities {
private static boolean isDebug = false;
private static JobInfo mainJobInfo;
public static void addOpenEditor(IEditorPart editor) {
openedEditors.add(editor);
}
@@ -435,6 +437,7 @@ public class ProcessorUtilities {
isMainJob = true;
codeModified = false;
mainJobInfo = jobInfo;
// this cache only keep the last main job's generation, so clear it since we regenerate a new job.
LastGenerationInfo.getInstance().getLastGeneratedjobs().clear();
@@ -507,7 +510,7 @@ public class ProcessorUtilities {
mainRelation.setId(jobInfo.getJobId());
mainRelation.setVersion(jobInfo.getJobVersion());
mainRelation.setType(RelationshipItemBuilder.JOB_RELATION);
hasLoopDependency = checkLoopDependencies(mainRelation);
hasLoopDependency = checkLoopDependencies(mainRelation, new HashMap<String, String>());
// clean the previous code in case it has deleted subjob
cleanSourceFolder(progressMonitor, currentProcess, processor);
}
@@ -607,28 +610,29 @@ public class ProcessorUtilities {
return processor;
}
private static boolean checkLoopDependencies(Relation mainJobInfo) throws ProcessorException {
List<Relation> itemsJobRelatedTo = getItemsRelation(mainJobInfo);
private static boolean checkLoopDependencies(Relation mainJobInfo, Map<String, String> idToLastestVersionMap)
throws ProcessorException {
List<Relation> itemsJobRelatedTo = getItemsRelation(mainJobInfo, idToLastestVersionMap);
List<Relation> relationChecked = new ArrayList<>();
relationChecked.add(mainJobInfo);
return checkLoopDependencies(mainJobInfo, itemsJobRelatedTo, relationChecked);
return checkLoopDependencies(mainJobInfo, itemsJobRelatedTo, relationChecked, idToLastestVersionMap);
}
private static boolean checkLoopDependencies(Relation mainRelation, List<Relation> itemsJobRelatedTo,
List<Relation> relationChecked) throws ProcessorException {
List<Relation> relationChecked, Map<String, String> idToLastestVersionMap) throws ProcessorException {
boolean hasDependency = false;
for (Relation relation : itemsJobRelatedTo) {
hasDependency = relation.getId().equals(mainRelation.getId())
&& relation.getVersion().equals(mainRelation.getVersion());
if (!hasDependency) {
List<Relation> itemsChildJob = getItemsRelation(relation);
List<Relation> itemsChildJob = getItemsRelation(relation, idToLastestVersionMap);
if (!relationChecked.contains(relation)) {
relationChecked.add(relation);
hasDependency = checkLoopDependencies(mainRelation, itemsChildJob, relationChecked);
hasDependency = checkLoopDependencies(mainRelation, itemsChildJob, relationChecked, idToLastestVersionMap);
}
if (!hasDependency) {
for (Relation childRelation : itemsChildJob) {
hasDependency = checkLoopDependencies(childRelation);
hasDependency = checkLoopDependencies(childRelation, idToLastestVersionMap);
if (hasDependency) {
break;
}
@@ -643,7 +647,7 @@ public class ProcessorUtilities {
return hasDependency;
}
private static List<Relation> getItemsRelation(Relation mainJobInfo) throws ProcessorException {
private static List<Relation> getItemsRelation(Relation mainJobInfo, Map<String, String> idToLastestVersionMap) throws ProcessorException {
List<Relation> itemsJobRelatedTo = new ArrayList<Relation>();
try {
List<Project> allProjects = new ArrayList<Project>();
@@ -657,12 +661,17 @@ public class ProcessorUtilities {
mainJobInfo.getType(), RelationshipItemBuilder.JOBLET_RELATION));
for (Relation relation : itemsJobRelatedTo) {
if (relation.getVersion().equals(RelationshipItemBuilder.LATEST_VERSION)) {
for (Project project : allProjects) {
IRepositoryViewObject lastVersion =
ProxyRepositoryFactory.getInstance().getLastVersion(project, relation.getId());
if (lastVersion != null) {
relation.setVersion(lastVersion.getVersion());
break;
if (idToLastestVersionMap.containsKey(relation.getId())) {
relation.setVersion(idToLastestVersionMap.get(relation.getId()));
} else {
for (Project project : allProjects) {
IRepositoryViewObject lastVersion =
ProxyRepositoryFactory.getInstance().getLastVersion(project, relation.getId());
if (lastVersion != null) {
relation.setVersion(lastVersion.getVersion());
idToLastestVersionMap.put(relation.getId(), relation.getVersion());
break;
}
}
}
}
@@ -954,6 +963,7 @@ public class ProcessorUtilities {
if (jobInfo.getFatherJobInfo() == null) {
isMainJob = true;
codeModified = false;
mainJobInfo = jobInfo;
// this cache only keep the last main job's generation, so clear it since we regenerate a new job.
LastGenerationInfo.getInstance().getLastGeneratedjobs().clear();
@@ -1021,7 +1031,7 @@ public class ProcessorUtilities {
mainRelation.setId(jobInfo.getJobId());
mainRelation.setVersion(jobInfo.getJobVersion());
mainRelation.setType(RelationshipItemBuilder.JOB_RELATION);
hasLoopDependency = checkLoopDependencies(mainRelation);
hasLoopDependency = checkLoopDependencies(mainRelation, new HashMap<String, String>());
// clean the previous code in case it has deleted subjob
cleanSourceFolder(progressMonitor, currentProcess, processor);
}
@@ -1621,10 +1631,12 @@ public class ProcessorUtilities {
jobList.clear();
esbJobs.clear();
hasLoopDependency = false;
mainJobInfo = null;
JobInfo jobInfo = new JobInfo(processName, contextName, version);
IProcessor process = generateCode(jobInfo, contextName, statistics, trace, true, GENERATE_ALL_CHILDS, monitor);
jobList.clear();
hasLoopDependency = false;
mainJobInfo = null;
return process;
}
@@ -1647,9 +1659,11 @@ public class ProcessorUtilities {
jobList.clear();
esbJobs.clear();
hasLoopDependency = false;
mainJobInfo = null;
IProcessor process = generateCode(jobInfo, contextName, statistics, trace, true, GENERATE_ALL_CHILDS, monitor);
jobList.clear();
hasLoopDependency = false;
mainJobInfo = null;
return process;
}
@@ -1667,9 +1681,11 @@ public class ProcessorUtilities {
jobList.clear();
esbJobs.clear();
hasLoopDependency = false;
mainJobInfo = null;
IProcessor result = generateCode(jobInfo, contextName, statistics, trace, true, GENERATE_ALL_CHILDS, monitor);
jobList.clear();
hasLoopDependency = false;
mainJobInfo = null;
return result;
}
@@ -1687,10 +1703,12 @@ public class ProcessorUtilities {
jobList.clear();
esbJobs.clear();
hasLoopDependency = false;
mainJobInfo = null;
IProcessor result =
generateCode(jobInfo, contextName, statistics, trace, needContext, GENERATE_ALL_CHILDS, monitor);
jobList.clear();
hasLoopDependency = false;
mainJobInfo = null;
return result;
}
@@ -1717,9 +1735,11 @@ public class ProcessorUtilities {
jobList.clear();
esbJobs.clear();
hasLoopDependency = false;
mainJobInfo = null;
IProcessor result = generateCode(jobInfo, contextName, statistics, trace, needContext, option, monitor);
jobList.clear();
hasLoopDependency = false;
mainJobInfo = null;
return result;
}
@@ -1740,9 +1760,11 @@ public class ProcessorUtilities {
jobList.clear();
esbJobs.clear();
hasLoopDependency = false;
mainJobInfo = null;
result = generateCode(jobInfo, contextName, statistics, trace, true, GENERATE_ALL_CHILDS, monitor);
jobList.clear();
hasLoopDependency = false;
mainJobInfo = null;
}
return result;
}
@@ -1752,9 +1774,11 @@ public class ProcessorUtilities {
jobList.clear();
esbJobs.clear();
hasLoopDependency = false;
mainJobInfo = null;
IProcessor returnValue = generateCode(process, contextName, statistics, trace, false);
jobList.clear();
hasLoopDependency = false;
mainJobInfo = null;
return returnValue;
}
@@ -1786,10 +1810,12 @@ public class ProcessorUtilities {
jobList.clear();
esbJobs.clear();
hasLoopDependency = false;
mainJobInfo = null;
IProcessor genCode = generateCode(jobInfo, context.getName(), statistics, trace, contextProperties,
GENERATE_ALL_CHILDS, new NullProgressMonitor());
jobList.clear();
hasLoopDependency = false;
mainJobInfo = null;
return genCode;
}
@@ -1798,10 +1824,12 @@ public class ProcessorUtilities {
jobList.clear();
esbJobs.clear();
hasLoopDependency = false;
mainJobInfo = null;
IProcessor returnValue =
generateCode(process, context, statistics, trace, properties, new NullProgressMonitor());
jobList.clear();
hasLoopDependency = false;
mainJobInfo = null;
return returnValue;
}
@@ -1833,10 +1861,12 @@ public class ProcessorUtilities {
jobList.clear();
esbJobs.clear();
hasLoopDependency = false;
mainJobInfo = null;
IProcessor genCode = generateCode(jobInfo, context.getName(), statistics, trace, properties,
GENERATE_ALL_CHILDS, progressMonitor);
jobList.clear();
hasLoopDependency = false;
mainJobInfo = null;
return genCode;
}
@@ -1882,10 +1912,12 @@ public class ProcessorUtilities {
jobList.clear();
esbJobs.clear();
hasLoopDependency = false;
mainJobInfo = null;
IProcessor genCode = generateCode(processor, jobInfo, context.getName(), statistics, trace, properties,
GENERATE_ALL_CHILDS, progressMonitor);
jobList.clear();
hasLoopDependency = false;
mainJobInfo = null;
TimeMeasure.end(timeMeasureGenerateCodesId);
// if active before, not disable and active still.
@@ -1912,10 +1944,12 @@ public class ProcessorUtilities {
jobList.clear();
esbJobs.clear();
hasLoopDependency = false;
mainJobInfo = null;
IProcessor genCode = generateCode(jobInfo, context.getName(), statistics, trace, properties, option,
new NullProgressMonitor());
jobList.clear();
hasLoopDependency = false;
mainJobInfo = null;
return genCode;
}
@@ -2175,7 +2209,7 @@ public class ProcessorUtilities {
EList<NodeType> nodes = ptype.getNode();
String jobletPaletteType = null;
String frameWork = ptype.getFramework();
if (frameWork == null) {
if (StringUtils.isBlank(frameWork)) {
jobletPaletteType = ComponentCategory.CATEGORY_4_DI.getName();
} else if (frameWork.equals(HadoopConstants.FRAMEWORK_SPARK)) {
jobletPaletteType = ComponentCategory.CATEGORY_4_SPARK.getName();
@@ -2462,6 +2496,15 @@ public class ProcessorUtilities {
return hasLoopDependency;
}
/**
* Getter for mainJobInfo. <font color="red">Need to check null</font>
*
* @return the mainJobInfo
*/
public static JobInfo getMainJobInfo() {
return mainJobInfo;
}
/**
* The dynamic loading of the hadoop configuration library is supported in DI, MapReduce and Spark (batch and
* streaming).

View File

@@ -1,5 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry exported="true" kind="lib" path="lib/commons-codec.jar"/>
<classpathentry exported="true" kind="lib" path="lib/httpclient.jar"/>
<classpathentry exported="true" kind="lib" path="lib/httpcore.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jcl-over-slf4j.jar"/>
<classpathentry exported="true" kind="lib" path="lib/maven-resolver-api.jar"/>
<classpathentry exported="true" kind="lib" path="lib/maven-resolver-connector-basic.jar"/>
<classpathentry exported="true" kind="lib" path="lib/maven-resolver-impl.jar"/>
<classpathentry exported="true" kind="lib" path="lib/maven-resolver-spi.jar"/>
<classpathentry exported="true" kind="lib" path="lib/maven-resolver-transport-classpath.jar"/>
<classpathentry exported="true" kind="lib" path="lib/maven-resolver-transport-file.jar"/>
<classpathentry exported="true" kind="lib" path="lib/maven-resolver-transport-http.jar"/>
<classpathentry exported="true" kind="lib" path="lib/maven-resolver-transport-wagon.jar"/>
<classpathentry exported="true" kind="lib" path="lib/maven-resolver-util.jar"/>
<classpathentry exported="true" kind="lib" path="lib/plexus-utils.jar"/>
<classpathentry exported="true" kind="lib" path="lib/slf4j-api.jar"/>
<classpathentry exported="true" kind="lib" path="lib/wagon-provider-api.jar"/>
<classpathentry exported="true" kind="lib" path="lib/maven-aether-provider-3.2.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/maven-model-3.2.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/maven-model-builder-3.2.1.jar"/>

View File

@@ -5,13 +5,6 @@ Bundle-SymbolicName: org.talend.designer.maven.aether
Bundle-Version: 7.2.1.qualifier
Bundle-Activator: org.talend.designer.maven.aether.Activator
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.aether.api,
org.eclipse.aether.connector.basic,
org.eclipse.aether.impl,
org.eclipse.aether.spi,
org.eclipse.aether.transport.file,
org.eclipse.aether.transport.http,
org.eclipse.aether.util,
org.talend.libraries.jackson,
org.talend.core.runtime
Bundle-ActivationPolicy: lazy
@@ -21,7 +14,23 @@ Bundle-ClassPath: .,
lib/maven-model-builder-3.2.1.jar,
lib/maven-repository-metadata-3.2.1.jar,
lib/plexus-interpolation-1.19.jar,
lib/plexus-utils-3.0.17.jar
lib/plexus-utils-3.0.17.jar,
lib/commons-codec.jar,
lib/httpclient.jar,
lib/httpcore.jar,
lib/jcl-over-slf4j.jar,
lib/maven-resolver-api.jar,
lib/maven-resolver-connector-basic.jar,
lib/maven-resolver-impl.jar,
lib/maven-resolver-spi.jar,
lib/maven-resolver-transport-classpath.jar,
lib/maven-resolver-transport-file.jar,
lib/maven-resolver-transport-http.jar,
lib/maven-resolver-transport-wagon.jar,
lib/maven-resolver-util.jar,
lib/plexus-utils.jar,
lib/slf4j-api.jar,
lib/wagon-provider-api.jar
Export-Package: org.talend.designer.maven.aether,
org.talend.designer.maven.aether.comparator,
org.talend.designer.maven.aether.node,

View File

@@ -0,0 +1 @@
*.jar

View File

@@ -9,4 +9,79 @@
</parent>
<artifactId>org.talend.designer.maven.aether</artifactId>
<packaging>eclipse-plugin</packaging>
<properties>
<maven.resolver.version>1.3.1</maven.resolver.version>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-api</artifactId>
<version>${maven.resolver.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-spi</artifactId>
<version>${maven.resolver.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-util</artifactId>
<version>${maven.resolver.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-impl</artifactId>
<version>${maven.resolver.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-connector-basic</artifactId>
<version>${maven.resolver.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-transport-classpath</artifactId>
<version>${maven.resolver.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-transport-file</artifactId>
<version>${maven.resolver.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-transport-http</artifactId>
<version>${maven.resolver.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-transport-wagon</artifactId>
<version>${maven.resolver.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.0.2</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>generate-resources</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<includeScope>runtime</includeScope>
<outputDirectory>${project.basedir}/lib</outputDirectory>
<stripVersion>true</stripVersion>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@@ -64,12 +64,6 @@
<version>${project.version}</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.talend.studio</groupId>
<artifactId>spring-boot-maven-plugin-1-5-9-RELEASE-tos</artifactId>
<version>${project.version}</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.talend.studio</groupId>
<artifactId>studio-maven-repository-zip</artifactId>

View File

@@ -1,115 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>studio-maven-repository-tos</artifactId>
<version>7.2.1-SNAPSHOT</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>spring-boot-maven-plugin-1-5-9-RELEASE-tos</artifactId>
<packaging>pom</packaging>
<properties>
<!-- Dependency versions -->
<features-maven-plugin.version>2.2.9</features-maven-plugin.version>
<maven-install-plugin.version>2.5.1</maven-install-plugin.version>
<plexus-utils.version>2.1</plexus-utils.version>
</properties>
<dependencies>
<!-- Required by MS packaging for Jobs -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>1.5.9.RELEASE</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson</groupId>
<artifactId>jackson-bom</artifactId>
<version>2.8.10</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-framework-bom</artifactId>
<version>4.3.13.RELEASE </version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-releasetrain</artifactId>
<version>Ingalls-SR9</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-bom</artifactId>
<version>4.3.12.RELEASE</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>1.5.9.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
<version>1.5.9.RELEASE</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-1.2-api</artifactId>
<version>2.7</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-log4j2</artifactId>
<version>1.5.9.RELEASE</version>
</dependency>
<!-- Required for MS packaging for Routes -->
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-spring-boot</artifactId>
<version>2.20.1</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.8</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<addParentPoms>true</addParentPoms>
<copyPom>true</copyPom>
<includeScope>compile</includeScope>
<outputDirectory>${basedir}/../../../tmp/repository</outputDirectory>
<useRepositoryLayout>true</useRepositoryLayout>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@@ -14,7 +14,6 @@
<module>plugins/maven-bundle-plugin-2-3-7</module>
<module>plugins/maven-bundle-plugin-2-5-3</module>
<module>plugins/maven-install-plugin-2-5-1</module>
<module>plugins/spring-boot-maven-plugin-1-5-9-RELEASE</module>
</modules>
<dependencies>
<dependency>

View File

@@ -52,6 +52,13 @@
<artifactId>jackson-dataformat-cbor</artifactId>
<version>2.9.5</version>
</dependency>
<!-- Required by commons-lang-2.6.pom -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-parent</artifactId>
<version>17</version>
<type>pom</type>
</dependency>
<!-- It fixes provided dependency scope to compile, because maven-dependency-plugin is setup to include
only compile and runtime scopes, but provided is also required. It's not possible to setup plugin to
include all: compile, runtime and provided dependencies -->
@@ -154,10 +161,11 @@
</dependency>
<!-- Dependencies in provided scope should be explicitly added as dependency in this module,
because provided scope is not transitive -->
<dependency>
<groupId>biz.aQute.bnd</groupId>
<artifactId>annotation</artifactId>
<version>2.4.0</version>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.service.component.annotations</artifactId>
<version>1.3.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.eclipse.sisu</groupId>

View File

@@ -11,7 +11,7 @@
<packaging>pom</packaging>
<properties>
<tcomp.version>1.1.4</tcomp.version>
<tcomp.version>1.1.9-SNAPSHOT</tcomp.version>
<slf4j.version>1.7.25</slf4j.version>
</properties>

View File

@@ -33,7 +33,7 @@
<artifactItem>
<groupId>org.talend.studio</groupId>
<artifactId>studio-maven-repository</artifactId>
<version>7.0.1.v20181127</version>
<version>7.2.1.v20190226</version>
<type>zip</type>
<overWrite>true</overWrite>
<outputDirectory>${project.basedir}/../repository</outputDirectory>

View File

@@ -26,6 +26,7 @@ import java.util.List;
import java.util.Properties;
import org.apache.maven.cli.MavenCli;
import org.apache.maven.cli.configuration.SettingsXmlConfigurationProcessor;
import org.apache.maven.settings.Profile;
import org.apache.maven.settings.Proxy;
import org.apache.maven.settings.Settings;
@@ -134,8 +135,9 @@ public class M2eUserSettingForTalendLoginTask extends AbstractLoginTask {
* only.
*/
final String userSettingsFile = MavenPlugin.getMavenConfiguration().getUserSettingsFile();
boolean defaultUserSetting = (userSettingsFile == null || MavenCli.DEFAULT_USER_SETTINGS_FILE.getAbsolutePath()
.equals(userSettingsFile));
boolean defaultUserSetting = (userSettingsFile == null
|| SettingsXmlConfigurationProcessor.DEFAULT_USER_SETTINGS_FILE.getAbsolutePath()
.equals(userSettingsFile));
boolean isStudioUserSetting = studioUserSettingsPath.equals(userSettingsFile);
// check the user setting when set for studio, don't existed or have no rights.

View File

@@ -32,7 +32,6 @@ import org.eclipse.jdt.launching.IVMInstall;
import org.eclipse.jdt.launching.IVMRunner;
import org.eclipse.jdt.launching.VMRunnerConfiguration;
import org.eclipse.m2e.internal.launch.MavenLaunchDelegate;
import org.eclipse.m2e.internal.launch.MavenRuntimeLaunchSupport;
import org.eclipse.osgi.util.NLS;
import org.talend.commons.CommonsPlugin;
@@ -100,7 +99,7 @@ public class TalendMavenLaunchDelegate extends MavenLaunchDelegate {
ForegroundResourceRefresher refresher = new ForegroundResourceRefresher(configuration, launch);
refresher.init();
} else {
MavenRuntimeLaunchSupport.removeTempFiles(launch);
// MavenRuntimeLaunchSupport.removeTempFiles(launch);
}
}
};
@@ -155,7 +154,7 @@ class ForegroundResourceRefresher implements IDebugEventSetListener {
protected void processResources() {
IProgressMonitor monitor = new NullProgressMonitor();
MavenRuntimeLaunchSupport.removeTempFiles(launch);
// MavenRuntimeLaunchSupport.removeTempFiles(launch);
if (CommonsPlugin.isHeadless() || !CommonsPlugin.isWorkbenchCreated()) { // no used for commandline to refresh.
return;

View File

@@ -77,6 +77,7 @@ import org.talend.designer.maven.template.ETalendMavenVariables;
import org.talend.designer.maven.template.MavenTemplateManager;
import org.talend.designer.maven.utils.PomIdsHelper;
import org.talend.designer.maven.utils.PomUtil;
import org.talend.designer.maven.utils.SortableDependency;
import org.talend.designer.runprocess.IProcessor;
import org.talend.designer.runprocess.IRunProcessService;
import org.talend.repository.ProjectManager;
@@ -147,21 +148,21 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
/*
* (non-Javadoc)
*
*
* @see org.talend.designer.maven.tools.creator.CreateMavenBundleTemplatePom#getTemplateStream()
*/
@Override
protected InputStream getTemplateStream() throws IOException {
File templateFile = PomUtil.getTemplateFile(getObjectTypeFolder(), getItemRelativePath(),
TalendMavenConstants.POM_FILE_NAME);
File templateFile = PomUtil
.getTemplateFile(getObjectTypeFolder(), getItemRelativePath(), TalendMavenConstants.POM_FILE_NAME);
if (!FilesUtils.allInSameFolder(templateFile, TalendMavenConstants.ASSEMBLY_FILE_NAME)) {
templateFile = null; // force to set null, in order to use the template from other places.
}
try {
final Map<String, Object> templateParameters = PomUtil.getTemplateParameters(getJobProcessor());
return MavenTemplateManager.getTemplateStream(templateFile,
IProjectSettingPreferenceConstants.TEMPLATE_STANDALONE_JOB_POM, JOB_TEMPLATE_BUNDLE,
getBundleTemplatePath(), templateParameters);
return MavenTemplateManager
.getTemplateStream(templateFile, IProjectSettingPreferenceConstants.TEMPLATE_STANDALONE_JOB_POM,
JOB_TEMPLATE_BUNDLE, getBundleTemplatePath(), templateParameters);
} catch (Exception e) {
throw new IOException(e);
}
@@ -174,7 +175,7 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
}
/**
*
*
* Add the properties for job.
*/
@Override
@@ -191,9 +192,9 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
if (ProcessUtils.isTestContainer(process)) {
if (GlobalServiceRegister.getDefault().isServiceRegistered(ITestContainerProviderService.class)) {
ITestContainerProviderService testService =
(ITestContainerProviderService) GlobalServiceRegister.getDefault().getService(
ITestContainerProviderService.class);
ITestContainerProviderService testService = (ITestContainerProviderService) GlobalServiceRegister
.getDefault()
.getService(ITestContainerProviderService.class);
try {
property = testService.getParentJobItem(property.getItem()).getProperty();
process = testService.getParentJobProcess(process);
@@ -224,7 +225,7 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
/*
* for jobInfo.properties
*
*
* should be same as JobInfoBuilder
*/
String contextName = getOptionString(TalendProcessArgumentConstant.ARG_CONTEXT_NAME);
@@ -397,8 +398,9 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
boolean set = false;
// read template from project setting
try {
File templateFile = PomUtil.getTemplateFile(getObjectTypeFolder(), getItemRelativePath(),
TalendMavenConstants.ASSEMBLY_FILE_NAME);
File templateFile = PomUtil
.getTemplateFile(getObjectTypeFolder(), getItemRelativePath(),
TalendMavenConstants.ASSEMBLY_FILE_NAME);
if (!FilesUtils.allInSameFolder(templateFile, TalendMavenConstants.POM_FILE_NAME)) {
templateFile = null; // force to set null, in order to use the template from other places.
}
@@ -410,22 +412,23 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
Object needLauncher = processor.getArguments().get(TalendProcessArgumentConstant.ARG_NEED_LAUNCHER);
if (needLauncher != null) {
if ((Boolean) needLauncher) {
Object launcherObj = processor.getArguments().get(TalendProcessArgumentConstant.ARG_LAUNCHER_NAME);
Object launcherObj =
processor.getArguments().get(TalendProcessArgumentConstant.ARG_LAUNCHER_NAME);
if (launcherObj != null) {
launcherName = (String) launcherObj;
}
}
}
}
String content =
MavenTemplateManager.getTemplateContent(templateFile,
String content = MavenTemplateManager
.getTemplateContent(templateFile,
IProjectSettingPreferenceConstants.TEMPLATE_STANDALONE_JOB_ASSEMBLY,
JOB_TEMPLATE_BUNDLE,
IProjectSettingTemplateConstants.PATH_STANDALONE + '/'
+ IProjectSettingTemplateConstants.ASSEMBLY_JOB_TEMPLATE_FILE_NAME,
templateParameters);
if (content != null) {
content = TemplateFileUtils.handleAssemblyJobTemplate(content, launcherName);
content = TemplateFileUtils.handleAssemblyJobTemplate(content, launcherName);
ByteArrayInputStream source = new ByteArrayInputStream(content.getBytes());
if (assemblyFile.exists()) {
assemblyFile.setContents(source, true, false, monitor);
@@ -450,7 +453,7 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
if (codeProject == null) {
return;
}
Property property = codeProject.getPropery();
Property property = codeProject.getPropery() != null ? codeProject.getPropery() : processor.getProperty();
if (property == null) {
return;
}
@@ -476,8 +479,8 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
addScriptAddition(unixScriptAdditionValue, contextPart);
}
// context params
List paramsList = ProcessUtils.getOptionValue(getArgumentsMap(),
TalendProcessArgumentConstant.ARG_CONTEXT_PARAMS, (List) null);
List paramsList = ProcessUtils
.getOptionValue(getArgumentsMap(), TalendProcessArgumentConstant.ARG_CONTEXT_PARAMS, (List) null);
if (paramsList != null && !paramsList.isEmpty()) {
StringBuffer contextParamPart = new StringBuffer(100);
// do codes same as JobScriptsManager.getSettingContextParametersValue
@@ -554,29 +557,32 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
}
}
final Map<String, Object> templateParameters = PomUtil.getTemplateParameters(property);
String batContent = MavenTemplateManager.getProjectSettingValue(IProjectSettingPreferenceConstants.TEMPLATE_BAT,
templateParameters);
batContent = StringUtils.replaceEach(batContent,
new String[] { "${talend.job.jvmargs}", "${talend.job.bat.classpath}", "${talend.job.class}",
"${talend.job.bat.addition}" },
new String[] { jvmArgsStr.toString().trim(), getWindowsClasspath(), jobClass,
windowsScriptAdditionValue.toString() });
String batContent = MavenTemplateManager
.getProjectSettingValue(IProjectSettingPreferenceConstants.TEMPLATE_BAT, templateParameters);
batContent = StringUtils
.replaceEach(batContent,
new String[] { "${talend.job.jvmargs}", "${talend.job.bat.classpath}", "${talend.job.class}",
"${talend.job.bat.addition}" },
new String[] { jvmArgsStr.toString().trim(), getWindowsClasspath(), jobClass,
windowsScriptAdditionValue.toString() });
String shContent = MavenTemplateManager.getProjectSettingValue(IProjectSettingPreferenceConstants.TEMPLATE_SH,
templateParameters);
shContent = StringUtils.replaceEach(shContent,
new String[] { "${talend.job.jvmargs}", "${talend.job.sh.classpath}", "${talend.job.class}",
"${talend.job.sh.addition}" },
new String[] { jvmArgsStr.toString().trim(), getUnixClasspath(), jobClass,
unixScriptAdditionValue.toString() });
String shContent = MavenTemplateManager
.getProjectSettingValue(IProjectSettingPreferenceConstants.TEMPLATE_SH, templateParameters);
shContent = StringUtils
.replaceEach(shContent,
new String[] { "${talend.job.jvmargs}", "${talend.job.sh.classpath}", "${talend.job.class}",
"${talend.job.sh.addition}" },
new String[] { jvmArgsStr.toString().trim(), getUnixClasspath(), jobClass,
unixScriptAdditionValue.toString() });
String psContent = MavenTemplateManager.getProjectSettingValue(IProjectSettingPreferenceConstants.TEMPLATE_PS,
templateParameters);
psContent = StringUtils.replaceEach(psContent,
new String[] { "${talend.job.jvmargs.ps1}", "${talend.job.ps1.classpath}", "${talend.job.class}",
"${talend.job.bat.addition}" },
new String[] { jvmArgsStrPs1.toString().trim(), getWindowsClasspathForPs1(), jobClass,
windowsScriptAdditionValue.toString() });
String psContent = MavenTemplateManager
.getProjectSettingValue(IProjectSettingPreferenceConstants.TEMPLATE_PS, templateParameters);
psContent = StringUtils
.replaceEach(psContent,
new String[] { "${talend.job.jvmargs.ps1}", "${talend.job.ps1.classpath}",
"${talend.job.class}", "${talend.job.bat.addition}" },
new String[] { jvmArgsStrPs1.toString().trim(), getWindowsClasspathForPs1(), jobClass,
windowsScriptAdditionValue.toString() });
String jobInfoContent = MavenTemplateManager
.getProjectSettingValue(IProjectSettingPreferenceConstants.TEMPLATE_JOB_INFO, templateParameters);
@@ -611,12 +617,15 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
protected ITalendProcessJavaProject getTalendJobJavaProject(JobInfo jobInfo) {
IProcessor processor = jobInfo.getProcessor();
if (processor == null) {
processor = getJobProcessor();
}
ITalendProcessJavaProject talendProcessJavaProject = processor.getTalendJavaProject();
if (talendProcessJavaProject == null) {
if (GlobalServiceRegister.getDefault().isServiceRegistered(IRunProcessService.class)) {
IRunProcessService service = (IRunProcessService) GlobalServiceRegister.getDefault()
.getService(IRunProcessService.class);
IRunProcessService service =
(IRunProcessService) GlobalServiceRegister.getDefault().getService(IRunProcessService.class);
if (processor.getProperty() == null) {
processor = jobInfo.getReloadedProcessor();
}
@@ -632,8 +641,8 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
if (talendProcessJavaProject == null) {
if (GlobalServiceRegister.getDefault().isServiceRegistered(IRunProcessService.class)) {
IRunProcessService service = (IRunProcessService) GlobalServiceRegister.getDefault()
.getService(IRunProcessService.class);
IRunProcessService service =
(IRunProcessService) GlobalServiceRegister.getDefault().getService(IRunProcessService.class);
talendProcessJavaProject = service.getTalendJobJavaProject(processor.getProperty());
}
@@ -642,7 +651,7 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
}
protected void updateDependencySet(IFile assemblyFile) {
Set<String> jobCoordinate = new HashSet<>();
Map<String, Dependency> jobCoordinateMap = new HashMap<String, Dependency>();
Set<JobInfo> childrenJobInfo = new HashSet<>();
if (!hasLoopDependency()) {
childrenJobInfo = getJobProcessor().getBuildChildrenJobs();
@@ -651,20 +660,25 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
// add children jobs
for (JobInfo jobInfo : childrenJobInfo) {
Property property = jobInfo.getProcessItem().getProperty();
String coordinate = getCoordinate(PomIdsHelper.getJobGroupId(property), PomIdsHelper.getJobArtifactId(jobInfo),
MavenConstants.PACKAGING_JAR, PomIdsHelper.getJobVersion(property));
jobCoordinate.add(coordinate);
String coordinate =
getCoordinate(PomIdsHelper.getJobGroupId(property), PomIdsHelper.getJobArtifactId(jobInfo),
MavenConstants.PACKAGING_JAR, PomIdsHelper.getJobVersion(property));
Dependency dependency = getDependencyObject(PomIdsHelper.getJobGroupId(property), PomIdsHelper.getJobArtifactId(jobInfo), PomIdsHelper.getJobVersion(property),
MavenConstants.PACKAGING_JAR, null);
jobCoordinateMap.put(coordinate, dependency);
}
// add parent job
Property parentProperty = this.getJobProcessor().getProperty();
String parentCoordinate = getCoordinate(PomIdsHelper.getJobGroupId(parentProperty),
PomIdsHelper.getJobArtifactId(parentProperty), MavenConstants.PACKAGING_JAR,
PomIdsHelper.getJobVersion(parentProperty));
jobCoordinate.add(parentCoordinate);
String parentCoordinate =
getCoordinate(PomIdsHelper.getJobGroupId(parentProperty), PomIdsHelper.getJobArtifactId(parentProperty),
MavenConstants.PACKAGING_JAR, PomIdsHelper.getJobVersion(parentProperty));
Dependency parentDependency = getDependencyObject(PomIdsHelper.getJobGroupId(parentProperty), PomIdsHelper.getJobArtifactId(parentProperty), PomIdsHelper.getJobVersion(parentProperty),
MavenConstants.PACKAGING_JAR, null);
jobCoordinateMap.put(parentCoordinate, parentDependency);
// add talend libraries and codes
Set<String> talendLibCoordinate = new HashSet<>();
Map<String, Dependency> talendLibCoordinateMap = new HashMap<String, Dependency>();
String projectTechName = ProjectManager.getInstance().getProject(parentProperty).getTechnicalLabel();
String projectGroupId = PomIdsHelper.getProjectGroupId(projectTechName);
@@ -672,13 +686,14 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
List<Dependency> dependencies = new ArrayList<>();
addCodesDependencies(dependencies);
for (Dependency dependency : dependencies) {
talendLibCoordinate.add(getCoordinate(dependency));
talendLibCoordinateMap.put(getCoordinate(dependency), dependency);
}
// libraries
dependencies.clear();
Set<ModuleNeeded> modules = getJobProcessor().getNeededModules(
TalendProcessOptionConstants.MODULES_WITH_JOBLET | TalendProcessOptionConstants.MODULES_EXCLUDE_SHADED);
Set<ModuleNeeded> modules = getJobProcessor()
.getNeededModules(TalendProcessOptionConstants.MODULES_WITH_JOBLET
| TalendProcessOptionConstants.MODULES_EXCLUDE_SHADED);
for (ModuleNeeded module : modules) {
String mavenUri = module.getMavenUri();
Dependency dependency = PomUtil.createModuleDependency(mavenUri);
@@ -690,23 +705,23 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
}
String dependencyGroupId = dependency.getGroupId();
String coordinate = getCoordinate(dependency);
if (!jobCoordinate.contains(coordinate)) {
if (!jobCoordinateMap.containsKey(coordinate)) {
if (MavenConstants.DEFAULT_LIB_GROUP_ID.equals(dependencyGroupId)) {
talendLibCoordinate.add(coordinate);
talendLibCoordinateMap.put(coordinate, dependency);
}
}
}
// add 3rd party libraries
Set<String> _3rdDepLib = new HashSet<>();
Map<String, Dependency> _3rdDepLibMap = new HashMap<String, Dependency>();
Map<String, Set<Dependency>> duplicateLibs = new HashMap<>();
for (Dependency dependency : dependencies) {
if (MavenConstants.PACKAGING_POM.equals(dependency.getType())) {
continue;
}
String coordinate = getCoordinate(dependency);
if (!jobCoordinate.contains(coordinate) && !talendLibCoordinate.contains(coordinate)) {
_3rdDepLib.add(coordinate);
if (!jobCoordinateMap.containsKey(coordinate) && !talendLibCoordinateMap.containsKey(coordinate)) {
_3rdDepLibMap.put(coordinate, dependency);
addToDuplicateLibs(duplicateLibs, dependency);
}
}
@@ -714,8 +729,10 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
// add missing modules from the job generation of children
Set<ModuleNeeded> fullModulesList = new HashSet<>();
for (JobInfo jobInfo : childrenJobInfo) {
fullModulesList.addAll(LastGenerationInfo.getInstance().getModulesNeededWithSubjobPerJob(jobInfo.getJobId(),
jobInfo.getJobVersion()));
fullModulesList
.addAll(LastGenerationInfo
.getInstance()
.getModulesNeededWithSubjobPerJob(jobInfo.getJobId(), jobInfo.getJobVersion()));
}
for (ModuleNeeded moduleNeeded : fullModulesList) {
if (moduleNeeded.isExcluded()) {
@@ -724,15 +741,17 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
MavenArtifact artifact = MavenUrlHelper.parseMvnUrl(moduleNeeded.getMavenUri());
String coordinate = getCoordinate(artifact.getGroupId(), artifact.getArtifactId(), artifact.getType(),
artifact.getVersion());
if (!jobCoordinate.contains(coordinate) && !talendLibCoordinate.contains(coordinate)
&& !_3rdDepLib.contains(coordinate)) {
if (!jobCoordinateMap.containsKey(coordinate) && !talendLibCoordinateMap.containsKey(coordinate)
&& !_3rdDepLibMap.containsKey(coordinate)) {
Dependency dependencyObject = getDependencyObject(artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), artifact.getType(), artifact.getClassifier());
if (MavenConstants.DEFAULT_LIB_GROUP_ID.equals(artifact.getGroupId())
|| artifact.getGroupId().startsWith(projectGroupId)) {
talendLibCoordinate.add(coordinate);
talendLibCoordinateMap.put(coordinate, dependencyObject);
} else {
_3rdDepLib.add(coordinate);
Dependency dependency = PomUtil.createDependency(artifact.getGroupId(), artifact.getArtifactId(),
artifact.getVersion(), artifact.getType(), artifact.getClassifier());
_3rdDepLibMap.put(coordinate, dependencyObject);
Dependency dependency = PomUtil
.createDependency(artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(),
artifact.getType(), artifact.getClassifier());
addToDuplicateLibs(duplicateLibs, dependency);
}
}
@@ -748,7 +767,7 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
} else {
// remove duplicated dependencies from 3rd lib list
for (Dependency dependency : dupDependencies) {
_3rdDepLib.remove(getCoordinate(dependency));
_3rdDepLibMap.remove(getCoordinate(dependency));
}
}
}
@@ -756,11 +775,12 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
try {
Document document = PomUtil.loadAssemblyFile(null, assemblyFile);
// add talend libs & codes
setupDependencySetNode(document, talendLibCoordinate, "lib", "${artifact.artifactId}.${artifact.extension}", false);
setupDependencySetNode(document, talendLibCoordinateMap, "lib", "${artifact.artifactId}.${artifact.extension}",
false);
// add 3rd party libs <dependencySet>
setupDependencySetNode(document, _3rdDepLib, "lib", null, false);
setupDependencySetNode(document, _3rdDepLibMap, "lib", null, false);
// add jobs
setupDependencySetNode(document, jobCoordinate, "${talend.job.name}",
setupDependencySetNode(document, jobCoordinateMap, "${talend.job.name}",
"${artifact.build.finalName}.${artifact.extension}", true);
// add duplicate dependencies if exists
setupFileNode(document, duplicateLibs);
@@ -772,7 +792,8 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
}
private String getCoordinate(Dependency dependency) {
return getCoordinate(dependency.getGroupId(), dependency.getArtifactId(), dependency.getType(), dependency.getVersion());
return getCoordinate(dependency.getGroupId(), dependency.getArtifactId(), dependency.getType(),
dependency.getVersion());
}
protected String getCoordinate(String groupId, String artifactId, String type, String version) {
@@ -782,14 +803,45 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
if (type != null) {
coordinate += type;
}
if (version != null) {
coordinate += separator + version;
}
return coordinate;
}
protected String getAssemblyCoordinate(Dependency dependency) {
String separator = ":"; //$NON-NLS-1$
String coordinate = dependency.getGroupId() + separator;
coordinate += dependency.getArtifactId() + separator;
if (dependency.getType() != null) {
coordinate += dependency.getType();
}
if (dependency.getClassifier() != null) {
coordinate += separator + "*";
}
if (dependency.getVersion() != null) {
coordinate += separator + dependency.getVersion();
}
return coordinate;
}
protected Dependency getDependencyObject(String groupId, String artifactId, String version, String type, String classifier) {
Dependency object = new SortableDependency();
object.setGroupId(groupId);
object.setArtifactId(artifactId);
object.setVersion(version);
object.setType(type);
object.setClassifier(classifier);
return object;
}
private void addToDuplicateLibs(Map<String, Set<Dependency>> map, Dependency dependency) {
String coordinate = getCoordinate(dependency.getGroupId(), dependency.getArtifactId(), dependency.getType(), null);
String coordinate =
getCoordinate(dependency.getGroupId(), dependency.getArtifactId(), dependency.getType(), null);
if (!map.containsKey(coordinate)) {
Set<Dependency> set = new HashSet<>();
map.put(coordinate, set);
@@ -797,8 +849,8 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
map.get(coordinate).add(dependency);
}
protected void setupDependencySetNode(Document document, Set<String> libIncludes, String outputDir, String fileNameMapping,
boolean useProjectArtifact) {
protected void setupDependencySetNode(Document document, Map<String, Dependency> libIncludes, String outputDir,
String fileNameMapping, boolean useProjectArtifact) {
if (libIncludes.isEmpty()) {
return;
}
@@ -816,9 +868,9 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
Node includesNode = document.createElement("includes");
dependencySetNode.appendChild(includesNode);
for (String include : libIncludes) {
for (Dependency dependency : libIncludes.values()) {
Node includeNode = document.createElement("include");
includeNode.setTextContent(include);
includeNode.setTextContent(getAssemblyCoordinate(dependency));
includesNode.appendChild(includeNode);
}
@@ -845,8 +897,9 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
for (Entry<String, Set<Dependency>> entry : duplicateDependencies.entrySet()) {
Set<Dependency> dependencies = entry.getValue();
for (Dependency dependency : dependencies) {
String sourceLocation = maven.getArtifactPath(repository, dependency.getGroupId(), dependency.getArtifactId(),
dependency.getVersion(), dependency.getType(), dependency.getClassifier());
String sourceLocation = maven
.getArtifactPath(repository, dependency.getGroupId(), dependency.getArtifactId(),
dependency.getVersion(), dependency.getType(), dependency.getClassifier());
Path path = new File(repository.getBasedir()).toPath().resolve(sourceLocation);
sourceLocation = path.toString();
String destName = path.getFileName().toString();

View File

@@ -18,12 +18,12 @@ import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.maven.model.Build;
import org.apache.maven.model.Dependency;
import org.apache.maven.model.Model;
import org.apache.maven.model.Plugin;
import org.apache.maven.model.PluginExecution;
@@ -203,7 +203,7 @@ public class CreateMavenStandardJobOSGiPom extends CreateMavenJobPom {
@Override
protected void updateDependencySet(IFile assemblyFile) {
Set<String> jobCoordinate = new HashSet<>();
Map<String, Dependency> jobCoordinateMap = new HashMap<String, Dependency>();
if (!hasLoopDependency()) {
// add children jobs
Set<JobInfo> childrenJobInfo = getJobProcessor().getBuildChildrenJobs();
@@ -211,7 +211,9 @@ public class CreateMavenStandardJobOSGiPom extends CreateMavenJobPom {
Property property = jobInfo.getProcessItem().getProperty();
String coordinate = getCoordinate(PomIdsHelper.getJobGroupId(property), PomIdsHelper.getJobArtifactId(jobInfo),
MavenConstants.PACKAGING_JAR, PomIdsHelper.getJobVersion(property));
jobCoordinate.add(coordinate);
Dependency dependency = getDependencyObject(PomIdsHelper.getJobGroupId(property), PomIdsHelper.getJobArtifactId(jobInfo), PomIdsHelper.getJobVersion(property),
MavenConstants.PACKAGING_JAR, null);
jobCoordinateMap.put(coordinate, dependency);
}
}
// add parent job
@@ -219,11 +221,13 @@ public class CreateMavenStandardJobOSGiPom extends CreateMavenJobPom {
String parentCoordinate = getCoordinate(PomIdsHelper.getJobGroupId(parentProperty),
PomIdsHelper.getJobArtifactId(parentProperty), MavenConstants.PACKAGING_JAR,
PomIdsHelper.getJobVersion(parentProperty));
jobCoordinate.add(parentCoordinate);
Dependency parentDependency = getDependencyObject(PomIdsHelper.getJobGroupId(parentProperty), PomIdsHelper.getJobArtifactId(parentProperty), PomIdsHelper.getJobVersion(parentProperty),
MavenConstants.PACKAGING_JAR, null);
jobCoordinateMap.put(parentCoordinate, parentDependency);
try {
Document document = PomUtil.loadAssemblyFile(null, assemblyFile);
// add jobs
setupDependencySetNode(document, jobCoordinate, "${talend.job.name}",
setupDependencySetNode(document, jobCoordinateMap, "${talend.job.name}",
"${artifact.build.finalName}.${artifact.extension}", true);
PomUtil.saveAssemblyFile(assemblyFile, document);
} catch (Exception e) {

View File

@@ -1,245 +0,0 @@
// ============================================================================
//
// Copyright (C) 2006-2018 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.maven.tools.repo;
import io.tesla.aether.connector.AetherRepositoryConnectorFactory;
import java.io.File;
import java.io.IOException;
import java.util.Collection;
import org.apache.maven.model.Model;
import org.apache.maven.repository.internal.MavenRepositorySystemUtils;
import org.eclipse.aether.DefaultRepositorySystemSession;
import org.eclipse.aether.RepositorySystem;
import org.eclipse.aether.RepositorySystemSession;
import org.eclipse.aether.artifact.Artifact;
import org.eclipse.aether.artifact.DefaultArtifact;
import org.eclipse.aether.connector.wagon.WagonRepositoryConnectorFactory;
import org.eclipse.aether.deployment.DeployRequest;
import org.eclipse.aether.deployment.DeployResult;
import org.eclipse.aether.impl.DefaultServiceLocator;
import org.eclipse.aether.installation.InstallRequest;
import org.eclipse.aether.installation.InstallResult;
import org.eclipse.aether.installation.InstallationException;
import org.eclipse.aether.metadata.Metadata;
import org.eclipse.aether.repository.LocalRepository;
import org.eclipse.aether.spi.connector.RepositoryConnectorFactory;
import org.eclipse.aether.util.artifact.SubArtifact;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.embedder.MavenModelManager;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.utils.workbench.resources.ResourceUtils;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.runtime.maven.MavenArtifact;
import org.talend.core.runtime.maven.MavenUrlHelper;
import org.talend.core.runtime.process.ITalendProcessJavaProject;
import org.talend.designer.maven.model.TalendMavenConstants;
import org.talend.designer.runprocess.IRunProcessService;
import org.talend.repository.ProjectManager;
import org.talend.utils.io.FilesUtils;
/**
* DOC ggu class global comment. Detailled comment
*
* FIXME, not impl yet
*/
public class LocalRepositoryAetherManager extends LocalRepositoryManager {
private RepositorySystem repositorySystem;
private LocalRepository localRepo;
protected static final MavenModelManager MODEL_MANAGER = MavenPlugin.getMavenModelManager();
private IFolder tempFolder;
public LocalRepositoryAetherManager(File baseDir) {
super(baseDir);
this.repositorySystem = newRepositorySystem();
this.localRepo = newRepository();
}
public LocalRepositoryAetherManager(IContainer container) {
this(container.getLocation().toFile());
}
protected RepositorySystem getRepositorySystem() {
return repositorySystem;
}
protected LocalRepository getLocalRepo() {
return localRepo;
}
protected IFolder getTempFolder() {
if (tempFolder == null) {
if (GlobalServiceRegister.getDefault().isServiceRegistered(IRunProcessService.class)) {
IRunProcessService service = (IRunProcessService) GlobalServiceRegister.getDefault().getService(
IRunProcessService.class);
ITalendProcessJavaProject talendProcessJavaProject = service.getTempJavaProject();
if (talendProcessJavaProject != null) {
tempFolder = talendProcessJavaProject.createSubFolder(null, (IFolder) talendProcessJavaProject
.getExternalResourcesFolder().getParent(), "temp"); //$NON-NLS-1$
} else {
try {
tempFolder = ResourceUtils.getProject(
ProjectManager.getInstance().getCurrentProject().getTechnicalLabel()).getFolder("temp");
if (!tempFolder.exists()) {
tempFolder.create(true, true, null);
}
} catch (Exception e) {
ExceptionHandler.process(e);
}
}
}
}
return tempFolder;
}
protected RepositorySystem newRepositorySystem() {
DefaultServiceLocator locator = MavenRepositorySystemUtils.newServiceLocator();
locator.addService(RepositoryConnectorFactory.class, AetherRepositoryConnectorFactory.class);
locator.addService(RepositoryConnectorFactory.class, WagonRepositoryConnectorFactory.class);
// locator.addService(RepositoryConnectorFactory.class, BasicRepositoryConnectorFactory.class);
// locator.addService(TransporterFactory.class, FileTransporterFactory.class);
// locator.addService(TransporterFactory.class, HttpTransporterFactory.class);
locator.setErrorHandler(new DefaultServiceLocator.ErrorHandler() {
@Override
public void serviceCreationFailed(Class<?> type, Class<?> impl, Throwable exception) {
ExceptionHandler.process(exception);
}
});
return locator.getService(RepositorySystem.class);
}
protected LocalRepository newRepository() {
File dir = getRepoFolder();
if (!dir.exists()) {
dir.mkdirs();
}
return new LocalRepository(dir);
}
protected RepositorySystemSession newSession() {
DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession();
session.setLocalRepositoryManager(repositorySystem.newLocalRepositoryManager(session, localRepo));
// session.setTransferListener(new ConsoleTransferListener());
// session.setRepositoryListener(new ConsoleRepositoryListener());
// uncomment to generate dirty trees
// session.setDependencyGraphTransformer( null );
return session;
}
@Override
public void install(File file, MavenArtifact artifact) throws Exception {
Artifact jarArtifact = createArtifact(file, artifact);
Artifact pomArtifact = createPomArtifact(jarArtifact);
InstallRequest installRequest = new InstallRequest().addArtifact(jarArtifact).addArtifact(pomArtifact);
InstallResult result = getRepositorySystem().install(newSession(), installRequest);
Collection<Metadata> metadata = result.getMetadata();
metadata.isEmpty();
}
@Override
public void deploy(File file, MavenArtifact artifact) throws Exception {
Artifact jarArtifact = createArtifact(file, artifact);
DeployRequest deployRequest = new DeployRequest().addArtifact(jarArtifact);
// Artifact pomArtifact = null;
// pomArtifact = new SubArtifact(jarArtifact, "", "pom").setFile(new File("pom.xml"));
// if (pomArtifact != null) {
// installRequest.addArtifact(pomArtifact);
// }
DeployResult result = getRepositorySystem().deploy(newSession(), deployRequest);
}
protected Artifact createArtifact(File file, MavenArtifact artifact) throws InstallationException {
if (!file.exists()) {
throw new InstallationException("The deploy file " + file + " is not existed.");
}
if (artifact == null) { // use default settings
String mvnUrl = MavenUrlHelper.generateMvnUrlForJarName(file.getName());
artifact = MavenUrlHelper.parseMvnUrl(mvnUrl);
if (artifact == null) {
throw new InstallationException("Can't deploy the file: " + file);
}
}
Artifact jarArtifact = new DefaultArtifact(artifact.getGroupId(), artifact.getArtifactId(), artifact.getClassifier(),
artifact.getType(), artifact.getVersion()).setFile(file);
return jarArtifact;
}
protected Artifact createPomArtifact(Artifact jarArtifact) throws IOException, CoreException {
File createTempFile = File.createTempFile(TalendMavenConstants.PACKAGING_POM, "");
createTempFile.delete();
String tmpFolderName = createTempFile.getName();
IFolder folder = getTempFolder().getFolder(tmpFolderName);
folder.create(true, true, null);
IFile pomFile = folder.getFile(TalendMavenConstants.POM_FILE_NAME);
Model pomModel = new Model();
pomModel.setModelVersion(TalendMavenConstants.POM_VERSION);
pomModel.setModelEncoding(TalendMavenConstants.DEFAULT_ENCODING);
pomModel.setGroupId(jarArtifact.getGroupId());
pomModel.setArtifactId(jarArtifact.getArtifactId());
pomModel.setVersion(jarArtifact.getVersion());
MODEL_MANAGER.createMavenModel(pomFile, pomModel);
Artifact pomArtifact = new SubArtifact(jarArtifact, "", TalendMavenConstants.PACKAGING_POM).setFile(pomFile.getLocation()
.toFile());
return pomArtifact;
}
@Override
public void cleanup(IProgressMonitor monitor) {
if (monitor == null) {
monitor = new NullProgressMonitor();
}
try {
IFolder folder = getTempFolder();
if (folder == null) {
return;
}
folder.refreshLocal(IResource.DEPTH_INFINITE, monitor);
if (folder.exists()) {
FilesUtils.deleteFolder(folder.getLocation().toFile(), false);
folder.refreshLocal(IResource.DEPTH_INFINITE, monitor);
}
} catch (CoreException e) {
ExceptionHandler.process(e);
}
}
}

View File

@@ -31,6 +31,7 @@ import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import javax.xml.parsers.DocumentBuilder;
@@ -77,8 +78,12 @@ import org.talend.core.model.process.JobInfo;
import org.talend.core.model.process.ProcessUtils;
import org.talend.core.model.properties.ProcessItem;
import org.talend.core.model.properties.Property;
import org.talend.core.model.relationship.Relation;
import org.talend.core.model.relationship.RelationshipItemBuilder;
import org.talend.core.model.repository.IRepositoryViewObject;
import org.talend.core.model.utils.JavaResourcesHelper;
import org.talend.core.nexus.TalendMavenResolver;
import org.talend.core.repository.model.ProxyRepositoryFactory;
import org.talend.core.runtime.maven.MavenArtifact;
import org.talend.core.runtime.maven.MavenConstants;
import org.talend.core.runtime.maven.MavenUrlHelper;
@@ -87,6 +92,7 @@ import org.talend.core.ui.branding.IBrandingService;
import org.talend.designer.maven.model.TalendJavaProjectConstants;
import org.talend.designer.maven.model.TalendMavenConstants;
import org.talend.designer.maven.template.MavenTemplateManager;
import org.talend.designer.maven.tools.AggregatorPomsHelper;
import org.talend.designer.maven.tools.ProcessorDependenciesManager;
import org.talend.designer.runprocess.IProcessor;
import org.talend.repository.ProjectManager;
@@ -109,6 +115,12 @@ public class PomUtil {
private static final MavenModelManager MODEL_MANAGER = MavenPlugin.getMavenModelManager();
private static RelationshipItemBuilder relationshipItemBuilder = RelationshipItemBuilder.getInstance();
private static ProxyRepositoryFactory repositoryFactory = ProxyRepositoryFactory.getInstance();
private static List<IFolder> bakJobletFolderCache = new ArrayList<>();
public static void savePom(IProgressMonitor monitor, Model model, IFile pomFile) throws Exception {
if (monitor == null) {
monitor = new NullProgressMonitor();
@@ -116,7 +128,9 @@ public class PomUtil {
if (pomFile == null) {
throw new NullPointerException("the output file is null.");
}
Properties properties = new Properties();
properties.putAll(model.getProperties());
model.setProperties(properties);
/*
* copied the codes from createMavenModel of MavenModelManager
*/
@@ -138,7 +152,9 @@ public class PomUtil {
if (pomFile == null) {
throw new NullPointerException("the output file is null.");
}
Properties properties = new Properties();
properties.putAll(model.getProperties());
model.setProperties(properties);
ByteArrayOutputStream buf = new ByteArrayOutputStream();
MavenPlugin.getMaven().writeModel(model, buf);
@@ -875,6 +891,77 @@ public class PomUtil {
}
public static void checkJobRelatedJobletDependencies(Property mainProperty, String itemType,
Set<String> childJobUrls, Set<Property> itemChecked, IProgressMonitor monitor) throws Exception {
itemChecked.add(mainProperty);
List<Relation> childItemRelations = getAllChildItemRelations(mainProperty, itemType);
for (Relation relation : childItemRelations) {
IRepositoryViewObject repositoryObject = null;
if (RelationshipItemBuilder.LATEST_VERSION.equals(relation.getVersion())) {
repositoryObject = repositoryFactory.getLastVersion(relation.getId());
} else {
repositoryObject = repositoryFactory.getSpecificVersion(relation.getId(), relation.getVersion(), true);
}
if (repositoryObject != null && repositoryObject.getProperty() != null) {
// to update joblet dependencies for loop
if (relationshipItemBuilder.JOBLET_RELATION.equals(relation.getType())) {
updateJobletDependencies4Loop(repositoryObject.getProperty(), childJobUrls, monitor);
}
// in case of loop
if (!itemChecked.contains(repositoryObject.getProperty())) {
// if joblet existed in subjob / joblet
checkJobRelatedJobletDependencies(repositoryObject.getProperty(), relation.getType(),
childJobUrls, itemChecked, monitor);
}
}
}
}
public static void updateJobletDependencies4Loop(Property jobletProperty, Set<String> childJobUrls, IProgressMonitor monitor)
throws Exception {
IFolder pomFolder = AggregatorPomsHelper.getItemPomFolder(jobletProperty);
backupPomFile(pomFolder);
// cached the backup pom file
bakJobletFolderCache.add(pomFolder);
IFile jobletPomFile = pomFolder.getFile(TalendMavenConstants.POM_FILE_NAME);
Model jobletModel = MODEL_MANAGER.readMavenModel(jobletPomFile);
List<Dependency> dependencies = jobletModel.getDependencies();
List<Dependency> toRemove = new ArrayList<Dependency>();
for (Dependency dependency : dependencies) {
String mvnUrl = generateMvnUrl(dependency);
if (childJobUrls.contains(mvnUrl)) {
toRemove.add(dependency);
}
}
dependencies.removeAll(toRemove);
savePom(monitor, jobletModel, jobletPomFile);
}
private static List<Relation> getAllChildItemRelations(Property property, String itemType) {
List<Relation> itemsRelatedTo = new ArrayList<Relation>();
itemsRelatedTo.addAll(relationshipItemBuilder.getItemsChildRelatedTo(property.getId(), property.getVersion(), itemType,
RelationshipItemBuilder.JOBLET_RELATION));
itemsRelatedTo.addAll(relationshipItemBuilder.getItemsChildRelatedTo(property.getId(), property.getVersion(), itemType,
RelationshipItemBuilder.JOB_RELATION));
return itemsRelatedTo;
}
public static void restoreJobletPoms() {
for (IFolder folder : bakJobletFolderCache) {
IFile backFile = folder.getFile(TalendMavenConstants.POM_BACKUP_FILE_NAME);
IFile pomFile = folder.getFile(TalendMavenConstants.POM_FILE_NAME);
restorePomFile(pomFile, backFile);
}
}
public static void clearBakJobletCache() {
bakJobletFolderCache.clear();
}
public static void backupPomFile(ITalendProcessJavaProject talendProject) {
final IProject project = talendProject.getProject();
final IFile backFile = project.getFile(TalendMavenConstants.POM_BACKUP_FILE_NAME);
@@ -913,6 +1000,10 @@ public class PomUtil {
final IProject project = talendProject.getProject();
final IFile backFile = project.getFile(TalendMavenConstants.POM_BACKUP_FILE_NAME);
final IFile pomFile = project.getFile(TalendMavenConstants.POM_FILE_NAME);
restorePomFile(pomFile, backFile);
}
public static void restorePomFile(IFile pomFile, IFile backFile) {
try {
updateFilesInWorkspaceRunnable(null, new IWorkspaceRunnable() {

View File

@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry exported="true" kind="lib" path="lib/xercesImpl.jar"/>
<classpathentry exported="true" kind="lib" path="lib/xml-apis.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry exported="true" kind="lib" path="lib/ant.jar"/>

View File

@@ -8,13 +8,15 @@ Bundle-ClassPath: .,
lib/apache-mime4j-0.6.jar,
lib/castor-1.0.3.jar,
lib/jakarta-oro-2.0.8.jar,
lib/xmlbeans-2.3.0.jar
lib/xmlbeans-2.3.0.jar,
lib/xercesImpl.jar,
lib/xml-apis.jar
Bundle-Vendor: .Talend SA.
Require-Bundle: org.apache.log4j;resolution:=optional,
org.talend.libraries.apache.common;visibility:=reexport,
jackson-core-asl;bundle-version="1.9.13",
jackson-mapper-asl;bundle-version="1.9.13",
org.apache.xerces;visibility:=reexport
org.apache.xerces
Export-Package:
org.apache.james.mime4j,
org.apache.james.mime4j.codec,

View File

@@ -2,7 +2,9 @@ output.. = bin/
bin.includes = META-INF/,\
.,\
licences/,\
lib/
lib/,\
lib/xercesImpl.jar,\
lib/xml-apis.jar
bin.excludes = libs_not_used/commons-betwixt-0.8.jar,\
libs_not_used/commons-digester-1.7.jar,\
libs_not_used/commons-discovery-0.2.jar,\

View File

@@ -1,4 +1,5 @@
Manifest-Version: 1.0
Automatic-Module-Name: org.talend.libraries.jboss.jars
Bundle-ManifestVersion: 2
Bundle-Name: Jars
Bundle-SymbolicName: org.talend.libraries.jboss.jars

View File

@@ -1,4 +1,5 @@
Manifest-Version: 1.0
Automatic-Module-Name: org.talend.libraries.jboss
Bundle-ManifestVersion: 2
Bundle-Name: Jboss
Bundle-SymbolicName: org.talend.libraries.jboss;singleton:=true

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