Compare commits

...

48 Commits

Author SHA1 Message Date
sponomarova
77f1a997bd patch(TPS-3062): add PATCH_RELEASE_NOTE.md 2019-05-06 18:57:36 +03:00
TKaczynski
ce4db18a63 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-05-03 12:14:41 +03:00
zwxue
d62bb79277 fix(TUP-17688): Performing HDFS operation after a tDataPrepRun. (#1140) 2019-04-09 15:58:00 +08:00
jding-tlnd
f87d99c023 fix(TUP-20505)duplicate copys of custom components uploaded to Nexus
https://jira.talendforge.org/browse/TUP-20505
2019-03-06 14:47:58 +08:00
jding-tlnd
cdcf4584f9 fix(TUP-20505)duplicate copys of custom components uploaded to Nexus
https://jira.talendforge.org/browse/TUP-20505
2019-03-05 18:25:52 +08:00
jding-tlnd
63d9c3b0eb fix(TUP-20505):duplicate copys of custom components uploaded to Nexus
https://jira.talendforge.org/browse/TUP-20505
2019-03-04 17:10:58 +08:00
wchen-talend
583876313b fix(TUP-20505):duplicate copys of custom components uploaded to Nexus 3
(#1809)
2019-03-04 17:07:13 +08:00
Chao MENG
06efca826e Cmeng/bugfix/tup 19436 add cache to improve performance (#1535)
* Revert "Revert "Cmeng/bugfix/tup 19436 improve performance (#1530)""

This reverts commit 3e15cd72ad.

* fix(TUP-19436) add back the synchronized

* fix(TUP-19436): Studio too slow to start
https://jira.talendforge.org/browse/TUP-19436

* fix(TUP-19436): Studio too slow to start
https://jira.talendforge.org/browse/TUP-19436

Conflicts:
	main/plugins/org.talend.core.runtime/src/main/java/org/talend/core/model/general/ModuleNeeded.java
	main/plugins/org.talend.librariesmanager/src/main/java/org/talend/librariesmanager/model/ExtensionModuleManager.java
	main/plugins/org.talend.librariesmanager/src/main/java/org/talend/librariesmanager/model/ModulesNeededProvider.java
2019-03-01 15:43:31 +08:00
nrousseau
78e7821f70 Revert "Cmeng/bugfix/tup 19436 improve performance (#1530)"
This reverts commit 28afcb604b.

Conflicts:
	main/plugins/org.talend.librariesmanager/src/main/java/org/talend/librariesmanager/model/ExtensionModuleManager.java
	main/plugins/org.talend.librariesmanager/src/main/java/org/talend/librariesmanager/model/ModulesNeededProvider.java
2019-03-01 15:35:52 +08:00
Chao MENG
553d2dacdd Cmeng/bugfix/tup 19436 improve performance (#1530)
* Revert "Xlwang/bugfix/tup 19436 revert changes (#1527)"

This reverts commit b74f336636.

* fix(TUP-19436): Studio too slow to start
https://jira.talendforge.org/browse/TUP-19436

1. Fix a wrong logic when initializing module group cache
2. Improve the logic of module id/name/group cache

* fix(TUP-19436): Studio too slow to start
https://jira.talendforge.org/browse/TUP-19436

Conflicts:
	main/plugins/org.talend.librariesmanager/src/main/java/org/talend/librariesmanager/model/ExtensionModuleManager.java
	main/plugins/org.talend.librariesmanager/src/main/java/org/talend/librariesmanager/model/ModulesNeededProvider.java
2019-03-01 15:32:32 +08:00
xlwang-tlnd
b43718c880 Xlwang/bugfix/tup 19436 revert changes (#1527)
* Revert "xlwang/fix(TUP-19436)Studio too slow to start (#1523)"

This reverts commit 5277c2c177.

* Revert "xlwang/fix(TUP-19663)Studio too slow to start (#1509)"

This reverts commit dfac26b4f8.

Conflicts:
	main/plugins/org.talend.librariesmanager/src/main/java/org/talend/librariesmanager/model/ExtensionModuleManager.java
	main/plugins/org.talend.librariesmanager/src/main/java/org/talend/librariesmanager/model/ModulesNeededProvider.java
2019-03-01 15:23:32 +08:00
xlwang-tlnd
0e417500a6 xlwang/fix(TUP-19436)Studio too slow to start (#1523)
Conflicts:
	main/plugins/org.talend.librariesmanager/src/main/java/org/talend/librariesmanager/model/ExtensionModuleManager.java
2019-03-01 15:15:31 +08:00
xlwang-tlnd
3e8ee895ca xlwang/fix(TUP-19663)Studio too slow to start (#1509)
* xlwang/fix(TUP-19663)Studio too slow to start

* xlwang/fix(TUP-19436)Studio too slow to start

* xlwang/fix(TUP-19436)Studio too slow to start
modify StringUtils.isBlank(moduleId) to StringUtils.isNotBlank(moduleId)

Conflicts:
	main/plugins/org.talend.librariesmanager/src/main/java/org/talend/librariesmanager/model/ModulesNeededProvider.java
2019-03-01 15:08:01 +08:00
Igor Lazebny
fd0722a2bd Pin maven plugin versions 2019-01-08 10:37:51 +02:00
zwxue
4ff7d5a484 fix(TUP-21110): skip deploy-file children job. (#2091) 2018-12-17 10:43:40 +08:00
zwxue
7d56a29adf fix(TUP-21110):Only job artifacts must be deployed (#2004) 2018-11-26 14:57:39 +08:00
nrousseau
39737a2c6d fix(TUP-20866) don't check mac version 2018-11-19 14:50:56 +08:00
nrousseau
72494aca06 fix(TUP-20866) avoid crash on mojave 2018-11-19 14:50:36 +08:00
apoltavtsev@gmail.com
34357a3ae3 TESB-23071 Default beans dependencies are added 2018-08-21 08:21:48 +03:00
kjwang-talend
618d931f4f fix TUP-20251 Unable to create a tag (Cloud) (#1756)
https://jira.talendforge.org/browse/TUP-20251

Conflicts:
	main/plugins/org.talend.core.runtime/src/main/java/org/talend/repository/ProjectManager.java
2018-07-09 10:54:00 +08:00
qiongli
d564d4d0cb TDQ-14308 move th code of copy drools file from 'BuildJobHandler' to (#1231) (#1257) (#1759)
'ProcessorUtilities'.copy drools files when run or build job.
2018-06-28 16:12:36 +08:00
zwxue
31c01110d7 fix(TUP-20223):Wrong branch value in the jobs generated by CI. (#1713) 2018-06-19 14:50:31 +08:00
zwxue
f19d7a549c fix(TUP-19806):Error: Could not find or load main class / Remote (#1615)
Execution / routines.jar missing in ZIP file
2018-05-14 10:29:04 +08:00
Chao MENG
8097a7d446 fix(TUP-18215): improve performance of "Finishing integrity check"
https://jira.talendforge.org/browse/TUP-18215
2018-04-23 11:25:27 +08:00
wchen-talend
bdd0ea2b4c fix(TUP-18674):Studio connection does not show other git branches with (#1533)
ldap set in tac
2018-04-09 14:43:05 +08:00
hcyi
86bae9927e Revert "fix(TUP-18674):Studio connection does not show other git branches with (#1533)"
This reverts commit 90bbb6e919.
2018-03-27 17:03:36 +08:00
wchen-talend
90bbb6e919 fix(TUP-18674):Studio connection does not show other git branches with (#1533)
ldap set in tac
2018-03-26 11:52:48 +08:00
GGu
52bac3d907 fix(TUP-18769): exclude the dependenceis of children jobs in main pom (#1254) 2018-03-19 10:27:22 +08:00
hcyi
760ea1eb52 fix(TUP-19270):Nexus download problem if studio with proxy. 2018-03-14 15:45:06 +08:00
hcyi
48011f5650 fix(TUP-19270):Cannot connect from studio to TAC via proxy server with
basic authentication.
2018-03-12 16:15:38 +08:00
hcyi
211a1f1bdc fix(TUP-19270):Cannot connect from studio to TAC via proxy server with
basic authentication (#1409)

* fix(TUP-19270):Cannot connect from studio to TAC via proxy server with
basic authentication

* fix(TUP-19270):Cannot connect from studio to TAC via proxy server with
basic authentication.

Conflicts:
	main/plugins/org.talend.commons.runtime/src/org/talend/commons/utils/network/NetworkUtil.java
2018-03-12 15:43:48 +08:00
hwang-talend
9e9c840834 fix(TUP-18208):Studio sending multiple "getLibLocation" metaservlet (#1147)
calls for each build activity
2017-11-27 17:52:40 +08:00
wchen-talend
2f26291ee9 fix(TUP-18825):Cannot use name "oracle" for row name (Main) (#1280) 2017-11-14 14:41:49 +08:00
wchen-talend
6c56827d40 fix(TUP-18452):The Generated schema is wrong by 'Import WSDL Schemas" 2017-10-24 10:45:26 +08:00
nrousseau
a94126fd6d fix(TUP-18452) fix wrong generation of schema from WSDL (#1226)
Fix as well import of XSD to avoid to lose information on similar nodes
2017-10-24 10:33:44 +08:00
zwxue
8474957e66 fix(TUP-18382):tXMLMap miss some fields while import schema from (#1193) 2017-10-24 10:32:58 +08:00
hcyi
e46126d756 fix(TUP-18388): add some new junits to enhance and fix the failed ones. (#1201)
* fix(TUP-18388): add some new junits to enhance and fix the failed ones.

* fix(TUP-18388): Cannot get globalMap after tFlowToIterate.
2017-10-16 11:47:43 +08:00
hcyi
cfff1eeb38 fix(TUP-18388): Cannot get globalMap after tFlowToIterate. (#1191)
Conflicts:
	main/plugins/org.talend.core.runtime/src/main/java/org/talend/core/model/utils/ParameterValueUtil.java
2017-10-16 11:47:27 +08:00
jzhao
262a00381d fix(TDI-39518) tSendMail job with multiline Message cannot be moved from
6.1.1 to 6.4.1 (#1234 and #1240) 

* This include 2 PR commit #1234 and #1240
2017-09-30 16:16:59 +08:00
GGu
2175b217a7 fix(TUP-18448/build): fix the missing children jars when build job 2017-09-18 16:22:38 +08:00
hcyi
887e1949e9 fix(TUP-18388): add some new junits to enhance and fix the failed ones. (#1201)
* fix(TUP-18388): add some new junits to enhance and fix the failed ones.

* fix(TUP-18388): Cannot get globalMap after tFlowToIterate.
2017-09-18 15:58:27 +08:00
hcyi
28cecec265 fix(TUP-18388): Cannot get globalMap after tFlowToIterate. (#1191) 2017-09-18 15:58:04 +08:00
kjwang-talend
1d8554a40c kjwang/fix(TUP-18276):PATCH broke Build Job with sub-jobs from Reference
project(junit)
https://jira.talendforge.org/browse/TUP-18276
2017-07-20 17:28:15 +08:00
kjwang-talend
b307a745d6 kjwang/fix(TUP-18276):PATCH broke Build Job with sub-jobs from Reference (#1161)
* kjwang/fix(TUP-18276):PATCH broke Build Job with sub-jobs from Reference
project
https://jira.talendforge.org/browse/TUP-18276

* kjwang/fix(TUP-18276):PATCH broke Build Job with sub-jobs from Reference
project
https://jira.talendforge.org/browse/TUP-18276
2017-07-20 17:27:10 +08:00
wchen-talend
d9b3a17640 fix(TUP-17900):"Export all projects documentation" does not create the (#1109)
zip file
2017-06-19 16:04:17 +08:00
GGu
27f8252ffd fix(TUP-18073): enhance and unify the component folders (#1111)
* fix(TUP-18073): miss component zip in installed folder

* fix(TUP-18073): install lib in m2 always and unify the component folder
2017-06-19 16:01:50 +08:00
Pierre Teyssier
8e68fe2dde chore: integrate tcomp 0.19.2 2017-06-19 14:02:16 +08:00
Jenkins Continuous Build server
fdf7892052 Set version to 6.4.1 2017-06-14 12:42:04 +02:00
228 changed files with 2245 additions and 971 deletions

130
PATCH_RELEASE_NOTE.md Normal file
View File

@@ -0,0 +1,130 @@
---
version: 6.4.1
module: https://talend.poolparty.biz/coretaxonomy/42
product:
- https://talend.poolparty.biz/coretaxonomy/16
- https://talend.poolparty.biz/coretaxonomy/17
- https://talend.poolparty.biz/coretaxonomy/18
---
# TPS-3062
| Info | Value |
| ---------------- | ---------------- |
| Patch Name | Patch_20190506_TPS-3062_v1-6.4.1 |
| Release Date | 2019-05-10 |
| Target Version | 20170623_1246-V6.4.1 |
| Product affected | Talend Studio |
## Introduction
This patch is cumulative.
It includes all previous generally available patches for Talend Studio 6.4.1.
**NOTE**: To download this patch, liaise with your Support contact at Talend.
## Fixed issues
This patch is cumulative and contains the following fixes:
- TPS-3062 [6.4.1] tFileInputDelimited on spark job - Column(s) missing issue with field separator "ò" (TBD-7687)
The patch also includes the following patches:
- TPS-2051 [6.4.1]Remote run in studio fails with file not found exception(TUP-18118)
- TPS-2056 [6.4.1]PATCH broke Build Job with sub-jobs from Reference project (TUP-18276)
- TPS-2108 [6.4.1]tDataMasking code cannot generate(TDQ-14231)
- TPS-2125 [6.4.1]Remote job server execution fails with child job (TUP-18448)
- TPS-2111 [6.4.1]Cannot get globalMap after tFlowToIterate (TUP-18388)
- TPS-2154 [6.4.1]IndexOutOfBoundsException happen after migrated to 6.4.1 (TDQ-14269)
- TPS-2149 [6.4.1]Could not find or load main class exception after building with CI Builder(TUP-18278)
- TPS-2135 [6.4.1]When Deploying one customer's job in CI, the build failed with error constant string too long (TDI-39029)
- TPS-2148 [6.4.1]AMC Main Chart Displays The Wrong Execution Times (TUP-18497)
- TPS-2153 [6.4.1]Add commons-codec to HDP 2.6 HDFS libraries (TBD-5535)
- TPS-2167 [6.4.1]tXMLMap miss some fields while import schema from repository (TUP-18382)
- TPS-2142 [6.4.1]tAS400Input - Guess Schema on tAS400Input fails with MissingDriverException (TUP-18453,TUP-18774)
- TPS-2217 [6.4.1]Can't initialize the datamart if service name is not same with sid of oracle 12 (TDQ-14384)
- TPS-2171 [6.4.1]Complete URL Pop-up with LDAP SSH Git Authentication (TUP-18466)
- TPS-2223 [6.4.1]Username and passwords to remote job servers stored in cleartext in Studio (TUP-18741)
- TPS-2247 [6.4.1]Cannot use name "oracle" for row name (Main) (TUP-18825)
- TPS-2219 [6.4.1]Issues with Hyphen in ServiceName(TESB-20417)
- TPS-2242 [6.4.1]tELTOracleMap / ELT Oracle Map Editor / left panel empty after migration from 6.1.1 to 6.3.1(TUP-18158)
- TPS-2234 [6.4.1]Studio sending multiple "getLibLocation" metaservlet calls for each build activity (TUP-18208)
- TPS-2218 [6.4.1]Testcase for tWriteJSONFiled gives junitGlobalMap cannot be resolved exception (TUP-18217)
- TPS-2264 [6.4.1]Jobscript generated shows empty with proper job design (TUP-19001)
- TPS-2250 [6.4.1]Hebrew in tSandardizeRow (TDQ-14435)
- TPS-2284 [6.4.1]Comparison in studio doesnt work for tXMLMap (TUP-19067)
- TPS-2179 [6.4.1]Get error when build big data batch job (TBD-5390)
- TPS-2321 [6.4.1]Offline SVN project changes not committed to remote project (TUP-18380)
- TPS-2077 [6.4.1]Spark Streaming hive job when migrated from 6.3 to 6.4 cannot compile (TBD-5427,TBD-5476)
- TPS-2198 [6.4.1]tFileOutputParquet doesn't handle null values(TBD-5681)
- TPS-2354 [6.4.1]MapR 52 Spark Streaming job with tMapRStreamOutput components cannot generate code (TBD-5521)
- TPS-2346 [6.4.1]BASE64Decoder and BASE64Encoder should be replaced by other class(TDQ-14095)
- TPS-2342 [6.4.1]Implicit context load behavior change (TUP-19342)
- TPS-2384 [6.4.1]Custom GroupId causing "cannot be resolved to a type" errors (TUP-18769)
- TPS-2393 [6.4.1]Child jobs are not being generated via itemfilter in CI Builder (TUP-19756)
- TPS-2324 [6.4.1]Cannot connect from studio to TAC via proxy server with basic authentication (TUP-19270)
- TPS-2408 [6.4.1]with git project the Studio Connection windows does not behave consistently (TUP-18674)
- TPS-2424 [6.4.1]After sending a commit the dialog "Finishing integrity check" never ends (TUP-18215)
- TPS-2427 [6.4.1]Deactivating components in a joblet results in a job that won't run (TUP-19875)
- TPS-2445 [6.4.1]tELTMSSqlInput component does not support the schema with a DB-column name having Degree symbol in it (TUP-19961)
- TPS-2452 [6.4.1]Error Could not find or load main class / Remote Execution / routines.jar missing in ZIP file (TUP-19806) (TUP-19806)
- TPS-2476 [6.4.1]Datamart migration task "Update context information for TdqVAnalyizedElement and TdqVLastAnalyzedElement" failed for oracle and postgresql (TDQ-14224)
- TPS-2400 [6.4.1]Studio crashing during startup with Failed to load the service org.ops4j.pax.url.mvn.MavenResolver (TUP-17411)
- TPS-2497 [6.4.1]"Browse Reports" issue on the component tDQReportRun (TDQ-15036)
- TPS-2530 [6.4.1]"Build Job" for Report does not prompt at all, only Empty Job (TDQ-15320)
- TPS-2505 [6.4.1]tSqoopImport with Parquet File Format Fails Against Kerberized Ha HDP 2.6 Cluster (TBD-6877)
- TPS-2547 [6.4.1]Wrong branch value in the jobs generated by CI (TUP-20223)
- TPS-2567 [6.4.1]Preview in Metadata Delimited File fails with NullPointerException (TUP-20267)
- TPS-2572 [6.4.1]IllegalArgumentException when Running a Spark Job Containing two tRuleSurvivorship Components (TDQ-15484,TDQ-14308,TBD-7049)
- TPS-2565 [6.4.1]STUDIO - cTalendJob component uses context parameters defined in another cTalendJob component(TESB-19834)
- TPS-2574 [6.4.1]Unable to create a tag (Cloud) (TUP-20251)
- TPS-2570 [6.4.1]Compile error after refactoring job (TDQ-15455)
- TPS-2587 [6.4.1]Change REST API Swagger documentation based on Talend job settings (TESB-21643)
- TPS-2268 [6.4.1]Talend Studio Import org.apache.camel not resolved in custom beans (TESB-20667, TESB-23071)
- TPS-2665 [6.4.1]tRuleSurvivorship places all data into a single Spark partition (TDQ-15756)
- TPS-2694 [6.4.1]Can't save the URL string in report editor (TDQ-15840)
- TPS-2711 [6.4.1]cKafka code generation fails to compile with SSL Truststore Password (TESB-22755)
- TPS-2758 [6.4.1]Unable to use a Custom Hadoop metadata connection in Spark configuration in a Spark job (TUP-20816)
- TPS-2774 [6.4.1]Studio Crash using tmap component after McOS Mojave Upgrade (TUP-20866)
- TPS-2796 [6.4.1]Only job artifacts must be deployed (TUP-21110)
- TPS-2838 [6.4.1]Context variable passed from route to routelet is not working as expected (TESB-24306)
- TPS-2863 [6.4.1][Spark]Compile error on tUnite (TBD-6792)
- TPS-2939 [6.4.1]Studio/TAC Performance Degradation (TUP-21985)
- TPS-2889 [6.4.1]NullPointerException when calling SOAP Service with empty body (TESB-24761)
- TPS-2902 [6.4.1]Child jobs are not being generated via itemfilter in CI Builder (TUP-19756)
- TPS-3020 [6.4.1]Performing HDFS operation after a tDataPrepRun (TUP-17688)
## Prerequisites
Consider the following requirements for your system:
- Talend Studio 6.4.1 must be installed.
## Installation
<!--
Detailed installation steps need to be documented for customer.
If any files need to be backed up before installation, it should be mentioned in this section.
Two scenarios need to be considered for the installation:
* The customer has not yet installed any patch before
* The customer had installed one previous cumulative patch
-->
### Installing the patch using Software update
1. Logon TAC and switch to Configuration->Software Update, enter the correct values and save referring to the documentation: https://help.talend.com/reader/f7Em9WV_cPm2RRywucSN0Q/j9x5iXV~vyxMlUafnDeja
2. Switch to Software update page, where the new patch will be listed. The patch can be downloaded from here into the nexus repository.
3. On Studio Side: Logon Studio with remote mode, on the logon page the Update button is displayed, click this button to install the patch.
### Installing the patch using Talend Studio
1. Create folder which named "patches" under your studio installer directory and copy patch .zip file to this folder.
2. Restart your studio,will popup up prompt window at first time and then click ok button to install the patch, or restart commandline, patch will be installed automatically.
The following files are installed by this patch: <!-- if applicable -->
- 'org.talend.librariesmanager_6.4.1.20190506_1208-patch.jar'

View File

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

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>6.4.1-SNAPSHOT</version>
<version>6.4.1</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.common.ui.runtime.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>6.4.1-SNAPSHOT</version>
<version>6.4.1</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.commons.runtime.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>6.4.1-SNAPSHOT</version>
<version>6.4.1</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.commons.ui.nl</artifactId>

View File

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

View File

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

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>6.4.1-SNAPSHOT</version>
<version>6.4.1</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.core.runtime.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>6.4.1-SNAPSHOT</version>
<version>6.4.1</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.core.ui.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>6.4.1-SNAPSHOT</version>
<version>6.4.1</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.cwm.mip.edit.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>6.4.1-SNAPSHOT</version>
<version>6.4.1</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.cwm.mip.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>6.4.1-SNAPSHOT</version>
<version>6.4.1</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.designer.maven.ui.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>6.4.1-SNAPSHOT</version>
<version>6.4.1</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.help.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>6.4.1-SNAPSHOT</version>
<version>6.4.1</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.helpers.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>6.4.1-SNAPSHOT</version>
<version>6.4.1</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.librariesmanager.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>6.4.1-SNAPSHOT</version>
<version>6.4.1</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.librariesmanager.ui.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>6.4.1-SNAPSHOT</version>
<version>6.4.1</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.metadata.managment.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>6.4.1-SNAPSHOT</version>
<version>6.4.1</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.metadata.managment.ui.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>6.4.1-SNAPSHOT</version>
<version>6.4.1</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.migrationTool.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>6.4.1-SNAPSHOT</version>
<version>6.4.1</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.model.edit.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>6.4.1-SNAPSHOT</version>
<version>6.4.1</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.model.migration.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>6.4.1-SNAPSHOT</version>
<version>6.4.1</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.model.nl</artifactId>

View File

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

View File

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

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>6.4.1-SNAPSHOT</version>
<version>6.4.1</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.registration.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>6.4.1-SNAPSHOT</version>
<version>6.4.1</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.repository.items.importexport.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>6.4.1-SNAPSHOT</version>
<version>6.4.1</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.repository.items.importexport.ui.nl</artifactId>

View File

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

View File

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

View File

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

View File

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

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>6.4.1-SNAPSHOT</version>
<version>6.4.1</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.resources.nl</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>6.4.1-SNAPSHOT</version>
<version>6.4.1</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.commons.feature</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>6.4.1-SNAPSHOT</version>
<version>6.4.1</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.core.feature</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>6.4.1-SNAPSHOT</version>
<version>6.4.1</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.fragment.jars.feature</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>6.4.1-SNAPSHOT</version>
<version>6.4.1</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.help.feature</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>6.4.1-SNAPSHOT</version>
<version>6.4.1</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.jdt.feature</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>6.4.1-SNAPSHOT</version>
<version>6.4.1</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.libraries.jdbc.feature</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>6.4.1-SNAPSHOT</version>
<version>6.4.1</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.m2e.feature</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>6.4.1-SNAPSHOT</version>
<version>6.4.1</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.model.migration.feature</artifactId>

View File

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

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>6.4.1-SNAPSHOT</version>
<version>6.4.1</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.rcp.feature</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>6.4.1-SNAPSHOT</version>
<version>6.4.1</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.update.p2.feature</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>6.4.1-SNAPSHOT</version>
<version>6.4.1</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.updates.feature</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>6.4.1-SNAPSHOT</version>
<version>6.4.1</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.utils.feature</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>6.4.1-SNAPSHOT</version>
<version>6.4.1</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.common.ui.runtime</artifactId>

View File

@@ -141,7 +141,6 @@
<KEYWORD3>sf</KEYWORD3>
<KEYWORD3>routines</KEYWORD3>
<KEYWORD3>javax</KEYWORD3>
<KEYWORD3>oracle</KEYWORD3>
<LITERAL2>false</LITERAL2>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>6.4.1-SNAPSHOT</version>
<version>6.4.1</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.commons.runtime</artifactId>

View File

@@ -1,135 +1,135 @@
<?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">
<?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">
<!--
Copyright (C) 2010 Talend Inc. - www.talend.com
-->
<modelVersion>4.0.0</modelVersion>
<groupId>org.talend</groupId>
<artifactId>org.talend.commons.runtime</artifactId>
<packaging>bundle</packaging>
<parent>
<groupId>org.talend</groupId>
<artifactId>org.talend.tos</artifactId>
<version>6.4.1-SNAPSHOT</version>
<relativePath>../pom_server.xml</relativePath>
</parent>
<dependencies>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>3.1</version>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.9.2</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.1</version>
</dependency>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant-apache-oro</artifactId>
<version>1.7.0</version>
</dependency>
<dependency>
<groupId>org.talend</groupId>
<artifactId>fakejdbc</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${basedir}/fakejdbc_driver.jar</systemPath>
</dependency>
<dependency>
<groupId>org.eclipse.birt.runtime</groupId>
<artifactId>org.eclipse.osgi</artifactId>
<version>3.10.2.v20150203-1939</version>
</dependency>
<dependency>
<groupId>org.eclipse.birt.runtime</groupId>
<artifactId>org.eclipse.core.runtime</artifactId>
<version>3.10.0.v20140318-2214</version>
</dependency>
<dependency>
<groupId>org.eclipse.birt.runtime</groupId>
<artifactId>org.eclipse.emf.common</artifactId>
<version>2.10.1.v20140901-1043</version>
</dependency>
<dependency>
<groupId>org.eclipse.birt.runtime</groupId>
<artifactId>org.eclipse.emf.ecore</artifactId>
<version>2.10.1.v20140901-1043</version>
</dependency>
<dependency>
<groupId>org.eclipse.birt.runtime</groupId>
<artifactId>org.eclipse.emf.ecore.xmi</artifactId>
<version>2.10.1.v20140901-1043</version>
</dependency>
<dependency>
<groupId>org.eclipse.birt.runtime</groupId>
<artifactId>org.eclipse.equinox.common</artifactId>
<version>3.6.200.v20130402-1505</version>
</dependency>
<dependency>
<groupId>org.eclipse.birt.runtime</groupId>
<artifactId>org.eclipse.equinox.registry</artifactId>
<version>3.5.400.v20140428-1507</version>
</dependency>
<dependency>
<groupId>org.eclipse.birt.runtime</groupId>
<artifactId>org.eclipse.equinox.app</artifactId>
<version>1.3.200.v20130910-1609</version>
</dependency>
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.11.0</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
<type>bundle</type>
</dependency>
</dependencies>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<includes>
<include>org/talend/commons/utils/threading/lockerbykey/*.java</include>
</includes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.3.5</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
</instructions>
<classifier>minimal</classifier>
</configuration>
</plugin>
</plugins>
</build>
</project>
-->
<modelVersion>4.0.0</modelVersion>
<groupId>org.talend</groupId>
<artifactId>org.talend.commons.runtime</artifactId>
<packaging>bundle</packaging>
<parent>
<groupId>org.talend</groupId>
<artifactId>org.talend.tos</artifactId>
<version>6.4.1</version>
<relativePath>../pom_server.xml</relativePath>
</parent>
<dependencies>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>3.1</version>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.9.2</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.1</version>
</dependency>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant-apache-oro</artifactId>
<version>1.7.0</version>
</dependency>
<dependency>
<groupId>org.talend</groupId>
<artifactId>fakejdbc</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${basedir}/fakejdbc_driver.jar</systemPath>
</dependency>
<dependency>
<groupId>org.eclipse.birt.runtime</groupId>
<artifactId>org.eclipse.osgi</artifactId>
<version>3.10.2.v20150203-1939</version>
</dependency>
<dependency>
<groupId>org.eclipse.birt.runtime</groupId>
<artifactId>org.eclipse.core.runtime</artifactId>
<version>3.10.0.v20140318-2214</version>
</dependency>
<dependency>
<groupId>org.eclipse.birt.runtime</groupId>
<artifactId>org.eclipse.emf.common</artifactId>
<version>2.10.1.v20140901-1043</version>
</dependency>
<dependency>
<groupId>org.eclipse.birt.runtime</groupId>
<artifactId>org.eclipse.emf.ecore</artifactId>
<version>2.10.1.v20140901-1043</version>
</dependency>
<dependency>
<groupId>org.eclipse.birt.runtime</groupId>
<artifactId>org.eclipse.emf.ecore.xmi</artifactId>
<version>2.10.1.v20140901-1043</version>
</dependency>
<dependency>
<groupId>org.eclipse.birt.runtime</groupId>
<artifactId>org.eclipse.equinox.common</artifactId>
<version>3.6.200.v20130402-1505</version>
</dependency>
<dependency>
<groupId>org.eclipse.birt.runtime</groupId>
<artifactId>org.eclipse.equinox.registry</artifactId>
<version>3.5.400.v20140428-1507</version>
</dependency>
<dependency>
<groupId>org.eclipse.birt.runtime</groupId>
<artifactId>org.eclipse.equinox.app</artifactId>
<version>1.3.200.v20130910-1609</version>
</dependency>
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.11.0</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
<type>bundle</type>
</dependency>
</dependencies>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<includes>
<include>org/talend/commons/utils/threading/lockerbykey/*.java</include>
</includes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.3.5</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
</instructions>
<classifier>minimal</classifier>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@@ -22,8 +22,6 @@ public interface ComponentsInstallComponent extends P2InstallComponent {
String FOLDER_COMPS = "components"; //$NON-NLS-1$
String FOLDER_INSTALLED = "installed"; //$NON-NLS-1$
String FOLDER_M2_REPOSITORY = "m2/repository"; //$NON-NLS-1$
void setLogin(boolean login);

View File

@@ -12,19 +12,22 @@
// ============================================================================
package org.talend.commons.utils.network;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.lang.reflect.Field;
import java.net.Authenticator;
import java.net.HttpURLConnection;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.net.PasswordAuthentication;
import java.net.SocketException;
import java.net.URI;
import java.net.URL;
import java.util.HashSet;
import java.util.Set;
import java.util.regex.Matcher;
import java.net.UnknownHostException;
import java.util.Enumeration;
import java.util.regex.Pattern;
import org.apache.commons.lang.StringUtils;
import org.talend.commons.runtime.utils.io.FileCopyUtils;
/**
* ggu class global comment. Detailled comment
*/
@@ -79,4 +82,104 @@ public class NetworkUtil {
return null;
}
public static void loadAuthenticator() {
// get parameter from System.properties.
if (Boolean.getBoolean("http.proxySet")) {//$NON-NLS-1$
// authentification for the url by using username and password
Authenticator.setDefault(new Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
String httpProxyUser = System.getProperty("http.proxyUser"); //$NON-NLS-1$
String httpProxyPassword = System.getProperty("http.proxyPassword"); //$NON-NLS-1$
String httpsProxyUser = System.getProperty("https.proxyUser"); //$NON-NLS-1$
String httpsProxyPassword = System.getProperty("https.proxyPassword"); //$NON-NLS-1$
String proxyUser = null;
char[] proxyPassword = new char[0];
if (StringUtils.isNotEmpty(httpProxyUser)) {
proxyUser = httpProxyUser;
if (StringUtils.isNotEmpty(httpProxyPassword)) {
proxyPassword = httpProxyPassword.toCharArray();
}
} else if (StringUtils.isNotEmpty(httpsProxyUser)) {
proxyUser = httpsProxyUser;
if (StringUtils.isNotEmpty(httpsProxyPassword)) {
proxyPassword = httpsProxyPassword.toCharArray();
}
}
return new PasswordAuthentication(proxyUser, proxyPassword);
}
});
} else {
Authenticator.setDefault(null);
}
}
public static void updateSvnkitConfigureFile(String srcFilePath, String destFilePath) {
// SVNFileUtil getSystemApplicationDataPath C:\ProgramData\\Application Data
// Note:ProgramData:Starting with Windows 10,this setting can no longer be used in provisioning packages.
String osName = System.getProperty("os.name");//$NON-NLS-1$
String osNameLC = osName == null ? null : osName.toLowerCase();
boolean windows = osName != null && osNameLC.indexOf("windows") >= 0;//$NON-NLS-1$
if (windows && Boolean.getBoolean("http.proxySet")) {//$NON-NLS-1$
FileCopyUtils.copy(srcFilePath + "\\servers", destFilePath + "\\servers");//$NON-NLS-1$//$NON-NLS-2$
}
}
/**
* encode url
*
* @param urlStr url not encoded yet!
* @return
* @throws Exception
*/
public static URL encodeUrl(String urlStr) throws Exception {
try {
// String decodedURL = URLDecoder.decode(urlStr, "UTF-8"); //$NON-NLS-1$
URL url = new URL(urlStr);
URI uri = new URI(url.getProtocol(), url.getUserInfo(), url.getHost(), url.getPort(), url.getPath(), url.getQuery(),
url.getRef());
return uri.toURL();
} catch (Exception e) {
throw e;
}
}
public static boolean isSelfAddress(String addr) {
if (addr == null || addr.isEmpty()) {
return false; // ?
}
try {
final InetAddress sourceAddress = InetAddress.getByName(addr);
if (sourceAddress.isLoopbackAddress()) {
// final String hostAddress = sourceAddress.getHostAddress();
// // if addr is localhost, will be 127.0.0.1 also
// if (hostAddress.equals("127.0.0.1") || hostAddress.equals("localhost") ) {
return true;
// }
} else {
// check all ip configs
InetAddress curAddr = null;
Enumeration<NetworkInterface> netInterfaces = NetworkInterface.getNetworkInterfaces();
while (netInterfaces.hasMoreElements()) {
NetworkInterface ni = netInterfaces.nextElement();
Enumeration<InetAddress> address = ni.getInetAddresses();
while (address.hasMoreElements()) {
curAddr = address.nextElement();
if (addr.equals(curAddr.getHostAddress())) {
return true;
}
}
}
}
} catch (SocketException e) {
e.printStackTrace();
} catch (UnknownHostException e) {
e.printStackTrace();
}
return false;
}
}

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>6.4.1-SNAPSHOT</version>
<version>6.4.1</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.commons.ui</artifactId>

View File

@@ -27,6 +27,7 @@ import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
import org.talend.commons.ui.runtime.image.ImageUtils;
import org.talend.commons.utils.system.EnvironmentUtils;
/**
* <code>ImageCapture</code> provides utilities to capture images.
@@ -53,11 +54,7 @@ public class ImageCapture {
*
* @param control
*/
public static Image capture(Control control) {
// First try not conclusive...
// So I should use org.eclipse.ve.internal.swt.targetvm.win32.ImageCapture class which work perfectly
public static Image capture(Control control) {
Shell shell = control.getShell();
Rectangle boundsShell = shell.getBounds();
@@ -71,7 +68,13 @@ public class ImageCapture {
GC gc = new GC(control);
Image image = new Image(control.getDisplay(), control.getSize().x, control.getSize().y);
gc.copyArea(image, 0, 0);
boolean skipCopyArea = false;
if (EnvironmentUtils.isMacOsSytem()) {
skipCopyArea = true;
}
if (!skipCopyArea) {
gc.copyArea(image, 0, 0);
}
gc.dispose();
return image;
// return getImage(control, control.getSize().x, control.getSize().y, true);

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>6.4.1-SNAPSHOT</version>
<version>6.4.1</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.core.repository</artifactId>

View File

@@ -1031,6 +1031,8 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
return this.repositoryFactoryFromProvider.getAllVersion(project, id, avoidSaveProject);
}
@Override
public List<IRepositoryViewObject> getAllVersion(Project project, String id, String folderPath, ERepositoryObjectType type)
throws PersistenceException {
return this.repositoryFactoryFromProvider.getAllVersion(project, id, folderPath, type);

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>6.4.1-SNAPSHOT</version>
<version>6.4.1</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.core.runtime</artifactId>

View File

@@ -99,6 +99,8 @@ public interface ILibraryManagerService extends IService {
IProgressMonitor... monitorWrap);
public boolean retrieve(ModuleNeeded module, String pathToStore, boolean showDialog, IProgressMonitor... monitorWrap);
public boolean retrieve(ModuleNeeded module, String pathToStore, boolean showDialog, NexusServerBean bean, IProgressMonitor... monitorWrap);
/**
*

View File

@@ -39,7 +39,7 @@ public class RepositoryContext {
private boolean forceReadOnly = false;
private boolean editableAsReadOnly = false;
private boolean noUpdateWhenLogon = false;
private Map<String, String> fields;
@@ -71,12 +71,18 @@ public class RepositoryContext {
// if the new user have no svn authentification, but old instance of user have svn authentification
// we force the new instance to set the svn infos.
String oldAuthentification = null;
if (this.user != null && user != null && StringUtils.equals(this.user.getLogin(), user.getLogin())
if (this.user != null && user != null
&& (StringUtils.equals(this.user.getLogin(), user.getLogin())
|| StringUtils.equals(this.user.getLogin(), user.getLdapLogin())
|| StringUtils.equals(this.user.getLdapLogin(), user.getLogin()))
&& user.getAuthenticationInfo() == null) {
oldAuthentification = this.user.getAuthenticationInfo();
}
String oldGitAuthentification = null;
if (this.user != null && user != null && StringUtils.equals(this.user.getLogin(), user.getLogin())
if (this.user != null && user != null
&& (StringUtils.equals(this.user.getLogin(), user.getLogin())
|| StringUtils.equals(this.user.getLogin(), user.getLdapLogin())
|| StringUtils.equals(this.user.getLdapLogin(), user.getLogin()))
&& user.getGitAuthenticationInfo() == null) {
oldGitAuthentification = this.user.getGitAuthenticationInfo();
}

View File

@@ -12,6 +12,7 @@
// ============================================================================
package org.talend.core.model.general;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -185,6 +186,34 @@ public class ModuleNeeded {
setMavenUri(mavenUrl);
}
@Override
public ModuleNeeded clone() {
ModuleNeeded cloned = new ModuleNeeded(context, moduleName, informationMsg, mrRequired, installURL, requiredIf, mavenUri);
cloned.bundleName = bundleName;
cloned.bundleVersion = bundleVersion;
cloned.context = context;
cloned.dynamic = dynamic;
if (extraAttributes != null && !extraAttributes.isEmpty()) {
cloned.extraAttributes = new HashMap<>(extraAttributes);
}
cloned.id = id;
cloned.informationMsg = informationMsg;
cloned.installStatus = installStatus;
if (installURL != null && !installURL.isEmpty()) {
cloned.installURL = new ArrayList<>(installURL);
}
cloned.isShow = isShow;
cloned.mavenUri = mavenUri;
cloned.moduleLocaion = moduleLocaion;
cloned.moduleName = moduleName;
cloned.mrRequired = mrRequired;
cloned.required = required;
cloned.requiredIf = requiredIf;
cloned.status = status;
return cloned;
}
public String getRequiredIf() {
return requiredIf;
}

View File

@@ -706,14 +706,25 @@ public class RelationshipItemBuilder {
if (item instanceof ProcessItem) {
type = JOB_RELATION;
}
if (item instanceof JobletProcessItem) {
} else if (item instanceof JobletProcessItem) {
type = JOBLET_RELATION;
} else {
throw new RuntimeException(Messages.getString("RelationshipItemBuilder.unexpect.item", item.getClass().getName())); //$NON-NLS-1$
}
return type;
}
public List<ERepositoryObjectType> getSupportRepObjTypes(String relationType) {
if (JOB_RELATION.equals(relationType)) {
return ERepositoryObjectType.getAllTypesOfProcess();
} else if (JOBLET_RELATION.equals(relationType)) {
return ERepositoryObjectType.getAllTypesOfJoblet();
} else {
throw new RuntimeException(Messages.getString("RelationshipItemBuilder.unexpect.relation", relationType)); //$NON-NLS-1$
}
}
private void clearItemsRelations(Item baseItem) {
Relation relation = new Relation();
relation.setId(baseItem.getProperty().getId());
@@ -898,19 +909,32 @@ public class RelationshipItemBuilder {
public boolean supportRelation(Item item) {
ERepositoryObjectType itemType = ERepositoryObjectType.getItemType(item);
if (ERepositoryObjectType.getAllTypesOfProcess().contains(itemType)) {
return true;
} else if (ERepositoryObjectType.JOBLET != null && itemType == ERepositoryObjectType.JOBLET) {
return true;
} else if (ERepositoryObjectType.SPARK_JOBLET != null && itemType == ERepositoryObjectType.SPARK_JOBLET) {
return true;
} else if (ERepositoryObjectType.SPARK_STREAMING_JOBLET != null
&& itemType == ERepositoryObjectType.SPARK_STREAMING_JOBLET) {
List<ERepositoryObjectType> supportTypes = getSupportTypes();
if (supportTypes != null && supportTypes.contains(itemType)) {
return true;
}
return false;
}
public List<ERepositoryObjectType> getSupportTypes() {
List<ERepositoryObjectType> supportTypes = new ArrayList<ERepositoryObjectType>();
List<ERepositoryObjectType> processTypes = getSupportRepObjTypes(JOB_RELATION);
if (processTypes != null && !processTypes.isEmpty()) {
supportTypes.addAll(processTypes);
}
List<ERepositoryObjectType> jobletTypes = getSupportRepObjTypes(JOBLET_RELATION);
if (jobletTypes != null && !jobletTypes.isEmpty()) {
supportTypes.addAll(jobletTypes);
}
return supportTypes;
}
public void addOrUpdateItem(Item item) {
addOrUpdateItem(item, false);
}
@@ -1003,6 +1027,17 @@ public class RelationshipItemBuilder {
}
}
public void removeItemRelations(Relation relation, boolean save) {
Map<Relation, Set<Relation>> itemRelations = getCurrentProjectItemsRelations();
if (itemRelations != null && itemRelations.containsKey(relation)) {
itemRelations.get(relation).clear();
itemRelations.remove(relation);
if (save) {
saveRelations();
}
}
}
public Map<Relation, Set<Relation>> getCurrentProjectItemsRelations() {
return this.currentProjectItemsRelations;
}

View File

@@ -950,10 +950,10 @@ public class NodeUtil {
String result = "";
int leftQuotes = original.indexOf("\"");
int rightQuotes = original.indexOf("\"", leftQuotes + 1);
int fakeRightQuotes = original.indexOf("\\\"", leftQuotes + 1);
int fakeRightQuotes = getFakeRightQuotes( original,leftQuotes);
while (rightQuotes == fakeRightQuotes + 1) {
rightQuotes = original.indexOf("\"", rightQuotes + 1);
fakeRightQuotes = original.indexOf("\\\"", fakeRightQuotes + 1);
fakeRightQuotes = getFakeRightQuotes( original,fakeRightQuotes);
}
int leftPrev = 0;
while (leftQuotes >= 0 && rightQuotes > leftQuotes) {
@@ -968,15 +968,43 @@ public class NodeUtil {
leftQuotes = original.indexOf("\"", rightQuotes + 1);
leftPrev = rightQuotes + 1;
rightQuotes = original.indexOf("\"", leftQuotes + 1);
fakeRightQuotes = original.indexOf("\\\"", leftQuotes + 1);
fakeRightQuotes = getFakeRightQuotes( original,leftQuotes);
while (rightQuotes == fakeRightQuotes + 1) {
rightQuotes = original.indexOf("\"", rightQuotes + 1);
fakeRightQuotes = original.indexOf("\\\"", fakeRightQuotes + 1);
fakeRightQuotes = getFakeRightQuotes( original,fakeRightQuotes);
}
}
result += original.substring(leftPrev);
return result;
}
/**
* This method would avoid get wrong fakeRithQuotes index, like:
* "\"\\\\\"" the right quote is not fake one.
*/
private static int getFakeRightQuotes(String original, int fromIdex) {
int fakeRightQuotes = original.indexOf("\\\"", fromIdex + 1);
String quoteStr = "\\\"";
int count = 0;
while (fakeRightQuotes > 0) {
count++;
quoteStr = "\\" + quoteStr;
int tmpIndex = original.indexOf(quoteStr, fromIdex + 1);
if (tmpIndex > fakeRightQuotes || tmpIndex < 0) {
// If add even times "\\", then the index is -1 or bigger than we get fakeRightQuotes
// This means that this is really fake quote
if (count % 2 == 1) {
break;
} else {// Else it is really a right quote, then need get and check next fakeRightQuotes
fakeRightQuotes = original.indexOf("\\\"", fakeRightQuotes + 1);
quoteStr = "\\\"";
count = 0;
}
}
}
return fakeRightQuotes;
}
/**
*

View File

@@ -287,7 +287,7 @@ public final class ParameterValueUtil {
// get the const string
subString = value.substring(start, end);
if (!commentStringSet.contains(start + ":" + (end - 1)) && start < methodMaxIndex) { //$NON-NLS-1$
subString = subString.replaceAll(oldName, newName);
subString = doSubStringReplace(oldName, newName, subString);
}
} else {
// get the varible string, do replace, then append it
@@ -309,7 +309,7 @@ public final class ParameterValueUtil {
Point funcNameArea = function.getNameArea();
String functionName = value.substring(funcNameArea.x, funcNameArea.y);
if (functionName.matches("^globalMap\\..+")) { //$NON-NLS-1$
subString = subString.replaceAll(oldName, newName);
subString = doSubStringReplace(oldName, newName, subString);
} else {
if (subString.equals("\"" + oldName + "\"")) { //$NON-NLS-1$ //$NON-NLS-2$
subString = "\"" + newName + "\""; //$NON-NLS-1$ //$NON-NLS-2$
@@ -334,6 +334,28 @@ public final class ParameterValueUtil {
return strBuffer.toString();
}
public static String doSubStringReplace(String oldName, String newName, String subString) {
String newStr = subString.replaceAll("\\b" + oldName + "\\b", newName);//$NON-NLS-1$ //$NON-NLS-2$
if (!oldName.contains(".") && newStr.equals(subString)) { // not connection and replace failure //$NON-NLS-1$
boolean haveQuotes = subString.startsWith("\""); //$NON-NLS-1$
boolean replaced = false;
if (haveQuotes) {
subString = subString.substring(1);
}
if (subString.startsWith(oldName + '_')) { // start with unique name
newStr = newName + subString.substring(oldName.length());
replaced = true;
} else if (subString.startsWith(oldName + '.')) { // only connection name
newStr = newName + subString.substring(oldName.length());
replaced = true;
}
if (haveQuotes && replaced) {
newStr = "\"" + newStr; //$NON-NLS-1$
}
}
return newStr;
}
/**
* <b>NOTE</b>: This variable only used to debug, should not use it in product
*/
@@ -489,8 +511,8 @@ public final class ParameterValueUtil {
* @param vStart
* @param vEnd
*/
private static String doVaribleReplace(String oldName, String newName, String value, List<FunctionInfo> functions,
int vStart, int vEnd) {
private static String doVaribleReplace(String oldName, String newName, String value, List<FunctionInfo> functions, int vStart,
int vEnd) {
if (value.trim().isEmpty()) {
return value;
}
@@ -616,7 +638,7 @@ public final class ParameterValueUtil {
private static int calcMethodArea(String varibleString, String wholeString, int beginIndex, List<FunctionInfo> functions) {
// globalMap.get(...)
// String regex = "\\b\\S*\\s*\\.\\s*\\S*\\s*\\(\\z"; //$NON-NLS-1$
// String regex = "\\b\\S*\\s*\\.\\s*\\S*\\s*\\(\\z"; //$NON-NLS-1$
// maybe get(...) also is target
String regex = "\\b[\\w\\.]*?\\s*\\("; //$NON-NLS-1$
@@ -822,7 +844,7 @@ public final class ParameterValueUtil {
Object docValue = param.getValue();
if (docValue != null) {
if ((param.getRepositoryValue() != null && param.getRepositoryValue().toUpperCase().contains("PASSWORD") //$NON-NLS-1$
|| EParameterFieldType.PASSWORD.equals(param.getFieldType()))//
|| EParameterFieldType.PASSWORD.equals(param.getFieldType()))//
&& !ContextParameterUtils.containContextVariables((String) docValue)) {
if (isHidePassword()) { // if hide will display the *

View File

@@ -206,6 +206,11 @@ public class TalendLibsServerManager {
return mavenResolver;
}
public void checkAndUpdateNexusServer() {
lastConnectionValid = null;
getCustomNexusServer();
}
public NexusServerBean getCustomNexusServer() {
if (!org.talend.core.PluginChecker.isCoreTISPluginLoaded()) {
@@ -225,28 +230,35 @@ public class TalendLibsServerManager {
|| Boolean.FALSE == lastConnectionValid) {
return null;
}
if (repositoryContext != null && repositoryContext.getFields() != null && !factory.isLocalConnectionProvider()
&& !repositoryContext.isOffline()) {
String adminUrl = repositoryContext.getFields().get(RepositoryConstants.REPOSITORY_URL);
String userName = "";
String password = "";
User user = repositoryContext.getUser();
if (user != null) {
userName = user.getLogin();
password = repositoryContext.getClearPassword();
}
if (lastConnectionValid != Boolean.TRUE) {
if (repositoryContext != null && repositoryContext.getFields() != null && !factory.isLocalConnectionProvider()
&& !repositoryContext.isOffline()) {
String adminUrl = repositoryContext.getFields().get(RepositoryConstants.REPOSITORY_URL);
String userName = "";
String password = "";
User user = repositoryContext.getUser();
if (user != null) {
userName = user.getLogin();
password = repositoryContext.getClearPassword();
}
if (adminUrl != null && !"".equals(adminUrl)
&& GlobalServiceRegister.getDefault().isServiceRegistered(IRemoteService.class)) {
IRemoteService remoteService = (IRemoteService) GlobalServiceRegister.getDefault()
.getService(IRemoteService.class);
NexusServerBean bean = remoteService.getLibNexusServer(userName, password, adminUrl);
if (bean != null) {
nexus_url = bean.getServer();
nexus_user = bean.getUserName();
nexus_pass = bean.getPassword();
repositoryId = bean.getRepositoryId();
snapshotRepId = bean.getSnapshotRepId();
if (adminUrl != null && !"".equals(adminUrl)
&& GlobalServiceRegister.getDefault().isServiceRegistered(IRemoteService.class)) {
IRemoteService remoteService = (IRemoteService) GlobalServiceRegister.getDefault()
.getService(IRemoteService.class);
NexusServerBean bean = remoteService.getLibNexusServer(userName, password, adminUrl);
if (bean != null) {
nexus_url = bean.getServer();
nexus_user = bean.getUserName();
nexus_pass = bean.getPassword();
repositoryId = bean.getRepositoryId();
snapshotRepId = bean.getSnapshotRepId();
System.setProperty(NEXUS_URL, nexus_url);
System.setProperty(NEXUS_USER, nexus_user);
System.setProperty(NEXUS_PASSWORD, nexus_pass);
System.setProperty(NEXUS_LIB_REPO, repositoryId);
System.setProperty(NEXUS_LIB_SNAPSHOT_REPO, snapshotRepId);
}
}
}
}

View File

@@ -14,6 +14,7 @@ package org.talend.core.runtime.process;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.Set;
import org.talend.core.model.general.ModuleNeeded;
@@ -31,6 +32,8 @@ public class LastGenerationInfo {
private HashMap<String, Set<String>> pigudfNeededPerJob;
private HashMap<String, Set<ModuleNeeded>> modulesNeededWithSubjobPerJob;
private Set<ModuleNeeded> highPriorityModuleNeeded;
private HashMap<String, Set<String>> routinesNeededWithSubjobPerJob;
@@ -50,6 +53,7 @@ public class LastGenerationInfo {
modulesNeededPerJob = new HashMap<String, Set<ModuleNeeded>>();
contextPerJob = new HashMap<String, Set<String>>();
modulesNeededWithSubjobPerJob = new HashMap<String, Set<ModuleNeeded>>();
highPriorityModuleNeeded = new LinkedHashSet<ModuleNeeded>();
lastGeneratedjobs = new HashSet<JobInfo>();
routinesNeededPerJob = new HashMap<String, Set<String>>();
pigudfNeededPerJob = new HashMap<String, Set<String>>();
@@ -236,6 +240,14 @@ public class LastGenerationInfo {
}
return routinesNeededPerJob.get(key);
}
public Set<ModuleNeeded> getHighPriorityModuleNeeded() {
return highPriorityModuleNeeded;
}
public void setHighPriorityModuleNeeded(ModuleNeeded moduleNeeded) {
highPriorityModuleNeeded.add(moduleNeeded);
}
/**
* Getter for pigudfNeededPerJob.
@@ -322,6 +334,7 @@ public class LastGenerationInfo {
routinesNeededPerJob.clear();
pigudfNeededPerJob.clear();
modulesNeededWithSubjobPerJob.clear();
highPriorityModuleNeeded.clear();
routinesNeededWithSubjobPerJob.clear();
pigudfNeededWithSubjobPerJob.clear();
contextPerJob.clear();

View File

@@ -0,0 +1,23 @@
// ============================================================================
//
// Copyright (C) 2006-2017 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.runprocess;
/**
* DOC ggu class global comment. Detailled comment
*/
public interface IMavenProcessor {
String[] getChildrenJobDependencies();
void setChildrenJobDependencies(String[] dependencies);
}

View File

@@ -72,6 +72,8 @@ public final class ProjectManager {
public static final String BRANCHES_PREFIX = "branches/";
public static final String ORIGIN_PREFIX = "origin/";
public static final String TAGS_PREFIX = "tags/";
private static ProjectManager singleton;
@@ -917,6 +919,16 @@ public final class ProjectManager {
}
return branchName;
}
public static String getCleanTagName(String tagName) {
if (tagName == null) {
return null;
}
if (tagName.startsWith(TAGS_PREFIX)) {
return tagName.substring(TAGS_PREFIX.length());
}
return tagName;
}
public Set<String> getBeforeLogonRecords() {
return this.beforeLogonRecords;
@@ -950,5 +962,11 @@ public final class ProjectManager {
}
return list;
}
}
public void addProjectReferenceToCache(Project mainProject, List<ProjectReference> projectReferenceList) {
List<ProjectReference> allProjectReferenceList = allTACProjectProjectReferenceSetting
.get(mainProject.getTechnicalLabel());
allProjectReferenceList.addAll(projectReferenceList);
}
}

View File

@@ -261,6 +261,9 @@ public interface IProxyRepositoryFactory {
public abstract List<IRepositoryViewObject> getAllVersion(Project project, String id, boolean avoidSaveProject)
throws PersistenceException;
public abstract List<IRepositoryViewObject> getAllVersion(Project project, String id, String folderPath,
ERepositoryObjectType type) throws PersistenceException;
public abstract List<IRepositoryViewObject> getAllVersion(String id) throws PersistenceException;
public abstract IRepositoryViewObject getLastVersion(Project project, String id, String relativeFolder,

View File

@@ -29,6 +29,8 @@ public class RepositoryConstants {
public static final String SETTING_DIRECTORY = ".settings"; //$NON-NLS-1$
public static final String PROJECT_BRANCH_ID = "repository.project.branch"; //$NON-NLS-1$
public static final String IMG_DIRECTORY = "images"; //$NON-NLS-1$
public static final String IMG_DIRECTORY_OF_JOB_OUTLINE = "images/job_outlines"; //$NON-NLS-1$

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>6.4.1-SNAPSHOT</version>
<version>6.4.1</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.core.ui</artifactId>

View File

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

View File

@@ -205,10 +205,18 @@ public class DocumentationHelper {
return;
}
for (Object node2 : nodes) {
String label = ((RepositoryNode) node2).getProperties(EProperties.LABEL).toString();
String version = ""; //$NON-NLS-1$
String label = null;
Object properties = ((RepositoryNode) node2).getProperties(EProperties.LABEL);
IRepositoryViewObject object = ((RepositoryNode) node2).getObject();
if (properties != null) {
label = properties.toString();
} else if (object != null) {
label = object.getLabel();
}
if (label == null) {
label = ((RepositoryNode) node2).getLabel();
}
String version = ""; //$NON-NLS-1$
if (((RepositoryNode) node2).getType() != ENodeType.SIMPLE_FOLDER && object != null) {
version = object.getProperty().getVersion();
}

View File

@@ -15,11 +15,13 @@ package org.talend.designer.runprocess;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -36,6 +38,7 @@ import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.emf.common.util.EList;
import org.eclipse.ui.IEditorPart;
import org.talend.commons.CommonsPlugin;
@@ -47,6 +50,7 @@ import org.talend.commons.utils.generation.JavaUtils;
import org.talend.commons.utils.time.TimeMeasure;
import org.talend.core.CorePlugin;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.ITDQItemService;
import org.talend.core.PluginChecker;
import org.talend.core.context.Context;
import org.talend.core.context.RepositoryContext;
@@ -74,10 +78,12 @@ import org.talend.core.model.repository.RepositoryManager;
import org.talend.core.model.repository.job.JobResource;
import org.talend.core.model.repository.job.JobResourceManager;
import org.talend.core.model.utils.JavaResourcesHelper;
import org.talend.core.nexus.TalendLibsServerManager;
import org.talend.core.runtime.process.ITalendProcessJavaProject;
import org.talend.core.runtime.process.LastGenerationInfo;
import org.talend.core.runtime.process.TalendProcessArgumentConstant;
import org.talend.core.runtime.process.TalendProcessOptionConstants;
import org.talend.core.runtime.repository.build.BuildExportManager;
import org.talend.core.services.ISVNProviderService;
import org.talend.core.ui.IJobletProviderService;
import org.talend.core.ui.ITestContainerProviderService;
@@ -87,8 +93,10 @@ import org.talend.designer.core.model.utils.emf.talendfile.ContextType;
import org.talend.designer.core.model.utils.emf.talendfile.ElementParameterType;
import org.talend.designer.core.model.utils.emf.talendfile.NodeType;
import org.talend.designer.core.model.utils.emf.talendfile.ProcessType;
import org.talend.repository.documentation.ExportFileResource;
import org.talend.repository.model.IProxyRepositoryFactory;
import org.talend.repository.model.IRepositoryService;
import org.talend.utils.io.FilesUtils;
/**
* DOC nrousseau class global comment. Detailled comment <br/>
@@ -391,9 +399,11 @@ public class ProcessorUtilities {
isMainJob = true;
codeModified = false;
TalendLibsServerManager.getInstance().checkAndUpdateNexusServer();
// this cache only keep the last main job's generation, so clear it since we regenerate a new job.
LastGenerationInfo.getInstance().getLastGeneratedjobs().clear();
LastGenerationInfo.getInstance().getHighPriorityModuleNeeded().clear();
retrievedJarsForCurrentBuild.clear();
// if it's the father, reset the processMap to ensure to have a good
@@ -505,6 +515,8 @@ public class ProcessorUtilities {
setNeededResources(argumentsMap, jobInfo);
processor.setArguments(argumentsMap);
copyDQDroolsToSrc(selectedProcessItem);
// generate the code of the father after the childrens
// so the code won't have any error during the check, and it will help to check
// if the generation is really needed.
@@ -753,7 +765,11 @@ public class ProcessorUtilities {
// this cache only keep the last main job's generation, so clear it since we regenerate a new job.
LastGenerationInfo.getInstance().getLastGeneratedjobs().clear();
LastGenerationInfo.getInstance().getHighPriorityModuleNeeded().clear();
retrievedJarsForCurrentBuild.clear();
TalendLibsServerManager.getInstance().checkAndUpdateNexusServer();
// if it's the father, reset the processMap to ensure to have a good
// code generation
ItemCacheManager.clearCache();
@@ -887,6 +903,8 @@ public class ProcessorUtilities {
processor.setArguments(argumentsMap);
copyDQDroolsToSrc(selectedProcessItem);
generateContextInfo(jobInfo, selectedContextName, statistics, trace, needContext, progressMonitor, currentProcess,
currentJobName, processor, isMainJob, codeGenerationNeeded);
@@ -939,6 +957,59 @@ public class ProcessorUtilities {
}
}
/**
*
* copy the current item's drools file from 'workspace/metadata/survivorship' to '.Java/src/resources'
*
* @param processItem
*/
private static void copyDQDroolsToSrc(ProcessItem processItem) {
// 1.TDQ-12474 copy the "metadata/survivorship/rulePackage" to ".Java/src/main/resources/". so that it will be used by
// maven command 'include-survivorship-rules' to export.
// 2.TDQ-14308 current drools file in 'src/resourcesmetadata/survivorship/' should be included to job jar.
if (GlobalServiceRegister.getDefault().isServiceRegistered(ITDQItemService.class)) {
ITDQItemService tdqItemService = (ITDQItemService) GlobalServiceRegister.getDefault().getService(
ITDQItemService.class);
if (tdqItemService == null) {
return;
}
try {
ExportFileResource resouece = new ExportFileResource();
BuildExportManager.getInstance().exportDependencies(resouece, processItem);
if (resouece.getAllResources().isEmpty()) {
return;
}
final Iterator<String> relativepath = resouece.getRelativePathList().iterator();
String pathStr = "metadata/survivorship"; //$NON-NLS-1$
IRunProcessService runProcessService = CorePlugin.getDefault().getRunProcessService();
ITalendProcessJavaProject talendProcessJavaProject = runProcessService.getTalendProcessJavaProject();
IFolder targetFolder = talendProcessJavaProject.getResourcesFolder();
if (targetFolder.exists()) {
IFolder survFolder = targetFolder.getFolder(new Path(pathStr));
// only copy self job rules, clear the 'survivorship' folder before copy.
if (survFolder.exists()) {
survFolder.delete(true, null);
}
while (relativepath.hasNext()) {
String relativePath = relativepath.next();
Set<URL> sources = resouece.getResourcesByRelativePath(relativePath);
for (URL sourceUrl : sources) {
File currentResource = new File(org.talend.commons.utils.io.FilesUtils.getFileRealPath(sourceUrl
.getPath()));
if (currentResource.exists()) {
FilesUtils.copyDirectory(currentResource, new File(targetFolder.getLocation().toPortableString()
+ File.separator + pathStr));
}
}
}
}
} catch (Exception exc) {
log.error(exc);
}
}
}
/**
* DOC nrousseau Comment method "cloneJobInfo".
*

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>6.4.1-SNAPSHOT</version>
<version>6.4.1</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.cwm.mip.edit</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>6.4.1-SNAPSHOT</version>
<version>6.4.1</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.cwm.mip.editor</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>6.4.1-SNAPSHOT</version>
<version>6.4.1</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.cwm.mip</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>6.4.1-SNAPSHOT</version>
<version>6.4.1</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.datatools.xml</artifactId>

View File

@@ -8,6 +8,8 @@
package org.talend.datatools.xml.utils;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
@@ -57,7 +59,7 @@ public class ATreeNode {
private long precisionValue;
private static HashMap xmlTypeToDataType = new HashMap();
private Object foxTreeNode;
static {
@@ -103,6 +105,24 @@ public class ATreeNode {
}
}
public ATreeNode copy() {
ATreeNode copyNode = new ATreeNode();
// don't copy parents and foxTreeNode, need to reset.
copyNode.setChoice(isChoice);
copyNode.setCurrentNamespace(currentNamespace);
copyNode.setDataMaxLength(dataMaxLength);
copyNode.dataType = dataType;
copyNode.originalDataType = originalDataType;
copyNode.setLabel(label);
copyNode.setOptional(isOptional);
copyNode.setPrecisionValue(precisionValue);
copyNode.setSubstitution(isSubstitution);
copyNode.setType(type);
copyNode.setValue(value);
return copyNode;
}
/**
* Return the value of tree node.
*
@@ -118,6 +138,25 @@ public class ATreeNode {
* @return
*/
public Object[] getChildren() {
// sort children with order namespace/attribute/element
Collections.sort(children, new Comparator() {
/*
* (non-Javadoc)
*
* @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
*/
@Override
public int compare(Object o1, Object o2) {
if (o1 instanceof ATreeNode && o2 instanceof ATreeNode) {
ATreeNode node1 = (ATreeNode) o1;
ATreeNode node2 = (ATreeNode) o2;
return node2.getType() - node1.getType();
}
return 0;
}
});
return children.toArray();
}
@@ -273,10 +312,10 @@ public class ATreeNode {
}
@Override
public boolean equals(Object obj){
public boolean equals(Object obj) {
return equals(obj, 0);
}
public boolean equals(Object obj, int depth) {
if (this == obj) {
return true;
@@ -385,7 +424,7 @@ public class ATreeNode {
public void setPrecisionValue(long precisionValue) {
this.precisionValue = precisionValue;
}
public Object getFoxTreeNode() {
return foxTreeNode;
}
@@ -393,5 +432,5 @@ public class ATreeNode {
public void setFoxTreeNode(Object foxTreeNode) {
this.foxTreeNode = foxTreeNode;
}
}

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>6.4.1-SNAPSHOT</version>
<version>6.4.1</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.designer.maven.tos</artifactId>

View File

@@ -4,13 +4,13 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>studio-maven-repository-tos</artifactId>
<version>6.4.1-SNAPSHOT</version>
<version>6.4.1</version>
<relativePath>../</relativePath>
</parent>
<artifactId>studio-components-dependencies</artifactId>
<packaging>pom</packaging>
<properties>
<components.version>0.19.0</components.version>
<components.version>0.19.2</components.version>
</properties>
<repositories>
<repository>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>6.4.1-SNAPSHOT</version>
<version>6.4.1</version>
<relativePath>../../../../</relativePath>
</parent>
<artifactId>studio-maven-repository-tos</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>studio-maven-repository-tos</artifactId>
<version>6.4.1-SNAPSHOT</version>
<version>6.4.1</version>
<relativePath>../</relativePath>
</parent>
<artifactId>studio-surefire-dependencies</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>studio-maven-repository-tos</artifactId>
<version>6.4.1-SNAPSHOT</version>
<version>6.4.1</version>
<relativePath>../</relativePath>
</parent>
<artifactId>studio-maven-repository-unzip</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>studio-maven-repository-tos</artifactId>
<version>6.4.1-SNAPSHOT</version>
<version>6.4.1</version>
<relativePath>../</relativePath>
</parent>
<artifactId>studio-maven-repository-zip</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>6.4.1-SNAPSHOT</version>
<version>6.4.1</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.designer.maven.ui</artifactId>

View File

@@ -12,5 +12,11 @@
class="org.talend.designer.maven.setting.DefaultMavenTemplateManager">
</TemplateManager>
</extension>
<extension
point="org.talend.designer.maven.mavenPomJob">
<pomJobExtension
class="org.talend.designer.maven.tools.creator.UpdatePomAndAssemblyForChildrenJobs">
</pomJobExtension>
</extension>
</plugin>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>6.4.1-SNAPSHOT</version>
<version>6.4.1</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.designer.maven</artifactId>

View File

@@ -14,6 +14,7 @@
<url>http://www.talend.org/</url>
<properties>
<maven.deploy.skip>true</maven.deploy.skip>
<encoding>UTF-8</encoding>
</properties>

View File

@@ -27,7 +27,6 @@ public enum ETalendMavenVariables {
ProjectName,
ProjectId,
ProjectBranch,
CodesGroupId,
CodesArtifactId,

View File

@@ -271,7 +271,7 @@ public class MavenTemplateManager {
private static Model getDefaultCodeProjectTemplateModel(String projectTechName) {
Model templateCodeProjectMOdel = new Model();
templateCodeProjectMOdel.setGroupId(PomIdsHelper.getProjectGroupId(projectTechName));
templateCodeProjectMOdel.setGroupId(PomIdsHelper.getProjectGroupId());
templateCodeProjectMOdel.setArtifactId(PomIdsHelper.getProjectArtifactId());
templateCodeProjectMOdel.setVersion(PomIdsHelper.getProjectVersion());
templateCodeProjectMOdel.setPackaging(TalendMavenConstants.PACKAGING_POM);

View File

@@ -21,6 +21,7 @@ import java.util.List;
import java.util.Map;
import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.maven.model.Model;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
@@ -32,24 +33,23 @@ import org.eclipse.m2e.core.embedder.MavenModelManager;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.model.general.ILibrariesService;
import org.talend.core.model.general.Project;
import org.talend.core.model.process.IProcess;
import org.talend.core.model.process.ProcessUtils;
import org.talend.core.model.properties.Item;
import org.talend.core.model.properties.Project;
import org.talend.core.model.properties.Property;
import org.talend.core.runtime.process.ITalendProcessJavaProject;
import org.talend.core.runtime.process.TalendProcessArgumentConstant;
import org.talend.core.runtime.projectsetting.IProjectSettingPreferenceConstants;
import org.talend.core.runtime.projectsetting.IProjectSettingTemplateConstants;
import org.talend.core.runtime.projectsetting.ProjectPreferenceManager;
import org.talend.designer.maven.model.TalendMavenConstants;
import org.talend.designer.maven.template.MavenTemplateManager;
import org.talend.designer.maven.tools.creator.CreateMavenBeanPom;
import org.talend.designer.maven.tools.creator.CreateMavenBundleTemplatePom;
import org.talend.designer.maven.tools.creator.CreateMavenPigUDFPom;
import org.talend.designer.maven.tools.creator.CreateMavenRoutinePom;
import org.talend.designer.maven.utils.PomUtil;
import org.talend.designer.runprocess.IProcessor;
import org.talend.repository.ProjectManager;
import org.talend.repository.model.RepositoryConstants;
import org.talend.utils.io.FilesUtils;
/**
@@ -135,7 +135,21 @@ public class MavenPomSynchronizer {
templateParameters);
String jobInfoContent = MavenTemplateManager.getProjectSettingValue(IProjectSettingPreferenceConstants.TEMPLATE_JOB_INFO,
templateParameters);
String projectTechName = ProjectManager.getInstance().getProject(processor.getProperty()).getTechnicalLabel();
Project project = ProjectManager.getInstance()
.getProjectFromProjectTechLabel(projectTechName);
if (project == null) {
project = ProjectManager.getInstance().getCurrentProject();
}
String mainProjectBranch = ProjectManager.getInstance().getMainProjectBranch(project);
if (mainProjectBranch == null) {
ProjectPreferenceManager preferenceManager = new ProjectPreferenceManager(project, "org.talend.repository");
mainProjectBranch = preferenceManager.getValue(RepositoryConstants.PROJECT_BRANCH_ID);
if (mainProjectBranch == null) {
mainProjectBranch = "";
}
}
jobInfoContent = StringUtils.replace(jobInfoContent, "${talend.project.branch}", mainProjectBranch);
MavenTemplateManager.saveContent(shFile, shContent, overwrite);
MavenTemplateManager.saveContent(batFile, batContent, overwrite);
MavenTemplateManager.saveContent(infoFile, jobInfoContent, overwrite);

View File

@@ -13,6 +13,7 @@
package org.talend.designer.maven.tools;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
@@ -34,6 +35,7 @@ import org.talend.designer.maven.model.TalendMavenConstants;
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.runprocess.IMavenProcessor;
import org.talend.designer.runprocess.IProcessor;
import org.talend.repository.ProjectManager;
@@ -214,10 +216,21 @@ public class ProjectPomManager {
final String jobGroupPrefix = PomIdsHelper.getJobGroupId((String) null);
// org.talend.test
final String testGroupPrefix = PomIdsHelper.getTestGroupId((String) null);
// TUP-18769
List<String> childrenJobDependencies = new ArrayList<String>();
if (processor instanceof IMavenProcessor) {
String[] childrenJobDependencies2 = ((IMavenProcessor) processor).getChildrenJobDependencies();
if (childrenJobDependencies2 != null) {
childrenJobDependencies.addAll(Arrays.asList(childrenJobDependencies2));
}
}
Iterator<Dependency> iterator = withoutChildrenJobDependencies.iterator();
while (iterator.hasNext()) {
Dependency d = iterator.next();
if (d.getGroupId().startsWith(jobGroupPrefix) || d.getGroupId().startsWith(testGroupPrefix)) {
if (d.getGroupId().startsWith(jobGroupPrefix) || d.getGroupId().startsWith(testGroupPrefix)
|| childrenJobDependencies.contains(PomUtil.generateMvnUrl(d))) {
// remove the children job's dependencies
iterator.remove();
}

View File

@@ -13,6 +13,7 @@
package org.talend.designer.maven.tools.creator;
import java.util.HashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -44,6 +45,7 @@ import org.talend.designer.maven.template.ETalendMavenVariables;
import org.talend.designer.maven.tools.ProcessorDependenciesManager;
import org.talend.designer.maven.utils.PomIdsHelper;
import org.talend.designer.maven.utils.PomUtil;
import org.talend.designer.runprocess.IMavenProcessor;
import org.talend.designer.runprocess.IProcessor;
import org.talend.designer.runprocess.ProcessorException;
import org.talend.repository.ProjectManager;
@@ -169,10 +171,13 @@ public abstract class AbstractMavenProcessorPom extends CreateMavenBundleTemplat
try {
getProcessorDependenciesManager().updateDependencies(null, model);
IProcessor processor = getJobProcessor();
Set<String> childrenJobDependencies = new LinkedHashSet<String>();
// add children jobs in dependencies
final List<Dependency> dependencies = model.getDependencies();
String parentId = getJobProcessor().getProperty().getId();
final Set<JobInfo> clonedChildrenJobInfors = getJobProcessor().getBuildChildrenJobs();
String parentId = processor.getProperty().getId();
final Set<JobInfo> clonedChildrenJobInfors = processor.getBuildChildrenJobs();
for (JobInfo jobInfo : clonedChildrenJobInfors) {
if (jobInfo.getFatherJobInfo() != null && jobInfo.getFatherJobInfo().getJobId().equals(parentId)) {
if (!validChildrenJob(jobInfo)) {
@@ -187,7 +192,7 @@ public abstract class AbstractMavenProcessorPom extends CreateMavenBundleTemplat
// try to get the pom version of children job and load from the pom file.
String childPomFileName = PomUtil.getPomFileName(jobInfo.getJobName(), jobInfo.getJobVersion());
IProject codeProject = getJobProcessor().getCodeProject();
IProject codeProject = processor.getCodeProject();
try {
codeProject.refreshLocal(IResource.DEPTH_ONE, null); // is it ok or needed here ???
} catch (CoreException e) {
@@ -208,10 +213,15 @@ public abstract class AbstractMavenProcessorPom extends CreateMavenBundleTemplat
}
Dependency d = PomUtil.createDependency(groupId, artifactId, version, null);
childrenJobDependencies.add(PomUtil.generateMvnUrl(d));
dependencies.add(d);
}
}
}
if (processor instanceof IMavenProcessor) {
((IMavenProcessor) processor).setChildrenJobDependencies(childrenJobDependencies
.toArray(new String[childrenJobDependencies.size()]));
}
} catch (ProcessorException e) {
ExceptionHandler.process(e);
}

View File

@@ -14,26 +14,18 @@ package org.talend.designer.maven.tools.creator;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import org.apache.commons.lang.StringEscapeUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.maven.model.Activation;
@@ -58,7 +50,6 @@ import org.talend.core.model.properties.ProcessItem;
import org.talend.core.model.properties.Project;
import org.talend.core.model.properties.Property;
import org.talend.core.model.repository.IRepositoryViewObject;
import org.talend.core.model.repository.SVNConstant;
import org.talend.core.model.utils.JavaResourcesHelper;
import org.talend.core.runtime.CoreRuntimePlugin;
import org.talend.core.runtime.process.JobInfoProperties;
@@ -72,6 +63,7 @@ import org.talend.designer.maven.model.TalendMavenConstants;
import org.talend.designer.maven.template.ETalendMavenVariables;
import org.talend.designer.maven.template.MavenTemplateManager;
import org.talend.designer.maven.tools.MavenPomSynchronizer;
import org.talend.designer.maven.utils.PomIdsHelper;
import org.talend.designer.maven.utils.PomUtil;
import org.talend.designer.runprocess.IProcessor;
import org.talend.repository.ProjectManager;
@@ -191,10 +183,6 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
if (project == null) { // current project
project = ProjectManager.getInstance().getCurrentProject().getEmfProject();
}
String mainProjectBranch = ProjectManager.getInstance().getMainProjectBranch(project);
if (mainProjectBranch == null) {
mainProjectBranch = SVNConstant.NAME_TRUNK;
}
checkPomProperty(properties, "talend.job.path", ETalendMavenVariables.JobPath, jobClassPackageFolder);
checkPomProperty(properties, "talend.job.package", ETalendMavenVariables.JobPackage, jobClassPackage);
@@ -214,13 +202,11 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
isOptionChecked(TalendProcessArgumentConstant.ARG_ENABLE_STATS));
checkPomProperty(properties, "talend.project.name", ETalendMavenVariables.ProjectName,
jobInfoProp.getProperty(JobInfoProperties.PROJECT_NAME, project.getTechnicalLabel()));
project.getTechnicalLabel());
checkPomProperty(properties, "talend.project.name.lowercase", ETalendMavenVariables.ProjectName,
jobInfoProp.getProperty(JobInfoProperties.PROJECT_NAME, project.getTechnicalLabel()).toLowerCase());
project.getTechnicalLabel().toLowerCase());
checkPomProperty(properties, "talend.project.id", ETalendMavenVariables.ProjectId,
jobInfoProp.getProperty(JobInfoProperties.PROJECT_ID, String.valueOf(project.getId())));
checkPomProperty(properties, "talend.project.branch", ETalendMavenVariables.ProjectBranch,
jobInfoProp.getProperty(JobInfoProperties.BRANCH, mainProjectBranch));
checkPomProperty(properties, "talend.job.name", ETalendMavenVariables.JobName,
jobInfoProp.getProperty(JobInfoProperties.JOB_NAME, property.getLabel()));
@@ -447,14 +433,50 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
protected void afterCreate(IProgressMonitor monitor) throws Exception {
setPomForHDInsight(monitor);
// check for children jobs
Set<String> childrenGroupIds = new HashSet<>();
final Set<JobInfo> clonedChildrenJobInfors = getJobProcessor().getBuildChildrenJobs();
// main job built, should never be in the children list, even if recursive
clonedChildrenJobInfors.remove(LastGenerationInfo.getInstance().getLastMainJob());
for (JobInfo child : clonedChildrenJobInfors) {
if (child.getFatherJobInfo() != null) {
Property childProperty = null;
ProcessItem childItem = child.getProcessItem();
if (childItem != null) {
childProperty = childItem.getProperty();
} else {
String jobId = child.getJobId();
if (jobId != null) {
IProxyRepositoryFactory proxyRepositoryFactory = CoreRuntimePlugin.getInstance()
.getProxyRepositoryFactory();
IRepositoryViewObject specificVersion = proxyRepositoryFactory.getSpecificVersion(jobId,
child.getJobVersion(), true);
if (specificVersion != null) {
childProperty = specificVersion.getProperty();
}
}
}
if (childProperty != null) {
final String childGroupId = PomIdsHelper.getJobGroupId(childProperty);
if (childGroupId != null) {
childrenGroupIds.add(childGroupId);
}
}
}
}
generateAssemblyFile(monitor, clonedChildrenJobInfors);
final IProcess process = getJobProcessor().getProcess();
Map<String, Object> args = new HashMap<String, Object>();
args.put(IPomJobExtension.KEY_PROCESS, process);
args.put(IPomJobExtension.KEY_ASSEMBLY_FILE, getAssemblyFile());
args.put(IPomJobExtension.KEY_CHILDREN_GROUPS, childrenGroupIds);
PomJobExtensionRegistry.getInstance().updatePom(monitor, getPomFile(), args);
generateAssemblyFile(monitor);
// generate routines
MavenPomSynchronizer pomSync = new MavenPomSynchronizer(this.getJobProcessor());
pomSync.setArgumentsMap(getArgumentsMap());
@@ -499,7 +521,7 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
}
}
protected void generateAssemblyFile(IProgressMonitor monitor) throws Exception {
protected void generateAssemblyFile(IProgressMonitor monitor, final Set<JobInfo> clonedChildrenJobInfors) throws Exception {
IFile assemblyFile = this.getAssemblyFile();
if (assemblyFile != null) {
@@ -539,23 +561,20 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
if (set) {
// add children resources in assembly.
addChildrenJobsInAssembly(monitor, assemblyFile);
addChildrenJobsInAssembly(monitor, assemblyFile, clonedChildrenJobInfors);
}
}
}
@SuppressWarnings("nls")
protected void addChildrenJobsInAssembly(IProgressMonitor monitor, IFile assemblyFile) throws Exception {
protected void addChildrenJobsInAssembly(IProgressMonitor monitor, IFile assemblyFile,
final Set<JobInfo> clonedChildrenJobInfors) throws Exception {
if (!assemblyFile.exists()) {
return;
}
final File file = assemblyFile.getLocation().toFile();
// assemblyFile
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
Document document = db.parse(file);
Document document = PomUtil.loadAssemblyFile(monitor, assemblyFile);
if (document == null) {
throw new IOException("Can't parse the file: " + file);
throw new IOException("Can't parse the file: " + assemblyFile.getLocation());
}
// files
@@ -571,10 +590,6 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
List<String> childrenPomsIncludes = new ArrayList<String>();
List<String> childrenFolderResourcesIncludes = new ArrayList<String>();
final Set<JobInfo> clonedChildrenJobInfors = getJobProcessor().getBuildChildrenJobs();
// main job built, should never be in the children list, even if recursive
clonedChildrenJobInfors.remove(LastGenerationInfo.getInstance().getLastMainJob());
for (JobInfo child : clonedChildrenJobInfors) {
if (child.getFatherJobInfo() != null) {
@@ -632,18 +647,9 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
addAssemblyFileSets(fileSetsElem, "${contexts.running.dir}", "${talend.job.name}", false,
childrenFolderResourcesIncludes, null, null, null, null, false, "add children context files for running.");
}
TransformerFactory transFactory = TransformerFactory.newInstance();
Transformer transFormer = transFactory.newTransformer();
transFormer.setOutputProperty(OutputKeys.INDENT, "yes");
FileOutputStream output = null;
try {
output = new FileOutputStream(file);
transFormer.transform(new DOMSource(document), new StreamResult(output));
} finally {
if (output != null) {
output.close();
}
}
PomUtil.saveAssemblyFile(monitor, assemblyFile, document);
// clean for children poms
cleanChildrenPomSettings(monitor, childrenPomsIncludes);
}
@@ -655,6 +661,7 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
IFile childPom = assemblyFile.getProject().getFile(childPomFile);
if (childPom.exists()) {
Model childModel = MODEL_MANAGER.readMavenModel(childPom);
childModel.getProperties().setProperty("maven.deploy.skip", Boolean.TRUE.toString()); //$NON-NLS-1$
List<Plugin> childPlugins = new ArrayList<Plugin>(childModel.getBuild().getPlugins());
Iterator<Plugin> childIterator = childPlugins.iterator();
while (childIterator.hasNext()) {
@@ -665,6 +672,9 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
} else if (p.getArtifactId().equals("maven-antrun-plugin")) { //$NON-NLS-1$
// because no assembly, so no need copy the scripts and rename it.
childIterator.remove();
} else if (p.getArtifactId().equals("maven-deploy-plugin")) { //$NON-NLS-1$
// no assembly so no need to do deploy for zip.
childIterator.remove();
}
}

View File

@@ -14,7 +14,11 @@ import org.eclipse.core.runtime.IProgressMonitor;
*/
public interface IPomJobExtension {
static final String KEY_PROCESS = "PROCESS"; //$NON-NLS-1$
String KEY_PROCESS = "PROCESS"; //$NON-NLS-1$
String KEY_ASSEMBLY_FILE = "ASSEMBLY_FILE"; //$NON-NLS-1$
String KEY_CHILDREN_GROUPS = "CHILDREN_GROUPS"; //$NON-NLS-1$
void updatePom(IProgressMonitor monitor, IFile pomFile, Map<String, Object> args);

View File

@@ -0,0 +1,224 @@
// ============================================================================
//
// Copyright (C) 2006-2016 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.creator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Properties;
import java.util.Set;
import org.apache.maven.model.Model;
import org.apache.maven.model.Profile;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.m2e.core.MavenPlugin;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.designer.maven.utils.PomUtil;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
/**
* DOC ggu class global comment. Detailled comment
*/
public class UpdatePomAndAssemblyForChildrenJobs implements IPomJobExtension {
/*
* (non-Javadoc)
*
* @see
* org.talend.designer.maven.tools.creator.IPomJobExtension#updatePom(org.eclipse.core.runtime.IProgressMonitor,
* org.eclipse.core.resources.IFile, java.util.Map)
*/
@SuppressWarnings("unchecked")
@Override
public void updatePom(IProgressMonitor monitor, IFile pomFile, Map<String, Object> args) {
if (pomFile == null || args == null || args.isEmpty() || !pomFile.exists()) {
return;
}
Set<String> childrenGroupIds = new HashSet<>();
if (args.containsKey(KEY_CHILDREN_GROUPS)) {
childrenGroupIds = (Set<String>) args.get(KEY_CHILDREN_GROUPS);
}
if (childrenGroupIds == null || childrenGroupIds.isEmpty()) {
return;
}
// set group map for libs and binaries
Map<String, String> childrenGroupsLibExcludesMap = new HashMap<>();
Map<String, String> childrenGroupsBinariesIncludesMap = new HashMap<>();
final String[] array = childrenGroupIds.toArray(new String[0]);
for (int i = 0; i < array.length; i++) {
String groupId = array[i];
final String childSet = groupId + ":*";
childrenGroupsLibExcludesMap.put("talend.jobs.excludes.set.child" + i, childSet);
childrenGroupsBinariesIncludesMap.put("jobs.binaries.includes.set.child" + i, childSet);
}
try {
updatePomProfiles(monitor, pomFile, childrenGroupsLibExcludesMap, childrenGroupsBinariesIncludesMap);
if (args.containsKey(KEY_ASSEMBLY_FILE)) {
IFile assemblyFile = (IFile) args.get(KEY_ASSEMBLY_FILE);
updateAssemblyDependencySets(monitor, assemblyFile, childrenGroupsLibExcludesMap,
childrenGroupsBinariesIncludesMap);
}
} catch (Exception e) {
ExceptionHandler.process(e);
}
}
private void updatePomProfiles(IProgressMonitor monitor, IFile pomFile,
final Map<String, String> childrenGroupsLibExcludesMap, final Map<String, String> childrenGroupsBinariesIncludesMap)
throws Exception {
Model pomModel = MavenPlugin.getMavenModelManager().readMavenModel(pomFile);
boolean modified = false;
for (Profile p : pomModel.getProfiles()) {
if (p.getId().equals("include-libs")) {
addProfileProperties(p, childrenGroupsLibExcludesMap);
modified = true;
} else if (p.getId().equals("include-binaries")) {
addProfileProperties(p, childrenGroupsBinariesIncludesMap);
modified = true;
}
}
if (modified) {
PomUtil.savePom(monitor, pomModel, pomFile);
}
}
private void addProfileProperties(Profile p, final Map<String, String> props) {
final Properties properties = p.getProperties();
final Iterator<Entry<String, String>> entryIt = props.entrySet().iterator();
while (entryIt.hasNext()) {
final Entry<String, String> entry = entryIt.next();
properties.put(entry.getKey(), entry.getValue());
}
}
private void updateAssemblyDependencySets(IProgressMonitor monitor, IFile assemblyFile,
final Map<String, String> childrenGroupsLibExcludesMap, final Map<String, String> childrenGroupsBinariesIncludesMap)
throws Exception {
if (assemblyFile == null || !assemblyFile.exists() || childrenGroupsLibExcludesMap.isEmpty()) {
return;
}
Document document = PomUtil.loadAssemblyFile(monitor, assemblyFile);
if (document == null) {
return;
}
Node dependencySetsElem = getElement(document.getDocumentElement(), "dependencySets", 1);
if (dependencySetsElem == null) {
return;
}
boolean modified = false;
final NodeList dependencySetNodes = dependencySetsElem.getChildNodes();
for (int i = 0; i < dependencySetNodes.getLength(); i++) {
Node dependencySetNode = dependencySetNodes.item(i);
if (dependencySetNode.getNodeType() == Node.ELEMENT_NODE && dependencySetNode.getNodeName().equals("dependencySet")) {
final Node outputDirectoryNode = getElement(dependencySetNode, "outputDirectory", 1);
if (outputDirectoryNode == null) {
continue;
}
// exclude for libs
if ("lib".equals(outputDirectoryNode.getTextContent())) {
final Node excludesNode = getElement(dependencySetNode, "excludes", 1);
if (excludesNode != null) {
boolean valid = false;
final NodeList childNodes = excludesNode.getChildNodes();
for (int index = 0; index < childNodes.getLength(); index++) {
Node exclude = childNodes.item(index);
if (exclude.getNodeType() == Node.ELEMENT_NODE && exclude.getNodeName().equals("exclude")) {
if ("${talend.jobs.excludes.set}".equals(exclude.getTextContent())) {
valid = true;
break;
}
}
}
//
if (valid) {
final Iterator<Entry<String, String>> libExcludesIt = childrenGroupsLibExcludesMap.entrySet()
.iterator();
while (libExcludesIt.hasNext()) {
final Entry<String, String> libExcludeEntry = libExcludesIt.next();
final Element excludeElement = document.createElement("exclude");
excludesNode.appendChild(excludeElement);
excludeElement.setTextContent("${" + libExcludeEntry.getKey() + "}");
}
modified = true;
}
}
}
// include for children jobs
if ("${talend.job.name}".equals(outputDirectoryNode.getTextContent())) {
final Node includesNode = getElement(dependencySetNode, "includes", 1);
if (includesNode != null) {
boolean valid = false;
final NodeList childNodes = includesNode.getChildNodes();
for (int index = 0; index < childNodes.getLength(); index++) {
Node include = childNodes.item(index);
if (include.getNodeType() == Node.ELEMENT_NODE && include.getNodeName().equals("include")) {
if ("${jobs.binaries.includes.set}".equals(include.getTextContent())) {
valid = true;
break;
}
}
}
if (valid) {
final Iterator<Entry<String, String>> binariesIncludesIt = childrenGroupsBinariesIncludesMap
.entrySet().iterator();
while (binariesIncludesIt.hasNext()) {
final Entry<String, String> binariesIncludeEntry = binariesIncludesIt.next();
final Element includeElement = document.createElement("include");
includesNode.appendChild(includeElement);
includeElement.setTextContent("${" + binariesIncludeEntry.getKey() + "}");
}
modified = true;
}
}
}
}
}
if (modified) {
PomUtil.saveAssemblyFile(monitor, assemblyFile, document);
}
}
private Node getElement(Node parent, String elemName, int level) {
NodeList childrenNodeList = parent.getChildNodes();
for (int i = 0; i < childrenNodeList.getLength(); i++) {
Node child = childrenNodeList.item(i);
if (child != null && child.getNodeType() == Node.ELEMENT_NODE) {
if (child.getNodeName().equals(elemName)) {
return child;
}
}
if (level > 1) {
Node element = getElement(child, elemName, --level);
if (element != null) {
return element;
}
}
}
return null;
}
}

View File

@@ -36,10 +36,11 @@ public class PomIdsHelper {
*
* always depend on current project.
*/
public static String getProjectGroupId(String projectTechName) {
if (projectTechName != null && !projectTechName.trim().isEmpty()) {
return JavaResourcesHelper.getGroupName(TalendMavenConstants.DEFAULT_MASTER + '.'
+ projectTechName.trim().toLowerCase());
public static String getProjectGroupId() {
final Project currentProject = ProjectManager.getInstance().getCurrentProject();
if (currentProject != null) {
String technicalLabel = currentProject.getTechnicalLabel();
return JavaResourcesHelper.getGroupName(TalendMavenConstants.DEFAULT_MASTER + '.' + technicalLabel);
}
return JavaResourcesHelper.getGroupName(TalendMavenConstants.DEFAULT_MASTER);
}
@@ -121,16 +122,9 @@ public class PomIdsHelper {
public static String getTestGroupId(Property property) {
if (property != null) {
final org.talend.core.model.properties.Project project = ProjectManager.getInstance().getProject(property);
if (project != null) {
if (project != null) {
final Project currentProject = ProjectManager.getInstance().getCurrentProject();
if (currentProject.getTechnicalLabel().equals(project.getTechnicalLabel())) {
return getTestGroupId(project.getTechnicalLabel());
} else { // reference project
return getTestGroupId(currentProject.getTechnicalLabel() + '.' + project.getTechnicalLabel());
}
}
Project currentProject = ProjectManager.getInstance().getCurrentProject();
if (currentProject != null) {
return getTestGroupId(currentProject.getTechnicalLabel());
}
}
return getTestGroupId((String) null);
@@ -147,14 +141,9 @@ public class PomIdsHelper {
return groupId;
}
}
final org.talend.core.model.properties.Project project = ProjectManager.getInstance().getProject(property);
if (project != null) {
final Project currentProject = ProjectManager.getInstance().getCurrentProject();
if (currentProject.getTechnicalLabel().equals(project.getTechnicalLabel())) {
return getJobGroupId(project.getTechnicalLabel());
} else { // reference project
return getJobGroupId(currentProject.getTechnicalLabel() + '.' + project.getTechnicalLabel());
}
Project currentProject = ProjectManager.getInstance().getCurrentProject();
if (currentProject != null) {
return getJobGroupId(currentProject.getTechnicalLabel());
}
}
return getJobGroupId((String) null);

View File

@@ -15,6 +15,7 @@ package org.talend.designer.maven.utils;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.security.SecureRandom;
import java.util.ArrayList;
@@ -31,7 +32,6 @@ import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
@@ -460,6 +460,55 @@ public class PomUtil {
return pomModel;
}
public static String generatePomInFolder(File baseFolder, MavenArtifact artifact) throws Exception {
if (baseFolder == null || artifact == null) {
return null;
}
if (!baseFolder.exists()) {
baseFolder.mkdirs();
}
File pomFile = new File(baseFolder, TalendMavenConstants.POM_FILE_NAME);
ByteArrayOutputStream buf = new ByteArrayOutputStream();
MavenPlugin.getMaven().writeModel(createModel(artifact), buf);
DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
documentBuilderFactory.setNamespaceAware(false);
DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
TransformerFactory tfactory = TransformerFactory.newInstance();
Document document = documentBuilder.parse(new ByteArrayInputStream(buf.toByteArray()));
Element documentElement = document.getDocumentElement();
NamedNodeMap attributes = documentElement.getAttributes();
if (attributes == null || attributes.getNamedItem("xmlns") == null) { //$NON-NLS-1$
Attr attr = document.createAttribute("xmlns"); //$NON-NLS-1$
attr.setTextContent("http://maven.apache.org/POM/4.0.0"); //$NON-NLS-1$
documentElement.setAttributeNode(attr);
}
if (attributes == null || attributes.getNamedItem("xmlns:xsi") == null) { //$NON-NLS-1$
Attr attr = document.createAttribute("xmlns:xsi"); //$NON-NLS-1$
attr.setTextContent("http://www.w3.org/2001/XMLSchema-instance"); //$NON-NLS-1$
documentElement.setAttributeNode(attr);
}
if (attributes == null || attributes.getNamedItem("xsi:schemaLocation") == null) { //$NON-NLS-1$
Attr attr = document.createAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "xsi:schemaLocation"); //$NON-NLS-1$ //$NON-NLS-2$
attr.setTextContent("http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"); //$NON-NLS-1$
documentElement.setAttributeNode(attr);
}
Transformer transformer = tfactory.newTransformer();
DOMSource source = new DOMSource(document);
StreamResult result = new StreamResult(pomFile);
transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes"); //$NON-NLS-1$
transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
transformer.transform(source, result);
return pomFile.getAbsolutePath();
}
/**
*
* Create pom without refresh eclipse resources
@@ -475,59 +524,8 @@ public class PomUtil {
IPath tempPath = fsProject.getLocation().append("temp").append("pom" + Math.abs(random.nextLong()));
File tmpFolder = new File(tempPath.toPortableString());
tmpFolder.mkdirs();
String pomFile = tempPath.append(TalendMavenConstants.POM_FILE_NAME).toPortableString();
ByteArrayOutputStream buf = new ByteArrayOutputStream();
MavenPlugin.getMaven().writeModel(createModel(artifact), buf);
DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
documentBuilderFactory.setNamespaceAware(false);
DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
TransformerFactory tfactory = TransformerFactory.newInstance();
Document document = documentBuilder.parse(new ByteArrayInputStream(buf.toByteArray()));
Element documentElement = document.getDocumentElement();
NamedNodeMap attributes = documentElement.getAttributes();
if (attributes == null || attributes.getNamedItem("xmlns") == null) { //$NON-NLS-1$
Attr attr = document.createAttribute("xmlns"); //$NON-NLS-1$
attr.setTextContent("http://maven.apache.org/POM/4.0.0"); //$NON-NLS-1$
documentElement.setAttributeNode(attr);
}
if (attributes == null || attributes.getNamedItem("xmlns:xsi") == null) { //$NON-NLS-1$
Attr attr = document.createAttribute("xmlns:xsi"); //$NON-NLS-1$
attr.setTextContent("http://www.w3.org/2001/XMLSchema-instance"); //$NON-NLS-1$
documentElement.setAttributeNode(attr);
}
if (attributes == null || attributes.getNamedItem("xsi:schemaLocation") == null) { //$NON-NLS-1$
Attr attr = document.createAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "xsi:schemaLocation"); //$NON-NLS-1$ //$NON-NLS-2$
attr.setTextContent("http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"); //$NON-NLS-1$
documentElement.setAttributeNode(attr);
}
Transformer transformer = tfactory.newTransformer();
DOMSource source = new DOMSource(document);
StreamResult result = new StreamResult(new File(pomFile));
transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes"); //$NON-NLS-1$
transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
transformer.transform(source, result);
return pomFile;
} catch (PersistenceException e) {
ExceptionHandler.process(e);
} catch (CoreException e) {
ExceptionHandler.process(e);
} catch (ParserConfigurationException e) {
ExceptionHandler.process(e);
} catch (SAXException e) {
ExceptionHandler.process(e);
} catch (IOException e) {
ExceptionHandler.process(e);
} catch (TransformerConfigurationException e) {
ExceptionHandler.process(e);
} catch (TransformerException e) {
return generatePomInFolder(tmpFolder, artifact);
} catch (Exception e) {
ExceptionHandler.process(e);
}
return null;
@@ -675,4 +673,34 @@ public class PomUtil {
}
return jobVersion;
}
public static Document loadAssemblyFile(IProgressMonitor monitor, IFile assemblyFile) throws ParserConfigurationException,
SAXException, IOException {
final File file = assemblyFile.getLocation().toFile();
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
Document document = db.parse(file);
return document;
}
public static void saveAssemblyFile(IProgressMonitor monitor, IFile assemblyFile, Document document)
throws TransformerException, IOException {
final File file = assemblyFile.getLocation().toFile();
TransformerFactory transFactory = TransformerFactory.newInstance();
Transformer transFormer = transFactory.newTransformer();
transFormer.setOutputProperty(OutputKeys.INDENT, "yes");
FileOutputStream output = null;
try {
output = new FileOutputStream(file);
transFormer.transform(new DOMSource(document), new StreamResult(output));
} finally {
if (output != null) {
try {
output.close();
} catch (IOException e) {
ExceptionHandler.process(e);
}
}
}
}
}

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>6.4.1-SNAPSHOT</version>
<version>6.4.1</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.developpement</artifactId>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>6.4.1-SNAPSHOT</version>
<version>6.4.1</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.helpers</artifactId>

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