Compare commits

...

103 Commits

Author SHA1 Message Date
Irene Wang
1be3e5919e Pin Maven plugin versions 2019-07-09 16:32:17 +02:00
Jane Ding
73829777ab Jding/tup 20866 backport to maintenance64 (#2025)
fix(TUP-20866) avoid crash on mojave
2019-03-29 17:23:13 +08:00
pyzhou
04341ca72d fix(TDI-39968):Compile error of constant string too long. (#1420) 2018-02-07 11:10:39 +08:00
pyzhou
da82aecd00 fix(TDI-39968):Split SQL to avoid exceed 64k limitation. (#1399)
Conflicts:
	main/plugins/org.talend.core.runtime/src/main/java/org/talend/core/model/utils/NodeUtil.java
2018-02-05 15:32:41 +08:00
hcyi
b01d1edad0 fix(TDI-39365): Support Amazon Redshift JDBC Driver 1.2.10 as 1.2.8 have
some bug though amazon release note don't contain 1.2.10 now
2017-10-18 18:12:28 +08:00
hcyi
71b95ffe82 fix(TDI-39365): Support Amazon Redshift JDBC Driver 1.2.8 2017-10-18 10:25:07 +08:00
nrousseau
ce642e7e25 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-09-14 11:56:28 +08:00
wchen-talend
285031d006 TPS-2121:[6.2.1]The Generated schema is wrong by 'Import WSDL
Schemas(TUP-18452)
2017-09-05 14:44:37 +08:00
zwxue
aeb90f135c fix(TUP-18382):tXMLMap miss some fields while import schema from (#1193) 2017-08-21 10:34:35 +08:00
hwang-talend
497ae99da7 fix(TUP-18208):Studio sending multiple getLibLocation metaservlet
Conflicts:
	main/plugins/org.talend.core.runtime/src/main/java/org/talend/core/ILibraryManagerService.java
2017-08-14 17:15:18 +08:00
zwxue
d4038a7b00 fix(TUP-17418): ContextOverride does not apply context the same as
Regular Context.
2017-08-02 16:36:49 +08:00
wchen-talend
3ab79261d0 fix(TPS-1905):[6.2.1]Faulty impact analysis and detect dependencies on
joblets (GIT?)(TUP-17248 & TUP-17418)
2017-08-01 15:18:14 +08:00
kjwang-talend
7d63df9992 fix(TUP-17412): Remote_Runs_from_Studio_Display_Project_Setting_Log4jLevel(Fix (#1065) 2017-07-31 18:58:03 +08:00
kjwang-talend
a5a7e8d8ef fix(TUP-17412): remote runs from studio display project setting Log4jLevel (#962) 2017-07-31 17:59:11 +08:00
hcyi
4dc2c392b8 TUP-17036:Job fail to run use remote jobserver. 2017-06-12 18:22:37 +08:00
hwang
64913f0de0 fix(TUP-17422/hwang):Job lost the related joblet, after empty recycle 2017-05-12 11:25:42 +08:00
hwang
1f1fc295bf fix(TDI-21403/hwang):Job lost the related joblet, after empty recycle
bin.
2017-05-12 11:24:50 +08:00
hwang
d566b5c618 TUP-17130:Two context group with same name 2017-05-02 11:21:51 +08:00
hwang
3661475476 TUP-17255:Context groups once edited, changes it name. 2017-05-02 11:20:07 +08:00
cmeng-talend
47454db941 TUP-17031 fix: Studio unstability since the application of the patch:
"Patch_20170117_TPS-1726_TPS-1688_v1-6.2.1.zip"
https://jira.talendforge.org/browse/TUP-17031
2017-04-18 18:59:35 +08:00
cmeng-talend
2738e22635 TUP-17031 fix: Studio unstability since the application of the patch:
"Patch_20170117_TPS-1726_TPS-1688_v1-6.2.1.zip"
https://jira.talendforge.org/browse/TUP-17031

1. Fix the null migration task problem of talend.project
2017-04-18 18:58:59 +08:00
wchen-talend
ff8770c26f TUP-17229:context value be overwrited after retrieve schema 2017-04-18 10:51:04 +08:00
Yucheng Bai
50c5f9fe21 TUP-16441: Issue with opening job with context group in Salesforce
(#766)

component.

Conflicts:
	main/plugins/org.talend.metadata.managment.ui/src/main/java/org/talend/metadata/managment/ui/wizard/context/MetadataContextPropertyValueEvaluator.java
2017-04-11 14:34:29 +08:00
zwxue
d5a8afb0e4 TUP-17148: Create xmlFile with XSD file occur "StackOverflowError". 2017-03-27 16:40:08 +08:00
guol
2423568f41 TUP-16015 fix:The studio can't preview xml file on 6.3 2017-03-27 16:39:45 +08:00
Yucheng Bai
d8f1efe293 TUP-17176: [6.2.1] tLibraryLoad Dynamic Lib path doesnt load library (#887)
from path
2017-03-23 09:54:34 +08:00
zshen-talend
fb228def78 bug fixed TPS-1852 TDQ-13488 fix java engin case 2017-03-22 17:58:54 +08:00
zshen
b67bb95bfc bug fixed TDQ-13488 backport on the brnch 6.2 2017-03-21 12:47:53 +08:00
hwang
c18a46d80c TUP-17194:Error with a job using nested joblets with MDM components 2017-03-16 17:36:26 +08:00
cmeng-talend
ae1e73aa5d TUP-16073 fix: Importing duplicated job causes wrong subjob referenced
in tRunJob
https://jira.talendforge.org/browse/TUP-16073

Should only check the selected item

Conflicts:
	main/plugins/org.talend.repository.items.importexport/src/main/java/org/talend/repository/items/importexport/handlers/ImportExportHandlersManager.java
2017-03-13 14:30:45 +08:00
cmeng-talend
bc57342be6 TUP-16073 fix: Importing duplicated job causes wrong subjob referenced
in tRunJob
https://jira.talendforge.org/browse/TUP-16073

Use new logic to change the id
2017-03-13 14:27:20 +08:00
cmeng-talend
772f3919ee TUP-16073 fix: Importing duplicated job causes wrong subjob referenced
in tRunJob
https://jira.talendforge.org/browse/TUP-16073

Use new logic to change the id
2017-03-13 14:26:03 +08:00
cmeng-talend
ba2bbe99e8 Revert "revert TUP-16073 fix: Importing duplicated job causes wrong
subjob referenced in tRunJob (#728)"

This reverts commit 71e020765f.

Conflicts:
	main/plugins/org.talend.repository.items.importexport/src/main/java/org/talend/repository/items/importexport/handlers/cache/RepositoryObjectCache.java

Conflicts:
	main/plugins/org.talend.repository.items.importexport/src/main/java/org/talend/repository/items/importexport/handlers/ImportExportHandlersManager.java
	main/plugins/org.talend.repository.items.importexport/src/main/java/org/talend/repository/items/importexport/handlers/model/ImportItem.java
2017-03-13 14:25:28 +08:00
build-talend
cfe000dec2 DEVOPS-1729 Nexus migration: Update URLs 2017-03-06 15:06:44 +08:00
GGu
7b6f6610da TBD-3996: Only disable autobuild when it's actived. 2017-03-03 15:24:48 +08:00
iwangtalend
9b2534c053 Merge pull request #886 from Talend/feature/DEVOPS-1729/patch/6.2.1_nexus
DEVOPS-1729 Nexus migration: Update URLs [patch/6.2.1]
2017-03-02 16:40:40 +01:00
build-talend
48dab7e53e DEVOPS-1729 Nexus migration: Update URLs 2017-03-02 16:20:48 +01:00
cmeng-talend
6c74a3c784 TUP-5285 fix: Error version conflict in git merge editor.
https://jira.talendforge.org/browse/TUP-5285
2017-02-16 11:14:18 +08:00
cmeng-talend
2c2eefaad2 TUP-17099 fix: Studio blocked after click refresh button
https://jira.talendforge.org/browse/TUP-17099
2017-02-14 10:57:47 +08:00
cmeng-talend
8b000d1c3b TUP-5270 fix: Studio is stuck when two users make talend.project
conflict
https://jira.talendforge.org/browse/TUP-5270
https://jira.talendforge.org/browse/TPS-1743

1. fix the block issue

Conflicts:
	main/plugins/org.talend.repository.view/src/org/talend/repository/navigator/RepoViewCommonNavigator.java
2017-02-14 10:57:12 +08:00
cmeng-talend
f381e5ea3f TUP-5270 fix: Studio is stuck when two users make talend.project
conflict
https://jira.talendforge.org/browse/TUP-5270
https://jira.talendforge.org/browse/TPS-1743

1. fix the block issue

Conflicts:
	main/plugins/org.talend.repository.view/src/org/talend/repository/navigator/RepoViewCommonNavigator.java
2017-02-10 10:59:28 +08:00
zwxue
6b9a18246b TUP-16573: cmdline generate time increase as the tasks number increase. 2017-01-10 10:38:28 +08:00
Yucheng Bai
312272e4c8 TUP-16619: SFTP problems related to the migration from 5.2.1 to 6.2.1 (#807) 2017-01-05 10:51:21 +08:00
hwang
202e75c108 TPS-1734:[6.2.1] Nested Joblets cause code generation failures for
lookups (TUP-16590)
2016-12-30 10:28:57 +08:00
GuoLiang
d17c7e2394 TUP-16461 fix:Building the job is not generating zip file (#768)
Conflicts:
	main/plugins/org.talend.designer.maven/src/main/java/org/talend/designer/maven/launch/MavenCommandLauncher.java
2016-12-30 10:05:21 +08:00
zwxue
ecbd97aba0 TUP-15856: Unable to create metadata from xsd file. 2016-12-23 10:54:30 +08:00
Kevin Wang
3b1b9d4f51 TUP-16262 Fix Opening schema is very slow using Talend studio 6.2
https://jira.talendforge.org/browse/TUP-16262
2016-12-22 14:32:40 +08:00
Kevin Wang
37cfc826a1 TUP-16262 Fix Opening schema is very slow using Talend studio 6.2
https://jira.talendforge.org/browse/TUP-16262
2016-12-21 15:01:45 +08:00
ycbai
5af4f4d66c TUP-15848: tRowGenerator Not Saving DataMasking Parameters 2016-12-20 16:51:44 +08:00
GGu
359dd99d47 TUP-4922: fix the relationship problem for test case 2016-12-05 18:34:41 +08:00
GGu
988180e793 TUP-4922: support reference project for local project 2016-12-05 18:34:27 +08:00
Yucheng Bai
0fd134ee6f TUP-16317: migration : password of implicit context Load project (#737)
settings wrongly handled.
2016-11-28 18:21:41 +08:00
hcyi
bcf6f75a45 TUP-16327:fix the problem of teradata truncates the names at 30
characters for tables,views,columns.
2016-11-28 02:53:45 +08:00
cmeng-talend
f513fb4c52 TUP-16164 fix: Studio freezes caused by native
WinNTFileSystem.getBooleanAttributes
https://jira.talendforge.org/browse/TUP-16164
2016-11-22 11:47:39 +08:00
wchen-talend
d6da724ed5 TUP-16024:local nexus username password in clear text in studio .log
file
2016-11-21 17:31:44 +08:00
nrousseau
a24d61f6fc TUP-15998: avoid to get all contexts too often when build jobs 2016-11-16 15:58:12 +08:00
nrousseau
76863a534f TUP-15998: avoid one local refresh
Conflicts:
	main/plugins/org.talend.designer.maven/src/main/java/org/talend/designer/maven/tools/creator/CreateMavenBundleTemplatePom.java
2016-11-16 15:57:38 +08:00
GGu
b783b8f5c1 TUP-15998: if the parent of folder is not existed, should be created. (#699) 2016-11-16 15:55:13 +08:00
nrousseau
5d49f07357 TUP-15998: Improve build speed for jobs
Conflicts:
	main/plugins/org.talend.core.runtime/src/main/java/org/talend/commons/utils/io/FilesUtils.java
	main/plugins/org.talend.designer.maven/src/main/java/org/talend/designer/maven/utils/PomUtil.java
2016-11-16 15:53:20 +08:00
nrousseau
9198b5fa23 TUP-14741: check if the folder exists from eclipse API. 2016-11-16 15:30:34 +08:00
cmeng-talend
f78b90451a TUP-15988 fix: Hive Metadata Wizard Does Not User Additional Parameters
https://jira.talendforge.org/browse/TUP-15988
2016-11-07 10:32:58 +08:00
Chao MENG
ac4793cc62 TUP-15473 fix: Namenode cannot check successfully when checking it for (#698)
the first time which using CDH 57 Kerberos HA
https://jira.talendforge.org/browse/TUP-15473
2016-11-02 14:53:42 +08:00
hcyi
1ee14bf126 TPS-1602:[6.2.1] Unable to connect to kerberized Impala on CDH 5.5 on db
connection metadata wizard (TUP-15221)
2016-11-01 17:38:27 +08:00
wchen-talend
872fe7b8b1 TDI-37032:Cannot "build job" from export of a 6.0.1 job zip 2016-09-27 10:18:32 +08:00
wchen-talend
e29bce7cca TDI-37032:Cannot "build job" from export of a 6.0.1 job zip 2016-09-27 10:18:18 +08:00
wchen-talend
3cef088688 TPS-1555:[6.2.1 ]Jobs fail to compile with various NPEs (TUP-5179) 2016-09-22 10:50:11 +08:00
cmeng-talend
c92187f577 TUP-5207 fix: GIT commits on every save in local mode
https://jira.talendforge.org/browse/TUP-5207
2016-09-20 14:13:20 +08:00
nrousseau
95097a2834 TDI-36930: Improve performances during the build (#591) 2016-09-07 17:12:41 +08:00
GGu
6c53ef0f5c TDI-36930: Only format main job and check compile error after build 2016-09-07 17:11:59 +08:00
wchen-talend
d4768de197 TPS-1501:[6.2.1] Allow manual/edit git merge (TUP-4819) 2016-08-29 17:59:44 +08:00
cmeng-talend
ca3469d057 TUP-5004 fix: GIT: Cannot open job if logon main project and there is
conflict in reference project
https://jira.talendforge.org/browse/TUP-5004
2016-08-24 18:50:53 +08:00
cmeng-talend
d726b9917a TUP-5020 fix: Wrong commit in specified case
https://jira.talendforge.org/browse/TUP-5020

Refact GitHandler
2016-08-18 14:44:02 +08:00
cmeng-talend
57ae0543fe TUP-5020 fix: Wrong commit in specified case
https://jira.talendforge.org/browse/TUP-5020

Refact GitHandler
2016-08-18 14:43:38 +08:00
cmeng-talend
81be190e48 TUP-5020 fix: Wrong commit in specified case
https://jira.talendforge.org/browse/TUP-5020

Refact GitHandler

Conflicts:
	main/plugins/org.talend.core.repository/src/main/java/org/talend/core/repository/model/ProxyRepositoryFactory.java
2016-08-18 14:42:52 +08:00
ycbai
87ba237389 TBD-3907: When hadoop cluster and hbase are all on context mode, drag
hbase schema to job don't add hadoop properties parameter to job
2016-08-17 18:07:10 +08:00
ycbai
64f283698b TBD-3755: Hadoop connection won't be contextualized when drag/drop a
hive connection
2016-08-17 10:01:12 +08:00
ycbai
c9444c7827 Revert "TUP-5071: revert 2932bb3374 and fix it in other way."
This reverts commit 364c9e6a99.
2016-08-02 11:42:49 +08:00
ycbai
364c9e6a99 TUP-5071: revert
2932bb3374
and fix it in other way.
2016-07-29 16:22:57 +08:00
ycbai
e5b08d5817 TBD-3776: Hadoop Cluster Connection & context variables: Hadoop
Properties not managed properly
2016-07-29 15:37:48 +08:00
ycbai
8ce7b38ffd TUP-5009: fix the quotes of context value problem. 2016-07-29 15:16:08 +08:00
ycbai
dbf73db7c1 TUP-5009: fix the hadoop(hadoop cluster, hdfs, hive, hbase or such)
default values problem.
2016-07-29 15:13:39 +08:00
ycbai
77b93bc9cc TUP-5009: [6.1.1] Export Context on Metadata Hadoop Connection erroneous
behavior when HA properties
2016-07-29 14:53:05 +08:00
nrousseau
e5c017ac00 update components version 2016-07-04 18:46:33 +08:00
nrousseau
96a08249fc Merge pull request #528 from Talend/bugfix/6.2.1/TDI-36770_fixRepositoryNodeUtilities
TDI-36770: fix repository node Utilities to retrieve from the view directly
2016-07-04 18:36:14 +08:00
nrousseau
8adc470b17 TDI-36770: fix retrieve of repository node issue from repository 2016-07-02 17:31:04 +08:00
nrousseau
34e66059d1 TUP-4961: fix refresh problem on hadoop cluster 2016-07-01 19:37:13 +08:00
nrousseau
d784f722ea TUP-4961: fix refresh issue of folder 2016-07-01 17:05:06 +08:00
ycbai
ee0b100728 TBD-3238: fix the problem of old confs jar migration. 2016-07-01 16:23:30 +08:00
hcyi
efbe3b9cd4 TBD-3704:MapR 51 Kerberos HDFS cannot check successfully 2016-07-01 14:58:18 +08:00
GGu
387ea3bfbc TBD-3785: Check for retrieve schema. 2016-07-01 11:48:48 +08:00
GGu
c9e201ca93 TBD-3785: Change to use module group function like component 2016-07-01 11:48:26 +08:00
nrousseau
8c82752570 TDI-36770: avoid to create a new instanceof project, and simply clean
the items hold by the old instance.
2016-07-01 11:10:13 +08:00
nrousseau
9bfeb8b268 update components version 2016-06-30 20:36:51 +08:00
nrousseau
ec47ba71bb TUP-4961: fix problem of refresh for repository for db / hadoop cluster 2016-06-30 20:27:53 +08:00
nrousseau
f470556711 TUP-4961: fix refresh issues 2016-06-30 20:26:47 +08:00
GGu
3518b38596 TBD-3785: enable to retrieve schema for Impala. 2016-06-30 19:33:19 +08:00
GGu
9f27da74f9 TDI-36717: When generete codes, need check children job 2016-06-30 19:29:46 +08:00
iwangtalend
070b88e605 Set version for 6.2.1 2016-06-27 18:25:24 +02:00
iwangtalend
c3be1e9b2e Set version for 6.2.1 2016-06-27 18:25:01 +02:00
iwangtalend
954c7a6bfd Set version for 6.2.1 2016-06-27 18:24:43 +02:00
iwangtalend
77e9cf633b Set version for 6.2.1 2016-06-27 18:24:27 +02:00
nhaumont
ad92e8d41a Set versions for 6.2.1 2016-06-27 16:16:28 +02:00
Igor Lazebny
1df0478f32 Update version to 6.2.1 in server poms 2016-06-27 16:26:07 +03:00
282 changed files with 4416 additions and 2068 deletions

View File

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

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>6.2.1-SNAPSHOT</version>
<version>6.2.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.2.1-SNAPSHOT</version>
<version>6.2.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.2.1-SNAPSHOT</version>
<version>6.2.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.2.1-SNAPSHOT</version>
<version>6.2.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.2.1-SNAPSHOT</version>
<version>6.2.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.2.1-SNAPSHOT</version>
<version>6.2.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.2.1-SNAPSHOT</version>
<version>6.2.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.2.1-SNAPSHOT</version>
<version>6.2.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.2.1-SNAPSHOT</version>
<version>6.2.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.2.1-SNAPSHOT</version>
<version>6.2.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.2.1-SNAPSHOT</version>
<version>6.2.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.2.1-SNAPSHOT</version>
<version>6.2.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.2.1-SNAPSHOT</version>
<version>6.2.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.2.1-SNAPSHOT</version>
<version>6.2.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.2.1-SNAPSHOT</version>
<version>6.2.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.2.1-SNAPSHOT</version>
<version>6.2.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.2.1-SNAPSHOT</version>
<version>6.2.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.2.1-SNAPSHOT</version>
<version>6.2.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.2.1-SNAPSHOT</version>
<version>6.2.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.2.1-SNAPSHOT</version>
<version>6.2.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.2.1-SNAPSHOT</version>
<version>6.2.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.2.1-SNAPSHOT</version>
<version>6.2.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.2.1-SNAPSHOT</version>
<version>6.2.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.2.1-SNAPSHOT</version>
<version>6.2.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.2.1-SNAPSHOT</version>
<version>6.2.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.2.1-SNAPSHOT</version>
<version>6.2.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.2.1-SNAPSHOT</version>
<version>6.2.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.2.1-SNAPSHOT</version>
<version>6.2.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.2.1-SNAPSHOT</version>
<version>6.2.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.2.1-SNAPSHOT</version>
<version>6.2.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.2.1-SNAPSHOT</version>
<version>6.2.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.2.1-SNAPSHOT</version>
<version>6.2.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.2.1-SNAPSHOT</version>
<version>6.2.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.2.1-SNAPSHOT</version>
<version>6.2.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.2.1-SNAPSHOT</version>
<version>6.2.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.2.1-SNAPSHOT</version>
<version>6.2.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.2.1-SNAPSHOT</version>
<version>6.2.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.2.1-SNAPSHOT</version>
<version>6.2.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.2.1-SNAPSHOT</version>
<version>6.2.1</version>
<relativePath>../../../</relativePath>
</parent>

View File

@@ -4,7 +4,7 @@
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>6.2.1-SNAPSHOT</version>
<version>6.2.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.2.1-SNAPSHOT</version>
<version>6.2.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.2.1-SNAPSHOT</version>
<version>6.2.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.2.1-SNAPSHOT</version>
<version>6.2.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.2.1-SNAPSHOT</version>
<version>6.2.1</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.common.ui.runtime</artifactId>

View File

@@ -34,6 +34,8 @@ public class ExceptionMessageDialog extends MessageDialog {
private Throwable ex;
private String exceptionString = null;
public ExceptionMessageDialog(Shell parentShell, String dialogTitle, Image dialogTitleImage, String dialogMessage,
int dialogImageType, String[] dialogButtonLabels, int defaultIndex, Throwable ex) {
super(parentShell, dialogTitle, dialogTitleImage, dialogMessage, dialogImageType, dialogButtonLabels, defaultIndex);
@@ -42,15 +44,18 @@ public class ExceptionMessageDialog extends MessageDialog {
@Override
protected Control createCustomArea(Composite parent) {
StringWriter stringWriter = new StringWriter();
ex.printStackTrace(new PrintWriter(stringWriter));
String exceptionString = stringWriter.toString();
if (exceptionString == null || exceptionString.isEmpty()) {
StringWriter stringWriter = new StringWriter();
ex.printStackTrace(new PrintWriter(stringWriter));
exceptionString = stringWriter.toString();
}
ExpandableComposite errorComposite = new ExpandableComposite(parent, ExpandableComposite.COMPACT);
errorComposite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, false, true, 1, 1));
errorComposite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true, 1, 1));
errorComposite.setText(Messages.getString("ExceptionMessageDialog.log")); //$NON-NLS-1$
errorComposite.addExpansionListener(new IExpansionListener() {
@Override
public void expansionStateChanged(ExpansionEvent e) {
int delta = 300;
if (!e.getState()) {
@@ -61,6 +66,7 @@ public class ExceptionMessageDialog extends MessageDialog {
getShell().setSize(newSize);
}
@Override
public void expansionStateChanging(ExpansionEvent e) {
}
@@ -108,4 +114,12 @@ public class ExceptionMessageDialog extends MessageDialog {
return;
}
public String getExceptionString() {
return this.exceptionString;
}
public void setExceptionString(String exceptionString) {
this.exceptionString = exceptionString;
}
}

View File

@@ -41,6 +41,8 @@ import org.eclipse.swt.events.KeyEvent;
import org.eclipse.swt.events.KeyListener;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.MouseListener;
import org.eclipse.swt.events.PaintEvent;
import org.eclipse.swt.events.PaintListener;
import org.eclipse.swt.events.TraverseEvent;
import org.eclipse.swt.events.TraverseListener;
import org.eclipse.swt.graphics.Color;
@@ -68,8 +70,8 @@ import org.talend.commons.ui.runtime.swt.tableviewer.selection.SelectionHelper;
import org.talend.commons.ui.runtime.swt.tableviewer.sort.TableViewerCreatorSorter;
import org.talend.commons.ui.runtime.swt.tableviewer.tableeditor.ITableEditorManagerListener;
import org.talend.commons.ui.runtime.swt.tableviewer.tableeditor.TableEditorManager;
import org.talend.commons.ui.runtime.swt.tableviewer.tableeditor.TableEditorManagerEvent;
import org.talend.commons.ui.runtime.swt.tableviewer.tableeditor.TableEditorManager.EVENT_TYPE;
import org.talend.commons.ui.runtime.swt.tableviewer.tableeditor.TableEditorManagerEvent;
import org.talend.commons.ui.runtime.thread.AsynchronousThreading;
import org.talend.commons.ui.runtime.utils.TableUtils;
import org.talend.commons.ui.runtime.ws.WindowSystem;
@@ -819,7 +821,15 @@ public class TableViewerCreatorNotModifiable<B> {
addTraverseListenerRecursivly(cellEditor.getControl(), traverseListenerForControls);
}
}
getTable().addPaintListener(new PaintListener() {
public void paintControl(PaintEvent event) {
if (tableEditorManager != null) {
tableEditorManager.paintVisibleAreaEditor(event);
}
}
});
}
/**

View File

@@ -23,6 +23,9 @@ import java.util.Set;
import org.apache.commons.collections.set.MapBackedSet;
import org.eclipse.swt.custom.TableEditor;
import org.eclipse.swt.events.PaintEvent;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Table;
@@ -146,9 +149,7 @@ public class TableEditorManager {
public void handleEvent(ListenableListEvent event) {
if (event.type == TYPE.ADDED) {
handleAddedEventAsynchronous(event);
} else if (event.type == TYPE.REMOVED) {
handleRemovedEventAsynchronous(event);
} else if (event.type == TYPE.SWAPED) {
@@ -190,7 +191,6 @@ public class TableEditorManager {
}).start();
}
}
private void handleRemovedEventAsynchronous(final ListenableListEvent event) {
@@ -218,7 +218,7 @@ public class TableEditorManager {
int indexStart = event.index;
if (tableViewerCreator.getTable().isDisposed()) {
if (tableViewerCreator.getTable().isDisposed() || tableViewerCreator.isLazyLoad()) {
return;
}
@@ -301,7 +301,7 @@ public class TableEditorManager {
// //////////////////////////////////
Set dataHash = MapBackedSet.decorate(new IdentityHashMap());
dataHash.addAll(Arrays.asList(event.swapedObjects));
;
for (TableItem tableItem : items) {
Object data = tableItem.getData();
if (dataHash.contains(data)) {
@@ -350,12 +350,65 @@ public class TableEditorManager {
}
}
public void paintVisibleAreaEditor(PaintEvent event) {
Table table = tableViewerCreator.getTable();
if (table.isDisposed()) {
return;
}
int topIndex = table.getTopIndex();
int itemsCount = table.getItemCount();
int itemHeight = table.getItemHeight();
GC gc = event.gc;
Rectangle clipping = gc.getClipping();
int headerHeight = table.getHeaderHeight();
int startIndex = (clipping.y - headerHeight) / itemHeight + topIndex;
int endIndex = -1;
if (startIndex < itemsCount) {
endIndex = startIndex + (int) Math.ceil((float) clipping.height / itemHeight);
}
startIndex = Math.max(0, startIndex);
endIndex = Math.min(endIndex, itemsCount - 1);
// Set the cell editor if need
for (int itemIndex = topIndex; itemIndex <= endIndex; itemIndex++) {
TableItem item = table.getItem(itemIndex);
for (int columnIndex = 0; columnIndex < columnsWithEditorContent.size(); columnIndex++) {
TableViewerCreatorColumnNotModifiable column = columnsWithEditorContent.get(columnIndex);
TableEditorContentNotModifiable tableEditorContent = column.getTableEditorContent();
if (dataToMultipleDataEditor.containsKey(item.getData())) {
Collection<TableEditor> tableEditorCollection = dataToMultipleDataEditor.getCollection(item.getData());
for (TableEditor tableEditor : tableEditorCollection) {
tableEditor.setItem(item);
Control editor = tableEditor.getEditor();
if (editor != null) {
editor.redraw();
}
}
if (columnIndex < tableEditorCollection.size()) {
continue;
} else {
addTableEditor(column, tableEditorContent, column.getId(), item);
}
} else {
addTableEditor(column, tableEditorContent, column.getId(), item);
}
}
}
}
public void refreshColumn(int index) {
Table table = tableViewerCreator.getTable();
if (table.isDisposed() || index >= table.getItems().length) {
return;
}
}
int topIndex = table.getTopIndex();
int itemCount = table.getItemCount();
int numVisibleLines = Math.min((table.getBounds().height / table.getItemHeight()) + 2, itemCount - topIndex);
if (index < topIndex || index > topIndex + numVisibleLines) {
return;
}
for (int iEditorCol = 0; iEditorCol < columnsWithEditorContent.size(); iEditorCol++) {
TableViewerCreatorColumnNotModifiable column = columnsWithEditorContent.get(iEditorCol);
@@ -412,16 +465,6 @@ public class TableEditorManager {
Control control = tableEditorContent.initialize(tableItem.getParent(), tableEditor, column, currentRowObject, value);
// control.addDisposeListener(new DisposeListener() {
//
// public void widgetDisposed(DisposeEvent e) {
//
// // System.out.println(e);
//
// }
//
// });
if (tableItem != null && !tableItem.isDisposed()) {
tableEditor.setEditor(control, tableItem, column.getIndex());
fireEvent(new TableEditorManagerEvent(EVENT_TYPE.CONTROL_CREATED, tableEditor));

View File

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

View File

@@ -12,7 +12,7 @@
<parent>
<groupId>org.talend</groupId>
<artifactId>org.talend.tos</artifactId>
<version>6.2.1-SNAPSHOT</version>
<version>6.2.1</version>
<relativePath>../pom_server.xml</relativePath>
</parent>

View File

@@ -94,21 +94,33 @@ public class TeradataDataBaseMetadata extends FakeDatabaseMetaData {
*/
@Override
public ResultSet getPrimaryKeys(String catalog, String schema, String table) throws SQLException {
int dbMajorVersion = connection.getMetaData().getDatabaseMajorVersion();
String sql = "HELP COLUMN \"" + schema + "\".\"" + table + "\".* ";//$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
ResultSet rs = null;
Statement stmt = null;
String columnName = null;
List<String[]> list = new ArrayList<String[]>();
try {
stmt = connection.createStatement();
rs = stmt.executeQuery(sql);
while (rs.next()) {
String columnName = rs.getString("Column Name").trim(); //$NON-NLS-1$
String pk = rs.getString("Primary?");//$NON-NLS-1$
String[] r = new String[] { columnName, pk };
list.add(r);
if (dbMajorVersion > 12) {
sql = "SELECT * from DBC.INDICESV WHERE UPPER(databasename) = UPPER('" + schema //$NON-NLS-1$
+ "') AND UPPER(tablename) = UPPER('" + table + "') AND UPPER(UniqueFlag) = UPPER('Y')"; //$NON-NLS-1$//$NON-NLS-2$
rs = getResultSet(catalog, schema, table, sql);
while (rs.next()) {
columnName = rs.getString("ColumnName").trim(); //$NON-NLS-1$
String indexType = rs.getString("IndexType");//$NON-NLS-1$
String[] r = new String[] { columnName, indexType };
list.add(r);
}
} else {
stmt = connection.createStatement();
rs = stmt.executeQuery(sql);
while (rs.next()) {
columnName = rs.getString("Column Name").trim(); //$NON-NLS-1$
String pk = rs.getString("Primary?");//$NON-NLS-1$
String[] r = new String[] { columnName, pk };
list.add(r);
}
}
} catch (SQLException e) {
throw new RuntimeException(e);
} finally {
@@ -124,6 +136,18 @@ public class TeradataDataBaseMetadata extends FakeDatabaseMetaData {
return tableResultSet;
}
public ResultSet getResultSet(String catalog, String schema, String table, String sql) throws SQLException {
ResultSet rs = null;
Statement stmt = null;
try {
stmt = connection.createStatement();
rs = stmt.executeQuery(sql);
} catch (SQLException e) {
throw new RuntimeException(e);
}
return rs;
}
/*
* (non-Javadoc)
*
@@ -173,12 +197,17 @@ public class TeradataDataBaseMetadata extends FakeDatabaseMetaData {
}
// end
String sql = null;
int dbMajorVersion = connection.getMetaData().getDatabaseMajorVersion();
String sysTable = "DBC.TABLES";//$NON-NLS-1$
if (dbMajorVersion > 12) {
sysTable = "DBC.TABLESV";//$NON-NLS-1$
}
if (types != null && types.length > 0) {
sql = "SELECT * from DBC.TABLES WHERE UPPER(databasename) = UPPER('" + database //$NON-NLS-1$
sql = "SELECT * from " + sysTable + " WHERE UPPER(databasename) = UPPER('" + database //$NON-NLS-1$//$NON-NLS-2$
+ "') AND tablekind " + addTypesToSql(types); //$NON-NLS-1$
} else {
// When the types is empty, all the tables and views will be retrieved.
sql = "SELECT * from DBC.TABLES WHERE UPPER(databasename) = UPPER('" + database //$NON-NLS-1$
sql = "SELECT * from " + sysTable + " WHERE UPPER(databasename) = UPPER('" + database //$NON-NLS-1$//$NON-NLS-2$
+ "') AND (tablekind = 'T' or tablekind = 'V')"; //$NON-NLS-1$
}
@@ -287,15 +316,25 @@ public class TeradataDataBaseMetadata extends FakeDatabaseMetaData {
@Override
public ResultSet getColumns(String catalog, String database, String tableNamePattern, String columnNamePattern)
throws SQLException {
// for real
String sql;
// for real sql
if (databaseName != null && !databaseName.trim().isEmpty()) {
database = databaseName;
}
// all the columns of this table will be retrieved.
String sql = null;
int dbMajorVersion = connection.getMetaData().getDatabaseMajorVersion();
if (!StringUtils.isEmpty(database)) {
sql = "HELP COLUMN \"" + database + "\".\"" + tableNamePattern + "\".* ";//$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
if (dbMajorVersion > 12) {
sql = "SELECT * from DBC.COLUMNSV WHERE UPPER(databasename) = UPPER('" + database //$NON-NLS-1$
+ "') AND UPPER(tablename) = UPPER('" + tableNamePattern + "')" + " Order by tablename "; //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
}
} else {
sql = "HELP COLUMN \"" + tableNamePattern + "\".* ";//$NON-NLS-1$//$NON-NLS-2$
if (dbMajorVersion > 12) {
sql = "SELECT * from DBC.COLUMNSV WHERE UPPER(tablename) = UPPER('" + tableNamePattern + "')" + " Order by tablename "; //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
}
}
ResultSet rs = null;
Statement stmt = null;
List<String[]> list = new ArrayList<String[]>();
@@ -304,16 +343,34 @@ public class TeradataDataBaseMetadata extends FakeDatabaseMetaData {
rs = stmt.executeQuery(sql);
while (rs.next()) {
String tableName = tableNamePattern;
String columnName = rs.getString("Column Name").trim(); //$NON-NLS-1$
String typeName = rs.getString("Type"); //$NON-NLS-1$
String columnSize = rs.getString("Max Length"); //$NON-NLS-1$
String decimalDigits = rs.getString("Decimal Fractional Digits"); //$NON-NLS-1$
String columnName = null;
String typeName = null;
String columnSize = null;
String decimalDigits = null;
if (dbMajorVersion > 12) {
columnName = rs.getString("ColumnName").trim(); //$NON-NLS-1$
typeName = rs.getString("ColumnType"); //$NON-NLS-1$
columnSize = rs.getString("ColumnLength"); //$NON-NLS-1$
decimalDigits = rs.getString("DecimalFractionalDigits"); //$NON-NLS-1$
} else {
columnName = rs.getString("Column Name").trim(); //$NON-NLS-1$
typeName = rs.getString("Type"); //$NON-NLS-1$
columnSize = rs.getString("Max Length"); //$NON-NLS-1$
decimalDigits = rs.getString("Decimal Fractional Digits"); //$NON-NLS-1$
}
String isNullable;
if ("Y".equals(rs.getString("Nullable"))) { //$NON-NLS-1$ //$NON-NLS-2$
isNullable = "YES"; //$NON-NLS-1$
} else {
isNullable = rs.getString("Nullable"); //$NON-NLS-1$
}
// fill default value if null
if (typeName == null) {
typeName = "CV"; //$NON-NLS-1$
}
if (columnSize == null) {
columnSize = "255";//$NON-NLS-1$
}
if (decimalDigits == null) {
decimalDigits = "0";//$NON-NLS-1$
}
@@ -324,7 +381,6 @@ public class TeradataDataBaseMetadata extends FakeDatabaseMetaData {
columnDef };
list.add(r);
}
} catch (SQLException e) {
throw new RuntimeException(e);
} finally {

View File

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

View File

@@ -18,7 +18,6 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.talend.commons.ui.runtime.thread.AsynchronousThreading;
@@ -98,22 +97,24 @@ public abstract class ProgressDialog {
display.asyncExec(new Runnable() {
public void run() {
final ProgressMonitorDialog progressMonitorDialog = new ProgressMonitorDialog(parentShell);
final ProgressMonitorDialog progressMonitorDialog = newProgressMonitorDialog(parentShell);
if (timeBeforeShowDialog > 0) {
progressMonitorDialog.setOpenOnRun(false);
if (progressMonitorDialog != null) {
progressMonitorDialog.setOpenOnRun(false);
}
// for bug 16801
AsynchronousThreading asynchronousThreading = new AsynchronousThreading(timeBeforeShowDialog, true,
display, new Runnable() {
public void run() {
progressMonitorDialog.open();
openDialog(progressMonitorDialog);
}
});
asynchronousThreading.start();
}
try {
progressMonitorDialog.run(false, true, op);
dialogRun(progressMonitorDialog, op);
} catch (InvocationTargetException e) {
// Pass it outside the workspace runnable
iteHolder[0] = e;
@@ -128,22 +129,24 @@ public abstract class ProgressDialog {
display.syncExec(new Runnable() {
public void run() {
final ProgressMonitorDialog progressMonitorDialog = new ProgressMonitorDialog(parentShell);
final ProgressMonitorDialog progressMonitorDialog = newProgressMonitorDialog(parentShell);
if (timeBeforeShowDialog > 0) {
progressMonitorDialog.setOpenOnRun(false);
if (progressMonitorDialog != null) {
progressMonitorDialog.setOpenOnRun(false);
}
// for bug 16801
AsynchronousThreading asynchronousThreading = new AsynchronousThreading(timeBeforeShowDialog, true,
display, new Runnable() {
public void run() {
progressMonitorDialog.open();
openDialog(progressMonitorDialog);
}
});
asynchronousThreading.start();
}
try {
progressMonitorDialog.run(false, true, op);
dialogRun(progressMonitorDialog, op);
} catch (InvocationTargetException e) {
// Pass it outside the workspace runnable
iteHolder[0] = e;
@@ -165,6 +168,19 @@ public abstract class ProgressDialog {
}
}
protected ProgressMonitorDialog newProgressMonitorDialog(Shell shell) {
return new ProgressMonitorDialog(shell);
}
protected void openDialog(ProgressMonitorDialog dialog) {
dialog.open();
}
protected void dialogRun(ProgressMonitorDialog dialog, IRunnableWithProgress op)
throws InvocationTargetException, InterruptedException {
dialog.run(false, true, op);
}
public abstract void run(final IProgressMonitor monitor) throws InvocationTargetException, InterruptedException;
}

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.2.1-SNAPSHOT</version>
<version>6.2.1</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.core.repository</artifactId>

View File

@@ -51,4 +51,15 @@ public final class Constant {
*/
public static final String FILE_LIST_EVENT_PROPERTY_KEY = "fileList"; //$NON-NLS-1$
/**
* suffix used when issuing an event on the OSGI event bus when the main project is reloaded.
*/
public static final String PROJECT_RELOAD_EVENT_SUFFIX = "project"; //$NON-NLS-1$
/**
* key used to get/set the property of an event related to a list of files modified in the repository
* (REPOSITORY_ITEM_EVENT_PREFIX). The value is the Collection of String (list of all files modified).
*/
public static final String PROJECT_RELOAD_PROPERTY_KEY = "project"; //$NON-NLS-1$
}

View File

@@ -271,7 +271,7 @@ public abstract class AbstractEMFRepositoryFactory extends AbstractRepositoryFac
}
for (IRepositoryViewObject current : list) {
if (name.equalsIgnoreCase(current.getProperty().getLabel())
if ((name.equalsIgnoreCase(current.getProperty().getLabel()) || name.equalsIgnoreCase(current.getProperty().getDisplayName()))
&& item.getProperty().getId() != current.getProperty().getId()) {
// To check SQLPattern in same path. see bug 0005038: unable to add a SQLPattern into repository.
if (!isAllowMultipleName || current.getProperty().getItem().getState().getPath().equals(path)) {

View File

@@ -76,7 +76,7 @@ public class CheckJobDeleteReference extends AbstractCheckDeleteItemReference im
Set<Project> refParentProjects = new HashSet<Project>();
try {
refParentProjects.add(ProjectManager.getInstance().getCurrentProject());
refParentProjects.addAll(ProjectManager.getInstance().getReferencedProjects());
// refParentProjects.addAll(ProjectManager.getInstance().getReferencedProjects());
for (Project refP : refParentProjects) {
// get all types processes such as standard job, big data streaming job, big data batch job;

View File

@@ -61,7 +61,8 @@ public class CheckJobletDeleteReference extends AbstractCheckDeleteItemReference
Set<Project> refParentProjects = new HashSet<Project>();
try {
refParentProjects.add(ProjectManager.getInstance().getCurrentProject());
refParentProjects.addAll(ProjectManager.getInstance().getReferencedProjects());
//the item in mainProject never be used in referenceProject TDI-21403
//refParentProjects.addAll(ProjectManager.getInstance().getReferencedProjects());
for (Project refP : refParentProjects) {
List<IRepositoryViewObject> processes = new ArrayList<IRepositoryViewObject>(50);

View File

@@ -126,6 +126,9 @@ public class ProjectRepositoryNode extends RepositoryNode implements IProjectRep
private static ProjectRepositoryNode defaultProjRepoNode;
private static ProjectRepositoryNode dummyProjRepoNode = new ProjectRepositoryNode(null, null,
ENodeType.STABLE_SYSTEM_FOLDER);
private final IProxyRepositoryFactory factory = ProxyRepositoryFactory.getInstance();
private org.talend.core.model.general.Project project;
@@ -169,6 +172,9 @@ public class ProjectRepositoryNode extends RepositoryNode implements IProjectRep
}
public static ProjectRepositoryNode getInstance() {
if (!ProxyRepositoryFactory.getInstance().isFullLogonFinished()) {
return dummyProjRepoNode;
}
if (defaultProjRepoNode == null) {
defaultProjRepoNode = new ProjectRepositoryNode(null, null, ENodeType.STABLE_SYSTEM_FOLDER);
defaultProjRepoNode.initialize(null);
@@ -469,7 +475,7 @@ public class ProjectRepositoryNode extends RepositoryNode implements IProjectRep
String parentBranch = ProjectManager.getInstance().getMainProjectBranch(project);
if (refProject.getBranch() == null || parentBranch.equals(refProject.getBranch())) {
Project p = refProject.getReferencedProject();
//no need caching
// no need caching
/*
* List<Project> list = nodeAndProject.get(parent); if (list == null) { list = new ArrayList<Project>();
* nodeAndProject.put(parent, list); } if (list.contains(p)) { return; } else { list.add(p); }
@@ -596,7 +602,7 @@ public class ProjectRepositoryNode extends RepositoryNode implements IProjectRep
public void buildDeletedItemsTree(RepositoryNode rootNode) {
// build deleted folders
//need to use the current project to avoid the cache influence
// need to use the current project to avoid the cache influence
List<String> folders = RecycleBinManager.getInstance()
.getDeletedFolders(ProjectManager.getInstance().getCurrentProject());
Collections.sort(folders);
@@ -714,7 +720,7 @@ public class ProjectRepositoryNode extends RepositoryNode implements IProjectRep
}
} else if (node.getType() == ENodeType.SIMPLE_FOLDER) {
RepositoryNode pNode = getTestCaseParent(node.getChildren(), originalID);
if(pNode!=null){
if (pNode != null) {
return pNode;
}
}
@@ -1190,10 +1196,7 @@ public class ProjectRepositoryNode extends RepositoryNode implements IProjectRep
if (parent.getType().equals(ENodeType.SYSTEM_FOLDER)) {
for (ProjectReference refProject : (List<ProjectReference>) project.getEmfProject().getReferencedProjects()) {
String parentBranch = ProjectManager.getInstance().getMainProjectBranch(project);
// if not a DB ref project, modified by nma, order 12519
if (refProject.getReferencedProject().getUrl() != null
&& refProject.getReferencedProject().getUrl().startsWith("teneo") //$NON-NLS-1$
|| (refProject.getBranch() != null && refProject.getBranch().equals(parentBranch))) {
if (refProject.getBranch() == null || refProject.getBranch().equals(parentBranch)) {
Project emfProject = refProject.getReferencedProject();
ProjectRepositoryNode referencedProjectNode = new ProjectRepositoryNode(
new org.talend.core.model.general.Project(emfProject), null, parent, this,
@@ -2000,7 +2003,17 @@ public class ProjectRepositoryNode extends RepositoryNode implements IProjectRep
}
public void cleanup() {
// reset it
defaultProjRepoNode = null;
if (defaultProjRepoNode == null) {
return;
}
// reinitialize every children
for (IRepositoryNode childNode : defaultProjRepoNode.getChildren()) {
if (childNode instanceof RepositoryNode) {
RepositoryNode node = (RepositoryNode) childNode;
node.setInitialized(false);
node.getChildren().clear();
}
}
}
}

View File

@@ -127,6 +127,7 @@ import org.talend.repository.model.IProxyRepositoryFactory;
import org.talend.repository.model.RepositoryConstants;
import org.talend.utils.io.FilesUtils;
import org.talend.utils.json.JSONArray;
import orgomg.cwm.objectmodel.core.ModelElement;
/**
@@ -1825,7 +1826,9 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
currentMonitor = subMonitor.newChild(1, SubMonitor.SUPPRESS_NONE);
currentMonitor.beginTask(Messages.getString("ProxyRepositoryFactory.initializeProjectConnection"), 1); //$NON-NLS-1$
ProjectManager.getInstance().getBeforeLogonRecords().clear();
this.repositoryFactoryFromProvider.beforeLogon(project);
ProjectManager.getInstance().getBeforeLogonRecords().clear();
// monitorWrap.worked(1);
TimeMeasure.step("logOnProject", "beforeLogon"); //$NON-NLS-1$ //$NON-NLS-2$
@@ -1843,13 +1846,17 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
currentMonitor = subMonitor.newChild(1, SubMonitor.SUPPRESS_NONE);
currentMonitor.beginTask("Execute before logon migrations tasks", 1); //$NON-NLS-1$
ProjectManager.getInstance().getMigrationRecords().clear();
executeMigrations(project, true, currentMonitor);
ProjectManager.getInstance().getMigrationRecords().clear();
// monitorWrap.worked(1);
TimeMeasure.step("logOnProject", "executeMigrations(beforeLogonTasks)"); //$NON-NLS-1$ //$NON-NLS-2$
currentMonitor = subMonitor.newChild(1, SubMonitor.SUPPRESS_NONE);
currentMonitor.beginTask(Messages.getString("ProxyRepositoryFactory.logonInProgress"), 1); //$NON-NLS-1$
ProjectManager.getInstance().getLogonRecords().clear();
this.repositoryFactoryFromProvider.logOnProject(project);
ProjectManager.getInstance().getLogonRecords().clear();
// monitorWrap.worked(1);
TimeMeasure.step("logOnProject", "logOnProject"); //$NON-NLS-1$ //$NON-NLS-2$
@@ -1867,7 +1874,9 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
currentMonitor = subMonitor.newChild(1, SubMonitor.SUPPRESS_NONE);
currentMonitor.beginTask(Messages.getString("ProxyRepositoryFactory.exec.migration.tasks"), 1); //$NON-NLS-1$
ProjectManager.getInstance().getMigrationRecords().clear();
executeMigrations(project, false, currentMonitor);
ProjectManager.getInstance().getMigrationRecords().clear();
TimeMeasure.step("logOnProject", "executeMigrations(afterLogonTasks)"); //$NON-NLS-1$ //$NON-NLS-2$
if (monitor != null && monitor.isCanceled()) {
throw new OperationCanceledException(""); //$NON-NLS-1$
@@ -1876,7 +1885,18 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
if (coreService != null) {
// clean workspace
currentMonitor.beginTask(Messages.getString("ProxyRepositoryFactory.cleanWorkspace"), 1); //$NON-NLS-1$
coreService.deleteAllJobs(false);
if (GlobalServiceRegister.getDefault().isServiceRegistered(IRunProcessService.class)) {
IRunProcessService runProcessService = (IRunProcessService) GlobalServiceRegister.getDefault().getService(
IRunProcessService.class);
try {
runProcessService.deleteAllJobs(false);
runProcessService.getTalendProcessJavaProject().cleanMavenFiles(monitor);
TimeMeasure.step("logOnProject", "clean Maven files"); //$NON-NLS-1$ //$NON-NLS-2$
} catch (Exception e) {
ExceptionHandler.process(e);
}
}
TimeMeasure.step("logOnProject", "clean Java project"); //$NON-NLS-1$ //$NON-NLS-2$
if (workspace instanceof Workspace) {
((Workspace) workspace).getFileSystemManager().getHistoryStore().clean(currentMonitor);
@@ -1967,6 +1987,17 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
public void logOffProject() {
// getRepositoryContext().setProject(null);
repositoryFactoryFromProvider.logOffProject();
/**
* If intergrate TUP-5048, should add those codes upon the [fullLogonFinished = false], since the gitHandler
* refactor is after fixed TUP-5048, I changed the order
*/
// ProjectRepositoryNode root = ProjectRepositoryNode.getInstance();
// if (root != null) {
// root.setEnableDisposed(true);
// root.dispose();
// }
fullLogonFinished = false;
}

View File

@@ -179,7 +179,7 @@ public abstract class AbstractRepoViewSeeker implements IRepositorySeeker<IRepos
if (preExpandTypes != null) {
for (ERepositoryObjectType preExpandType : preExpandTypes) {
IRepositoryNode preExpandNode = root.getRootRepositoryNode(preExpandType);
if (preExpandNode != null) {
if (preExpandNode != null && viewer != null) {
viewer.expandToLevel(preExpandNode, expandLevel);
}
}

View File

@@ -795,7 +795,7 @@ public class DeleteAction extends AContextualAction {
Set<Project> refParentProjects = new HashSet<Project>();
try {
refParentProjects.add(ProjectManager.getInstance().getCurrentProject());
refParentProjects.addAll(ProjectManager.getInstance().getReferencedProjects());
// refParentProjects.addAll(ProjectManager.getInstance().getReferencedProjects());
for (Project refP : refParentProjects) {
List<IRepositoryViewObject> objList = new ArrayList<IRepositoryViewObject>();
List<IRepositoryViewObject> allJobVersions = new ArrayList<IRepositoryViewObject>();
@@ -1007,7 +1007,7 @@ public class DeleteAction extends AContextualAction {
Set<Project> refParentProjects = new HashSet<Project>();
try {
refParentProjects.add(ProjectManager.getInstance().getCurrentProject());
refParentProjects.addAll(ProjectManager.getInstance().getReferencedProjects());
// refParentProjects.addAll(ProjectManager.getInstance().getReferencedProjects());
// if (currentProject != null) {
// final Project[] readProject = factory.readProject();
// for (Project p : readProject) {

View File

@@ -369,9 +369,18 @@ public class XmiResourceManager {
return getItemResource(item, true);
}
public Resource getItemResource(ResourceSet resourceSet, Item item) {
return getItemResource(resourceSet, item, true);
}
public Resource getItemResource(Item item, boolean forceLoad) {
if (item == null)
return getItemResource(getResourceSet(), item, forceLoad);
}
public Resource getItemResource(ResourceSet resourceSet, Item item, boolean forceLoad) {
if (item == null) {
return null;
}
URI itemResourceURI = null;
if (item.getFileExtension() != null) {
itemResourceURI = getItemResourceURI(getItemURI(item), item.getFileExtension());
@@ -381,13 +390,13 @@ public class XmiResourceManager {
} else {
itemResourceURI = getItemResourceURI(getItemURI(item));
}
Resource itemResource = getResourceSet().getResource(itemResourceURI, false);
Resource itemResource = resourceSet.getResource(itemResourceURI, false);
if (forceLoad && itemResource == null) {
if (item instanceof FileItem) {
itemResource = new ByteArrayResource(itemResourceURI);
getResourceSet().getResources().add(itemResource);
resourceSet.getResources().add(itemResource);
}
itemResource = getResourceSet().getResource(itemResourceURI, true);
itemResource = resourceSet.getResource(itemResourceURI, true);
}
return itemResource;
}
@@ -400,10 +409,14 @@ public class XmiResourceManager {
* Get a resource obj from Item resource file. if the resouce file does not exist ,will create it first.
*/
public Resource getScreenshotResource(Item item, boolean createIfNotExist) {
return getScreenshotResource(item, createIfNotExist, false);
return getScreenshotResource(getResourceSet(), item, createIfNotExist, false);
}
public Resource getScreenshotResource(Item item, boolean createIfNotExist, boolean forceReload) {
return getScreenshotResource(getResourceSet(), item, createIfNotExist, forceReload);
}
public Resource getScreenshotResource(ResourceSet resourceSet, Item item, boolean createIfNotExist, boolean forceReload) {
URI itemResourceURI = null;
itemResourceURI = getScreenshotResourceURI(getItemURI(item));
boolean fileExist = false;
@@ -526,6 +539,10 @@ public class XmiResourceManager {
// }
public List<Resource> getAffectedResources(Property property) {
return getAffectedResources(getResourceSet(), property);
}
public List<Resource> getAffectedResources(ResourceSet resourceSet, Property property) {
List<Resource> resources = new ArrayList<Resource>();
List<Resource> allRes = resourceSet.getResources();
synchronized (allRes) {
@@ -547,8 +564,8 @@ public class XmiResourceManager {
if (!currentResource.getURI().lastSegment().equals(getProjectFilename())) {
resources.add(currentResource);
}
if (!getResourceSet().getResources().contains(currentResource)) {
getResourceSet().getResources().add(currentResource);
if (!resourceSet.getResources().contains(currentResource)) {
resourceSet.getResources().add(currentResource);
}
}
if (object instanceof ReferenceFileItem) {
@@ -591,8 +608,8 @@ public class XmiResourceManager {
resources.add(currentResource);
}
}
if (!getResourceSet().getResources().contains(currentResource)) {
getResourceSet().getResources().add(currentResource);
if (!resourceSet.getResources().contains(currentResource)) {
resourceSet.getResources().add(currentResource);
}
}
}
@@ -608,7 +625,7 @@ public class XmiResourceManager {
if (property.getItem() instanceof ProcessItem || property.getItem() instanceof JobletProcessItem || isTestContainer) {
if (property.eResource() != null) {
Resource screenshotResource = getScreenshotResource(property.getItem());
Resource screenshotResource = getScreenshotResource(resourceSet, property.getItem(), false, false);
if (screenshotResource != null) {
resources.add(screenshotResource);
}
@@ -850,10 +867,14 @@ public class XmiResourceManager {
}
public void unloadResources(Property property) {
for (Resource resource : getAffectedResources(property)) {
unloadResources(getResourceSet(), property);
}
public void unloadResources(ResourceSet resourceSet, Property property) {
for (Resource resource : getAffectedResources(resourceSet, property)) {
if (resource != null) {
resource.unload();
getResourceSet().getResources().remove(resource);
resourceSet.getResources().remove(resource);
}
}
}

View File

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

View File

@@ -215,8 +215,8 @@ public class FilesUtils {
copyFolder(current, newFolder, targetBaseFolder, emptyTargetBeforeCopy, sourceFolderFilter,
sourceFileFilter, copyFolder, synchronize);
} else {
copyFolder(current, target, targetBaseFolder, emptyTargetBeforeCopy, sourceFolderFilter,
sourceFileFilter, copyFolder, synchronize);
copyFolder(current, target, targetBaseFolder, emptyTargetBeforeCopy, sourceFolderFilter, sourceFileFilter,
copyFolder, synchronize);
}
}
}
@@ -339,7 +339,8 @@ public class FilesUtils {
return getFilesFromFolder(bundle, path, extension, true, false);
}
public static List<URL> getFilesFromFolder(Bundle bundle, String path, String extension, boolean absoluteURL, boolean nested) {
public static List<URL> getFilesFromFolder(Bundle bundle, String path, String extension, boolean absoluteURL,
boolean nested) {
List<URL> toReturn = new ArrayList<URL>();
Enumeration entryPaths = bundle.getEntryPaths(path);
@@ -484,7 +485,7 @@ public class FilesUtils {
}
public static List<File> getDllFilesFromFolder(File file, String fileName) throws MalformedURLException {
return getFilesFromFolderByName(file, fileName, new String[] { ".dll" }, null, true); //$NON-NLS-1$
return getFilesFromFolderByName(file, fileName, new String[] { ".dll" }, null, true); //$NON-NLS-1$
}
public static FileFilter getExcludeSystemFilesFilter() {
@@ -492,7 +493,7 @@ public class FilesUtils {
@Override
public boolean accept(File pathname) {
return !isSVNFolder(pathname) && !pathname.toString().endsWith(".dummy"); //$NON-NLS-1$
return !isSVNFolder(pathname) && !pathname.toString().endsWith(".dummy"); //$NON-NLS-1$
}
};
@@ -1142,8 +1143,8 @@ public class FilesUtils {
return filePath;
}
public static BufferedReader isFilePathAvailable(String fileStr, FileConnection connection) throws IOException,
UnsupportedEncodingException, FileNotFoundException {
public static BufferedReader isFilePathAvailable(String fileStr, FileConnection connection)
throws IOException, UnsupportedEncodingException, FileNotFoundException {
BufferedReader in;
File file = new File(fileStr);
Charset guessedCharset = CharsetToolkit.guessEncoding(file, 4096);
@@ -1156,23 +1157,15 @@ public class FilesUtils {
return in;
}
protected static List<IResource> getExistedResources(IResource file, boolean ignoreFileNameCase) {
List<IResource> existedFiles = new ArrayList<IResource>();
protected static List<IResource> getExistedResources(IResource file, boolean ignoreFileNameCase) throws CoreException {
List<IResource> existedFiles = new ArrayList<>();
if (ignoreFileNameCase) {
final String currentFileName = file.getName();
File parentFile = file.getLocation().toFile().getParentFile();
IContainer parentFile = file.getParent();
if (parentFile.exists()) {
File[] listFiles = parentFile.listFiles(new FilenameFilter() {
@Override
public boolean accept(File dir, String name) {
return name.equalsIgnoreCase(currentFileName);
}
});
if (listFiles != null) {
for (File f : listFiles) {
IFile sameFile = file.getParent().getFile(new Path(f.getName()));
existedFiles.add(sameFile);
for (IResource resource: parentFile.members()) {
if (resource.getName().equalsIgnoreCase(currentFileName)) {
existedFiles.add(resource);
}
}
}
@@ -1184,9 +1177,6 @@ public class FilesUtils {
public static void removeExistedResources(IProgressMonitor monitor, IResource currentResources, boolean ignoreFileNameCase,
boolean overwrite) throws Exception {
final IContainer parent = currentResources.getParent();
parent.refreshLocal(IResource.DEPTH_ONE, monitor);
List<IResource> existedSameFiles = getExistedResources(currentResources, ignoreFileNameCase);
// existed current one and not overwrite.
@@ -1195,17 +1185,8 @@ public class FilesUtils {
}
// delete all
for (IResource resource : existedSameFiles) {
File f = resource.getLocation().toFile();
if (f.exists()) {
if (f.isDirectory()) {
org.talend.utils.io.FilesUtils.deleteFolder(f, true);
} else {
f.delete();
}
}
resource.delete(true, monitor);
}
parent.refreshLocal(IResource.DEPTH_ONE, monitor);
}
}

View File

@@ -119,7 +119,7 @@ public final class ResourceUtils {
public static IFolder getFolder(IProject source, String folderName, boolean forceExists) throws PersistenceException {
IFolder processFolder = source.getFolder(folderName);
if (forceExists && !processFolder.getLocation().toFile().exists()) {
if (forceExists && !processFolder.exists()) {
String msg = Messages.getString("resources.folder.notGet", folderName, source.getName()); //$NON-NLS-1$
throw new ResourceNotFoundException(msg);
}

View File

@@ -96,6 +96,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);
/**
* List all the jars (or other files) available.

View File

@@ -32,9 +32,11 @@ import org.talend.commons.utils.workbench.resources.ResourceUtils;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.ILibraryManagerService;
import org.talend.core.database.conn.ConnParameterKeys;
import org.talend.core.model.general.ModuleNeeded;
import org.talend.core.model.general.Project;
import org.talend.core.model.metadata.IMetadataConnection;
import org.talend.core.runtime.hd.IHDistribution;
import org.talend.core.runtime.hd.IHDistributionVersion;
import org.talend.core.runtime.hd.hive.HiveMetadataHelper;
import org.talend.repository.ProjectManager;
import org.talend.utils.io.FilesUtils;
@@ -52,6 +54,8 @@ public class ClassLoaderFactory {
public final static String SEPARATOR = ";"; //$NON-NLS-1$
public final static String KEY_SEPARATOR = ":"; //$NON-NLS-1$
private final static String PATH_SEPARATOR = "/"; //$NON-NLS-1$
public final static String INDEX_ATTR = "index"; //$NON-NLS-1$
@@ -307,7 +311,7 @@ public class ClassLoaderFactory {
String jarsStr = (String) metadataConn.getParameter(ConnParameterKeys.CONN_PARA_KEY_HADOOP_CUSTOM_JARS);
moduleList = jarsStr.split(";"); //$NON-NLS-1$
} else {
String index = "HIVE" + ":" + distroKey + ":" + distroVersion + ":" + hiveModel; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
String index = "HIVE" + KEY_SEPARATOR + distroKey + KEY_SEPARATOR + distroVersion + KEY_SEPARATOR + hiveModel; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
moduleList = getDriverModuleList(index);
}
return moduleList;
@@ -328,4 +332,16 @@ public class ClassLoaderFactory {
}
return null;
}
public static DynamicClassLoader getClassLoader(IHDistributionVersion hdVersion) {
String index = "HadoopModules" + KEY_SEPARATOR + hdVersion.getDistribution().getName() + KEY_SEPARATOR
+ hdVersion.getVersion();
List<ModuleNeeded> modulesNeeded = hdVersion.getModulesNeeded();
Set<String> libraries = new HashSet<String>();
for (ModuleNeeded m : modulesNeeded) {
libraries.add(m.getModuleName());
}
DynamicClassLoader hdClassLoader = getCustomClassLoader(index, libraries);
return hdClassLoader;
}
}

View File

@@ -336,7 +336,7 @@ public class DatabaseConnStrUtil {
}
} else {
if (Principal != null) {
standardURlString = standardURlString.concat(SEMICOLON).concat(principalSuffix).concat(Principal);
standardURlString = urlArray[0].concat(SEMICOLON).concat(principalSuffix).concat(Principal);
}
}

View File

@@ -146,7 +146,7 @@ public enum EDatabaseVersion4Drivers {
// Changed by Marvin Wang on Oct.9, 2012, just because the libs checking can not pass, Remy updated some jars from
HBASE(new DbVersion4Drivers(EDatabaseTypeName.HBASE, new String[] {})),
REDSHIFT(new DbVersion4Drivers(EDatabaseTypeName.REDSHIFT, "RedshiftJDBC41-1.1.13.1013.jar")), //$NON-NLS-1$
REDSHIFT(new DbVersion4Drivers(EDatabaseTypeName.REDSHIFT, "RedshiftJDBC41-1.2.10.1009.jar")), //$NON-NLS-1$
AMAZON_AURORA(new DbVersion4Drivers(EDatabaseTypeName.AMAZON_AURORA, "mysql-connector-java-5.1.30-bin.jar")); //$NON-NLS-1$

View File

@@ -218,7 +218,7 @@ public class HadoopClassLoaderFactory2 {
return cll;
}
private static String[] getSecurityJars(EHadoopCategory category) {
public static String[] getSecurityJars(EHadoopCategory category) {
String[] securityJars;
switch (category) {
case HDFS:

View File

@@ -17,6 +17,7 @@ import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import org.apache.commons.lang.StringUtils;
import org.talend.commons.exception.ExceptionHandler;
@@ -24,6 +25,7 @@ import org.talend.core.GlobalServiceRegister;
import org.talend.core.hadoop.IHadoopClusterService;
import org.talend.core.model.metadata.builder.connection.Connection;
import org.talend.core.model.utils.ContextParameterUtils;
import org.talend.core.service.IMetadataManagmentUiService;
import org.talend.core.utils.TalendQuoteUtils;
import org.talend.designer.core.model.utils.emf.talendfile.ContextType;
import org.talend.utils.json.JSONArray;
@@ -134,6 +136,11 @@ public class HadoopRepositoryUtil {
*/
public static List<Map<String, Object>> getHadoopPropertiesFullList(Connection connection, String propertiesJsonStr,
boolean includeQuotes) {
return getHadoopPropertiesFullList(connection, propertiesJsonStr, includeQuotes, false);
}
public static List<Map<String, Object>> getHadoopPropertiesFullList(Connection connection, String propertiesJsonStr,
boolean includeQuotes, boolean useOriginalValue) {
IHadoopClusterService hadoopClusterService = null;
if (GlobalServiceRegister.getDefault().isServiceRegistered(IHadoopClusterService.class)) {
hadoopClusterService = (IHadoopClusterService) GlobalServiceRegister.getDefault().getService(
@@ -143,11 +150,12 @@ public class HadoopRepositoryUtil {
if (hadoopClusterService != null) {
Connection hadoopClusterConnection = hadoopClusterService.getHadoopClusterConnectionBySubConnection(connection);
if (hadoopClusterConnection != null) {
parentProperties = getHadoopPropertiesList(hadoopClusterService.getHadoopClusterProperties(connection),
hadoopClusterConnection.isContextMode(), true);
String hadoopClusterPropertiesStrs = hadoopClusterService.getHadoopClusterProperties(connection);
parentProperties = getHadoopProperties(hadoopClusterConnection, hadoopClusterPropertiesStrs, includeQuotes,
useOriginalValue);
}
}
List<Map<String, Object>> properties = getHadoopPropertiesList(propertiesJsonStr, connection.isContextMode(), true);
List<Map<String, Object>> properties = getHadoopProperties(connection, propertiesJsonStr, includeQuotes, useOriginalValue);
Map<String, Map<String, Object>> propertiesMap = new HashMap<String, Map<String, Object>>();
for (Map<String, Object> proMap : properties) {
String property = String.valueOf(proMap.get("PROPERTY")); //$NON-NLS-1$
@@ -165,7 +173,27 @@ public class HadoopRepositoryUtil {
return properties;
}
private static List<Map<String, Object>> getHadoopProperties(Connection connection, String propertiesJsonStr,
boolean includeQuotes, boolean useOriginalValue) {
List<Map<String, Object>> properties = null;
IMetadataManagmentUiService mmUIService = null;
if (GlobalServiceRegister.getDefault().isServiceRegistered(IMetadataManagmentUiService.class)) {
mmUIService = (IMetadataManagmentUiService) GlobalServiceRegister.getDefault().getService(
IMetadataManagmentUiService.class);
}
ContextType contextType = null;
if (mmUIService != null) {
contextType = mmUIService.getContextTypeForContextMode(connection);
}
if (useOriginalValue && contextType != null) {
properties = getHadoopPropertiesWithOriginalValue(propertiesJsonStr, contextType, includeQuotes);
} else {
properties = getHadoopPropertiesList(propertiesJsonStr, contextType != null, includeQuotes);
}
return properties;
}
public static boolean useClouderaNavi(Connection hadoopSubConnection) {
IHadoopClusterService hadoopClusterService = null;
if (GlobalServiceRegister.getDefault().isServiceRegistered(IHadoopClusterService.class)) {
@@ -274,36 +302,62 @@ public class HadoopRepositoryUtil {
return false;
}
public static String getOriginalValueOfProperties(ContextType contextType, String propertiesStrings) {
public static String getOriginalValueOfProperties(String propertiesStrings, ContextType contextType) {
return getOriginalValueOfProperties(propertiesStrings, contextType, false);
}
public static String getOriginalValueOfProperties(String propertiesStrings, ContextType contextType, boolean includeQuotes) {
String originalValueOfProperties = propertiesStrings;
if (propertiesStrings != null && !propertiesStrings.isEmpty()) {
List<Map<String, Object>> jdbcPropertiesList = HadoopRepositoryUtil.getHadoopPropertiesList(propertiesStrings);
if (jdbcPropertiesList != null && !jdbcPropertiesList.isEmpty()) {
List<Map<String, Object>> newJdbcPropertiesList = new ArrayList<Map<String, Object>>(jdbcPropertiesList.size());
Iterator<Map<String, Object>> iter = jdbcPropertiesList.iterator();
while (iter.hasNext()) {
Map<String, Object> map = iter.next();
if (map != null && !map.isEmpty()) {
Map<String, Object> newMap = new HashMap<String, Object>();
Iterator<Map.Entry<String, Object>> mapEntryIter = map.entrySet().iterator();
while (mapEntryIter.hasNext()) {
Map.Entry<String, Object> entry = mapEntryIter.next();
if (entry != null) {
Object obj = entry.getValue();
Object newValue = null;
if (obj != null) {
newValue = ContextParameterUtils.getOriginalValue(contextType, obj.toString());
}
newMap.put(entry.getKey(), newValue);
}
}
newJdbcPropertiesList.add(newMap);
}
}
originalValueOfProperties = HadoopRepositoryUtil.getHadoopPropertiesJsonStr(newJdbcPropertiesList);
List<Map<String, Object>> propertiesList = getHadoopPropertiesWithOriginalValue(propertiesStrings, contextType,
includeQuotes);
if (propertiesList != null && !propertiesList.isEmpty()) {
originalValueOfProperties = getHadoopPropertiesJsonStr(propertiesList);
}
}
return originalValueOfProperties;
}
/**
* DOC ycbai Comment method "getHadoopPropertiesWithOriginalValue".
*
* <p>
* Get hadoop properties list which convert conext value to original value if needed.
* </p>
*
* @param propertiesStrings
* @param contextType
* @param includeQuotes
* @return
*/
public static List<Map<String, Object>> getHadoopPropertiesWithOriginalValue(String propertiesStrings,
ContextType contextType, boolean includeQuotes) {
boolean isContextMode = contextType == null ? false : true;
List<Map<String, Object>> propertiesList = getHadoopPropertiesList(propertiesStrings, isContextMode,
includeQuotes);
if (!isContextMode) {
return propertiesList;
}
List<Map<String, Object>> newPropertiesList = new ArrayList<>();
for (Map<String, Object> propMap : propertiesList) {
Map<String, Object> newPropMap = new HashMap<>();
Iterator<Map.Entry<String, Object>> propMapEntryIter = propMap.entrySet().iterator();
while (propMapEntryIter.hasNext()) {
Entry<String, Object> propMapEntry = propMapEntryIter.next();
String propKey = propMapEntry.getKey();
Object propValue = propMapEntry.getValue();
if (propKey != null && propValue != null) {
String newValue = ContextParameterUtils.getOriginalValue(contextType, String.valueOf(propValue));
newPropMap.put(propKey, newValue);
}
}
if (!newPropMap.isEmpty()) {
newPropertiesList.add(newPropMap);
}
}
return newPropertiesList;
}
}

View File

@@ -299,6 +299,11 @@ public class JobContextManager implements IContextManager {
Item item = ContextUtils.getRepositoryContextItemById(contextParam.getSource());
if (item != null) {
contextParamType.setRepositoryContextId(item.getProperty().getId());
} else {
String contextId = contextParam.getSource();
if (!IContextParameter.BUILT_IN.equals(contextId)) {
contextParamType.setRepositoryContextId(contextId);
}
}
}
}

View File

@@ -98,6 +98,8 @@ public interface ILibrariesService extends IService {
Set<ModuleNeeded> getCodesModuleNeededs(ERepositoryObjectType type);
List<ModuleNeeded> getModuleNeeded(String id, boolean isGroup);
/**
* Listener used to fire that libraries status has been changed (new lib or new check install).
*

View File

@@ -16,6 +16,7 @@ import java.util.List;
import java.util.Set;
import org.apache.commons.lang.StringUtils;
import org.eclipse.core.runtime.Path;
import org.ops4j.pax.url.mvn.MavenResolver;
import org.osgi.framework.Bundle;
import org.osgi.framework.ServiceReference;
@@ -62,6 +63,9 @@ public class ModuleNeeded {
private ELibraryInstallStatus status = ELibraryInstallStatus.UNKNOWN;
// status installed in maven
private ELibraryInstallStatus installStatus = ELibraryInstallStatus.UNKNOWN;
private boolean isShow = true;
List<String> installURL;
@@ -70,6 +74,8 @@ public class ModuleNeeded {
private String mavenUri;
private boolean dynamic;
public static final String SINGLE_QUOTE = "'"; //$NON-NLS-1$
public static final String QUOTATION_MARK = "\""; //$NON-NLS-1$
@@ -113,7 +119,10 @@ public class ModuleNeeded {
UNKNOWN,
INSTALLED,
UNUSED,
NOT_INSTALLED;
NOT_INSTALLED,
DEPLOYED,
NOT_DEPLOYED;
}
/**
@@ -141,7 +150,7 @@ public class ModuleNeeded {
/**
* creates ModuleNeeded from its maven uri. the modeule name is the artifact_ID + "." + artifact_type
*
*
* @param context
* @param informationMsg
* @param required
@@ -252,8 +261,11 @@ public class ModuleNeeded {
public void setModuleName(String moduleName) {
if (moduleName != null) {
this.moduleName = moduleName.replace(QUOTATION_MARK, "").replace(SINGLE_QUOTE, //$NON-NLS-1$
""); //$NON-NLS-1$
String mn = moduleName.replace(QUOTATION_MARK, "").replace(SINGLE_QUOTE, ""); //$NON-NLS-1$ //$NON-NLS-2$
if (mn.indexOf("\\") != -1 || mn.indexOf("/") != -1) { //$NON-NLS-1$ //$NON-NLS-2$
mn = new Path(mn).lastSegment();
}
this.moduleName = mn;
} else {
this.moduleName = moduleName;
}
@@ -272,7 +284,7 @@ public class ModuleNeeded {
final ELibraryInstallStatus eLibraryInstallStatus = ModuleStatusProvider.getStatusMap().get(mvnUriStatusKey);
if (eLibraryInstallStatus != null) {
return eLibraryInstallStatus;
} else {
} else if (mvnUriStatusKey != null) {
// compute the status of the lib.
// first use the Library manager service
ILibraryManagerService libManagerService = (ILibraryManagerService) GlobalServiceRegister.getDefault().getService(
@@ -280,20 +292,41 @@ public class ModuleNeeded {
Set<String> existLibraries = libManagerService.list();
if (existLibraries.contains(getModuleName())) {
status = ELibraryInstallStatus.INSTALLED;
ModuleStatusProvider.getStatusMap().put(mvnUriStatusKey, status);
} else {// then try to resolve locally
String localMavenUri = mvnUriStatusKey.replace("mvn:", "mvn:" + MavenConstants.LOCAL_RESOLUTION_URL + "!"); //$NON-NLS-1$ //$NON-NLS-2$
try {
getMavenResolver().resolve(localMavenUri);
status = ELibraryInstallStatus.INSTALLED;
} catch (Exception e) {
status = ELibraryInstallStatus.NOT_INSTALLED;
}
resolveStatusLocally(mvnUriStatusKey);
}
ModuleStatusProvider.getStatusMap().put(mvnUriStatusKey, status);
}
return this.status;
}
public ELibraryInstallStatus getDeployStatus() {
String mvnUriStatusKey = getMavenUri(true);
final ELibraryInstallStatus eLibraryDeployStatus = ModuleStatusProvider.getDeployStatusMap().get(mvnUriStatusKey);
if (eLibraryDeployStatus != null) {
return eLibraryDeployStatus;
} else {
resolveStatusLocally(mvnUriStatusKey);
}
return this.installStatus;
}
private void resolveStatusLocally(String mvnUriStatusKey) {
// then try to resolve locally
String localMavenUri = mvnUriStatusKey.replace("mvn:", "mvn:" + MavenConstants.LOCAL_RESOLUTION_URL + "!"); //$NON-NLS-1$ //$NON-NLS-2$
try {
getMavenResolver().resolve(localMavenUri);
status = ELibraryInstallStatus.INSTALLED;
installStatus = ELibraryInstallStatus.DEPLOYED;
} catch (Exception e) {
status = ELibraryInstallStatus.NOT_INSTALLED;
installStatus = ELibraryInstallStatus.NOT_DEPLOYED;
}
ModuleStatusProvider.getStatusMap().put(mvnUriStatusKey, status);
ModuleStatusProvider.getDeployStatusMap().put(mvnUriStatusKey, installStatus);
}
private MavenResolver getMavenResolver() {
if (mavenResolver == null) {
final Bundle bundle = CoreRuntimePlugin.getInstance().getBundle();
@@ -393,7 +426,7 @@ public class ModuleNeeded {
/*
* (non-Javadoc)
*
*
* @see java.lang.Object#hashCode()
*/
@Override
@@ -416,7 +449,7 @@ public class ModuleNeeded {
/*
* (non-Javadoc)
*
*
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
@@ -530,7 +563,7 @@ public class ModuleNeeded {
/**
* Getter for mavenUriSnapshot.
*
*
* @return the mavenUriSnapshot
*/
public String getMavenUri() {
@@ -539,7 +572,7 @@ public class ModuleNeeded {
/**
* Sets the mavenUrl.
*
*
* @param mavenUrl the mavenUrl to set
*/
public void setMavenUri(String mavenUri) {
@@ -556,9 +589,18 @@ public class ModuleNeeded {
// set jar by default
parseMvnUrl.setType(MavenConstants.TYPE_JAR);
}
uri = MavenUrlHelper.generateMvnUrl(parseMvnUrl.getGroupId(), parseMvnUrl.getArtifactId(),
parseMvnUrl.getVersion(), parseMvnUrl.getType(), parseMvnUrl.getClassifier());
uri = MavenUrlHelper.generateMvnUrl(parseMvnUrl.getGroupId(), parseMvnUrl.getArtifactId(), parseMvnUrl.getVersion(),
parseMvnUrl.getType(), parseMvnUrl.getClassifier());
}
return uri;
}
public boolean isDynamic() {
return this.dynamic;
}
public void setDynamic(boolean dynamic) {
this.dynamic = dynamic;
}
}

View File

@@ -31,6 +31,8 @@ public class ModuleStatusProvider {
*/
private static Map<String, ELibraryInstallStatus> statusMap = new HashMap<String, ELibraryInstallStatus>();
private static Map<String, ELibraryInstallStatus> deployStatusMap = new HashMap<String, ELibraryInstallStatus>();
/**
* Getter for statusMap.
*
@@ -40,7 +42,17 @@ public class ModuleStatusProvider {
return statusMap;
}
/**
* Getter for deployStatusMap.
*
* @return the deployStatusMap
*/
public static Map<String, ELibraryInstallStatus> getDeployStatusMap() {
return deployStatusMap;
}
public static void reset() {
statusMap.clear();
deployStatusMap.clear();
}
}

View File

@@ -111,6 +111,7 @@ public class MetadataColumn implements IMetadataColumn, Cloneable {
setRelatedEntity(metadataColumn.getRelatedEntity());
setRelationshipType(metadataColumn.getRelationshipType());
this.usefulColumn = metadataColumn.isUsefulColumn();
this.getAdditionalField().putAll(metadataColumn.getAdditionalField());
}
private static synchronized String getNewId() {

View File

@@ -94,9 +94,9 @@ import org.talend.cwm.helper.ConnectionHelper;
/**
* DOC nrousseau class global comment. Detailled comment <br/>
*
*
* $Id: RepositoryToComponentProperty.java 51621 2010-11-23 09:18:34Z hwang $
*
*
*/
public class RepositoryToComponentProperty {
@@ -168,7 +168,7 @@ public class RepositoryToComponentProperty {
/**
* DOC guanglong.du Comment method "getEDIFACTSchemaValue".
*
*
* @param connection
* @param value
* @return
@@ -196,9 +196,9 @@ public class RepositoryToComponentProperty {
}
/**
*
*
* DOC YeXiaowei Comment method "getSAPInputAndOutputValue".
*
*
* @param conn
* @param value2
* @param functionLabel
@@ -283,9 +283,9 @@ public class RepositoryToComponentProperty {
}
/**
*
*
* DOC xye Comment method "getSAPValuesForFunction".
*
*
* @param conn
* @param functionLabel
* @param paramterName
@@ -316,9 +316,9 @@ public class RepositoryToComponentProperty {
}
/**
*
*
* DOC YeXiaowei Comment method "getTalendTypeFromJCOType".
*
*
* @param jcoType
* @return
*/
@@ -335,9 +335,9 @@ public class RepositoryToComponentProperty {
}
/**
*
*
* DOC YeXiaowei Comment method "getSAPValue".
*
*
* @param connection
* @param value
* @return
@@ -399,9 +399,9 @@ public class RepositoryToComponentProperty {
if (property.getPropertyName() != null && !"".equals(property.getPropertyName())) {
map.put("PROPERTY", TalendQuoteUtils.addQuotes(property.getPropertyName()));//$NON-NLS-1$
if (isContextMode(connection, property.getValue())) {
map.put("VALUE", property.getValue());//$NON-NLS-1$
map.put("VALUE", property.getValue());//$NON-NLS-1$
} else {
map.put("VALUE", TalendQuoteUtils.addQuotes(property.getValue()));//$NON-NLS-1$
map.put("VALUE", TalendQuoteUtils.addQuotes(property.getValue()));//$NON-NLS-1$
}
values.add(map);
}
@@ -414,7 +414,7 @@ public class RepositoryToComponentProperty {
/**
* DOC gcui Comment method "getHL7Value".
*
*
* @param connection
* @param value
* @return
@@ -444,7 +444,7 @@ public class RepositoryToComponentProperty {
/**
* DOC YeXiaowei Comment method "getSalesforceSchemaValue".
*
*
* @param connection
* @param value
* @return
@@ -601,7 +601,7 @@ public class RepositoryToComponentProperty {
/**
* DOC qzhang Comment method "getWSDLValue".
*
*
* @param connection
* @param value
* @return
@@ -726,7 +726,7 @@ public class RepositoryToComponentProperty {
/**
* DOC hwang Comment method "getMDMValue".
*
*
* @param connection
* @param value
* @param node
@@ -1131,14 +1131,14 @@ public class RepositoryToComponentProperty {
return getAppropriateValue(connection, connection.getDBRootPath());
}
// add for feature 11674
if (value.equals("RUNNING_MODE")) {//$NON-NLS-1$
String runningMode = "HSQLDB_IN_MEMORY";//$NON-NLS-1$
if (value.equals("RUNNING_MODE")) {//$NON-NLS-1$
String runningMode = "HSQLDB_IN_MEMORY";//$NON-NLS-1$
if (EDatabaseTypeName.HSQLDB_IN_PROGRESS.getXmlName().equals(databaseType)) {
runningMode = "HSQLDB_INPROGRESS_PERSISTENT";//$NON-NLS-1$
runningMode = "HSQLDB_INPROGRESS_PERSISTENT";//$NON-NLS-1$
} else if (EDatabaseTypeName.HSQLDB_SERVER.getXmlName().equals(databaseType)) {
runningMode = "HSQLDB_SERVER";//$NON-NLS-1$
runningMode = "HSQLDB_SERVER";//$NON-NLS-1$
} else if (EDatabaseTypeName.HSQLDB_WEBSERVER.getXmlName().equals(databaseType)) {
runningMode = "HSQLDB_WEBSERVER";//$NON-NLS-1$
runningMode = "HSQLDB_WEBSERVER";//$NON-NLS-1$
}
return runningMode;
}
@@ -1410,7 +1410,7 @@ public class RepositoryToComponentProperty {
/**
* JOBTRACKER_PRINCIPAL and RESOURCEMANAGER_PRINCIPAL use the same field
*
*
* @see org.talend.repository.model.hadoopcluster.HadoopClusterConnection#getJtOrRmPrincipal()
*/
if (value.equals("JOBTRACKER_PRINCIPAL") || value.equals("RESOURCEMANAGER_PRINCIPAL")) {
@@ -1542,7 +1542,7 @@ public class RepositoryToComponentProperty {
/**
* DOC nrousseau Comment method "getDatabaseValue".
*
*
* @param connection
* @param value
* @return
@@ -1564,7 +1564,7 @@ public class RepositoryToComponentProperty {
/**
* DOC nrousseau Comment method "getFileValue".
*
*
* @param connection
* @param value
* @return
@@ -1649,9 +1649,9 @@ public class RepositoryToComponentProperty {
}
/**
*
*
* ggu Comment method "getEBCDICFieldValue".
*
*
*/
private static Object getEBCDICFieldValue(EbcdicConnection connection, String value) {
// if ("XC2J_FILE".equals(value)) { //$NON-NLS-1$
@@ -1692,7 +1692,7 @@ public class RepositoryToComponentProperty {
/**
* DOC yexiaowei Comment method "getExcelFileValue".
*
*
* @param connection
* @param value
* @return
@@ -1767,7 +1767,7 @@ public class RepositoryToComponentProperty {
/**
* DOC YeXiaowei Comment method "getExcelSheetTableValue".
*
*
* @param connection
*/
private static List<Map<String, Object>> getExcelSheetTableValue(FileExcelConnection connection) {
@@ -1787,7 +1787,7 @@ public class RepositoryToComponentProperty {
/**
* DOC nrousseau Comment method "getPositionalFileValue".
*
*
* @param connection
* @param value
* @return
@@ -1810,7 +1810,7 @@ public class RepositoryToComponentProperty {
return connection.getTextEnclosure();
}
if (value.equals("SPLITRECORD")) { //$NON-NLS-1$
if (value.equals("SPLITRECORD")) { //$NON-NLS-1$
return connection.isSplitRecord();
}
return null;
@@ -1980,7 +1980,7 @@ public class RepositoryToComponentProperty {
/**
* qiang.zhang Comment method "getTableXMLMappingValue".
*
*
* @param connection
* @param tableInfo
* @param metaTable
@@ -2073,7 +2073,7 @@ public class RepositoryToComponentProperty {
/**
* qiang.zhang Comment method "getTableXMLMappingValue".
*
*
* @param connection
* @param tableInfo
* @param metaTable
@@ -2348,7 +2348,7 @@ public class RepositoryToComponentProperty {
/**
* Gets repository value for LDAP schema.
*
*
* @param connection
* @param value
* @return
@@ -2435,7 +2435,7 @@ public class RepositoryToComponentProperty {
/**
* DOC qiang.zhang Comment method "getXMLMappingValue".
*
*
* @param repositoryConnection
* @param metadataTable
* @return
@@ -2665,7 +2665,7 @@ public class RepositoryToComponentProperty {
}
if (value.equals("USE_ENCODING")) {
return connection.isSFTP();
return connection.isUseFileNameEncoding();
}
if (value.equals("ENCODING")) {

View File

@@ -17,6 +17,7 @@ import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -26,7 +27,6 @@ import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.emf.common.util.EList;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.exception.PersistenceException;
import org.talend.core.model.general.Project;
@@ -175,7 +175,7 @@ public class RelationshipItemBuilder {
return instance;
}
private static RelationshipItemBuilder createInstance(IProxyRepositoryFactory repositoryFactory, Project project) {
public static RelationshipItemBuilder createInstance(IProxyRepositoryFactory repositoryFactory, Project project) {
RelationshipItemBuilder instance = new RelationshipItemBuilder();
instance.setAimProject(project);
instance.setProxyRepositoryFactory(repositoryFactory);
@@ -218,15 +218,28 @@ public class RelationshipItemBuilder {
* @return
*/
public List<Relation> getItemsHaveRelationWith(String itemId) {
return getItemsHaveRelationWith(itemId, null);
}
/**
* Look for every linked items who use the selected id, no matter the version. Usefull when want to delete an item
* since it will delete every versions.
*
* @param itemId
* @param version
* @return
*/
public List<Relation> getItemsHaveRelationWith(String itemId, String version) {
if (!loaded) {
loadRelations();
}
Set<Relation> relations = new HashSet<Relation>();
Set<Relation> itemsRelations = getItemsHaveRelationWith(currentProjectItemsRelations, itemId);
Set<Relation> itemsRelations = getItemsHaveRelationWith(currentProjectItemsRelations, itemId, version);
if (itemsRelations != null) {
relations.addAll(itemsRelations);
}
itemsRelations = getItemsHaveRelationWith(referencesItemsRelations, itemId);
itemsRelations = getItemsHaveRelationWith(referencesItemsRelations, itemId, version);
if (itemsRelations != null) {
relations.addAll(itemsRelations);
}
@@ -275,7 +288,20 @@ public class RelationshipItemBuilder {
return new ArrayList<Relation>(relations);
}
private Set<Relation> getItemsHaveRelationWith(Map<Relation, Set<Relation>> itemsRelations, String itemId) {
/**
*
* DOC cmeng Comment method "getItemsHaveRelationWith".
*
* @param itemsRelations
* @param itemId
* @param version if null, then won't check
* @return
*/
private Set<Relation> getItemsHaveRelationWith(Map<Relation, Set<Relation>> itemsRelations, String itemId, String version) {
/**
* if verison is null, then won't check
*/
Set<Relation> relations = new HashSet<Relation>();
@@ -295,8 +321,36 @@ public class RelationshipItemBuilder {
tmpRelatedItem = relatedItem;
}
if (tmpRelatedItem != null && itemId.equals(id)) {
relations.add(baseItem);
break;
boolean isEqual = true;
if (version != null) {
/**
* if verison is null, then won't check
*/
String curVersion = tmpRelatedItem.getVersion();
if (!LATEST_VERSION.equals(version) && LATEST_VERSION.equals(curVersion)) {
try {
IRepositoryViewObject latest = getProxyRepositoryFactory().getLastVersion(getAimProject(),
id);
if (latest != null) {
curVersion = latest.getVersion();
}
} catch (PersistenceException e) {
ExceptionHandler.process(e);
}
}
if (version.equals(curVersion)) {
isEqual = true;
} else {
isEqual = false;
}
}
if (isEqual) {
relations.add(baseItem);
break;
}
}
}
}
@@ -314,7 +368,7 @@ public class RelationshipItemBuilder {
if (relatedItem.getType().equals(JOB_RELATION) && itemId.equals(id)) {
if ("Latest".equals(relatedItem.getVersion())) {
try {
IRepositoryViewObject latest = getProxyRepositoryFactory().getLastVersion(id);
IRepositoryViewObject latest = getProxyRepositoryFactory().getLastVersion(getAimProject(), id);
if (!latest.getVersion().equals(version)) {
continue;
}
@@ -431,8 +485,68 @@ public class RelationshipItemBuilder {
public void unloadRelations() {
loaded = false;
currentProjectItemsRelations = new HashMap<Relation, Set<Relation>>();
referencesItemsRelations = new HashMap<Relation, Set<Relation>>();
clearAllItemsRelations();
}
public void clearAllItemsRelations() {
if (currentProjectItemsRelations != null) {
currentProjectItemsRelations.clear();
}
if (referencesItemsRelations != null) {
referencesItemsRelations.clear();
}
}
public void cleanTypeRelations(String baseType, String relationType, boolean save) {
if (!loaded) {
loadRelations();
}
// because only save for current project
modified = cleanTypeRelations(getCurrentProjectItemsRelations(), baseType, relationType);
cleanTypeRelations(referencesItemsRelations, baseType, relationType);
if (save) {
saveRelations();
}
}
private boolean cleanTypeRelations(Map<Relation, Set<Relation>> projectRelations, String baseType, String relationType) {
if (projectRelations == null) {
return false;
}
boolean modified = false;
// clean up base type first
if (baseType != null) {
List<Relation> cleanupItems = new ArrayList<Relation>();
for (Relation base : projectRelations.keySet()) {
if (baseType.equals(base.getType())) {
cleanupItems.add(base);
}
}
modified = !cleanupItems.isEmpty();
//
for (Relation r : cleanupItems) {
projectRelations.remove(r);
}
}
// deal with the left for relation type
if (relationType != null) {
for (Relation base : projectRelations.keySet()) {
Set<Relation> relation = projectRelations.get(base);
if (relation != null) {
Iterator<Relation> iterator = relation.iterator();
while (iterator.hasNext()) {
Relation r = iterator.next();
if (relationType.equals(r.getType())) {
iterator.remove();
modified = true;
}
}
}
}
}
return modified;
}
private void loadRelations() {
@@ -506,15 +620,17 @@ public class RelationshipItemBuilder {
for (Relation relation : currentProjectItemsRelations.keySet()) {
ItemRelations itemRelations = null;
boolean exist = false;
for(ItemRelations relations : oldRelations){
if(relations.getBaseItem().getId().equals(relation.getId())){
for (ItemRelations relations : oldRelations) {
boolean isIdSame = relations.getBaseItem().getId().equals(relation.getId());
boolean isVersionSame = StringUtils.equals(relations.getBaseItem().getVersion(), relation.getVersion());
if (isIdSame && isVersionSame) {
usedList.add(relations);
itemRelations = relations;
exist = true;
break;
}
}
if(itemRelations == null){
if (itemRelations == null) {
itemRelations = PropertiesFactory.eINSTANCE.createItemRelations();
ItemRelation baseItem = PropertiesFactory.eINSTANCE.createItemRelation();
@@ -524,7 +640,7 @@ public class RelationshipItemBuilder {
baseItem.setType(relation.getType());
baseItem.setVersion(relation.getVersion());
}
// sort by type
List<Relation> relationItemsList = new ArrayList<Relation>(currentProjectItemsRelations.get(relation));
Collections.sort(relationItemsList, new Comparator<Relation>() {
@@ -534,16 +650,31 @@ public class RelationshipItemBuilder {
return o1.getType().compareTo(o2.getType());
}
});
List<ItemRelation> usedRelationList = new ArrayList<ItemRelation>();
List<ItemRelation> oldRelatedItems = new ArrayList<ItemRelation>(itemRelations.getRelatedItems());
for (Relation relatedItem : relationItemsList) {
List<ItemRelation> relationList = new ArrayList<ItemRelation>(itemRelations.getRelatedItems());
boolean found = false;
for(ItemRelation item : relationList){
if(item.getId() != null && item.getId().equals(relatedItem.getId())){
boolean found = false;
for (ItemRelation item : oldRelatedItems) {
boolean isIdSame = false;
String itemId = item.getId();
if (itemId != null) {
isIdSame = itemId.equals(relatedItem.getId());
}
boolean isVersionSame = false;
if (isIdSame) {
isVersionSame = StringUtils.equals(item.getVersion(), relatedItem.getVersion());
}
boolean sameType = false;
if (isVersionSame) {
sameType = StringUtils.equals(item.getType(), relatedItem.getType());
}
if (isIdSame && isVersionSame && sameType) {
usedRelationList.add(item);
found = true;
break;
}
}
if(found){
if (found) {
continue;
}
ItemRelation emfRelatedItem = PropertiesFactory.eINSTANCE.createItemRelation();
@@ -552,7 +683,11 @@ public class RelationshipItemBuilder {
emfRelatedItem.setVersion(relatedItem.getVersion());
itemRelations.getRelatedItems().add(emfRelatedItem);
}
if(!exist){
// get unused relation items
oldRelatedItems.removeAll(usedRelationList);
// remove unused relation items
itemRelations.getRelatedItems().removeAll(oldRelatedItems);
if (!exist) {
currentProject.getEmfProject().getItemsRelations().add(itemRelations);
}
}
@@ -604,15 +739,6 @@ public class RelationshipItemBuilder {
}
}
public void clearAllItemsRelations() {
if (currentProjectItemsRelations != null) {
currentProjectItemsRelations.clear();
}
if (referencesItemsRelations != null) {
referencesItemsRelations.clear();
}
}
private void addRelationShip(Item baseItem, String relatedId, String relatedVersion, String type) {
Relation relation = new Relation();
relation.setId(baseItem.getProperty().getId());
@@ -659,7 +785,7 @@ public class RelationshipItemBuilder {
try {
for (ERepositoryObjectType curTyp : getTypes()) {
if (curTyp != null) {
list.addAll(factory.getAll(curTyp, true, true));
list.addAll(factory.getAll(project, curTyp, true, true));
}
}
monitor.beginTask(Messages.getString("RelationshipItemBuilder.buildingIndex"), list.size()); //$NON-NLS-1$
@@ -858,7 +984,7 @@ public class RelationshipItemBuilder {
}
}
public Map<Relation, Set<Relation>> getCurrentProjectItemsRelations(){
public Map<Relation, Set<Relation>> getCurrentProjectItemsRelations() {
return this.currentProjectItemsRelations;
}
}

View File

@@ -27,6 +27,8 @@ public interface SVNConstant {
public static final String NAME_MASTER = "master"; //$NON-NLS-1$
public static final String NAME_ORIGIN = "origin"; //$NON-NLS-1$
/*
*
*/

View File

@@ -268,6 +268,14 @@ public class RepositoryUpdateManagerHelper {
if (jobletType != null) {
processRep.addAll(factory.getAll(jobletType, true));
}
ERepositoryObjectType processMr = ERepositoryObjectType.PROCESS_MR;
if (processMr != null) {
processRep.addAll(factory.getAll(processMr, true));
}
ERepositoryObjectType processStrom = ERepositoryObjectType.PROCESS_STORM;
if (processStrom != null) {
processRep.addAll(factory.getAll(processStrom, true));
}
} catch (PersistenceException e) {
ExceptionHandler.process(e);
}

View File

@@ -66,9 +66,7 @@ public abstract class AbstractRepository4ProcessUpdateManagerProvider extends Ab
return helper.checkJobItemsForUpdate(monitor, getTypes());
}
protected boolean enableCheckItem(final IRepositoryViewObject object) {
return false; // false, will only check the opened job.
}
protected List<Relation> getRelations(final IRepositoryViewObject object) {
// get the relation of item with other items

View File

@@ -24,6 +24,7 @@ import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.TreeViewer;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.core.model.repository.IRepositoryViewObject;
import org.talend.core.model.update.IUpdateItemType;
import org.talend.core.model.update.UpdateResult;
import org.talend.core.model.update.UpdatesConstants;
@@ -37,6 +38,8 @@ import org.talend.repository.model.IProxyRepositoryFactory;
*/
public abstract class AbstractRepositoryUpdateManagerProvider implements IRepositoryUpdateManagerProvider {
protected boolean enableCheckItem;
protected IProxyRepositoryFactory factory = CoreRuntimePlugin.getInstance().getProxyRepositoryFactory();
/*
@@ -196,4 +199,22 @@ public abstract class AbstractRepositoryUpdateManagerProvider implements IReposi
}
return false;
}
/**
* @return false, will only check the opened job.
*/
@Override
public boolean enableCheckItem(final IRepositoryViewObject object) {
return enableCheckItem;
}
/*
* (non-Javadoc)
*
* @see org.talend.core.model.update.extension.IRepositoryUpdateManagerProvider#setEnableCheckItem(boolean)
*/
@Override
public void setEnableCheckItem(boolean checkItem) {
this.enableCheckItem = checkItem;
}
}

View File

@@ -14,6 +14,7 @@ package org.talend.core.model.update.extension;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.TreeViewer;
import org.talend.core.model.repository.IRepositoryViewObject;
/**
* DOC ggu class global comment. Detailled comment
@@ -61,4 +62,15 @@ public interface IRepositoryUpdateManagerProvider extends IUpdateManagerProvider
*/
boolean updateForRepository(IStructuredSelection selection);
/**
* @return false, will only check the opened job.
*/
boolean enableCheckItem(final IRepositoryViewObject object);
/**
*
* @param checkItem if true , force to check closed job
*/
void setEnableCheckItem(boolean checkItem);
}

View File

@@ -246,42 +246,51 @@ public enum UpdateManagerProviderDetector {
public boolean updateForRepository(IStructuredSelection selection, boolean needConfirm) {
boolean forcePropagation = false;
IRepositoryUpdateManagerProvider[] repositoryProviders = reader.getRepositoryProviders();
for (IRepositoryUpdateManagerProvider provider : repositoryProviders) {
if (provider.needForcePropagation(selection)) {
forcePropagation = true;
}
}
if (!forcePropagation && needConfirm) {
IDesignerCoreService designerCoreService = CoreRuntimePlugin.getInstance().getDesignerCoreService();
boolean deactive = designerCoreService != null ? Boolean.parseBoolean(designerCoreService
.getPreferenceStore(ITalendCorePrefConstants.DEACTIVE_REPOSITORY_UPDATE)) : true;
if (deactive) {// disable to do update
return false;
try {
for (IRepositoryUpdateManagerProvider provider : repositoryProviders) {
if (provider.needForcePropagation(selection)) {
forcePropagation = true;
}
}
boolean propagated = RepositoryUpdateManager.openPropagationDialog();
if (!propagated) {
return false;
}
}
if (!forcePropagation && needConfirm) {
IDesignerCoreService designerCoreService = CoreRuntimePlugin.getInstance().getDesignerCoreService();
boolean deactive = designerCoreService != null ? Boolean.parseBoolean(designerCoreService
.getPreferenceStore(ITalendCorePrefConstants.DEACTIVE_REPOSITORY_UPDATE)) : true;
if (deactive) {// disable to do update
return false;
}
boolean updated = false;
for (IRepositoryUpdateManagerProvider provider : repositoryProviders) {
// if one upate successfully, will return true.
if (provider.updateForRepository(selection)) {
boolean propagated = RepositoryUpdateManager.openPropagationDialog();
if (!propagated) {
return false;
}
}
boolean updated = false;
for (IRepositoryUpdateManagerProvider provider : repositoryProviders) {
// fix for the joblet ,force to check closed jobs incese joblet context changed
provider.setEnableCheckItem(true);
// if one upate successfully, will return true.
if (provider.updateForRepository(selection)) {
updated = true;
}
}
// Old Updates
if (doOldUpdates(selection)) {
updated = true;
}
if (!updated) {
// nothing to update
RepositoryUpdateManager.openNoModificationDialog();
}
return updated;
} finally {
for (IRepositoryUpdateManagerProvider provider : repositoryProviders) {
// change back to default value
provider.setEnableCheckItem(false);
}
}
// Old Updates
if (doOldUpdates(selection)) {
updated = true;
}
if (!updated) {
// nothing to update
RepositoryUpdateManager.openNoModificationDialog();
}
return updated;
}
private boolean doOldUpdates(IStructuredSelection selection) {

View File

@@ -58,8 +58,12 @@ public final class ContextParameterUtils {
private static final String JAVA_ENDWITH = "\"))"; //$NON-NLS-1$
private static final String LINE = "_"; //$NON-NLS-1$
private static final String EMPTY = ""; //$NON-NLS-1$
private static final String NON_CONTEXT_PATTERN = "[^a-zA-Z0-9_]"; //$NON-NLS-1$
/**
* Constructs a new ContextParameterUtils.
*/
@@ -395,6 +399,35 @@ public final class ContextParameterUtils {
return value;
}
/**
* DOC ycbai Comment method "isContextParamOfContextType".
*
* <p>
* Estimate if the context parameter exists in the context type.
*
* @param contextType
* @param value
* @return
*/
public static boolean isContextParamOfContextType(ContextType contextType, String value) {
if (contextType == null || value == null) {
return false;
}
ContextParameterType param = null;
if (ContextParameterUtils.isContainContextParam(value)) {
String var = ContextParameterUtils.getVariableFromCode(value);
if (var != null) {
for (ContextParameterType paramType : (List<ContextParameterType>) contextType.getContextParameter()) {
if (var.equals(paramType.getName())) {
param = paramType;
break;
}
}
}
}
return param != null;
}
public static boolean isValidParameterName(String name) {
if (name != null) {
// for java, the var name not be named with java keywords.
@@ -420,4 +453,28 @@ public final class ContextParameterUtils {
return false;
}
/**
* DOC ycbai Comment method "getValidParameterName".
*
* <p>
* Get a valid context parameter name which revise the invalid characters.
* </p>
*
* @param name
* @return
*/
public static String getValidParameterName(String name) {
if (name == null || name.isEmpty()) {
return null;
}
if (isValidParameterName(name)) {
return name;
}
String newName = name.replaceAll(NON_CONTEXT_PATTERN, LINE);
if (ContextUtils.isJavaKeyWords(newName)) {
newName = LINE + name;
}
return newName;
}
}

View File

@@ -941,7 +941,7 @@ public class NodeUtil {
if (original == null || original.trim().length() == 0) {
return original;
}
String result = "";
StringBuilder result = new StringBuilder();
int leftQuotes = original.indexOf("\"");
int rightQuotes = original.indexOf("\"", leftQuotes + 1);
int fakeRightQuotes = original.indexOf("\\\"", leftQuotes + 1);
@@ -950,14 +950,33 @@ public class NodeUtil {
fakeRightQuotes = original.indexOf("\\\"", fakeRightQuotes + 1);
}
int leftPrev = 0;
while (leftQuotes >= 0 && rightQuotes > leftQuotes) {
if (leftQuotes > leftPrev) {
result += original.substring(leftPrev, leftQuotes);
}
// System.out.println("leftQuote="+leftQuotes + ", rightQuote="+rightQuotes);
if (leftQuotes < rightQuotes) {
result += original.substring(leftQuotes, rightQuotes + 1).replace("\r", "").replace("\n", "\\n");
}
while (leftQuotes >= 0 && rightQuotes > leftQuotes) {
if (leftQuotes > leftPrev) {//Outside of double quote
result.append(original.substring(leftPrev, leftQuotes));
}
if (leftQuotes < rightQuotes) {//Inside of double quote
//split string for better appearance and avoid compile error when string exceed 64k
int current = leftQuotes;
int Offset = 120;
int count = 0;
while (rightQuotes + 1 - current > 120) {
while (original.charAt(current + Offset - 1) == '\\') {//avoid split special character e.g. \"
Offset--;
}
if(count>500){//This is the code that really solve TDI-39968 others are only for good appearance.
result.append(original.substring(current, current + Offset).replace("\r", "").replace("\n", "\\n")).append("\" + new String()\n+\"");
count = 0;
}else{
result.append(original.substring(current, current + Offset).replace("\r", "").replace("\n", "\\n")).append("\"\n+\"");
}
current += Offset;
Offset = 120;
count++;
}
result.append(original.substring(current, rightQuotes + 1).replace("\r", "").replace("\n", "\\n"));
}
leftQuotes = original.indexOf("\"", rightQuotes + 1);
leftPrev = rightQuotes + 1;
@@ -968,8 +987,8 @@ public class NodeUtil {
fakeRightQuotes = original.indexOf("\\\"", fakeRightQuotes + 1);
}
}
result += original.substring(leftPrev);
return result;
result.append( original.substring(leftPrev));
return result.toString();
}
/**

View File

@@ -204,6 +204,11 @@ public class TalendLibsServerManager {
return mavenResolver;
}
public void checkAndUpdateNexusServer() {
lastConnectionValid = null;
getCustomNexusServer();
}
public NexusServerBean getCustomNexusServer() {
if (!org.talend.core.PluginChecker.isCoreTISPluginLoaded()) {
@@ -223,32 +228,40 @@ 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);
JSONObject libServerObject;
libServerObject = remoteService.getLibNexusServer(userName, password, adminUrl);
if (libServerObject != null) {
nexus_url = libServerObject.getString(KEY_NEXUS_RUL);
nexus_user = libServerObject.getString(KEY_NEXUS_USER);
nexus_pass = libServerObject.getString(KEY_NEXUS_PASS);
repositoryId = libServerObject.getString(KEY_CUSTOM_LIB_REPOSITORY);
snapshotRepId = libServerObject.getString(KEY_CUSTOM_LIB_SNAPSHOT_REPOSITORY);
if (adminUrl != null && !"".equals(adminUrl)
&& GlobalServiceRegister.getDefault().isServiceRegistered(IRemoteService.class)) {
IRemoteService remoteService = (IRemoteService) GlobalServiceRegister.getDefault().getService(
IRemoteService.class);
JSONObject libServerObject;
libServerObject = remoteService.getLibNexusServer(userName, password, adminUrl);
if (libServerObject != null) {
nexus_url = libServerObject.getString(KEY_NEXUS_RUL);
nexus_user = libServerObject.getString(KEY_NEXUS_USER);
nexus_pass = libServerObject.getString(KEY_NEXUS_PASS);
repositoryId = libServerObject.getString(KEY_CUSTOM_LIB_REPOSITORY);
snapshotRepId = libServerObject.getString(KEY_CUSTOM_LIB_SNAPSHOT_REPOSITORY);
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);
}
}
}
}
if (lastConnectionValid == null) {
boolean connectionOk = NexusServerUtils.checkConnectionStatus(nexus_url, repositoryId, nexus_user, nexus_pass)
&& NexusServerUtils.checkConnectionStatus(nexus_url, snapshotRepId, nexus_user, nexus_pass);

View File

@@ -12,6 +12,10 @@
// ============================================================================
package org.talend.core.runtime.hd;
import java.util.List;
import org.talend.core.model.general.ModuleNeeded;
/**
* DOC ggu class global comment. Detailled comment
*/
@@ -24,4 +28,6 @@ public interface IHDistributionVersion {
String getDisplayVersion();
String getDefaultConfig(String... keys);
List<ModuleNeeded> getModulesNeeded();
}

View File

@@ -146,4 +146,10 @@ public interface ITalendProcessJavaProject {
*/
void cleanMavenFiles(IProgressMonitor monitor) throws Exception;
/**
*
* Reset the main pom to empty the content of the job dependencies.
*/
void regenerateMainProjectPom(IProgressMonitor monitor) throws Exception;
}

View File

@@ -30,6 +30,8 @@ public interface TalendProcessOptionConstants {
public static final int GENERATE_WITHOUT_COMPILING = 1 << 5;
public static final int GENERATE_WITHOUT_FORMAT = 1 << 6;
/**
* clean options
*/

View File

@@ -23,4 +23,6 @@ import org.eclipse.core.runtime.jobs.ISchedulingRule;
public interface ITalendSchedulingRule extends ISchedulingRule {
public Thread getRuleThread();
public void setRuleThread(Thread thread);
}

View File

@@ -17,6 +17,9 @@ import java.util.List;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.core.runtime.i18n.Messages;
import org.talend.utils.json.JSONArray;
import org.talend.utils.json.JSONException;
import org.talend.utils.json.JSONObject;
/**
* class global comment. Detailled comment <br/>
@@ -24,6 +27,14 @@ import org.talend.core.runtime.i18n.Messages;
*/
public class Function implements Cloneable {
public static final String NAME = "NAME"; //$NON-NLS-1$
public static final String PARAMETERS = "PARAMETERS"; //$NON-NLS-1$
public static final String PARAMETER_NAME = "PARAMETER_NAME"; //$NON-NLS-1$
public static final String PARAMETER_VALUE = "PARAMETER_VALUE"; //$NON-NLS-1$
private String category;
private String className;
@@ -239,6 +250,32 @@ public class Function implements Cloneable {
return function;
}
@SuppressWarnings("unchecked")
public Function clone(JSONArray parametersArray) {
if (parametersArray == null || parametersArray.length() == 0) {
return (Function) clone();
}
Function function = (Function) clone();
if (parametersArray != null) {
try {
List<Parameter> params = function.getParameters();
for (Parameter param : params) {
for (int i = 0; i < parametersArray.length(); i++) {
JSONObject parameterObj = parametersArray.getJSONObject(i);
String paramName = parameterObj.getString(PARAMETER_NAME);
String paramValue = parameterObj.getString(PARAMETER_VALUE);
if (param.getName().equals(paramName)) {
param.setValue(paramValue);
}
}
}
} catch (JSONException e) {
ExceptionHandler.process(e);
}
}
return function;
}
public boolean sameFunctionAs(Function fun) {
if (this == fun) {
return true;
@@ -477,4 +514,21 @@ public class Function implements Cloneable {
public void setClassName(String className) {
this.className = className;
}
@SuppressWarnings("unchecked")
public String toSerialized() throws JSONException {
JSONObject functionObj = new JSONObject();
functionObj.put(NAME, getName());
JSONArray parametersArr = new JSONArray();
List<Parameter> params = getParameters();
for (Parameter param : params) {
JSONObject parameterObj = new JSONObject();
parameterObj.put(PARAMETER_NAME, param.getName());
parameterObj.put(PARAMETER_VALUE, param.getValue());
parametersArr.put(parameterObj);
}
functionObj.put(PARAMETERS, parametersArr);
return functionObj.toString();
}
}

View File

@@ -59,6 +59,8 @@ public interface IProcessor {
*/
public void generateCode(boolean statistics, boolean trace, boolean context) throws ProcessorException;
public void generateCode(boolean statistics, boolean trace, boolean context, int option) throws ProcessorException;
/**
*
* Only generate context code, not main code.

View File

@@ -15,9 +15,11 @@ package org.talend.repository;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
@@ -73,7 +75,16 @@ public final class ProjectManager {
private Map<String, List<FolderItem>> foldersMap = new HashMap<String, List<FolderItem>>();
private Set<String> beforeLogonRecords;
private Set<String> logonRecords;
private Set<String> migrationRecords;
private ProjectManager() {
beforeLogonRecords = new HashSet<String>();
logonRecords = new HashSet<String>();
migrationRecords = new HashSet<String>();
initCurrentProject();
}
@@ -121,7 +132,7 @@ public final class ProjectManager {
String parentBranch = ProjectManager.getInstance().getMainProjectBranch(p);
if (parentBranch != null) {
for (ProjectReference pr : (List<ProjectReference>) p.getReferencedProjects()) {
if (pr.getBranch() == null || parentBranch.equals(pr.getBranch())) {
if (pr.getBranch() == null || pr.getBranch().equals(parentBranch)) {
resolveRefProject(pr.getReferencedProject()); // only to resolve all
}
}
@@ -135,7 +146,7 @@ public final class ProjectManager {
String parentBranch = ProjectManager.getInstance().getMainProjectBranch(p);
if (parentBranch != null) {
for (ProjectReference pr : (List<ProjectReference>) p.getReferencedProjects()) {
if (pr.getBranch() == null || parentBranch.equals(pr.getBranch())) {
if (pr.getBranch() == null || pr.getBranch().equals(parentBranch)) {
Project project = new Project(pr.getReferencedProject(), false);
allReferencedprojects.add(project);
resolveSubRefProject(pr.getReferencedProject(), allReferencedprojects); // only to resolve all
@@ -251,7 +262,7 @@ public final class ProjectManager {
List<Project> refProjects = new ArrayList<Project>();
for (ProjectReference refProject : (List<ProjectReference>) project.getEmfProject().getReferencedProjects()) {
if (refProject.getBranch() == null || parentBranch.equals(refProject.getBranch())) {
if (refProject.getBranch() == null || refProject.getBranch().equals(parentBranch)) {
refProjects.add(new Project(refProject.getReferencedProject(), false));
}
}
@@ -528,14 +539,6 @@ public final class ProjectManager {
public String getMainProjectBranch(org.talend.core.model.properties.Project project) {
String branchForMainProject = project != null ? getMainProjectBranch(project.getTechnicalLabel()) : null;
if (branchForMainProject != null) {
if (!branchForMainProject.contains(SVNConstant.NAME_TAGS)
&& !branchForMainProject.contains(SVNConstant.NAME_BRANCHES)
&& !branchForMainProject.contains(SVNConstant.NAME_TRUNK)
&& !branchForMainProject.contains(SVNConstant.NAME_MASTER)) {
branchForMainProject = SVNConstant.NAME_BRANCHES + SVNConstant.SEP_CHAR + branchForMainProject;
}
}
return branchForMainProject;
}
@@ -547,16 +550,30 @@ public final class ProjectManager {
* @return
*/
public String getMainProjectBranch(String technicalLabel) {
String branchForMainProject = null;
Map<String, String> fields = getRepositoryContextFields();
if (fields == null || technicalLabel == null) {
return null;
return branchForMainProject;
}
String branchKey = IProxyRepositoryFactory.BRANCH_SELECTION + SVNConstant.UNDER_LINE_CHAR + technicalLabel;
if (fields.containsKey(branchKey)) {
String branchForMainProject = fields.get(branchKey);
return branchForMainProject;
branchForMainProject = fields.get(branchKey);
}
return null;
if (branchForMainProject != null) {
branchForMainProject = getFormatedBranchName(branchForMainProject);
}
return branchForMainProject;
}
public String getFormatedBranchName(String branchName) {
String formatedBranchName = branchName;
if (!branchName.startsWith(SVNConstant.NAME_TAGS + SVNConstant.SEP_CHAR)
&& !branchName.startsWith(SVNConstant.NAME_BRANCHES + SVNConstant.SEP_CHAR)
&& !branchName.startsWith(SVNConstant.NAME_ORIGIN + SVNConstant.SEP_CHAR)
&& !branchName.equals(SVNConstant.NAME_TRUNK) && !branchName.equals(SVNConstant.NAME_MASTER)) {
formatedBranchName = SVNConstant.NAME_BRANCHES + SVNConstant.SEP_CHAR + branchName;
}
return formatedBranchName;
}
/**
@@ -643,4 +660,17 @@ public final class ProjectManager {
}
return projectType;
}
public Set<String> getBeforeLogonRecords() {
return this.beforeLogonRecords;
}
public Set<String> getLogonRecords() {
return this.logonRecords;
}
public Set<String> getMigrationRecords() {
return this.migrationRecords;
}
}

View File

@@ -252,7 +252,15 @@ public class RepositoryNodeUtilities {
if (view == null) {
return null;
}
return getRepositoryNode((IRepositoryNode) view.getRoot(), curNode, view, expanded);
RepositoryNode node = null;
IRepositoryNode nodeFromType = view.getRoot().getRootRepositoryNode(curNode.getRepositoryObjectType());
if (nodeFromType != null) {
node = getRepositoryNode(nodeFromType, curNode, view, expanded);
}
if (node == null) {
node = getRepositoryNode((IRepositoryNode) view.getRoot(), curNode, view, expanded);
}
return node;
}
private static IRepositoryNode viewRootNode;

View File

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

View File

@@ -12,6 +12,7 @@
// ============================================================================
package org.talend.core.ui.context;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.gef.commands.Command;
@@ -25,7 +26,11 @@ import org.talend.core.model.process.IContext;
import org.talend.core.model.process.IContextManager;
import org.talend.core.model.process.IProcess2;
import org.talend.core.model.update.EUpdateItemType;
import org.talend.core.model.update.IUpdateItemType;
import org.talend.core.model.update.IUpdateManager;
import org.talend.core.model.update.UpdateManagerHelper;
import org.talend.core.model.update.UpdateResult;
import org.talend.core.model.update.extension.UpdateManagerProviderDetector;
/**
* An action that can config the contexts. <br/>
@@ -61,7 +66,14 @@ public class ConfigureContextAction extends Action {
if (manager.getProcess() != null && manager.getProcess() instanceof IProcess2) {
IUpdateManager updateManager = manager.getProcess().getUpdateManager();
if (updateManager != null) {
updateManager.update(EUpdateItemType.CONTEXT);
List<UpdateResult> updatesNeeded = new ArrayList<UpdateResult>();
updatesNeeded.addAll(updateManager.getUpdatesNeeded(EUpdateItemType.CONTEXT));
final IUpdateItemType jobletContextType = UpdateManagerProviderDetector.INSTANCE
.getUpdateItemType(UpdateManagerHelper.TYPE_JOBLET_CONTEXT);
if (jobletContextType != null) {
updatesNeeded.addAll(updateManager.getUpdatesNeeded(jobletContextType));
}
updateManager.executeUpdates(updatesNeeded);
}
} else {
// set the report editor dirty according to the manager(TdqContextViewComposite)

View File

@@ -546,7 +546,7 @@ public class MetadataEmfTableEditorView extends AbstractMetadataTableEditorView<
@Override
protected void setTableViewerCreatorOptions(TableViewerCreator<MetadataColumn> newTableViewerCreator) {
super.setTableViewerCreatorOptions(newTableViewerCreator);
// newTableViewerCreator.setLazyLoad(true);
newTableViewerCreator.setLazyLoad(true);
}
/*

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