Compare commits

...

294 Commits

Author SHA1 Message Date
cmeng-talend
63cfdc42e6 TDI-33997 bug: [5.6.2]Talend Studio - SVN checkout command is not
working as expected for Routes
https://jira.talendforge.org/browse/TDI-33997
2016-01-26 10:48:33 +08:00
zwxue
2032376f19 TDI-33387: fix NPE of repository context with null comment. 2016-01-07 14:24:00 +08:00
cmeng-talend
a8cb3e3d8b TUP-3781 bug: Problems with svn lock/commit mode in a multi user
environment
https://jira.talendforge.org/browse/TUP-3781
2015-12-31 11:14:42 +08:00
hcyi
0eb1a2c7c4 TDI-33701:Column Name org is changing to _org. 2015-12-04 14:24:15 +08:00
zwxue
1e70e83d6c TDI-34266: more optimization for adding context. 2015-12-04 14:23:45 +08:00
cmeng-talend
0b56bc83bc TDI-34154 bug: Wrong schema retrieval with synonyms on Oracle
https://jira.talendforge.org/browse/TDI-34154

Conflicts:
	main/plugins/org.talend.metadata.managment.ui/src/main/java/org/talend/metadata/managment/ui/model/ProjectNodeHelper.java
2015-11-19 18:28:15 +08:00
cmeng-talend
cc3d31c485 TDI-34154 fix bug: Wrong schema retrieval with synonyms on Oracle
https://jira.talendforge.org/browse/TDI-34154

Also fix problem when check all synonyms
2015-11-17 10:36:06 +08:00
cmeng-talend
cc4f6dbe2a TDI-34154 fix bug: Wrong schema retrieval with synonyms on Oracle
https://jira.talendforge.org/browse/TDI-34154
2015-11-17 10:35:41 +08:00
zwxue
b48614901b TDI-34150: Change the way of getting process context to speed up. 2015-11-16 17:55:57 +08:00
zwxue
751f1797a8 TDI-33387: Avoid setting null to comment attribute of context. 2015-10-29 17:30:17 +08:00
zwxue
91723e3e3b TUP-3612: Reduce unnecessary refreshing of adding context operation. 2015-10-27 18:19:59 +08:00
zwxue
88ea8c0d35 TUP-3612: Optimize the operation of opening context group selecting
dialog in context view.
2015-10-27 18:19:58 +08:00
zwxue
d69591b1c4 TPS-1109:[5.6.2]Comments on context variables(TDI-33387) 2015-09-28 11:24:46 +08:00
wchen-talend
f4b2e4a961 TDI-33737:SAP Bapi input/output schema structure generated by Talend is
different with the correct strucuture
2015-09-24 16:16:26 +08:00
nrousseau
6fce0bf810 TDI-32615: fix problem of GUI class loaded 2015-09-24 14:45:14 +08:00
hcyi
cc72a08f73 TPS-1107:[5.6.2] Need some options to disable the internet access. 2015-09-24 12:16:02 +08:00
wchen-talend
9e55460726 TPS-1068:[5.6.2] Issue with DB Connection Metadata with name of the
form: [XXX]YYYY (TUP-3400)
2015-09-14 16:47:28 +08:00
xhkong
2270d6b884 TDI-32552 Talend Studio Context tab scrollbars locked
https://jira.talendforge.org/browse/TDI-32552
2015-08-18 15:51:19 +08:00
xhkong
a1c6cf217d TDI-32552 Talend Studio Context tab scrollbars locked
https://jira.talendforge.org/browse/TDI-32552
2015-08-18 11:57:26 +08:00
cmeng-talend
84ec465fe7 TUP-3315 backlog task: need backport on 5.6 branch
https://jira.talendforge.org/browse/TUP-3315

Parent ticket:
Possible freeze when start the studio
https://jira.talendforge.org/browse/TUP-2926
2015-08-03 11:32:25 +08:00
wchen-talend
2651e07e2c TPS-1012:[5.6.2]Using context variables in SAP Connections does not work 2015-07-28 13:55:46 +08:00
cmeng-talend
05982475b4 TDI-32083 fix bug: Workspace: Studio can't start properly after
switching workspace in Start page;
https://jira.talendforge.org/browse/TDI-32083

1. Remove the workspaces which are not exist in the Connections
2. Will random set a connection as default, and this connection's
workspace is same as user selected
2015-07-27 14:07:07 +08:00
hwang
70080e2897 TDI-32083: place the connection file into configuration again 2015-07-27 14:04:30 +08:00
cmeng-talend
29f7ccdb20 TDQ-10259 fix bug: can not get columns with Impala(CDH5.4) , but show
errors instead
https://jira.talendforge.org/browse/TDQ-10259
2015-05-05 19:01:14 +08:00
cmeng-talend
e74f6212ef TBD-1869 fix bug: The Impala version shows wrong when importing an
impala item from the repository using Cloudera cdh 5.4
https://jira.talendforge.org/browse/TBD-1869
2015-04-30 15:36:51 +08:00
cmeng-talend
045b05cdcb TUP-2644 new feature: Upgrade CDH version for 5.6.2
https://jira.talendforge.org/browse/TUP-2644

1. Update some jars
2. disable hive1 standarlone for CDH5.4
3. fix an impala dnd problem
2015-04-27 19:35:57 +08:00
cmeng-talend
40e4782d91 TUP-2644 new feature: Upgrade CDH version for 5.6.2
https://jira.talendforge.org/browse/TUP-2644

Fix an invalid thread access problem
2015-04-26 12:45:51 +08:00
cmeng-talend
dd31eff3ef TUP-2644 new feature: Upgrade CDH version for 5.6.2
https://jira.talendforge.org/browse/TUP-2644
2015-04-26 12:45:43 +08:00
cmeng-talend
189aa4391f TUP-2644 new feature: Upgrade CDH version for 5.6.2
https://jira.talendforge.org/browse/TUP-2644
2015-04-26 12:45:36 +08:00
Chao Meng
8b7ff0ef10 Merge pull request #182 from wwang-talend/release/5.6.2
TBD-1613: Support for Cloudera CDH 5.3 & 5.4
2015-04-25 19:46:42 +08:00
wang wei
2e378750f5 TBD-1613: Support for Cloudera CDH 5.3 & 5.4
https://jira.talendforge.org/browse/TBD-1613
2015-04-25 18:49:16 +08:00
Rémy DUBOIS
a97896078d Merge pull request #180 from ftom/release/5.6.2
[TBD-1238]
2015-04-24 17:43:45 +02:00
ftom
762a616388 [TBD-1238]
Introduce new split function to handle direct byte buffers and apply encoding rules to handle mixed encoded record (ex: ISO-8859-15 + UTF-8)
2015-04-24 17:31:31 +02:00
lwang-talend
d00f13a4f6 https://jira.talendforge.org/browse/TUP-2750
TUP-2750: upgrade CXF to 2.7.15
https://jira.talendforge.org/browse/TDI-31542
Netsuite component update
add the cxf jars for tWebService and tNetsuiteXXX
2015-04-24 21:33:45 +08:00
cmeng-talend
bcea76fd7d TDI-32362 fix bug: compile error occured using jdk6
https://jira.talendforge.org/browse/TDI-32362
2015-04-23 10:11:26 +08:00
cmeng-talend
0e4592d24f TDI-32362 new feature: Modify drag&drop of salesforce components
https://jira.talendforge.org/browse/TDI-32362
Add a sort method into IRepositoryComponentDndFilter, now it will show
tSalesforceConnection at the top of the list when d&d a salesforce
connection
2015-04-22 18:15:29 +08:00
cmeng-talend
568c234fd1 TDI-32362 new feature: Modify drag&drop of salesforce components
https://jira.talendforge.org/browse/TDI-32362
2015-04-22 18:15:19 +08:00
hcyi
cc6db192a8 TBD-1812:Hbase kerberos:hadoop properties cann't save 2015-04-20 18:27:15 +08:00
nrousseau
4e7e1f7fb1 TUP-2737: icons update 2015-04-15 18:50:20 +08:00
hwang
1a6879abbd TDI-32265:Impact Analysis is not available in context menu for JSON
files in metadata repo
2015-04-15 16:33:52 +08:00
xhkong
6185aceb1f Revert "fix bug TDI-31969 The code and Label are always displayed as PB https://jira.talendforge.org/browse/TDI-31969"
This reverts commit b7607091c7.
2015-04-14 18:00:21 +08:00
xhkong
b7607091c7 fix bug TDI-31969 The code and Label are always displayed as PB
https://jira.talendforge.org/browse/TDI-31969
2015-04-14 17:45:01 +08:00
cmeng-talend
d8c0cedff4 TBD-1265 fix bug: Properties not brought to MapRed Run tab Hadoop
Configuration
https://jira.talendforge.org/browse/TBD-1265
2015-04-09 17:27:31 +08:00
cmeng-talend
0cb81d2ef0 TBD-1556 new feature: Upgrade HDP version for 5.6.2
https://jira.talendforge.org/browse/TBD-1556
2015-04-09 11:48:08 +08:00
cmeng-talend
5b77b07402 TBD-1556 new feature: Upgrade HDP version for 5.6.2
https://jira.talendforge.org/browse/TBD-1556
2015-04-09 11:47:55 +08:00
wang wei
a376b56bd5 TDI-32092: Dynamic Schema doesn't work with mysql TEXT type
https://jira.talendforge.org/browse/TDI-32092
2015-04-07 14:46:23 +08:00
wang wei
b32ebabf50 TBD-1577: Support for Hortonworks 2.2
https://jira.talendforge.org/browse/TBD-1577
2015-03-30 17:50:55 +08:00
wchen-talend
3b4c4246f7 TDI-31907:NPE while opening a job:
org.talend.core.model.properties.impl.JobletProcessItemImpl.getIcon
2015-03-30 14:12:26 +08:00
Pierre Teyssier
e2e374ba68 Merge pull request #164 from lwang-talend/maintenance/5.6
https://jira.talendforge.org/browse/TMDM-7994
2015-03-27 17:17:36 +08:00
lwang-talend
1aa2cd76e7 https://jira.talendforge.org/browse/TMDM-7994
TMDM-7994: tMDMOutput change in component part
update the mdm webservice jar
2015-03-27 15:04:43 +08:00
wchen-talend
7b9bd9128b TUP-2761 :Need some SVN preference setup in the studio to limit the
number of access to svn
2015-03-24 14:40:08 +08:00
wchen-talend
058a84513a TDI-31751:tSAPBapi can create connection with input tables 2015-03-20 13:56:56 +08:00
wchen-talend
1e01d4d568 TDI-31167:No missing jars banner in component 2015-03-20 13:25:34 +08:00
amarkevich
fab9aa46c2 initialize bundleID for org.talend.core.runtime.librariesNeeded 2015-03-18 10:28:59 -03:00
cmeng-talend
59aa8d256f TBD-1458 fix bug: Property Type defaults back to "Built In"
https://jira.talendforge.org/browse/TBD-1458
2015-03-18 12:57:07 +08:00
cmeng-talend
b2bdcd5fd0 TBD-1265 fix bug: Properties not brought to MapRed Run tab Hadoop
Configuration
https://jira.talendforge.org/browse/TBD-1265

Add the job history principal to the wizard
2015-03-13 18:30:34 +08:00
ldong-talend
3d07cf391c TDI-30557:fix some bugs. 2015-03-13 11:01:57 +08:00
wchen-talend
17b068d21c TDI-29892 : tXMLMap: Error message popup error after user imported from
repository to Docume
2015-03-10 17:05:13 +08:00
xhkong
7bb88fee20 TDI-31167 fix bug No missing jars banner in component (NPE TUJ) 2015-03-06 15:27:37 +08:00
xhkong
b7bebaba7c Merge branch 'bugfix/5.6/TDI-31167_No_missing_jars_banner_in_component' into maintenance/5.6 2015-03-05 15:37:39 +08:00
xhkong
29c00d2489 fix bug TDI-31167 No missing jars banner in component 2015-03-05 14:56:50 +08:00
wchen-talend
34f8dd8d1d TDI-31947:Add a new action to import IDoc Structures from TDM on the SAP
Connection
2015-03-04 18:19:57 +08:00
cmeng-talend
941ff55143 TDI-31896 fix bug: replacement problem in java code with special
comments
https://jira.talendforge.org/browse/TDI-31896
2015-03-04 14:10:43 +08:00
ycbai
397dd1d955 TBD-1415: add DND support 2015-03-04 11:16:55 +08:00
ycbai
e0c04223f4 TBD-1415: Metadata conn for HBASE doesn't work in PHD with kerberos 2015-03-04 11:16:50 +08:00
wchen-talend
d1dd090b33 TUP-2671 : Crash of studio 5.6.1 2015-02-28 14:04:42 +08:00
wchen-talend
52e0760e73 TDI-29397:When import items check,uncheck "overwirte existing items"
will effect items choosed
2015-02-16 16:48:14 +08:00
ldong-talend
dd54af237b TDI-30141:Metadata:File xml:update column name in step 4/5, the mapping
lost in job.
2015-02-16 09:56:41 +08:00
ldong-talend
791b35f663 TDI-31787:context value lost when drag joblet to job,and context mode is
build-in.
2015-02-15 17:15:47 +08:00
zshen-talend
cfbd1f44e4 Merge pull request #146 from msjian/maintenance/5.6
TDQ-9051: fix No schema shows under db connection when use context
2015-02-15 12:09:31 +08:00
msjian
2877da8123 TDQ-9051: fix No schema shows under db connection when use context 2015-02-15 11:59:55 +08:00
xhkong
7a312a42c3 fix bug TDI-29320_BRMS_Duplicate_items_name_cannot_update_automaticly 2015-02-13 13:22:47 +08:00
ldong-talend
a064ab73f9 TDI-31834:revert some code of TDI-30490 and fix the pb. 2015-02-13 09:53:13 +08:00
xhkong
8c6393250c fix bug TBD-1468 create storm job named all numbers(modified) 2015-02-12 17:09:55 +08:00
xhkong
b9ed000511 fix bug TBD-1468 create storm job named all numbers 2015-02-12 17:09:35 +08:00
ldong-talend
143115a8fd TDI-31789:encoding combo's context mode for file positional wizard. 2015-02-06 14:37:17 +08:00
hcyi
99f1ee03a1 TDI-29459:Input long type for a column on tRowGenerator component, then
select function for it, the function name is duplicate
2015-02-05 15:56:52 +08:00
hcyi
bf39ddd570 TUP-2551: try to fix a tuj compil fail . 2015-02-05 15:42:46 +08:00
Sebastien Gandon
4366d1a8f3 improved the stack error in case of component failed to load it's extension plugin 2015-02-04 15:21:46 +01:00
xhkong
2c8c4d8719 fix bug TUP-2589: No more handles
Conflicts:
	main/plugins/org.talend.common.ui.runtime/src/main/java/org/talend/commons/ui/runtime/exception/MessageBoxExceptionHandler.java
2015-02-03 17:23:18 +08:00
xhkong
db9ad40dca fix bug TDI-19936 cannot display the window properly(reopen)
Conflicts:
	main/plugins/org.talend.repository.metadata/src/main/java/org/talend/repository/ui/wizards/metadata/connection/files/delimited/DelimitedFileStep2Form.java
2015-02-03 16:52:01 +08:00
ldong-talend
ff93d61119 TDI-31655:document node dirty text lost when a tag project. 2015-01-29 17:45:12 +08:00
hcyi
176146f91b TDI-31708:SAP Bapi:NPE error when I click edit schema button for line if
I change the line name
2015-01-27 16:10:57 +08:00
hcyi
cfaccd6dfb TUP-2454:The default value doesn't show for columns in the Schma page
after selecting Retrieve schema by right clicking oracle db connection.
2015-01-27 16:09:06 +08:00
hcyi
a5de645037 TUP-2551:tSalesforceOutput always display warning after reopen the job. 2015-01-27 15:54:53 +08:00
ldong-talend
78e957fc0d TDI-31623:continue to access the rest nodes if got a delete pb in before
nodes.
2015-01-26 17:26:04 +08:00
ldong-talend
8fa66fec43 TUP-2073 fixed:connecton item should not unlock if it opened in DQ
editor.
2015-01-26 17:18:14 +08:00
xhkong
b6b135110b fix bug TDI-31713 The default column in tRowGenerator is not usefull 2015-01-26 11:59:34 +08:00
alex
019750ab52 Merge pull request #142 from csuntalendbj/maintenance/5.6
TESB-14376: Job with tRouteInput component can not be detected in cTalen...
2015-01-22 11:05:40 +03:00
billy sun
9d84478866 TESB-14376: Job with tRouteInput component can not be detected in cTalendJob 2015-01-22 11:49:40 +08:00
ldong-talend
6580500330 TDI-30557:support reuse context for NoSQL wizard. 2015-01-21 13:53:11 +08:00
ldong-talend
bc29c5c419 TDI-31707:backport on 5.6. 2015-01-20 14:22:09 +08:00
hcyi
5f01b94bbc TDI-31136:tMap doesn't always show ellipsis to expression builder on OS
X
2015-01-19 15:35:21 +08:00
cmeng-talend
d580207102 TBD-1425 fix bug: Hive:Guess schema fail when I click guess schema
button for hive schema
https://jira.talendforge.org/browse/TBD-1425

Conflicts:
	main/plugins/org.talend.metadata.managment.ui/src/main/java/org/talend/metadata/managment/ui/utils/DBConnectionContextUtils.java
2015-01-19 13:42:38 +08:00
cmeng-talend
2e709ae941 TDI-31583 fix bug: File XML:The variable type is not consistent with
before for XML Output
https://jira.talendforge.org/browse/TDI-31583

Conflicts:
	main/plugins/org.talend.metadata.managment.ui/src/main/java/org/talend/metadata/managment/ui/wizard/metadata/xml/node/FOXTreeNode.java
	main/plugins/org.talend.metadata.managment.ui/src/main/java/org/talend/metadata/managment/ui/wizard/metadata/xml/utils/TreeUtil.java
	main/plugins/org.talend.repository.metadata/src/main/java/org/talend/repository/metadata/ui/wizards/form/AbstractXmlFileStepForm.java
2015-01-19 11:41:08 +08:00
cmeng-talend
efca42296b Fix a compile error after update the jar:
poi-ooxml-3.11-20141221_modified_talend.jar
2015-01-19 10:07:00 +08:00
ldong-talend
06737945a1 TDI-31692:Can't open add schema sub window when I click edit schema
button for txxxInput for tos_bd.
2015-01-16 15:37:12 +08:00
ycbai
a7d74c37be TBD-1285: fix null propertie problem. 2015-01-15 17:47:53 +08:00
wang wei
bf93d1f4ee TDI-30541: Unable to create table in redshift
https://jira.talendforge.org/browse/TDI-30541
2015-01-15 17:26:59 +08:00
ycbai
f76f1f891c TBD-1285: fix display problem. 2015-01-15 16:43:29 +08:00
hcyi
05a078c78b TDI-31646:it is not good java code . 2015-01-15 16:06:35 +08:00
ycbai
92bbb3d92b TBD-1285 : Add advanced JDBC parameters in the Hive wizards 2015-01-15 14:23:08 +08:00
ldong-talend
907dce15b1 TDI-31646:hide the precision column for Redshift component. 2015-01-15 10:28:53 +08:00
ldong-talend
203841e299 TDI-31656:Switch to tag project:always has warning message at error log
list.
2015-01-15 10:08:21 +08:00
wchen-talend
64223affda TDI-31520:copy to branch' search option appears to take time to generate
the results
2015-01-15 09:53:40 +08:00
hwang
3e440a1a48 TDI-29300:Displaying problem in M/R job editor 2015-01-14 12:05:19 +08:00
jzhao
d791226489 TDI-31607: tS3 components and Frankfurt AWS region
https://jira.talendforge.org/browse/TDI-31607
Note:Add new jars
2015-01-14 11:10:10 +08:00
qyliu
02d1842a48 TDI-31335: error Data Type "BF" does not match a Defined Type name.
https://jira.talendforge.org/browse/TDI-31335
2015-01-13 13:53:58 +08:00
cmeng-talend
7a7bdd1304 TBD-1148 fix bug: Can't data viewer for AVRO schema & tAvroInput
https://jira.talendforge.org/browse/TBD-1148

Conflicts:
	main/plugins/org.talend.repository.view.example/src/org/talend/repository/example/viewer/handler/demo/ExampleDemoDragAndDropHandler.java
2015-01-12 17:43:06 +08:00
ldong-talend
49640dc098 TDI-31613:backport TUP-2457 on 5.5 and revert the code of TDI-30237. 2015-01-12 17:05:37 +08:00
ldong-talend
499d771a09 TBD-1146:update schema for Hadoop cluster. 2015-01-12 15:56:30 +08:00
hcyi
7aa17338e8 TDI-30883:EXASOL metadata Integration not working 2015-01-06 16:05:24 +08:00
ycbai
f63cb69983 TBD-1242 : Improve the display of hadoop properties. 2015-01-05 17:51:32 +08:00
ycbai
e44f70719f TBD-1242: Problem with check services in the Hadoop Cluster in Kerberos
mode
2015-01-05 15:18:24 +08:00
cmeng-talend
bb632c8427 TDI-31483 fix bug: Quotes at database input query
https://jira.talendforge.org/browse/TDI-31483
2015-01-05 10:31:56 +08:00
cmeng-talend
f298a5e768 TDI-30881 fix bug: The Column number,Create status lost value if I
remove the Name Filter on the retrieve schema wizard
https://jira.talendforge.org/browse/TDI-30881
2015-01-05 09:57:05 +08:00
cmeng-talend
8397fa3f0a TDI-31475 fix bug: AS400:It show all of databases schemas whenever I
just input one database
https://jira.talendforge.org/browse/TDI-31475

Fix an invalid thread access problem when checking connection in DB
Wizard.
2015-01-04 17:50:30 +08:00
cmeng-talend
6a6624b346 TDI-31475 fix bug: AS400:It show all of databases schemas whenever I
just input one database
https://jira.talendforge.org/browse/TDI-31475
2015-01-04 17:50:17 +08:00
hcyi
041af5ca86 TDI-31546:TalendForge Log In Issue. 2014-12-31 16:09:18 +08:00
CHEN Bin
ea2bc4ded1 TUP-2478: Heap space error hangs job with parallel iterations
https://jira.talendforge.org/browse/TUP-2478
handle java.lang.Error when iterator enable parallel
2014-12-31 14:16:48 +08:00
xhkong
ee93748000 TDI-31426 fix bug: if get studio license use : Import License :after get
license successfully , connection is not created automatically
https://jira.talendforge.org/browse/TDI-31426

Conflicts:
	main/plugins/org.talend.core.runtime/src/main/java/org/talend/repository/ui/login/connections/ConnectionUserPerReader.java
2014-12-31 12:10:53 +08:00
ldong-talend
1fc3b9b827 TDI-31493:unable to change the value under the "Name" context. 2014-12-30 13:47:42 +08:00
hwang
4b0a447523 TUP-2481:When check the "Data (schema) auto propagate" and save, the "*"
on the tab will not disappear
2014-12-29 16:25:56 +08:00
hwang
6ecc4602c6 TDI-20893:in create JDBC connection wizard, better to change the default
path of .jar
2014-12-25 14:51:28 +08:00
ldong-talend
02c4087da8 TDI-31474:fix the pb of multithreading access the same emf model. 2014-12-24 09:47:00 +08:00
ldong-talend
50b7a5411f TDI-31464:accent value in context should always use unicode. 2014-12-23 17:25:54 +08:00
jzhao
06ea71267b TDI-29203: Add the Websphere MQ in the tMomConnection
https://jira.talendforge.org/browse/TDI-29203
Note:Add a new method for get virtual node by unique name
2014-12-23 16:15:15 +08:00
cmeng-talend
e851d208cc TDI-31425 fix bug: If import items operation choose wrong root
folder(lots subfolder under it), then importing operation will never
stop.
https://jira.talendforge.org/browse/TDI-31425

Do some improvement
2014-12-22 16:43:51 +08:00
cmeng-talend
6dccd92692 TDI-31425 fix bug: If import items operation choose wrong root
folder(lots subfolder under it), then importing operation will never
stop.
https://jira.talendforge.org/browse/TDI-31425

Do some improvement
2014-12-22 16:02:50 +08:00
cmeng-talend
606af0695d TDI-31425 fix bug: If import items operation choose wrong root
folder(lots subfolder under it), then importing operation will never
stop.
https://jira.talendforge.org/browse/TDI-31425
2014-12-22 16:02:47 +08:00
ycbai
4706f2b826 TBD-1346: Can't dataviewer for hcatalog which has partition 2014-12-22 11:45:20 +08:00
ycbai
e73cdc9d1f TBD-1345: Mapr 4.0.1:The studio will exit when I check file on the HDFS
retrieve schema page
2014-12-22 10:43:01 +08:00
Sebastien Gandon
d762b9e163 TDM-4411 : generate a timestamp at every export for TDM generation 2014-12-22 09:59:33 +08:00
cmeng-talend
863080eb9b TDI-31270 fix bug: After import an excle metadata,no message show up if
the file patch not correct
https://jira.talendforge.org/browse/TDI-31270
2014-12-19 18:58:14 +08:00
wluo-talend
039ca47173 TDI-31476: Serious precision loss in standard routine and undue rounding
effect
https://jira.talendforge.org/browse/TDI-31476
2014-12-19 09:22:19 +08:00
hcyi
9c93731ffb TDI-31444:duplicated EMF register in plugin.xml of org.talend.model
plugin
2014-12-18 17:59:41 +08:00
zshen-talend
2f53fd6dca bugfixed TDQ-9487 change input columns' name, transfer changes to
tMatchGroup, but when open the "Configuration wizard" still use the old
name.
2014-12-17 18:15:47 +08:00
ldong-talend
730d75f774 TBD-1111:Collection context parameters for HBase. 2014-12-16 16:55:14 +08:00
hcyi
ddf3af5098 TDI-31220:TALEND BETA 5.6: The Check connection fails in DBType:
"General JDBC Connection" mode while goes through fine in DBType:IBM DB2
2014-12-16 15:39:31 +08:00
wchen-talend
ccb76fc453 TDI-30824:fixedGot SAP Exception after clicking "select all" button When
retrieve tables from sap connection
2014-12-16 14:42:35 +08:00
hwang
8733a729a5 TBD-1315:MR Job:Map icon lost after deactive MR job 2014-12-15 17:06:33 +08:00
hwang
39dc446c3f TBD-1315:MR Job:Map icon lost after deactive MR job 2014-12-15 17:06:30 +08:00
CHEN Bin
506f96c24a TDI-31266: OutputFIleDelimited having issues with records over 8K when used with other components
https://jira.talendforge.org/browse/TDI-31266
change the tag about Iterator enable parallel from subtree to each component, which can fix the problem if the component is after onComponent/Subjob
2014-12-15 16:23:23 +08:00
ycbai
abe4f85633 Update talend version to 5.6.2 2014-12-15 16:01:34 +08:00
ldong-talend
b551521943 TDI-30848:Change the job's context parameter mode if its source is
deleted.
2014-12-15 15:33:59 +08:00
hcyi
56432bf9fc TDI-30941:CDC for oracle12: Generated XStreamOut Script is always failed
to be executed;
2014-12-15 13:41:07 +08:00
Igor Lazebny
8b446480a2 Update version to 5.6.2-SNAPSHOT in poms 2014-12-11 14:59:14 +02:00
ldong-talend
4973ec2ebb TBD-1314:database changed pb for Hive and Impla when user hive2 embeded
url.
2014-12-10 15:26:20 +08:00
hcyi
5491ac08c0 TDI-30801:Password disappears when click password after set Hive model
as Standalone then set hive server as hive2
2014-12-10 14:29:57 +08:00
cmeng-talend
bd6f07ace9 TDI-31174 fix bug: On the Standard Jobs filed can create a job that name
is existing on the storm job
https://jira.talendforge.org/browse/TDI-31174
2014-12-10 11:37:51 +08:00
wchen-talend
46cd0dd0f2 TDI-31382 :Can't show delete folder if this folder is names as Hive 2014-12-10 10:54:03 +08:00
wchen-talend
c7119be498 TDI-31195:File xml: file xml couldn't recognize the XML or XSD File Path
after "Export as Context"
2014-12-10 10:27:38 +08:00
wchen-talend
b81e9aa69e TUP-2426:Studio detect update each time logon studio if select don't
show again but cancel wizard
2014-12-10 10:18:20 +08:00
cmeng-talend
273f670161 TDI-31224 fix bug: Retrieve Schema Wizard hangs and provides no
Exit/Cancel means and eventually needs to be Killed
https://jira.talendforge.org/browse/TDI-31224
2014-12-09 17:08:43 +08:00
cmeng-talend
98f2e9f9fe TDI-31224 fix bug: Retrieve Schema Wizard hangs and provides no
Exit/Cancel means and eventually needs to be Killed
https://jira.talendforge.org/browse/TDI-31224
2014-12-09 17:08:39 +08:00
hwang
78f8887dc4 TBD-1333:The default port for Pivotal HD 2.0 HBase is wrong. 2014-12-09 16:27:37 +08:00
ldong-talend
2032a21b57 TDI-30871:give a kindly confirm dialog for use to add context from
built-in to repository mode.
2014-12-05 17:02:17 +08:00
ldong-talend
5906567331 TDI-31394:reuse context lost connection parameters for advance
webservice wizard.
2014-12-05 16:39:19 +08:00
ldong-talend
02d1b86214 TDI-31076:Swtich between context use mode lost some parameters. 2014-12-05 16:08:04 +08:00
hcyi
543f437175 TDI-31340:Teradata:Can't show the db table list on the Select Table Name
sub window
2014-12-02 17:47:14 +08:00
GGu
df05d2c06f TDQ-9769: enhance the codes. 2014-12-02 10:36:00 +08:00
wchen-talend
4c9f1ffcac TDI-31369:The context value can't be removed 2014-12-01 15:52:01 +08:00
ldong-talend
4845b6a1f3 TDI-31373:There is always popup error log when change setting of
tSAPInput.
2014-11-28 21:16:58 +08:00
hcyi
27ba23ae9a TUP-2457:don't modify, just click "Finish", all the table and view lost
from Postgresql connection.
2014-11-28 21:03:58 +08:00
cmeng-talend
1cb01a53f8 TBD-1110 fix bug: Export Dependencies:The sub job can't be checked When
I export a MR job that use tRunJob
https://jira.talendforge.org/browse/TBD-1110
2014-11-28 20:21:06 +08:00
wchen-talend
76a2ba4d8b TDI-31369:The context value can't be removed 2014-11-28 18:17:29 +08:00
ycbai
c002b50a69 TBD-1018: add missing data type mappings. 2014-11-28 17:11:45 +08:00
hwang
51dad4ff8e TDI-31361:Issues about URL for json wizard 2014-11-28 16:19:21 +08:00
GGu
e010f552c7 TUP-1878: fixed the calc import item issue for DQ. 2014-11-27 18:29:11 +08:00
ycbai
76ed270542 TBD-1018: fix the problem of cassandra datatype mapping. 2014-11-27 10:00:48 +08:00
Sizhao Liu
d52498bfab TDQ-9769 duplicated items shown in imported DQ_DEMO project 2014-11-26 14:14:24 +01:00
nrousseau
887529a1cb Revert "TDI-31021:storm job_missing jar window pop up when run storm job for the first time"
This reverts commit fc1265dea1.
2014-11-26 18:53:29 +08:00
hcyi
0f8c65b933 TBD-1297:Some small problems about EMR hive. 2014-11-26 17:42:42 +08:00
Igor Lazebny
ba19fc6002 Update version to 5.6.1 in poms 2014-11-26 10:19:28 +02:00
wang wei
4d56b928d5 TDI-31298: Null Password error if you change the password context field
in Default.properties after building the Talend Job.
https://jira.talendforge.org/browse/TDI-31298
2014-11-26 15:17:54 +08:00
cmeng-talend
f8c67a7336 TDI-31282 TBD-1204 fix bug: when there is a jar downloading action while
checking connection, the cancel progress dialog with time limit can not
work well
https://jira.talendforge.org/browse/TDI-31282
https://jira.talendforge.org/browse/TBD-1204

Now, change the time of cancel progress dialog to endless.
2014-11-26 14:28:32 +08:00
ldong-talend
2d4cd387fe TDI-30940:The additional properties of sap wizard can support muliti dot
name do the context and revert.
2014-11-26 13:58:21 +08:00
ycbai
456f2e323e TBD-1274: add the missing jars of PHD 2.0 classloader configuration. 2014-11-26 11:22:38 +08:00
nrousseau
2b17f21374 TDQ-9667: fix problem of compilation for the jobserver 2014-11-26 10:05:27 +08:00
ycbai
1de90da548 TBD-1274: error occurs when check connection on Amazon EMR 2014-11-25 19:00:04 +08:00
hwang
f228ad97d5 TDI-31258:Need some simple way to setup the jdbc needed for audit in
commandline.
2014-11-25 18:29:04 +08:00
zshen-talend
370f86bc30 Merge pull request #109 from xqliu-talend/maintenance/5.6
TDQ-9667 Problem to select column for analysis and to see column
2014-11-25 17:56:04 +08:00
xqliu
244f1e4987 TDQ-9667 Problem to select column for analysis and to see column
fix the problem: show NPE when modify the database connection which imported from the demo project
2014-11-25 16:56:01 +08:00
CHEN Bin
e2a7f2dc93 TDI-30996: Duplicate variable names when enabling parallel execution on iterations within the same subjob
https://jira.talendforge.org/browse/TDI-30996
lockWrite is the lock provided by iterate with parallel, one lockWrite for one Iterate connector
2014-11-25 16:30:25 +08:00
cmeng-talend
3fc56e6415 TBD-1204 fix bug: Check HDFS connection block the studio
https://jira.talendforge.org/browse/TBD-1204
2014-11-25 16:13:19 +08:00
ldong-talend
c6a09f9f7c TDI-31272:correct the state of export as context button for andvance
webservice wizard.
2014-11-25 14:38:55 +08:00
cmeng-talend
28e7e0db85 TDI-31282 work item: Maybe should enhance the check action in DB wizard
https://jira.talendforge.org/browse/TDI-31282
2014-11-25 14:32:24 +08:00
GGu
fe5cad4ea0 TDI-31303: encrypt the pass for project settings when import. 2014-11-25 11:53:49 +08:00
Sebastien Gandon
106be8ffc0 TDI-31187 : reverted to have workspace link to connection.
But keep the conflicting workspace hanbling with eclipse like choose
workspace handling.
2014-11-24 11:15:08 +01:00
wchen-talend
220d6d0ce6 TDI-31299 fixed:salesforce metadata use the old api version(19),but
component use the new version(25)
2014-11-24 16:47:03 +08:00
hwang
2684524cee TALEND BETA 5.6: Studio Hangs when clicked OK on an empty "select
module" dialog
2014-11-24 15:52:18 +08:00
hcyi
f334ec8dd8 TDI-31257:Got NPE when editing a new added column during retrieving MDM
Entity in Metadata.
2014-11-24 15:28:50 +08:00
hwang
fc1265dea1 TDI-31021:storm job_missing jar window pop up when run storm job for the
first time
2014-11-24 15:07:16 +08:00
GGu
3e80a096d5 TUP-2422: only deal with for DI items. 2014-11-24 14:39:40 +08:00
ldong-talend
2122466105 TDI-31260:add quotes for the salesforce's propery value of custom
module.
2014-11-24 14:33:38 +08:00
GGu
3ba3c678c9 Merge pull request #108 from zwli-talend/maintenance/5.6
TDI-31032: error after install : svn don't connect inside TAC
2014-11-24 11:25:18 +08:00
zwli
17b6ccc4be TDI-31032: error after install : svn don't connect inside TAC
https://jira.talendforge.org/browse/TDI-31032

- remove single mode in AES.java to avoid random error message
2014-11-24 11:00:10 +08:00
Sizhao Liu
3bae8af045 TDQ-9679 tDqReportRun crash if DBconnection from Analyse is contextualized 2014-11-21 14:52:52 +01:00
ldong-talend
aa866137fb TDI-31101:perform the row text auto resize for different resolution. 2014-11-21 17:41:26 +08:00
cmeng-talend
0bb3bab57b TDI-30490 fix bug: Error code when refactor tESBConsumer combining with
tJavaRow to Joblet
https://jira.talendforge.org/browse/TDI-30490

1. Fix replacement bug, after fixed, when the const string is in the
parameter of globalMap.xxx function, Studio will do partly replacement;
when the const string is in other functions(functions except
globalMap.xxx), Studio will do fully replacement.

2. Fix bug: we can NOT refactor those components(on fault / response
line) to Joblet any more...
2014-11-21 17:34:20 +08:00
cmeng-talend
3341ecd8fb TDI-30490 fix bug: Error code when refactor tESBConsumer combining with
tJavaRow to Joblet
https://jira.talendforge.org/browse/TDI-30490

1. Fix replacement bug, after fixed, when the const string is in the
parameter of globalMap.xxx function, Studio will do partly replacement;
when the const string is in other functions(functions except
globalMap.xxx), Studio will do fully replacement.

2. Fix bug: we can NOT refactor those components(on fault / response
line) to Joblet any more...
2014-11-21 17:34:16 +08:00
cmeng-talend
3c822bfc23 TBD-1226 fix bug: Publish button to Artifact Repository is missing on
Storm Jobs
https://jira.talendforge.org/browse/TBD-1226
2014-11-21 11:21:29 +08:00
cmeng-talend
5e2985d081 TBD-1153 fix bug: impala:should disable SQL Builder at component side
https://jira.talendforge.org/browse/TBD-1153
2014-11-21 10:52:01 +08:00
nrousseau
c0561c5722 TDI-31283: babili update 2014-11-21 09:51:13 +08:00
zshen-talend
6c9534bc4f Merge pull request #104 from xqliu-talend/maintenance/5.6
TDQ-9543 Netezza DB: Error When Attempting to View Keys or Indexes
2014-11-20 16:07:05 +08:00
xqliu
eb90ce13bd TDQ-9543 Netezza DB: Error When Attempting to View Keys or Indexes
1) let Netezza Jdbc connection same with Netezza connection: only show one catalog
2) uppercase the database name when check Netezza connection
2014-11-20 14:48:54 +08:00
nrousseau
f56ad186af TUP-2361: add a way to update the license automatically from the studio
after a change from administrator.
2014-11-20 14:18:10 +08:00
ldong-talend
1105a5460e TDI-31231:default encoding for context property. 2014-11-20 09:41:15 +08:00
ldong-talend
32b8fe77de TDI-31176:create context parameter with empty string. 2014-11-19 18:26:40 +08:00
hwang
9568679f05 TDI-31069:Error occur when I select update repository connection for SAP
repository schema
2014-11-18 16:16:39 +08:00
hwang
017d6da371 TDI-31069:Error occur when I select update repository connection for
SAP repository schema
2014-11-18 16:16:36 +08:00
hwang
9dfc2367cf TDI-31069:Error occur when I select update repository connection for SAP
repository schema
2014-11-18 16:16:33 +08:00
ldong-talend
4208e8b96a TDI-30940:improved the context function for SAP wizard. 2014-11-18 14:14:10 +08:00
ycbai
3df5b70b36 TDI-31114: Hive 2 connection in embbeded mode throwing exception to say
not support on windows
2014-11-18 13:47:38 +08:00
ycbai
538784da75 TBD-1201: CDH 5.1.3 Hadoop Wizard - Check Services fails 2014-11-18 11:44:51 +08:00
cmeng-talend
b20a139c08 TDI-30278 fix bug: It will be no response then pop up en error when I
click add schema button at last step for Impala db retrieve schema
https://jira.talendforge.org/browse/TDI-30278

Also fix a potential bug for replacing schema to proposed one
2014-11-18 11:40:09 +08:00
zshen-talend
c8b6058dd5 fixed merge conflict TDQ-9667 Problem to select column for analysis and
to see column
2014-11-17 18:11:33 +08:00
nrousseau
772ffe0b31 Merge pull request #82 from zshen-talend/maintenance/5.6
Maintenance/5.6
2014-11-17 17:01:10 +08:00
nrousseau
ebe76b0edd Merge pull request #97 from rdubois/maintenance/5.6
TBD-1218: Update the mappings.xml file for Hive and Impala
2014-11-17 16:42:12 +08:00
wang wei
b3b1d83001 TUP-2332: add a junit testcase for the changeset.
https://jira.talendforge.org/browse/TUP-2332
2014-11-14 15:34:44 +08:00
cmeng-talend
018304de1e TDI-30778 fix bug: retrieve schema query issued for Teradata from studio
needs Optimization
https://jira.talendforge.org/browse/TDI-30778
2014-11-14 15:29:21 +08:00
wang wei
4998b34014 TUP-2332: uppercase of the key in a map of JSONObject class
https://jira.talendforge.org/browse/TUP-2332
2014-11-14 13:40:39 +08:00
nrousseau
37ef13c438 TDI-31164: fix problem of retrieve schema for sybase 2014-11-14 12:43:31 +08:00
cmeng-talend
ebf96cc76a TDI-30279 fix bug: Data Viewer can't work for Impala schema
https://jira.talendforge.org/browse/TDI-30279
2014-11-13 18:49:41 +08:00
GGu
d18cbb0b6c Merge pull request #96 from amaumont/maintenance/5.6
merge on 5.6 first.
2014-11-13 16:55:31 +08:00
remydub
f02b1b6902 TBD-1218: Update the mappings.xml file for Hive and Impala 2014-11-13 09:36:23 +01:00
GGu
a3a5139f19 Merge pull request #95 from msjian/maintenance/5.6
TDQ-8546: fix the oracle type database column's comment is wrong
2014-11-13 11:07:13 +08:00
Axel MAUMONT
4ef4144391 TDI-31161 Mutiple tasks deployment failed if generated jobs folder is NFS shared directory
- add signatures to zip methods with the parameter 'fileFilter' to exclude some kind of files (for this issue it is necessary to exclude .nfs* files)
2014-11-12 17:25:53 +01:00
hwang
5f2e52150a TDI-30936:tFileInputEBCDIC - Schema editor 2014-11-12 17:22:39 +08:00
msjian
af307c720b TDQ-8546: fix the oracle type database column's comment is wrong 2014-11-12 12:46:24 +08:00
zshen-talend
abf3e167ac Merge pull request #93 from xqliu-talend/maintenance/5.6
TDQ-9667 Problem to select column for analysis and to see column
2014-11-11 16:55:12 +08:00
ycbai
bdf8dfec0c TDI-30981: database value is missing after editing Hive item. 2014-11-11 16:43:54 +08:00
xqliu
a3a88d51e8 TDQ-9667 Problem to select column for analysis and to see column
if can't get MappingTypeRetriever by DbmsId, get it by DbType
2014-11-11 16:43:42 +08:00
hwang
2edd69fc6d TDI-30936:tFileInputEBCDIC - Schema editor 2014-11-11 10:35:03 +08:00
hwang
6fa1c4b1e2 TDI-30936:tFileInputEBCDIC - Schema editor 2014-11-11 10:35:00 +08:00
CHEN Bin
341a79ded9 Merge pull request #86 from wwang-talend/maintenance/5.6
TDI-31036: LockWrite can not be resolved as a variable in parallel
2014-11-10 17:39:04 +08:00
zshen-talend
470a91d431 Merge pull request #87 from xqliu-talend/maintenance/5.6
TDQ-9689 tMultiPatternCheck reject message cannot be a context variable.
2014-11-10 17:16:35 +08:00
xqliu
154629aed9 TDQ-9689 tMultiPatternCheck reject message cannot be a context variable.
1) use the value of context instead of the key in the output message
2) handle \ and " correctly in the output message
2014-11-10 17:08:25 +08:00
wang wei
0f2c0e15f5 TDI-31036: LockWrite can not be resolved as a variable in parallel
iterations
https://jira.talendforge.org/browse/TDI-31036
2014-11-10 16:52:30 +08:00
hwang
a3699c6ee0 TDI-30657:Expression Builder for Var in tMap does not show Var name
correctly
2014-11-10 10:07:15 +08:00
GGu
ebe2c3971a TDI-29687: fixed the refresh issue for MR/Storm Job. 2014-11-07 17:12:24 +08:00
ycbai
a89180f042 TBD-1171: No response when I click check connection on the Retrieve
schema page for HBase of CDH5.1
2014-11-07 10:42:29 +08:00
cmeng-talend
b0df757099 TDI-30278 fix bug: It will be no response then pop up en error when I
click add schema button at last step for Impala db retrieve schema
https://jira.talendforge.org/browse/TDI-30278
2014-11-06 18:42:18 +08:00
cmeng-talend
a828fa7b62 TBD-1110 fix bug: Export Dependencies:The sub job can't be checked When
I export a MR job that use tRunJob
https://jira.talendforge.org/browse/TBD-1110
2014-11-06 18:14:27 +08:00
cmeng-talend
ff88fca324 TBD-1170 fix bug: Cannot check an impala connection in the wizard
https://jira.talendforge.org/browse/TBD-1170

Fix bug: When click "Finish" or do the retrieve schema there is still
the exception.
2014-11-06 18:09:04 +08:00
cmeng-talend
e0ae30ea49 TBD-1170 fix bug: Cannot check an impala connection in the wizard
https://jira.talendforge.org/browse/TBD-1170
2014-11-06 18:08:56 +08:00
zshen-talend
936cbb0038 Merge branch 'maintenance/5.6' of https://github.com/zshen-talend/tcommon-studio-se.git into maintenance/5.6 2014-11-06 18:08:12 +08:00
zshen-talend
cb8b3b6237 fixed bug TDI-30384 Unable to extract schema from an AS400 Connection
some change on the TDQ-9624 is making this issue, this commite fixed it.
2014-11-06 18:01:11 +08:00
hcyi
ed734b0a73 TDI-30739:DB2 connection retrieve schema produces 0 tables. 2014-11-06 14:56:41 +08:00
hcyi
3e89b6ef44 TDI-30739:DB2 connection retrieve schema produces 0 tables. 2014-11-06 14:56:38 +08:00
zshen-talend
749bee61e4 Merge pull request #80 from xqliu-talend/maintenance/5.6
TDQ-9543
2014-11-06 12:38:10 +08:00
xqliu
bf96d2fab0 TDQ-9543
a commit
2014-11-06 12:34:03 +08:00
xqliu
82750475ce TDQ-9543
1) show catalog and schema in the structure of Netezza connection and jdbc connection
2) let the analysis and indicator can run well on Netezza connection and jdbc connection
3) let reload/compare database connection, drill down, view keys/indexs run well on Netezza's connection and jdbc connection
2014-11-06 12:33:33 +08:00
ycbai
72e3f208b4 TBD-1200: Cassandra repository metadata : stuck on third party jars
screen, can't download
2014-11-06 12:11:23 +08:00
cmeng-talend
9acc3b0600 TDI-30323 + TUP-2207: xsd infinite loop and fix the problem of same name
of element.
Do a little improvement.
2014-11-05 18:49:28 +08:00
nrousseau
aced75d8d5 TDI-30323 + TUP-2207: xsd infinite loop and fix the problem of same name
of element.
2014-11-05 18:49:25 +08:00
CHEN Bin
275dfda8d1 TDI-30760: Compile error if Log the runtime value of component setting(FIELD="TEXT")
https://jira.talendforge.org/browse/TDI-30760
log component setting in raw value
2014-11-05 16:25:40 +08:00
GGu
53c4fbaa89 Merge pull request #78 from msjian/maintenance/5.6
TDQ-9629: make the import context is build-in mode when the current perspective is dataprofiling
2014-11-05 15:34:36 +08:00
msjian
c3995e7b37 TDQ-9629: make the import context is build-in mode when the current
perspective is dataprofiling
2014-11-05 14:31:49 +08:00
Wu Liu
28b5d5fec7 TDI-31037 : Password Context generate an error in log4j 2014-11-04 18:12:57 +08:00
GGu
1bdaf027dc TDI-30227: because the old sap plugin is removed, so need impl in new one. 2014-11-04 15:47:59 +08:00
GGu
9ba08ee7e8 TDI-30227: because the old sap plugin is removed, so need impl in new one. 2014-11-04 15:41:58 +08:00
GGu
8364505379 TDI-30227: remove the decrypt function for MDM, else will save raw
password.
2014-11-04 14:56:02 +08:00
ldong-talend
c029631bd3 TDI-30979:fix a pb of Widget is disposed for the new context view. 2014-11-03 16:54:33 +08:00
ldong-talend
08612d635b TDI-30675:remove the extra string in message.properties. 2014-11-03 16:05:25 +08:00
zwzhao-talend
5b2ff566ca TDI-30675 : Salesforce:Job view tab name isn't correct when user clicks
Salesfore Module
2014-11-03 15:47:23 +08:00
ycbai
7906bfcff9 TUP-2330 : CDH5_error throw when click Finish for HBase 2014-11-03 14:26:48 +08:00
GGu
4e15071689 fixed the JUnit problem for compile error. 2014-10-31 17:07:19 +08:00
ycbai
e405292398 TUP-2338 : Amazon EMR hive connection wizard should be more explicit 2014-10-31 17:04:23 +08:00
wang wei
869d6dae1e TDI-30984: fix for the joblet case
https://jira.talendforge.org/browse/TDI-30984
2014-10-31 16:29:28 +08:00
wang wei
74d22b00e6 TDI-30984: tWriteJSONField and tWriteXMLField will be blocked when there
is a big iterate loop to start
https://jira.talendforge.org/browse/TDI-30984
2014-10-31 16:29:28 +08:00
cmeng-talend
b061aaacb3 TDI-30975 fix bug: tSAPTableInput can't change schema from repository
metadata
https://jira.talendforge.org/browse/TDI-30975
2014-10-31 15:21:52 +08:00
GGu
7cbcc5d181 fixed the Junit for module test. 2014-10-31 14:18:01 +08:00
GGu
0431c3e82f Fixed the junit problem for migration task test. 2014-10-31 14:18:01 +08:00
hwang
6d9f6bc9e1 TDI-30967:Add 2 new attributes in *_java.xml to help generate log4j code 2014-10-31 13:57:57 +08:00
hwang
9969c5eddf TDI-30967:Add 2 new attributes in *_java.xml to help generate log4j code 2014-10-31 13:57:52 +08:00
hwang
892d753208 TDI-30967:Add 2 new attributes in *_java.xml to help generate log4j code 2014-10-31 13:57:47 +08:00
hwang
07fad3df80 TDI-30967:Add 2 new attributes in *_java.xml to help generate log4j code 2014-10-31 13:57:43 +08:00
hwang
95998cb027 TDI-30967:Add 2 new attributes in *_java.xml to help generate log4j code 2014-10-31 13:57:38 +08:00
zwzhao-talend
8e6381d57a TBD-1150 : Create Impala Wizard:even the roll bar at the bottom, string
still truncated, only way to resize this window let it show completely
2014-10-31 11:56:51 +08:00
ldong-talend
55adf2497b TBD-1146:improve the algorithm here for Hadoop Cluster to avoid the NPE. 2014-10-31 11:39:48 +08:00
Igor Lazebny
9fd32f24c6 Update version to 5.6.1-SNAPSHOT in poms 2014-10-30 13:27:01 +02:00
Igor Lazebny
4e3c339740 Update version to 5.6.0 in poms 2014-10-30 13:26:45 +02:00
ycbai
a0b55a1b92 Update talend version to 5.6.1. 2014-10-29 13:44:03 +08:00
nrousseau
cda01ec386 Merge pull request #71 from zshen-talend/maintenance/5.6
fixed bug TDQ-9624 The table's number is less in the table folder 'sbrackets under TALEND schema for General JDBC As400
2014-10-29 10:01:31 +08:00
zshen-talend
7c2d54307d fixed bug TDQ-9624 The table's number is less in the table folder 's
brackets under TALEND schema for General JDBC As400
2014-10-28 18:06:22 +08:00
cmeng-talend
6e517eabc2 TDI-30943 fix bug: SAP_issues about IDoc
https://jira.talendforge.org/browse/TDI-30943
2014-10-28 17:54:27 +08:00
zwzhao-talend
e8fa4df277 TBD-1151 : Impala:Fill database when create connection, but when
retrieve schema it cannot filter
2014-10-28 15:07:23 +08:00
zwzhao-talend
2a990d3234 TBD-1151 : Impala:Fill database when create connection, but when
retrieve schema it cannot filter
2014-10-28 15:07:21 +08:00
cmeng-talend
273e4cc7e4 TUP-2333 fix bug: Code generation broken with Jobs using Joblets
https://jira.talendforge.org/browse/TUP-2333
2014-10-28 10:53:18 +08:00
GGu
a90288194c TDI-30227: fixed the junit problem for emtpy password. 2014-10-28 10:22:57 +08:00
Wu Liu
9b7c5c6f42 TDI-30937 : Fix the tuj with log4j enabled
Fix the compile error when StringBuilder.append(null)
2014-10-28 09:57:38 +08:00
Wu Liu
5ddd559d03 TDI-30937 : Fix the tuj with log4j enabled
Optimize the code to reduce the memory usage
2014-10-27 19:22:34 +08:00
cmeng-talend
7025474b39 TUP-2333 fix bug: Code generation broken with Jobs using Joblets
https://jira.talendforge.org/browse/TUP-2333
2014-10-27 16:08:58 +08:00
315 changed files with 34558 additions and 27625 deletions

View File

@@ -511,7 +511,7 @@ AbstractForm.SelectExistContext=Use exist context
ContextModeWizard.Title=Create / Reuse a context group
ContextModeSelectPage.contextModes=Create a new context or reuse the existing one
ContextModeSelectPage.createContext=Create a new repository context
ContextModeSelectPage.reuseContext=Reuse a existing repository context
ContextModeSelectPage.reuseContext=Reuse an existing repository context
ReuseRepositoryContext.name=Context
ShowRepositoryContextPage.title=Select context group
ShowRepositoryContextPage.warnMsg=please select an context group

View File

@@ -478,3 +478,4 @@ InegerCellEditorListener.NumeralMessage=Valeur d'entr
EditProcessPropertiesWizardPage.button.name.convert=Convertir en Job Map/Reduce
EditProcessPropertiesWizard.wizardTitle=Editer les propriétés
ContextSetsSelectionDialog.ReportMessages=Le rapport est en mode contexte.
ContextModeSelectPage.reuseContext=Réutiliser un contexte existant dans le référentiel

View File

@@ -11,11 +11,11 @@ _UI_BusinessItemShape_incomingRelationships_feature=Relation entrante
_UI_TalendItem_type=Element Talend
_UI_BusinessItem_type=Elément
_UI_FileXmlMetadata_type=Métadonnées des fichiers XML
_UI_BusinessProcess_businessZones_feature=Zones Affaires
_UI_BusinessProcess_businessZones_feature=Zones Business
_UI_GenericSchemaMetadata_type=Schéma générique des Métadonnées
_UI_BaseBusinessItemRelationship_type=Relation de l'Elément Business de base
_UI_FileMetadata_type=Métadonnées des fichiers
_UI_BusinessZone_parentEntity_feature=Entité Père
_UI_BusinessZone_parentEntity_feature=Entité Mère
_UI_BusinessProcess_type=Business Model
_UI_BusinessProcess_businessItemRelationships_feature=Relations de l'Elément Business
_UI_DatabaseBusinessItem_type=Objet Database Business
@@ -26,7 +26,7 @@ _UI_BusinessAssignment_type=Affectation
_UI_BaseBusinessItemRelationship_source_feature=Source
_UI_TalendItem_id_feature=ID
_UI_BusinessItem_businessProcess_feature=Business Model
_UI_BidirectionalBusinessItemRelationship_type=Relations d'affaires Bidirectionnel
_UI_BidirectionalBusinessItemRelationship_type=Relations d'affaires Bidirectionnelle
_UI_TalendItem_version_feature=Version
_UI_BaseBusinessItemRelationship_target_feature=Cible
_UI_Documentation_type=Documentation
@@ -78,9 +78,9 @@ _UI_DataBusinessItem_type=Objet des donn
_UI_Context_type=Contexte
_UI_BusinessZoneRelationShip_type=Relation de la zone
_UI_BusinessZone_businessProcess_feature=Business Model
_UI_BusinessZone_childEntites_feature=Entités Fils
_UI_BusinessZone_childEntites_feature=Entités Filles
_UI_FileRegexpMetadata_type=Metadonnées des fichiers Regex
_UI_CreateChild_tooltip=Créez nouveau {0} sous {1} dispositif
_UI_CreateChild_tooltip=Créez nouveau {0} sous fonction {1}
_UI_BusinessAssignation_businessZone_feature=Zone Business
_UI_CreateSibling_description=Créer un frère de type {0} pour le {2} sélectionné, sous la fonctionnalité {1} du parent.
_UI_Repository_Talenditems_feature=objetsTalend
@@ -598,6 +598,7 @@ _UI_CDCType_type=Type de CDC
_UI_SubscriberTable_type=Table souscripteur
_UI_SAPTestInputParameterTable_type=SAP Test Input Parameter Table
_UI_Concept_type=Concept
_UI_ConceptTarget_type=Cible concept
_UI_HL7Connection_type=Connexion HL7
_UI_HeaderFooterConnection_type=Connexion En-tête/pied de page
_UI_XMLFileNode_type=Noeud Fichier XML
@@ -679,10 +680,12 @@ _UI_DatabaseConnection_DatabaseType_feature=Type de base de donn
_UI_DatabaseConnection_DriverJarPath_feature=Chemin d'accès au jar du pilote
_UI_DatabaseConnection_DriverClass_feature=Classe du pilote
_UI_DatabaseConnection_URL_feature=URL
_UI_DatabaseConnection_dbVersionString_feature=Invisible
_UI_DatabaseConnection_Port_feature=Port
_UI_DatabaseConnection_Username_feature=Utilisateur
_UI_DatabaseConnection_Password_feature=Mot de passe
_UI_DatabaseConnection_ServerName_feature=Nom du serveur
_UI_DatabaseConnection_DatasourceName_feature=Nom de la source de données
_UI_DatabaseConnection_FileFieldName_feature=Nom du champ Fichier
_UI_DatabaseConnection_SID_feature=SID
_UI_DatabaseConnection_SqlSynthax_feature=Syntaxe SQL
@@ -694,9 +697,8 @@ _UI_DatabaseConnection_DBRootPath_feature=Chemin d'acc
_UI_DatabaseConnection_AdditionalParams_feature=Paramètres supplémentaires
_UI_DatabaseConnection_StandardSQL_feature=SQL Standard
_UI_DatabaseConnection_SystemSQL_feature=SQL Système
_UI_DatabaseConnection_cdcConns_feature=%
_UI_DatabaseConnection_cdcTypeMode_feature=%
_UI_DatabaseConnection_SQLMode_feature=Mode SQL
_UI_DatabaseConnection_UiSchema_feature=Invisible
_UI_SAPConnection_Host_feature=Hôte
_UI_SAPConnection_Username_feature=Utilisateur
_UI_SAPConnection_Password_feature=Mot de passe
@@ -728,8 +730,6 @@ _UI_SAPFunctionParameterColumn_Length_feature=Length
_UI_SAPFunctionParameterColumn_Value_feature=Valeur
_UI_SAPFunctionParameterColumn_ParameterTable_feature=Table des paramètres
_UI_SAPFunctionParameterTable_columns_feature=Colonnes
_UI_InputSAPFunctionParameterTable_functionUnit_feature=%
_UI_OutputSAPFunctionParameterTable_functionUnit_feature=%
_UI_RegexpFileConnection_FieldSeparatorType_feature=Type de séparateurs de champs
_UI_XmlFileConnection_XsdFilePath_feature=Chemin d'accès au fichier XSD
_UI_XmlFileConnection_XmlFilePath_feature=Chemin d'accès au fichier XML
@@ -823,10 +823,10 @@ _UI_SalesforceSchemaConnection_useAlphbet_feature=Utiliser l'alphabet
_UI_SalesforceSchemaConnection_timeOut_feature=Délai avant suspension
_UI_CDCConnection_connection_feature=Connexion
_UI_CDCConnection_cdcTypes_feature=Types de CDC
_UI_CDCType_linkDB_feature=Lien BdD
_UI_CDCType_subscribers_feature=Souscripteurs
_UI_CDCType_cdcConnection_feature=Connexion CDC
_UI_CDCType_journalName_feature=Nom du journal
_UI_SAPTestInputParameterTable_functionUnit_feature=%
_UI_Concept_LoopExpression_feature=Expression sur laquelle itérer
_UI_Concept_LoopLimit_feature=Limite de la boucle
_UI_Concept_conceptTargets_feature=Concept Cible
@@ -864,7 +864,6 @@ _UI_TdSqlDataType_autoIncrement_feature=Incr
_UI_TdSqlDataType_localTypeName_feature=Nom de type local
_UI_TdSqlDataType_searchable_feature=Interrogeable
_UI_TdXMLElement_xsdElementDeclaration_feature=Déclaration de l'élément XSD
_UI_TdXMLElement_ownedDocument_feature=%
_UI_TdXMLElement_javaType_feature=Type Java
_UI_TdXMLElement_xmlContent_feature=Contenu XML
_UI_TdXMLContent_xmlElements_feature=Eléments XML
@@ -953,7 +952,6 @@ _UI_WSDLParameter_ParameterInfoParent_feature=Parameter Info Parent
_UI_TdXmlElementType_type=Type de l'élément XSD
_UI_TdXmlSchema_type=Schéma XML Td
_UI_TdXmlElementType_xsdElementDeclaration_feature=Déclaration de l'élément XSD
_UI_TdXmlElementType_ownedDocument_feature=%
_UI_TdXmlElementType_javaType_feature=Type Java
_UI_TdXmlElementType_xmlContent_feature=Contenu XML
_UI_TdXmlSchema_xsdFilePath_feature=Chemin d'accès au fichier XSD

View File

@@ -763,6 +763,7 @@ _UI_UserRoleReference_user_feature=\u041F\u043E\u043B\u044C\u0437\u043E\u0432\u0
_UI_PlanExecutionHistory_originalLabel_feature=\u0418\u0441\u0445\u043E\u0434\u043D\u0430\u044F \u043C\u0435\u0442\u043A\u0430
_UI_PlanExecutionHistory_currentLabel_feature=\u0422\u0435\u043A\u0443\u0449\u0430\u044F \u043C\u0435\u0442\u043A\u0430
_UI_ExecutionServer_timeoutUnknownState_feature=\u0421\u043E\u0441\u0442\u043E\u044F\u043D\u0438\u0435 \u0422\u0430\u0439\u043C\u0430\u0443\u0442 \u041D\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u0435\u043D
_UI_UserRoleReference_user_feature=\u041F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C
_UI_WSDLParameter_type=\u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440 WSDL
_UI_WSDLSchemaConnection_serverName_feature=\u041D\u0430\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u043D\u0438\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430
_UI_WSDLSchemaConnection_portName_feature=\u041D\u0430\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u043D\u0438\u0435 \u043F\u043E\u0440\u0442\u0430

View File

@@ -58,7 +58,12 @@ RegisterWizardPage.proxyUser=Utilisateur du proxy
RegisterWizardPage.proxyPassword=Mot de passe proxy
RegisterManagement.wrongUserOrPassword=Utilisateur ou mot de passe incorrect.
TalendForgeDialog.newProjectTitle=Se connecter à TalendForge
TalendForgeDialog.labelTitle=Connectez votre Studio à TalendForge, la communauté en ligne de Talend.
TalendForgeDialog.labelMessageOne=Télécharger de nouveaux composants et connecteurs depuis Talend Exchange
TalendForgeDialog.labelMessageTwo=Accéder à la documentation la plus récentes et aux articles techniques de \nla base de connaissances Talend.
TalendForgeDialog.labelMessageThree=Consulter les derniers messages des forums de discussion Talend
TalendForgeDialog.createLabel=Créer un compte
TalendForgeDialog.userNameLabel=Utilisateur :
TalendForgeDialog.countryLabel=Pays :
TalendForgeDialog.agreeButton=J'accepte les Conditions d'Utilisation de TalendForge
TalendForgeDialog.createAccountButton=Créer un compte

View File

@@ -297,6 +297,7 @@ AddListDialog.Error=\u041E\u0448\u0438\u0431\u043A\u0430
WebServiceUI.Add_list_element=\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u044D\u043B\u0435\u043C\u0435\u043D\u0442 \u0441\u043F\u0438\u0441\u043A\u0430
WebServiceUI.Add_list_element=\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u044D\u043B\u0435\u043C\u0435\u043D\u0442 \u0441\u043F\u0438\u0441\u043A\u0430
WebServiceUI.COLUMN=\u041A\u043E\u043B\u043E\u043D\u043A\u0430
WebServiceUI.ELEMENT=\u0415\u043B\u0435\u043C\u0435\u043D\u0442
WebServiceUI.EXPRESSION=\u0412\u044B\u0440\u0430\u0436\u0435\u043D\u0438\u0435
WebServiceUI.Normalize=\u041D\u043E\u0440\u043C\u0430\u043B\u0438\u0437\u043E\u0432\u0430\u0442\u044C
WebServiceUI.Operation=\u041E\u043F\u0435\u0440\u0430\u0446\u0438\u044F

View File

@@ -1,9 +1,5 @@
RepositoryView_recyclebin=Corbeille
RepositoryView_statusFilter=Filtre sur le statut
RepositoryView_statusFilterDesc=%
RepositoryView_usersFilter=Filtre sur l'utilisateur
RepositoryView_usersFilterDesc=%
RepositoryView_nameFilter=Filtre sur le nom
RepositoryView_nameFilterDesc=%
RepositoryView_Refresh=Rafraîchir
RepositoryView_commonFilter=%

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

@@ -19,6 +19,7 @@ import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.talend.commons.CommonsPlugin;
import org.talend.commons.exception.CommonExceptionHandler;
import org.talend.commons.ui.runtime.CommonUIPlugin;
import org.talend.commons.ui.runtime.i18n.Messages;
/**
@@ -42,22 +43,24 @@ public final class MessageBoxExceptionHandler {
*
* @param ex - exception to log
*/
public static void process(final Throwable ex) {
final Display display = Display.getCurrent() == null ? Display
.getDefault() : Display.getCurrent();
if(display != null){
display.syncExec(new Runnable() {
@Override
public void run() {
Shell shell = display.getActiveShell() == null ? new Shell()
: display.getActiveShell();
process(ex, shell);
}
});
}
}
public static void process(final Throwable ex) {
if (CommonUIPlugin.isFullyHeadless()) {
CommonExceptionHandler.process(ex);
return;
}
final Display display = Display.getCurrent() == null ? Display.getDefault() : Display.getCurrent();
if (display != null) {
display.syncExec(new Runnable() {
@Override
public void run() {
Shell shell = display.getActiveShell() == null ? new Shell() : display.getActiveShell();
process(ex, shell);
}
});
}
}
public static void process(Throwable ex, Shell shell) {
CommonExceptionHandler.process(ex);

View File

@@ -176,6 +176,8 @@ public enum ECoreImage implements IImage {
EXCHNAGEIMAGEMISSING("/icons/component_missing.gif"), //$NON-NLS-1$
STATUS_OK("/icons/ok.png"), //$NON-NLS-1$
MRGREEBAR("/icons1/mrGreeBar.gif"), //$NON-NLS-1$
MRMAP("/icons1/map.gif"), //$NON-NLS-1$
MRREDUCE("/icons1/reduce.gif"), //$NON-NLS-1$
MRREDBAR("/icons1/mrRedBar.gif"), //$NON-NLS-1$
MRGRAYBAR("/icons1/mrGrayBar.gif"), //$NON-NLS-1$

View File

@@ -23,6 +23,7 @@ import org.eclipse.swt.widgets.Control;
import org.talend.commons.ui.expressionbuilder.ICellEditorDialog;
import org.talend.commons.ui.expressionbuilder.IExtendedCellEditorBehavior;
import org.talend.commons.ui.runtime.i18n.Messages;
import org.talend.commons.ui.runtime.ws.WindowSystem;
/**
* yzhang class global comment. Detailled comment <br/>
@@ -69,6 +70,7 @@ public class CellEditorDialogBehavior implements IExtendedCellEditorBehavior {
* org.talend.designer.rowgenerator.ui.tabs.IExtendedCellEditorBehavior#createBehaviorControls(org.eclipse.swt.widgets
* .Composite)
*/
@Override
public Control createBehaviorControls(Composite parent) {
panel = new Composite(parent, SWT.NONE);
@@ -86,7 +88,10 @@ public class CellEditorDialogBehavior implements IExtendedCellEditorBehavior {
panel.setLayoutData(gd);
GridData controlGD = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
// Set a default height for the text control on OS X
if (WindowSystem.isOSX()) {
controlGD.heightHint = 14;
}
Control text = extendedTextCellEditor.createText(panel);
text.setLayoutData(controlGD);

View File

@@ -17,9 +17,7 @@ import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.apache.commons.lang.StringUtils;
@@ -43,8 +41,12 @@ public class AS400DatabaseMetaData extends PackageFakeDatabaseMetadata {
private String A = "A";//$NON-NLS-1$
private String P = "P";//$NON-NLS-1$
private String TABLE = "TABLE"; //$NON-NLS-1$
private String EXTERNAL_TABLE = "EXTERNAL_TABLE"; //$NON-NLS-1$
private String VIEW = "VIEW"; //$NON-NLS-1$
private String SYNONYM = "SYNONYM"; //$NON-NLS-1$
@@ -116,7 +118,6 @@ public class AS400DatabaseMetaData extends PackageFakeDatabaseMetadata {
ResultSet rs = null;
PreparedStatement stmt = null;
List<String[]> list = new ArrayList<String[]>();
Set<String> tablesRetrieved = new HashSet<String>();
try {
stmt = connection.prepareStatement(sql);
if (!StringUtils.isEmpty(tableNamePattern)) {
@@ -127,9 +128,8 @@ public class AS400DatabaseMetaData extends PackageFakeDatabaseMetadata {
String type = rs.getString("TYPE"); //$NON-NLS-1$
String table_name = rs.getString("TABLE_NAME"); //$NON-NLS-1$
String system_table_name = rs.getString("SYSTEM_TABLE_NAME"); //$NON-NLS-1$
tablesRetrieved.add(system_table_name);
String table_schema = rs.getString("TABLE_SCHEMA"); //$NON-NLS-1$
String system_table_schema = rs.getString("SYSTEM_TABLE_SCHEMA");
String system_table_schema = rs.getString("SYSTEM_TABLE_SCHEMA"); //$NON-NLS-1$
String[] r = new String[] { type, table_name, system_table_name, table_schema, system_table_schema };
list.add(r);
@@ -145,18 +145,6 @@ public class AS400DatabaseMetaData extends PackageFakeDatabaseMetadata {
}
}
ResultSet jdbcRset = super.getTables(catalog, schemaPattern, tableNamePattern, types);
while (jdbcRset.next()) {
String table_name = jdbcRset.getString("TABLE_NAME"); //$NON-NLS-1$
if (tablesRetrieved.contains(table_name)) {
continue;
}
String type = jdbcRset.getString("TABLE_TYPE"); //$NON-NLS-1$
String table_schema = jdbcRset.getString("TABLE_SCHEM"); //$NON-NLS-1$
String[] r = new String[] { type, table_name, table_name, table_schema, table_schema };
list.add(r);
}
AS400ResultSet tableResultSet = new AS400ResultSet();
tableResultSet.setMetadata(TABLE_META);
tableResultSet.setData(list);
@@ -205,6 +193,8 @@ public class AS400DatabaseMetaData extends PackageFakeDatabaseMetadata {
result = S;
} else if (ALIAS.equals(typeName)) {
result = A;
} else if (EXTERNAL_TABLE.equals(typeName)) {
result = P;
}
return result;
}
@@ -226,4 +216,4 @@ public class AS400DatabaseMetaData extends PackageFakeDatabaseMetadata {
return resultSet;
}
}
}

View File

@@ -19,6 +19,7 @@ import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.lang.ArrayUtils;
import org.apache.log4j.Logger;
/**
@@ -27,6 +28,10 @@ import org.apache.log4j.Logger;
*/
public class SybaseDatabaseMetaData extends PackageFakeDatabaseMetadata {
private static final String[] TABLE_META = { "ID", "TABLE_SCHEM", "TABLE_NAME", "TABLE_TYPE", "REMARKS" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
private static final String[] NEEDED_TYPES = { "TABLE", "VIEW" }; //$NON-NLS-1$ //$NON-NLS-2$
private static Logger log = Logger.getLogger(SybaseDatabaseMetaData.class);
/**
@@ -149,4 +154,40 @@ public class SybaseDatabaseMetaData extends PackageFakeDatabaseMetadata {
}
return sybaseRS;
}
/*
* (non-Javadoc)
*
* @see org.talend.commons.utils.database.PackageFakeDatabaseMetadata#getTables(java.lang.String, java.lang.String,
* java.lang.String, java.lang.String[])
*/
@Override
public ResultSet getTables(String catalog, String schemaPattern, String tableNamePattern, String[] types) throws SQLException {
ResultSet sybaseRS = super.getTables(catalog, schemaPattern, tableNamePattern, NEEDED_TYPES);
List<String[]> list = new ArrayList<String[]>();
while (sybaseRS.next()) {
String name = sybaseRS.getString("TABLE_NAME"); //$NON-NLS-1$
String schema = sybaseRS.getString("TABLE_SCHEM"); //$NON-NLS-1$
String type = sybaseRS.getString("TABLE_TYPE"); //$NON-NLS-1$
String id = ""; //$NON-NLS-1$
String remarks = ""; //$NON-NLS-1$
try {
remarks = sybaseRS.getString("REMARKS"); //$NON-NLS-1$
} catch (Exception e) {
// nothing
}
if (ArrayUtils.contains(NEEDED_TYPES, type)) {
// check if the type is contained is in the types needed.
// since sybase can return some system views as "SYSTEM VIEW" instead of "VIEW/TABLE" from the request.
String[] r = new String[] { id, schema, name, type, remarks };
list.add(r);
}
}
SybaseResultSet tableResultSet = new SybaseResultSet();
tableResultSet.setMetadata(TABLE_META);
tableResultSet.setData(list);
return tableResultSet;
}
}

View File

@@ -105,7 +105,7 @@ public class TeradataDataBaseMetadata extends FakeDatabaseMetaData {
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 };//$NON-NLS-1$
String[] r = new String[] { columnName, pk };
list.add(r);
}
@@ -131,9 +131,9 @@ public class TeradataDataBaseMetadata extends FakeDatabaseMetaData {
*/
@Override
public ResultSet getTableTypes() throws SQLException {
String[] s1 = new String[] { CONST_TABLE }; //$NON-NLS-1$
String[] s2 = new String[] { CONST_VIEW }; //$NON-NLS-1$
String[] s3 = new String[] { CONST_SYNONYM }; //$NON-NLS-1$
String[] s1 = new String[] { CONST_TABLE };
String[] s2 = new String[] { CONST_VIEW };
String[] s3 = new String[] { CONST_SYNONYM };
List<String[]> list = new ArrayList<String[]>();
@@ -168,18 +168,29 @@ public class TeradataDataBaseMetadata extends FakeDatabaseMetaData {
@Override
public ResultSet getTables(String catalog, String database, String tableNamePattern, String[] types) throws SQLException {
// modify by wzhang
if (databaseName != null) {
if (databaseName != null && !databaseName.trim().isEmpty()) {
database = databaseName;
}
// end
String sql = null;
if (types != null && types.length > 0) {
sql = "SELECT * from DBC.TABLES WHERE UPPER(databasename) = UPPER('" + database //$NON-NLS-1$
+ "') AND tablekind " + addTypesToSql(types) + " AND tablename LIKE '" + tableNamePattern + "' Order by tablename "; //$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$
+ "') AND (tablekind = 'T' or tablekind = 'V') AND tablename LIKE '" + tableNamePattern + "' Order by tablekind, tablename "; //$NON-NLS-1$
+ "') AND (tablekind = 'T' or tablekind = 'V')"; //$NON-NLS-1$
}
// add the filter for table/views
if (!StringUtils.isEmpty(tableNamePattern)) {
sql = sql + " AND tablename LIKE '" + tableNamePattern + "'";//$NON-NLS-1$//$NON-NLS-2$
}
if (types != null && types.length > 0) {
sql = sql + " Order by tablename "; //$NON-NLS-1$
} else {
sql = sql + " Order by tablekind, tablename "; //$NON-NLS-1$
}
ResultSet rs = null;
@@ -282,7 +293,7 @@ public class TeradataDataBaseMetadata extends FakeDatabaseMetaData {
if (!StringUtils.isEmpty(database)) {
sql = "HELP COLUMN \"" + database + "\".\"" + tableNamePattern + "\".* ";//$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
} else {
sql = "HELP COLUMN \"" + tableNamePattern + "\".* ";//$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
sql = "HELP COLUMN \"" + tableNamePattern + "\".* ";//$NON-NLS-1$//$NON-NLS-2$
}
ResultSet rs = null;
@@ -292,7 +303,7 @@ public class TeradataDataBaseMetadata extends FakeDatabaseMetaData {
stmt = connection.createStatement();
rs = stmt.executeQuery(sql);
while (rs.next()) {
String tableName = tableNamePattern; //$NON-NLS-1$
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$
@@ -304,7 +315,7 @@ public class TeradataDataBaseMetadata extends FakeDatabaseMetaData {
isNullable = rs.getString("Nullable"); //$NON-NLS-1$
}
if (decimalDigits == null) {
decimalDigits = "0";
decimalDigits = "0";//$NON-NLS-1$
}
String remarks = ""; //$NON-NLS-1$
String columnDef = ""; //$NON-NLS-1$

View File

@@ -95,35 +95,48 @@ public class FileCopyUtils {
public static void copyFolder(File resFolder, File destFolder) {
try {
if (!resFolder.exists()) {
return;
}
destFolder.mkdirs();
String[] file = resFolder.list();
File temp = null;
for (String element : file) {
temp = new File(resFolder, element);
if (temp.isFile()) {
FileInputStream input = new FileInputStream(temp);
FileOutputStream output = new FileOutputStream(new File(destFolder, temp.getName()));
byte[] b = new byte[1024 * 5];
int len;
while ((len = input.read(b)) != -1) {
output.write(b, 0, len);
}
output.flush();
output.close();
input.close();
}
if (temp.isDirectory()) {
copyFolder(new File(resFolder, element), new File(destFolder, element));
}
}
copyFolder(resFolder, destFolder, false);
} catch (Exception e) {
ExceptionHandler.process(e);
}
}
public static void copyFolder(File resFolder, File destFolder, boolean interruptable) throws Exception {
Thread currentThread = Thread.currentThread();
if (interruptable && currentThread.isInterrupted()) {
throw new InterruptedException();
}
if (!resFolder.exists()) {
return;
}
destFolder.mkdirs();
String[] file = resFolder.list();
File temp = null;
for (String element : file) {
if (interruptable && currentThread.isInterrupted()) {
throw new InterruptedException();
}
temp = new File(resFolder, element);
if (temp.isFile()) {
FileInputStream input = new FileInputStream(temp);
FileOutputStream output = new FileOutputStream(new File(destFolder, temp.getName()));
byte[] b = new byte[1024 * 5];
int len;
while ((len = input.read(b)) != -1) {
if (interruptable && currentThread.isInterrupted()) {
break;
}
output.write(b, 0, len);
}
output.flush();
output.close();
input.close();
}
if (temp.isDirectory()) {
copyFolder(new File(resFolder, element), new File(destFolder, element), interruptable);
}
}
}
}

View File

@@ -35,6 +35,8 @@ public class NetworkUtil {
private static final Pattern macPattern = Pattern
.compile(".*((:?[0-9a-f]{2}[-:]){5}[0-9a-f]{2}).*", Pattern.CASE_INSENSITIVE); //$NON-NLS-1$
private static final String TALEND_DISABLE_INTERNET = "talend.disable.internet";//$NON-NLS-1$
private final static Set<String> getMacAddressList() throws IOException {
final Set<String> macAddressList = new HashSet<String>();
@@ -100,7 +102,10 @@ public class NetworkUtil {
}
public static boolean isNetworkValid() {
String disableInternet = System.getProperty(TALEND_DISABLE_INTERNET);
if ("true".equals(disableInternet)) { //$NON-NLS-1$
return false;
}
try {
URL url = new URL("http://www.talend.com"); //$NON-NLS-1$
HttpURLConnection conn = (HttpURLConnection) url.openConnection();

View File

@@ -15,7 +15,9 @@ package org.talend.commons.utils.threading;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.RejectedExecutionHandler;
import java.util.concurrent.TimeUnit;
/**
* created by wchen on 2014-6-6 Detailled comment
@@ -36,6 +38,11 @@ public class CustomMapThreadPoolExecutor extends TalendCustomThreadPoolExecutor
super(queueCapacity, handler);
}
public CustomMapThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit,
BlockingQueue<Runnable> workQueue, RejectedExecutionHandler handler) {
super(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue, handler);
}
/*
* (non-Javadoc)
*

View File

@@ -32,6 +32,11 @@ public class TalendCustomThreadPoolExecutor extends ThreadPoolExecutor {
super(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue);
}
public TalendCustomThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit,
BlockingQueue<Runnable> workQueue, RejectedExecutionHandler handler) {
super(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue, handler);
}
public TalendCustomThreadPoolExecutor(int queueCapacity, RejectedExecutionHandler handler) {
super(5, 10, 0, TimeUnit.SECONDS, new ArrayBlockingQueue<Runnable>(queueCapacity), handler);
}

View File

@@ -1 +1 @@
talend.version=5.6.0
talend.version=5.6.2

View File

@@ -13,7 +13,6 @@
package org.talend.commons.ui.swt.advanced.dataeditor;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -33,55 +32,51 @@ import org.talend.commons.ui.swt.tableviewer.TableViewerCreatorColumn;
import org.talend.commons.utils.data.bean.IBeanPropertyAccessors;
import org.talend.commons.utils.data.list.ListenableListEvent;
public class HadoopPropertiesTableView extends AbstractDataTableEditorView<HashMap<String, Object>> {
public class HadoopPropertiesTableView extends AbstractDataTableEditorView<Map<String, Object>> {
private static final String VALUE = "VALUE";
private static final String VALUE = "VALUE"; //$NON-NLS-1$
private static final String PROPERTY = "PROPERTY";
private static final String PROPERTY = "PROPERTY"; //$NON-NLS-1$
public HadoopPropertiesTableView(HadoopPropertiesFieldModel model, Composite parent, int styleChild) {
this(model, parent, styleChild, false);
public HadoopPropertiesTableView(Composite parent, HadoopPropertiesFieldModel model) {
super(parent, SWT.NONE, model, false, true, false);
}
public HadoopPropertiesTableView(HadoopPropertiesFieldModel model, Composite parent, int styleChild, boolean showDbTypeColumn) {
super(parent, styleChild, model);
}
public HadoopPropertiesTableView(HadoopPropertiesFieldModel model, Composite parent) {
this(model, parent, SWT.NONE, false);
public HadoopPropertiesTableView(Composite parent, HadoopPropertiesFieldModel model, boolean labelVisible) {
super(parent, SWT.NONE, model, false, true, labelVisible);
}
@Override
protected void handleBeforeListenableListOperationEvent(ListenableListEvent<HashMap<String, Object>> event) {
protected void handleBeforeListenableListOperationEvent(ListenableListEvent<Map<String, Object>> event) {
super.handleBeforeListenableListOperationEvent(event);
}
@Override
protected void handleAfterListenableListOperationEvent(ListenableListEvent<HashMap<String, Object>> event) {
protected void handleAfterListenableListOperationEvent(ListenableListEvent<Map<String, Object>> event) {
super.handleAfterListenableListOperationEvent(event);
}
@Override
protected void setTableViewerCreatorOptions(TableViewerCreator<HashMap<String, Object>> newTableViewerCreator) {
protected void setTableViewerCreatorOptions(TableViewerCreator<Map<String, Object>> newTableViewerCreator) {
super.setTableViewerCreatorOptions(newTableViewerCreator);
}
@Override
protected void createColumns(TableViewerCreator<HashMap<String, Object>> tableViewerCreator, Table table) {
protected void createColumns(TableViewerCreator<Map<String, Object>> tableViewerCreator, Table table) {
createKeyColumn(tableViewerCreator);
createValueColumn(tableViewerCreator);
}
private TableViewerCreatorColumn createValueColumn(TableViewerCreator<HashMap<String, Object>> tableViewerCreator) {
private TableViewerCreatorColumn createValueColumn(TableViewerCreator<Map<String, Object>> tableViewerCreator) {
TableViewerCreatorColumn column = new TableViewerCreatorColumn(tableViewerCreator);
column.setTitle("Value"); //$NON-NLS-1$
column.setBeanPropertyAccessors(new IBeanPropertyAccessors<HashMap<String, Object>, String>() {
column.setBeanPropertyAccessors(new IBeanPropertyAccessors<Map<String, Object>, String>() {
public String get(HashMap<String, Object> bean) {
public String get(Map<String, Object> bean) {
return (String) bean.get(VALUE);
}
public void set(HashMap<String, Object> bean, String value) {
public void set(Map<String, Object> bean, String value) {
bean.put(VALUE, value);
}
@@ -95,17 +90,17 @@ public class HadoopPropertiesTableView extends AbstractDataTableEditorView<HashM
return column;
}
private TableViewerCreatorColumn createKeyColumn(TableViewerCreator<HashMap<String, Object>> tableViewerCreator) {
private TableViewerCreatorColumn createKeyColumn(TableViewerCreator<Map<String, Object>> tableViewerCreator) {
TableViewerCreatorColumn column = new TableViewerCreatorColumn(tableViewerCreator);
column.setTitle("Property"); //$NON-NLS-1$
column.setBeanPropertyAccessors(new IBeanPropertyAccessors<HashMap<String, Object>, String>() {
column.setBeanPropertyAccessors(new IBeanPropertyAccessors<Map<String, Object>, String>() {
public String get(HashMap<String, Object> bean) {
public String get(Map<String, Object> bean) {
return (String) bean.get(PROPERTY);
}
public void set(HashMap<String, Object> bean, String value) {
public void set(Map<String, Object> bean, String value) {
bean.put(PROPERTY, value);
}
@@ -133,7 +128,7 @@ public class HadoopPropertiesTableView extends AbstractDataTableEditorView<HashM
@Override
protected Object getObjectToAdd() {
HashMap<String, Object> hpt = getModel().createHadoopPropertiesType();
Map<String, Object> hpt = getModel().createHadoopPropertiesType();
hpt.put(PROPERTY, "new line");
hpt.put(VALUE, "");
return hpt;
@@ -151,13 +146,13 @@ public class HadoopPropertiesTableView extends AbstractDataTableEditorView<HashM
return new ExtendedTablePasteCommand(extendedTableModel, indexWhereInsert) {
@Override
public List<HashMap<String, Object>> createPastableBeansList(ExtendedTableModel extendedTableModel,
public List<Map<String, Object>> createPastableBeansList(ExtendedTableModel extendedTableModel,
List copiedObjectsList) {
List list = new ArrayList();
HadoopPropertiesFieldModel fieldsModel = (HadoopPropertiesFieldModel) extendedTableModel;
for (Object current : copiedObjectsList) {
if (current instanceof HashMap) {
Map<String, Object> original = (HashMap<String, Object>) current;
if (current instanceof Map) {
Map<String, Object> original = (Map<String, Object>) current;
Map<String, Object> copy = fieldsModel.createHadoopPropertiesType();
copy.putAll(original);
list.add(copy);

View File

@@ -15,26 +15,25 @@ package org.talend.commons.ui.swt.extended.table;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.talend.commons.ui.swt.extended.table.ExtendedTableModel;
public class HadoopPropertiesFieldModel extends ExtendedTableModel<HashMap<String, Object>> {
public class HadoopPropertiesFieldModel extends ExtendedTableModel<Map<String, Object>> {
public HadoopPropertiesFieldModel(String name) {
super(name);
setProperties(new ArrayList<HashMap<String, Object>>());
setProperties(new ArrayList<Map<String, Object>>());
}
public HadoopPropertiesFieldModel(List<HashMap<String, Object>> conditionTypeList, String name) {
public HadoopPropertiesFieldModel(List<Map<String, Object>> propertiesTypeList, String name) {
super(name);
setProperties(conditionTypeList);
setProperties(propertiesTypeList);
}
public void setProperties(List<HashMap<String, Object>> properties) {
registerDataList((List<HashMap<String, Object>>) properties);
public void setProperties(List<Map<String, Object>> properties) {
registerDataList(properties);
}
public HashMap<String, Object> createHadoopPropertiesType() {
public Map<String, Object> createHadoopPropertiesType() {
return new HashMap<String, Object>();
}
}

View File

@@ -15,6 +15,7 @@
<extension-point id="repositorySeeker" name="Repository Seeker" schema="schema/repositorySeeker.exsd"/>
<extension-point id="extended_repositorynode_handler" name="Extended Repository Node Handler" schema="schema/extended_repositorynode_handler.exsd"/>
<extension-point id="repository_review_filter" name="repository_review_filter" schema="schema/repository_review_filter.exsd"/>
<extension-point id="repository_context" name="Repository_context" schema="schema/repository_context.exsd"/>
<extension
point="org.talend.core.runtime.service">
@@ -462,6 +463,11 @@
clazz="org.talend.core.model.properties.SalesforceSchemaConnectionItem">
</Item>
</RepositoryComponent>
<DragAndDropFilter
clazz="org.talend.core.repository.model.dnd.SalesforceComponentDndFilter"
id="org.talend.core.repository.SalesforceComponentDndFilter"
name="Salesforce DnD Filter">
</DragAndDropFilter>
<RepositoryComponent
name="SAS"
withSchema="true"

View File

@@ -0,0 +1,102 @@
<?xml version='1.0' encoding='UTF-8'?>
<!-- Schema file written by PDE -->
<schema targetNamespace="org.talend.core.repository" xmlns="http://www.w3.org/2001/XMLSchema">
<annotation>
<appinfo>
<meta.schema plugin="org.talend.core.repository" id="repository_context" name="repository_context"/>
</appinfo>
<documentation>
[Enter description of this extension point.]
</documentation>
</annotation>
<element name="extension">
<annotation>
<appinfo>
<meta.element />
</appinfo>
</annotation>
<complexType>
<sequence>
<element ref="RepositoryContext" minOccurs="1" maxOccurs="unbounded"/>
</sequence>
<attribute name="point" type="string" use="required">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
<attribute name="id" type="string">
<annotation>
<documentation>
</documentation>
</annotation>
</attribute>
<attribute name="name" type="string">
<annotation>
<documentation>
</documentation>
<appinfo>
<meta.attribute translatable="true"/>
</appinfo>
</annotation>
</attribute>
</complexType>
</element>
<element name="RepositoryContext">
<complexType>
<attribute name="class" type="string" use="required">
<annotation>
<documentation>
</documentation>
<appinfo>
<meta.attribute kind="java" basedOn=":org.talend.repository.ui.utils.IRepositoryContextHandler"/>
</appinfo>
</annotation>
</attribute>
</complexType>
</element>
<annotation>
<appinfo>
<meta.section type="since"/>
</appinfo>
<documentation>
[Enter the first release in which this extension point appears.]
</documentation>
</annotation>
<annotation>
<appinfo>
<meta.section type="examples"/>
</appinfo>
<documentation>
[Enter extension point usage example here.]
</documentation>
</annotation>
<annotation>
<appinfo>
<meta.section type="apiinfo"/>
</appinfo>
<documentation>
[Enter API information here.]
</documentation>
</annotation>
<annotation>
<appinfo>
<meta.section type="implementation"/>
</appinfo>
<documentation>
[Enter information about supplied implementation of this extension point.]
</documentation>
</annotation>
</schema>

View File

@@ -16,5 +16,6 @@ public interface ILoginConnectionService {
// public boolean isAllowLocalConnection();
public String checkConnectionValidation(String name, String description, String email, String password, String url);
public String checkConnectionValidation(String name, String description, String email, String password, String workspace,
String url);
}

View File

@@ -0,0 +1,106 @@
// ============================================================================
//
// Copyright (C) 2006-2015 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core.repository.model.dnd;
import java.util.Iterator;
import java.util.List;
import org.talend.core.model.components.IComponent;
import org.talend.core.model.properties.Item;
import org.talend.core.model.properties.SalesforceSchemaConnectionItem;
import org.talend.core.model.repository.ERepositoryObjectType;
import org.talend.core.repository.DefaultRepositoryComponentDndFilter;
import org.talend.repository.model.RepositoryNode;
/**
* created by cmeng on Apr 21, 2015 Detailled comment
*
*/
public class SalesforceComponentDndFilter extends DefaultRepositoryComponentDndFilter {
public static final String COMPONENT_T_SALSEFORCE_CONNECTION = "tSalesforceConnection"; //$NON-NLS-1$
public static final String COMPONENT_T_SALSEFORCE_WAVE_BULK_EXEC = "tSalesforceWaveBulkExec"; //$NON-NLS-1$
public static final String COMPONENT_T_SALSEFORCE_WAVE_OUTPUT_BULK_EXEC = "tSalesforceWaveOutputBulkExec"; //$NON-NLS-1$
public static final String COMPONENT_T_SALSEFORCE_INPUT = "tSalesforceInput"; //$NON-NLS-1$
public static final String COMPONENT_T_SALSEFORCE_OUTPUT = "tSalesforceOutput"; //$NON-NLS-1$
@Override
public boolean except(Item item, ERepositoryObjectType type, RepositoryNode seletetedNode, IComponent component,
String repositoryType) {
if (!(item instanceof SalesforceSchemaConnectionItem)) {
return false;
}
if (ERepositoryObjectType.METADATA_SALESFORCE_SCHEMA == type) {
String componentName = component.getName();
if (COMPONENT_T_SALSEFORCE_INPUT.equals(componentName) || COMPONENT_T_SALSEFORCE_OUTPUT.equals(componentName)) {
return true;
}
} else if (ERepositoryObjectType.METADATA_SALESFORCE_MODULE == type || ERepositoryObjectType.METADATA_CON_TABLE == type
|| ERepositoryObjectType.METADATA_CON_COLUMN == type) {
String componentName = component.getName();
if (COMPONENT_T_SALSEFORCE_CONNECTION.equals(componentName)
|| COMPONENT_T_SALSEFORCE_WAVE_BULK_EXEC.equals(componentName)
|| COMPONENT_T_SALSEFORCE_WAVE_OUTPUT_BULK_EXEC.equals(componentName)) {
return true;
}
}
return false;
}
@Override
public boolean valid(Item item, ERepositoryObjectType type, RepositoryNode seletetedNode, IComponent component,
String repositoryType) {
if (!(item instanceof SalesforceSchemaConnectionItem)) {
return false;
}
if (ERepositoryObjectType.METADATA_SALESFORCE_SCHEMA == type) {
String componentName = component.getName();
if (COMPONENT_T_SALSEFORCE_CONNECTION.equals(componentName)
|| COMPONENT_T_SALSEFORCE_WAVE_BULK_EXEC.equals(componentName)
|| COMPONENT_T_SALSEFORCE_WAVE_OUTPUT_BULK_EXEC.equals(componentName)) {
return true;
}
} else if (ERepositoryObjectType.METADATA_SALESFORCE_MODULE == type || ERepositoryObjectType.METADATA_CON_TABLE == type
|| ERepositoryObjectType.METADATA_CON_COLUMN == type) {
String componentName = component.getName();
if (COMPONENT_T_SALSEFORCE_INPUT.equals(componentName) || COMPONENT_T_SALSEFORCE_OUTPUT.equals(componentName)) {
return true;
}
}
return false;
}
@Override
public List<IComponent> sort(List<IComponent> components, Item item, ERepositoryObjectType type, RepositoryNode seletetedNode) {
if (item instanceof SalesforceSchemaConnectionItem) {
if (ERepositoryObjectType.METADATA_SALESFORCE_SCHEMA == type && components != null) {
Iterator<IComponent> iter = components.iterator();
while (iter.hasNext()) {
IComponent component = iter.next();
if (COMPONENT_T_SALSEFORCE_CONNECTION.equals(component.getName())) {
iter.remove();
components.add(0, component);
return components;
}
}
}
}
return components;
}
}

View File

@@ -1393,7 +1393,13 @@ public class ProjectRepositoryNode extends RepositoryNode implements IProjectRep
// createTables(recBinNode, node, repObj, metadataConnection.getTables());
// 4.Queries:
if (!ConnectionUtils.isHiveConnection(dbconn.getURL())) {
boolean isImpala = false;
if (metadataConnection instanceof DatabaseConnection) {
if (EDatabaseTypeName.IMPALA.getDisplayName().equals(((DatabaseConnection) metadataConnection).getDatabaseType())) {
isImpala = true;
}
}
if (!ConnectionUtils.isHiveConnection(dbconn.getURL()) || isImpala) {
RepositoryNode queriesNode = new StableRepositoryNode(node,
Messages.getString("ProjectRepositoryNode.queries"), ECoreImage.FOLDER_CLOSE_ICON); //$NON-NLS-1$
node.getChildren().add(queriesNode);

View File

@@ -72,7 +72,6 @@ import org.talend.core.model.properties.ProcessItem;
import org.talend.core.model.properties.ProjectReference;
import org.talend.core.model.properties.Property;
import org.talend.core.model.repository.ERepositoryObjectType;
import org.talend.core.model.repository.Folder;
import org.talend.core.model.repository.IRepositoryContentHandler;
import org.talend.core.model.repository.IRepositoryViewObject;
import org.talend.core.model.repository.ISubRepositoryObject;
@@ -92,6 +91,8 @@ import org.talend.cwm.helper.SubItemHelper;
import org.talend.designer.business.diagram.custom.IDiagramModelService;
import org.talend.designer.core.ICamelDesignerCoreService;
import org.talend.designer.core.IDesignerCoreService;
import org.talend.designer.core.model.utils.emf.talendfile.ContextParameterType;
import org.talend.designer.core.model.utils.emf.talendfile.ContextType;
import org.talend.designer.core.model.utils.emf.talendfile.NodeType;
import org.talend.designer.runprocess.IRunProcessService;
import org.talend.expressionbuilder.ExpressionPersistance;
@@ -104,6 +105,7 @@ import org.talend.repository.model.IRepositoryNode.ENodeType;
import org.talend.repository.model.IRepositoryNode.EProperties;
import org.talend.repository.model.ItemReferenceBean;
import org.talend.repository.model.JobletReferenceBean;
import org.talend.repository.model.ProjectRepositoryNode;
import org.talend.repository.model.RepositoryConstants;
import org.talend.repository.model.RepositoryNode;
import org.talend.repository.model.RepositoryNodeUtilities;
@@ -178,8 +180,10 @@ public class DeleteAction extends AContextualAction {
}
final List<ItemReferenceBean> unDeleteItems = RepositoryNodeDeleteManager.getInstance().getUnDeleteItems(
selectNodes, deleteActionCache);
List<RepositoryNode> accessNodes = new ArrayList<RepositoryNode>();
for (RepositoryNode node : selectNodes) {
try {
accessNodes.add(node);
// ADD xqliu 2012-05-24 TDQ-4831
if (sourceFileOpening(node)) {
continue;
@@ -242,7 +246,12 @@ public class DeleteAction extends AContextualAction {
needToUpdataPalette = true;
}
if (needReturn) {
return;
// TDI-31623: Access the rest nodes in select nodes if current node's delete has pb
if (accessNodes.containsAll(selectNodes)) {
return;
} else {
continue;
}
}
types.add(node.getObjectType());
@@ -280,33 +289,14 @@ public class DeleteAction extends AContextualAction {
}
}
}
// bug 18158
boolean isSqlTemplate = false;
if (node.getObject() instanceof Folder) {
// isSqlTemplate = ((Folder) node.getObject()).getContentType().equals(
// ERepositoryObjectType.SQLPATTERNS);
Object label = node.getProperties(EProperties.LABEL);
if (ENodeType.SIMPLE_FOLDER.equals(node.getType())
&& ERepositoryObjectType.SQLPATTERNS.equals(node.getContentType())
&& (label.equals("Generic") || label.equals("UserDefined") || label.equals("MySQL") //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|| label.equals("Netezza") || label.equals("Oracle") //$NON-NLS-1$ //$NON-NLS-2$
|| label.equals("ParAccel") || label.equals("Teradata")) //$NON-NLS-1$ //$NON-NLS-2$
|| label.equals("Hive")) { //$NON-NLS-1$
isSqlTemplate = true;
}
}
if (!isSqlTemplate) {
types.add(node.getContentType());
// fixed for the documentation deleted
if (node.getContentType() == ERepositoryObjectType.PROCESS
|| node.getContentType() == ERepositoryObjectType.JOBLET) {
types.add(ERepositoryObjectType.DOCUMENTATION);
}
deletedFolder.add(node);
deleteFolder(node, factory, deleteActionCache);
types.add(node.getContentType());
// fixed for the documentation deleted
if (node.getContentType() == ERepositoryObjectType.PROCESS
|| node.getContentType() == ERepositoryObjectType.JOBLET) {
types.add(ERepositoryObjectType.DOCUMENTATION);
}
deletedFolder.add(node);
deleteFolder(node, factory, deleteActionCache);
}
} catch (PersistenceException e) {
MessageBoxExceptionHandler.process(e);
@@ -850,7 +840,8 @@ public class DeleteAction extends AContextualAction {
if (item == item2) {
continue;
}
List<IContext> contextList = null;
List<IContextParameter> openedContextParameterList = null;
List<ContextParameterType> closedContextParameterList = null;
String contextID = null;
// if (!isOpenedItem(item2, deleteActionCache.getOpenProcessMap())) {
// The following logic is added by Marvin Wang on Sep. 14, 2012 for bug TDI-21878.
@@ -863,7 +854,10 @@ public class DeleteAction extends AContextualAction {
for (IProcess2 tempPro : openedProcesses) {
if (process.getId().equals(tempPro.getId())) {
isOpenedProcess = true;
contextList = tempPro.getContextManager().getListContext();
List<IContext> contextList = tempPro.getContextManager().getListContext();
if(contextList != null && !contextList.isEmpty()) {
openedContextParameterList = contextList.get(0).getContextParameterList();
}
break;
}
}
@@ -876,42 +870,60 @@ public class DeleteAction extends AContextualAction {
// loading file. That is why it can not use the method to get IProcess directly without
// checking if "process" is opened.
if (!isOpenedProcess) {
if (item2 instanceof ProcessItem) {
contextList = service.getProcessFromProcessItem((ProcessItem) item2).getContextManager()
.getListContext();
if (item2 instanceof ConnectionItem) {
contextID = ((ConnectionItem) item2).getConnection().getContextId();
} else {
List<?> contextList = null;
if (item2 instanceof ProcessItem) {
// contextList = service.getProcessFromProcessItem((ProcessItem) item2).getContextManager().getListContext();
contextList = ((ProcessItem) item2).getProcess().getContext();
} else if (item2 instanceof JobletProcessItem) {
// contextList = service.getProcessFromJobletProcessItem((JobletProcessItem)item2).getContextManager().getListContext();
contextList = ((JobletProcessItem) item2).getJobletProcess().getContext();
}
if (contextList != null && !contextList.isEmpty()) {
Object obj = contextList.get(0);
if (obj instanceof ContextType) {
closedContextParameterList = ((ContextType) obj).getContextParameter();
}
}
}
}
if (item2 instanceof JobletProcessItem) {
contextList = service.getProcessFromJobletProcessItem((JobletProcessItem) item2)
.getContextManager().getListContext();
} else if (item2 instanceof ConnectionItem) {
contextID = ((ConnectionItem) item2).getConnection().getContextId();
List<?> contextParameterList = null;
if (openedContextParameterList != null) {
contextParameterList = openedContextParameterList;
} else if (closedContextParameterList != null) {
contextParameterList = closedContextParameterList;
}
if (contextList != null) {
if (contextParameterList != null && contextParameterList.size() > 0) {
// Added by Marvin Wang on Sep.14, 2012 for bug TDI-21878. It just needs to check the
// first IContext, normally it is named "default". In order to add the different version
// jobs to ContextReferenceBean, below uses
// "RepositoryReferenceBeanUtils.hasReferenceBean" to filter the repeat object.
List<IContextParameter> contextParams = contextList.get(0).getContextParameterList();
if (contextParams != null && contextParams.size() > 0) {
for (IContextParameter contextParameter : contextParams) {
if (contextParameter.isBuiltIn()) {
continue;
}
String contextId = item.getProperty().getId();
String sourceId = contextParameter.getSource();
if (contextId != null && contextId.equals(sourceId)) {
String processName = process.getLabel();
String processVersion = process.getVersion();
if (!RepositoryReferenceBeanUtils.hasReferenceBean(list, processName, processVersion)) {
String path = item2.getState().getPath();
String type = process.getRepositoryObjectType().getType();
ContextReferenceBean bean = new ContextReferenceBean(property2.getLabel(), type,
property2.getVersion(), path, refP.getLabel());
bean.setJobFlag(isJob, isDelete);
list.add(bean);
}
// List<IContextParameter> contextParams = contextList.get(0).getContextParameterList();
for (int i = 0; i < contextParameterList.size(); i++) {
String sourceId = null;
Object objContextParameter = contextParameterList.get(i);
if (objContextParameter instanceof IContextParameter) {
IContextParameter contextParameter = (IContextParameter) objContextParameter;
sourceId = contextParameter.getSource();
} else if (objContextParameter instanceof ContextParameterType) {
ContextParameterType contextParameter = (ContextParameterType) objContextParameter;
sourceId = contextParameter.getRepositoryContextId();
}
String contextId = item.getProperty().getId();
if (contextId != null && contextId.equals(sourceId)) {
String processName = process.getLabel();
String processVersion = process.getVersion();
if (!RepositoryReferenceBeanUtils.hasReferenceBean(list, processName, processVersion)) {
String path = item2.getState().getPath();
String type = process.getRepositoryObjectType().getType();
ContextReferenceBean bean = new ContextReferenceBean(property2.getLabel(), type,
property2.getVersion(), path, refP.getLabel());
bean.setJobFlag(isJob, isDelete);
list.add(bean);
}
}
}
@@ -1478,9 +1490,24 @@ public class DeleteAction extends AContextualAction {
// 2. the select node is the father node of the SQL Patterns
// 3. the select node do not has father node(means do not contain "/")
String selectName = selection.getFirstElement().toString();
if (node.getContentType() == ERepositoryObjectType.SQLPATTERNS && selectName.equals(label)
&& !selectName.contains("/")) { //$NON-NLS-1$
visible = false;
if (node.getContentType() == ERepositoryObjectType.SQLPATTERNS) {
boolean isDeleted = false;
IRepositoryViewObject object = node.getObject();
if (object != null) {
Property folderProperty = object.getProperty();
if (folderProperty != null && folderProperty.getItem() != null
&& folderProperty.getItem().getState() != null) {
isDeleted = node.getObject().getProperty().getItem().getState().isDeleted();
}
}
if (!isDeleted && selectName.equals(label) && !selectName.contains("/")) {
visible = false;
}
if (!isDeleted && node.getParent() != null
& node.getParent().getParent() instanceof ProjectRepositoryNode) {
visible = false;
}
}
break;
case REPOSITORY_ELEMENT:

View File

@@ -417,6 +417,10 @@ public class DuplicateAction extends AContextualAction {
item = PropertiesFactory.eINSTANCE.createValidationRulesConnectionItem();
} else if (repositoryType == ERepositoryObjectType.METADATA_HEADER_FOOTER) {
item = PropertiesFactory.eINSTANCE.createHeaderFooterConnectionItem();
} else if (repositoryType == ERepositoryObjectType.METADATA_FILE_BRMS) {
item = PropertiesFactory.eINSTANCE.createBRMSConnectionItem();
} else if (repositoryType == ERepositoryObjectType.METADATA_FILE_FTP) {
item = PropertiesFactory.eINSTANCE.createFTPConnectionItem();
}
if (item == null) {
for (IRepositoryContentHandler handler : RepositoryContentManager.getHandlers()) {

View File

@@ -170,6 +170,14 @@ public class RepositoryLabelProvider extends LabelProvider implements IColorProv
}
return label;
}
if (repositoryObjectType == ERepositoryObjectType.JOB_DOC || repositoryObjectType == ERepositoryObjectType.JOBLET_DOC
|| repositoryObjectType == ERepositoryObjectType.valueOf(ERepositoryObjectType.class, "ROUTE_DOC")) {
// TDI-31655:documention node need to update property for its structure to get the correct text
object.getProperty();
if (object.isModified()) {
label = "> "; //$NON-NLS-1$
}
}
label = label + getText(object);
if (!mainProject.getLabel().equals(projectLabel) && PluginChecker.isRefProjectLoaded()) {
IReferencedProjectService service = (IReferencedProjectService) GlobalServiceRegister.getDefault().getService(

View File

@@ -24,9 +24,11 @@
<dbType type="BIGINT" ignorePre="true" />
<dbType type="BLOB" ignorePre="true" />
<dbType type="BOOLEAN" ignorePre="true" />
<dbType type="TEXT" ignorePre="true" />
<dbType type="UUID" ignorePre="true" />
<dbType type="TIMEUUID" ignorePre="true" />
<dbType type="VARINT" ignorePre="true" />
<dbType type="INT" ignorePre="true" />
<dbType type="FLOAT" defaultLength="20" defaultPrecision="10" />
<dbType type="DOUBLE" defaultLength="20" defaultPrecision="10" />
<dbType type="DECIMAL" defaultLength="20" defaultPrecision="10" />
@@ -60,7 +62,9 @@
</talendType>
<talendType type="id_Integer">
<dbType type="Int32Type" default="true" />
<dbType type="IntegerType"/>
<dbType type="VARINT" />
<dbType type="INT" />
</talendType>
<talendType type="id_Long">
<dbType type="LongType" default="true" />
@@ -70,7 +74,6 @@
</talendType>
<talendType type="id_Object">
<dbType type="ObjectType" default="true" />
<dbType type="IntegerType" />
<dbType type="BLOB" />
</talendType>
<talendType type="id_Short" />
@@ -80,6 +83,7 @@
<dbType type="UUIDType" />
<dbType type="TimeUUIDType" />
<dbType type="ASCII" />
<dbType type="TEXT" />
<dbType type="UUID" />
<dbType type="TIMEUUID" />
</talendType>
@@ -91,11 +95,14 @@
<dbType type="AsciiType">
<talendType type="id_String" default="true" />
</dbType>
<dbType type="TEXT">
<talendType type="id_String" default="true" />
</dbType>
<dbType type="UTF8Type">
<talendType type="id_String" default="true" />
</dbType>
<dbType type="IntegerType">
<talendType type="id_Object" default="true" />
<talendType type="id_Integer" default="true" />
</dbType>
<dbType type="Int32Type">
<talendType type="id_Integer" default="true" />
@@ -152,6 +159,9 @@
<dbType type="VARINT">
<talendType type="id_Integer" default="true" />
</dbType>
<dbType type="INT">
<talendType type="id_Integer" default="true" />
</dbType>
<dbType type="FLOAT">
<talendType type="id_Float" default="true" />
</dbType>

View File

@@ -20,7 +20,7 @@
<talendToDbTypes><!-- Adviced mappings -->
<talendType type="id_List"/>
<talendType type="id_Boolean">
<dbType type="BOOLEAN"/>
<dbType type="BOOLEAN" default="true"/>
</talendType>
<talendType type="id_Byte">
<dbType type="TINYINT" default="true"/>
@@ -30,7 +30,7 @@
</talendType>
<talendType type="id_byte[]"/>
<talendType type="id_Character">
<dbType type="STRING"/>
<dbType type="STRING" default="true"/>
</talendType>
<talendType type="id_Date">
<dbType type="TIMESTAMP" default="true"/>
@@ -65,7 +65,7 @@
<dbType type="INT" />
</talendType>
<talendType type="id_String">
<dbType type="STRING"/>
<dbType type="STRING" default="true"/>
</talendType>
</talendToDbTypes>
<dbToTalendTypes><!-- Adviced mappings -->

View File

@@ -36,7 +36,7 @@
<dbType type="SMALLINT" ignorePre="true" />
<dbType type="SMALLINT UNSIGNED" ignoreLen="true" ignorePre="true" />
<dbType type="SET" ignoreLen="true" ignorePre="true" />
<dbType type="TEXT" ignorePre="true" />
<dbType type="TEXT" ignoreLen="true" ignorePre="true" />
<dbType type="TIME" ignoreLen="true" ignorePre="true" />
<dbType type="TIMESTAMP" ignoreLen="true" ignorePre="true" />
<dbType type="TINYBLOB" ignoreLen="true" ignorePre="true" />
@@ -124,6 +124,7 @@
<dbType type="MEDIUMTEXT" />
<dbType type="MULTILINESTRING" />
<dbType type="TEXT" />
<dbType type="TINYTEXT" />
</talendType>
</talendToDbTypes>
<dbToTalendTypes>

View File

@@ -50,7 +50,7 @@
<dbType type="TIME" ignorePre="true" />
<dbType type="TINTERVAL" ignoreLen="true" ignorePre="true" />
<dbType type="TIMESTAMPTZ" ignoreLen="true" ignorePre="true" />
<dbType type="TIMESTAMP" ignorePre="true" />
<dbType type="TIMESTAMP" ignoreLen="true" ignorePre="true" />
<dbType type="TIMETZ" ignoreLen="true" ignorePre="true" />
<dbType type="VARBIT" ignoreLen="true" ignorePre="true" />
<dbType type="VARCHAR" defaultLength="200" ignorePre="true" />
@@ -125,12 +125,12 @@
<dbType type="TEXT" />
</talendType>
<talendType type="id_Date">
<dbType type="DATE" default="true" />
<dbType type="DATE" />
<dbType type="ABSTIME" />
<dbType type="TIMETZ" />
<dbType type="TIME" />
<dbType type="TIMESTAMPTZ" />
<dbType type="TIMESTAMP" />
<dbType type="TIMESTAMP" default="true"/>
<dbType type="INTERVAL" />
<dbType type="TINTERVAL" />
<dbType type="RELTIME" />

View File

@@ -13,6 +13,7 @@
<dbType type="DATETIME" ignoreLen="true" ignorePre="true" />
<dbType type="DECIMAL" defaultLength="20" defaultPrecision="10" />
<dbType type="DOUBLE PRECISION" ignoreLen="true" ignorePre="true" />
<dbType type="UNSIGNED INT" ignoreLen="true" ignorePre="true" />
<dbType type="DOUBLE PRECIS" ignoreLen="true" ignorePre="true" />
<dbType type="FLOAT" ignoreLen="true" ignorePre="true" />
<dbType type="INT" ignoreLen="true" ignorePre="true" />
@@ -92,10 +93,12 @@
<dbType type="BIGINT" />
<dbType type="SMALLINT"/>
<dbType type="TINYINT"/>
<dbType type="UNSIGNED INT"/>
</talendType>
<talendType type="id_Long">
<dbType type="BIGINT" default="true" />
<dbType type="INT"/>
<dbType type="UNSIGNED INT"/>
<dbType type="SMALLINT"/>
<dbType type="TINYINT"/>
</talendType>
@@ -172,6 +175,10 @@
<talendType type="id_Double"/>
<talendType type="id_BigDecimal"/>
</dbType>
<dbType type="UNSIGNED INT">
<talendType type="id_Long" default="true" />
<talendType type="id_Integer"/>
</dbType>
<dbType type="INT">
<talendType type="id_Integer" default="true" />
<talendType type="id_Short"/>

View File

@@ -58,13 +58,13 @@
</talendType>
<talendType type="id_Byte">
<dbType type="BF" default="true"/>
<dbType type="BYTEINT" />
<dbType type="BYTE" />
<dbType type="BF"/>
<dbType type="BYTEINT" default="true"/>
<dbType type="BYTE"/>
</talendType>
<talendType type="id_byte[]">
<dbType type="BF" default="true"/>
<dbType type="VARBYTE"/>
<dbType type="BF"/>
<dbType type="VARBYTE" default="true"/>
</talendType>
<talendType type="id_Character">
<dbType type="BYTE" />

View File

@@ -6,6 +6,7 @@
"NAMENODE_PRINCIPAL": "nn/_HOST@EXAMPLE.COM",
"JOBTRACKER_PRINCIPAL" : "mapred/_HOST@EXAMPLE.COM",
"RESOURCE_MANAGER_PRINCIPAL" : "yarn/_HOST@EXAMPLE.COM",
"JOBHISTORY_PRINCIPAL" : "mapred/_HOST@EXAMPLE.COM",
"HIVE": {
"EMBEDDED": {
"PORT": 9083
@@ -27,6 +28,7 @@
"NAMENODE_PRINCIPAL": "hdfs/_HOST@EXAMPLE.COM",
"JOBTRACKER_PRINCIPAL" : "mapred/_HOST@EXAMPLE.COM",
"RESOURCE_MANAGER_PRINCIPAL" : "yarn/_HOST@EXAMPLE.COM",
"JOBHISTORY_PRINCIPAL" : "mapred/_HOST@EXAMPLE.COM",
"HIVE": {
"EMBEDDED": {
"PORT": 9083
@@ -109,7 +111,7 @@
"PORT": 9083
},
"STANDALONE": {
"PORT": 10000
"PORT": 10004
},
"DATABASE": "default",
"HIVE_PRINCIPAL": "hive/_HOST@EXAMPLE.COM"
@@ -122,6 +124,7 @@
"NAMENODE_PRINCIPAL": "nn/_HOST@EXAMPLE.COM",
"JOBTRACKER_PRINCIPAL" : "mapred/_HOST@EXAMPLE.COM",
"RESOURCE_MANAGER_PRINCIPAL" : "yarn/_HOST@EXAMPLE.COM",
"JOBHISTORY_PRINCIPAL" : "mapred/_HOST@EXAMPLE.COM",
"HIVE": {
"EMBEDDED": {
"PORT": 9083
@@ -133,7 +136,7 @@
"HIVE_PRINCIPAL": "hive/_HOST@EXAMPLE.COM"
},
"HBASE": {
"PORT": 5181
"PORT": 2181
}
},
"CUSTOM": {

View File

@@ -66,6 +66,16 @@
</documentation>
</annotation>
</attribute>
<attribute name="parent" type="string">
<annotation>
<documentation>
The parent classloader index of the classloader.
</documentation>
<appinfo>
<meta.attribute translatable="true"/>
</appinfo>
</annotation>
</attribute>
</complexType>
</element>

View File

@@ -0,0 +1,24 @@
// ============================================================================
//
// Copyright (C) 2006-2014 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core;
import org.talend.core.model.metadata.builder.connection.Connection;
/**
* created by ldong on Mar 5, 2015 Detailled comment
*
*/
public interface IRepositoryContextUpdateService extends IService {
public void updateRelatedContextVariableName(Connection con, String oldName, String newName);
}

View File

@@ -1,273 +1,285 @@
// ============================================================================
//
// Copyright (C) 2006-2014 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core.classloader;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.commons.lang.StringUtils;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Platform;
import org.talend.commons.exception.ExceptionHandler;
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.Project;
import org.talend.core.model.metadata.IMetadataConnection;
import org.talend.core.model.metadata.connection.hive.HiveConnUtils;
import org.talend.repository.ProjectManager;
import org.talend.utils.io.FilesUtils;
/**
* DOC ycbai class global comment. Detailled comment
*/
public class ClassLoaderFactory {
private final static String EXTENSION_POINT_ID = "org.talend.core.runtime.classloader_provider"; //$NON-NLS-1$
private static IConfigurationElement[] configurationElements = null;
private static Map<String, DynamicClassLoader> classLoadersMap = null;
private final static String SEPARATOR = ";"; //$NON-NLS-1$
private final static String PATH_SEPARATOR = "/"; //$NON-NLS-1$
private final static String INDEX_ATTR = "index"; //$NON-NLS-1$
private final static String LIB_ATTR = "libraries"; //$NON-NLS-1$
static {
IExtensionRegistry registry = Platform.getExtensionRegistry();
configurationElements = registry.getConfigurationElementsFor(EXTENSION_POINT_ID);
}
/**
* DOC ycbai Comment method "getClassLoader".
*
* @param index
* @return the classLoader by index
*/
public static DynamicClassLoader getClassLoader(String index) {
return getClassLoader(index, true);
}
public static DynamicClassLoader getClassLoader(String index, boolean showDownloadIfNotExist) {
if (classLoadersMap == null) {
init();
}
DynamicClassLoader classLoader = classLoadersMap.get(index);
if (classLoader == null) {
classLoader = findLoader(index, showDownloadIfNotExist);
}
return classLoader;
}
public static DynamicClassLoader getCustomClassLoader(String index, String jarsStr) {
return getCustomClassLoader(index, jarsStr, SEPARATOR);
}
protected static DynamicClassLoader getCustomClassLoader(String index, String jars, String jarSeparator) {
Set<String> jarSet = new HashSet<String>();
if (StringUtils.isNotBlank(jars)) {
String[] jarsArray = jars.split(jarSeparator);
for (String jar : jarsArray) {
jarSet.add(jar);
}
}
return getCustomClassLoader(index, jarSet);
}
/**
* DOC ycbai Comment method "getCustomClassLoader".
*
* @param index
* @param libraries
* @return the classLoader by specific libraries
*/
public static DynamicClassLoader getCustomClassLoader(String index, Set<String> libraries) {
if (libraries == null || libraries.size() == 0) {
return null;
}
DynamicClassLoader classLoader = getClassLoader(index);
if (classLoader == null) {
classLoader = createCustomClassLoader(index, libraries);
} else {
boolean changed;
Set<String> oldLibraries = classLoader.getLibraries();
Set<String> oldLibrariesClone = new HashSet<String>(oldLibraries);
changed = oldLibrariesClone.retainAll(libraries);
if (!changed) {
Set<String> newLibrariesClone = new HashSet<String>(libraries);
changed = newLibrariesClone.retainAll(oldLibraries);
}
if (changed) {
File libFolder = new File(classLoader.getLibStorePath());
if (libFolder.exists()) {
FilesUtils.removeFolder(libFolder, true);
}
classLoader = createCustomClassLoader(index, libraries);
}
}
return classLoader;
}
private static DynamicClassLoader createCustomClassLoader(String index, Set<String> libraries) {
DynamicClassLoader classLoader = new DynamicClassLoader();
loadLibraries(classLoader, libraries.toArray(new String[0]), false);
classLoadersMap.put(index, classLoader);
return classLoader;
}
private static void init() {
File tmpFolder = getTmpFolder();
if (tmpFolder.exists()) {
FilesUtils.removeFolder(tmpFolder, true);
}
classLoadersMap = new HashMap<String, DynamicClassLoader>();
}
private static DynamicClassLoader findLoader(String index, boolean showDownloadIfNotExist) {
if (index != null && configurationElements != null) {
for (IConfigurationElement current : configurationElements) {
String key = current.getAttribute(INDEX_ATTR);
if (index.equals(key)) {
String libraries = current.getAttribute(LIB_ATTR);
if (StringUtils.isNotEmpty(index)) {
DynamicClassLoader classLoader = new DynamicClassLoader();
boolean putInCache = true;
if (StringUtils.isNotEmpty(libraries)) {
String[] librariesArray = libraries.split(SEPARATOR);
putInCache = loadLibraries(classLoader, librariesArray, showDownloadIfNotExist);
}
if (putInCache) {
// if any libraries can't be retreived , do not put it in cache
classLoadersMap.put(index, classLoader);
}
return classLoader;
}
}
}
}
return null;
}
private static boolean loadLibraries(DynamicClassLoader classLoader, String[] driversArray, boolean showDownloadIfNotExist) {
List<String> jarPathList = new ArrayList<String>();
if (driversArray == null || driversArray.length == 0) {
return true;
}
ILibraryManagerService librairesManagerService = (ILibraryManagerService) GlobalServiceRegister.getDefault().getService(
ILibraryManagerService.class);
String libPath = getLibPath();
List<String> driverNotExist = new ArrayList<String>();
for (String driverName : driversArray) {
String jarPath = libPath + PATH_SEPARATOR + driverName;
File jarFile = new File(jarPath);
if (!jarFile.exists()) {
driverNotExist.add(driverName);
}
jarPathList.add(jarFile.getAbsolutePath());
}
// retreive all needed libs in one time
boolean putInCache = false;
if (!driverNotExist.isEmpty()) {
putInCache = librairesManagerService.retrieve(driverNotExist, libPath, showDownloadIfNotExist,
new NullProgressMonitor());
}
classLoader.setLibStorePath(libPath);
classLoader.addLibraries(jarPathList);
return putInCache;
}
private static String getLibPath() {
File tmpFolder = getTmpFolder();
if (!tmpFolder.exists()) {
tmpFolder.mkdirs();
}
try {
tmpFolder = File.createTempFile("libs", null, tmpFolder); //$NON-NLS-1$
if (tmpFolder.exists() && tmpFolder.isFile()) {
tmpFolder.delete();
tmpFolder.mkdirs();
}
} catch (IOException e) {
// do nothing
}
return tmpFolder.getAbsolutePath();
}
private static File getTmpFolder() {
Project project = ProjectManager.getInstance().getCurrentProject();
IProject physProject;
String tmpFolderPath = System.getProperty("user.dir"); //$NON-NLS-1$
try {
physProject = ResourceUtils.getProject(project.getTechnicalLabel());
tmpFolderPath = physProject.getFolder("temp").getLocation().toPortableString(); //$NON-NLS-1$
} catch (Exception e) {
ExceptionHandler.process(e);
}
tmpFolderPath = tmpFolderPath + "/libraries"; //$NON-NLS-1$
return new File(tmpFolderPath);
}
public static String[] getDriverModuleList(IMetadataConnection metadataConn) {
String[] moduleList;
String distroKey = (String) metadataConn.getParameter(ConnParameterKeys.CONN_PARA_KEY_HIVE_DISTRIBUTION);
String distroVersion = (String) metadataConn.getParameter(ConnParameterKeys.CONN_PARA_KEY_HIVE_VERSION);
String hiveModel = (String) metadataConn.getParameter(ConnParameterKeys.CONN_PARA_KEY_HIVE_MODE);
if (HiveConnUtils.isCustomDistro(distroKey)) {
String jarsStr = (String) metadataConn.getParameter(ConnParameterKeys.CONN_PARA_KEY_HADOOP_CUSTOM_JARS);
moduleList = jarsStr.split(";");
} else {
String index = "HIVE" + ":" + distroKey + ":" + distroVersion + ":" + hiveModel; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
moduleList = getDriverModuleList(index);
}
return moduleList;
}
public static String[] getDriverModuleList(String connKeyString) {
if (connKeyString != null && configurationElements != null) {
for (IConfigurationElement current : configurationElements) {
String key = current.getAttribute(INDEX_ATTR);
if (connKeyString.equals(key)) {
String libraries = current.getAttribute(LIB_ATTR);
if (StringUtils.isNotEmpty(libraries)) {
String[] librariesArray = libraries.split(SEPARATOR);
return librariesArray;
}
}
}
}
return null;
}
}
// ============================================================================
//
// Copyright (C) 2006-2014 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core.classloader;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import org.apache.commons.lang.StringUtils;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Platform;
import org.talend.commons.exception.ExceptionHandler;
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.Project;
import org.talend.core.model.metadata.IMetadataConnection;
import org.talend.core.model.metadata.connection.hive.HiveConnUtils;
import org.talend.repository.ProjectManager;
import org.talend.utils.io.FilesUtils;
/**
* DOC ycbai class global comment. Detailled comment
*/
public class ClassLoaderFactory {
private final static String EXTENSION_POINT_ID = "org.talend.core.runtime.classloader_provider"; //$NON-NLS-1$
private static IConfigurationElement[] configurationElements = null;
private static Map<String, DynamicClassLoader> classLoadersMap = null;
private final static String SEPARATOR = ";"; //$NON-NLS-1$
private final static String PATH_SEPARATOR = "/"; //$NON-NLS-1$
private final static String INDEX_ATTR = "index"; //$NON-NLS-1$
private final static String LIB_ATTR = "libraries"; //$NON-NLS-1$
private final static String PARENT_ATTR = "parent"; //$NON-NLS-1$
static {
IExtensionRegistry registry = Platform.getExtensionRegistry();
configurationElements = registry.getConfigurationElementsFor(EXTENSION_POINT_ID);
}
/**
* DOC ycbai Comment method "getClassLoader".
*
* @param index
* @return the classLoader by index
*/
public static DynamicClassLoader getClassLoader(String index) {
return getClassLoader(index, true);
}
public static DynamicClassLoader getClassLoader(String index, boolean showDownloadIfNotExist) {
if (classLoadersMap == null) {
init();
}
DynamicClassLoader classLoader = classLoadersMap.get(index);
if (classLoader == null) {
classLoader = findLoader(index, showDownloadIfNotExist);
}
return classLoader;
}
public static DynamicClassLoader getCustomClassLoader(String index, String jarsStr) {
return getCustomClassLoader(index, jarsStr, SEPARATOR);
}
protected static DynamicClassLoader getCustomClassLoader(String index, String jars, String jarSeparator) {
Set<String> jarSet = new HashSet<String>();
if (StringUtils.isNotBlank(jars)) {
String[] jarsArray = jars.split(jarSeparator);
for (String jar : jarsArray) {
jarSet.add(jar);
}
}
return getCustomClassLoader(index, jarSet);
}
/**
* DOC ycbai Comment method "getCustomClassLoader".
*
* @param index
* @param libraries
* @return the classLoader by specific libraries
*/
public static DynamicClassLoader getCustomClassLoader(String index, Set<String> libraries) {
if (libraries == null || libraries.size() == 0) {
return null;
}
DynamicClassLoader classLoader = getClassLoader(index);
if (classLoader == null) {
classLoader = createCustomClassLoader(index, libraries);
} else {
boolean changed;
Set<String> oldLibraries = classLoader.getLibraries();
Set<String> oldLibrariesClone = new HashSet<String>(oldLibraries);
changed = oldLibrariesClone.retainAll(libraries);
if (!changed) {
Set<String> newLibrariesClone = new HashSet<String>(libraries);
changed = newLibrariesClone.retainAll(oldLibraries);
}
if (changed) {
File libFolder = new File(classLoader.getLibStorePath());
if (libFolder.exists()) {
FilesUtils.removeFolder(libFolder, true);
}
classLoader = createCustomClassLoader(index, libraries);
}
}
return classLoader;
}
private static DynamicClassLoader createCustomClassLoader(String index, Set<String> libraries) {
DynamicClassLoader classLoader = new DynamicClassLoader();
loadLibraries(classLoader, libraries.toArray(new String[0]), false);
classLoadersMap.put(index, classLoader);
return classLoader;
}
private static void init() {
File tmpFolder = getTmpFolder();
if (tmpFolder.exists()) {
FilesUtils.removeFolder(tmpFolder, true);
}
classLoadersMap = new ConcurrentHashMap<String, DynamicClassLoader>();
}
private static synchronized DynamicClassLoader findLoader(String index, boolean showDownloadIfNotExist) {
if (index != null && configurationElements != null) {
for (IConfigurationElement current : configurationElements) {
String key = current.getAttribute(INDEX_ATTR);
if (index.equals(key)) {
String libraries = current.getAttribute(LIB_ATTR);
if (StringUtils.isNotEmpty(index)) {
DynamicClassLoader classLoader = null;
DynamicClassLoader parentClassLoader = null;
String parentKey = current.getAttribute(PARENT_ATTR);
if (StringUtils.isNotEmpty(parentKey)) {
parentClassLoader = getClassLoader(parentKey, showDownloadIfNotExist);
}
if (parentClassLoader == null) {
classLoader = new DynamicClassLoader();
} else {
classLoader = new DynamicClassLoader(parentClassLoader);
}
boolean putInCache = true;
if (StringUtils.isNotEmpty(libraries)) {
String[] librariesArray = libraries.split(SEPARATOR);
putInCache = loadLibraries(classLoader, librariesArray, showDownloadIfNotExist);
}
if (putInCache) {
// if any libraries can't be retreived , do not put it in cache
classLoadersMap.put(index, classLoader);
}
return classLoader;
}
}
}
}
return null;
}
private static boolean loadLibraries(DynamicClassLoader classLoader, String[] driversArray, boolean showDownloadIfNotExist) {
List<String> jarPathList = new ArrayList<String>();
if (driversArray == null || driversArray.length == 0) {
return true;
}
ILibraryManagerService librairesManagerService = (ILibraryManagerService) GlobalServiceRegister.getDefault().getService(
ILibraryManagerService.class);
String libPath = getLibPath();
List<String> driverNotExist = new ArrayList<String>();
for (String driverName : driversArray) {
String jarPath = libPath + PATH_SEPARATOR + driverName;
File jarFile = new File(jarPath);
if (!jarFile.exists()) {
driverNotExist.add(driverName);
}
jarPathList.add(jarFile.getAbsolutePath());
}
// retreive all needed libs in one time
boolean putInCache = false;
if (!driverNotExist.isEmpty()) {
putInCache = librairesManagerService.retrieve(driverNotExist, libPath, showDownloadIfNotExist,
new NullProgressMonitor());
}
classLoader.setLibStorePath(libPath);
classLoader.addLibraries(jarPathList);
return putInCache;
}
public static String getLibPath() {
File tmpFolder = getTmpFolder();
if (!tmpFolder.exists()) {
tmpFolder.mkdirs();
}
try {
tmpFolder = File.createTempFile("libs", null, tmpFolder); //$NON-NLS-1$
if (tmpFolder.exists() && tmpFolder.isFile()) {
tmpFolder.delete();
tmpFolder.mkdirs();
}
} catch (IOException e) {
// do nothing
}
return tmpFolder.getAbsolutePath();
}
private static File getTmpFolder() {
Project project = ProjectManager.getInstance().getCurrentProject();
IProject physProject;
String tmpFolderPath = System.getProperty("user.dir"); //$NON-NLS-1$
try {
physProject = ResourceUtils.getProject(project.getTechnicalLabel());
tmpFolderPath = physProject.getFolder("temp").getLocation().toPortableString(); //$NON-NLS-1$
} catch (Exception e) {
ExceptionHandler.process(e);
}
tmpFolderPath = tmpFolderPath + "/libraries"; //$NON-NLS-1$
return new File(tmpFolderPath);
}
public static String[] getDriverModuleList(IMetadataConnection metadataConn) {
String[] moduleList;
String distroKey = (String) metadataConn.getParameter(ConnParameterKeys.CONN_PARA_KEY_HIVE_DISTRIBUTION);
String distroVersion = (String) metadataConn.getParameter(ConnParameterKeys.CONN_PARA_KEY_HIVE_VERSION);
String hiveModel = (String) metadataConn.getParameter(ConnParameterKeys.CONN_PARA_KEY_HIVE_MODE);
if (HiveConnUtils.isCustomDistro(distroKey)) {
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$
moduleList = getDriverModuleList(index);
}
return moduleList;
}
public static String[] getDriverModuleList(String connKeyString) {
if (connKeyString != null && configurationElements != null) {
for (IConfigurationElement current : configurationElements) {
String key = current.getAttribute(INDEX_ATTR);
if (connKeyString.equals(key)) {
String libraries = current.getAttribute(LIB_ATTR);
if (StringUtils.isNotEmpty(libraries)) {
String[] librariesArray = libraries.split(SEPARATOR);
return librariesArray;
}
}
}
}
return null;
}
}

View File

@@ -1,102 +1,168 @@
// ============================================================================
//
// Copyright (C) 2006-2014 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core.classloader;
import java.io.File;
import java.net.MalformedURLException;
import java.net.URISyntaxException;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.talend.commons.exception.ExceptionHandler;
/**
* DOC ycbai class global comment. Detailled comment
*/
public class DynamicClassLoader extends URLClassLoader {
private String libStorePath;
/**
* DOC ycbai DynamicClassLoader constructor comment.
*/
public DynamicClassLoader() {
super(new URL[0], DynamicClassLoader.class.getClassLoader());
}
public void addLibraries(String lib) {
if (lib != null) {
File libFile = new File(lib);
try {
addURL(libFile.toURI().toURL());
} catch (MalformedURLException e) {
ExceptionHandler.process(e);
}
}
}
public void addLibraries(List<String> libs) {
if (libs != null && libs.size() > 0) {
for (String lib : libs) {
addLibraries(lib);
}
}
}
/**
* DOC ycbai Comment method "getLibraries".
*
* <p>
* Get libraries which this classloader contains.
* </p>
*
* @return
*/
public Set<String> getLibraries() {
Set<String> set = new HashSet<String>();
URL[] urLs = getURLs();
if (urLs != null) {
for (URL url : urLs) {
try {
File file = new File(url.toURI());
set.add(file.getName());
} catch (URISyntaxException e) {
// dont care...
}
}
}
return set;
}
/**
* DOC ycbai Comment method "getLibStorePath".
*
* <p>
* Get folder path which stores libraries of classloader.
* </p>
*
* @return
*/
public String getLibStorePath() {
return this.libStorePath;
}
public void setLibStorePath(String libStorePath) {
this.libStorePath = libStorePath;
}
}
// ============================================================================
//
// Copyright (C) 2006-2014 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core.classloader;
import java.io.File;
import java.net.MalformedURLException;
import java.net.URISyntaxException;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.ILibraryManagerService;
/**
* DOC ycbai class global comment. Detailled comment
*/
public class DynamicClassLoader extends URLClassLoader {
private final static String PATH_SEPARATOR = "/"; //$NON-NLS-1$
private String libStorePath;
/**
* DOC ycbai DynamicClassLoader constructor comment.
*/
public DynamicClassLoader() {
this(new URL[0]);
}
public DynamicClassLoader(URL[] urls) {
super(urls);
}
public DynamicClassLoader(ClassLoader parent) {
this(new URL[0], parent);
}
public DynamicClassLoader(URL[] urls, ClassLoader parent) {
super(urls, parent);
}
public void addLibrary(String lib) {
if (lib != null) {
File libFile = new File(lib);
try {
addURL(libFile.toURI().toURL());
} catch (MalformedURLException e) {
ExceptionHandler.process(e);
}
}
}
public void addLibraries(List<String> libs) {
if (libs != null && libs.size() > 0) {
for (String lib : libs) {
addLibrary(lib);
}
}
}
/**
* DOC ycbai Comment method "getLibraries".
*
* <p>
* Get libraries which this classloader contains.
* </p>
*
* @return
*/
public Set<String> getLibraries() {
Set<String> set = new HashSet<String>();
URL[] urLs = getURLs();
if (urLs != null) {
for (URL url : urLs) {
try {
File file = new File(url.toURI());
set.add(file.getName());
} catch (URISyntaxException e) {
// dont care...
}
}
}
return set;
}
/**
* DOC ycbai Comment method "getLibStorePath".
*
* <p>
* Get folder path which stores libraries of classloader.
* </p>
*
* @return
*/
public String getLibStorePath() {
return this.libStorePath;
}
public void setLibStorePath(String libStorePath) {
this.libStorePath = libStorePath;
}
public static DynamicClassLoader createNewOneBaseLoader(DynamicClassLoader baseLoader, String[] addedJars,
String[] excludedJars) throws MalformedURLException {
if (baseLoader == null) {
baseLoader = new DynamicClassLoader();
}
if (addedJars == null) {
addedJars = new String[0];
}
if (excludedJars == null) {
excludedJars = new String[0];
}
URL[] baseURLs = baseLoader.getURLs();
String libPath = baseLoader.getLibStorePath();
if (libPath == null) {
libPath = ClassLoaderFactory.getLibPath();
}
List<URL> urlList = new ArrayList<URL>(Arrays.asList(baseURLs));
updateLoaderURLs(urlList, libPath, addedJars, true);
updateLoaderURLs(urlList, libPath, excludedJars, false);
DynamicClassLoader loader = new DynamicClassLoader(urlList.toArray(new URL[0]));
loader.setLibStorePath(libPath);
return loader;
}
private static void updateLoaderURLs(List<URL> urlList, String libPath, String[] jars, boolean added)
throws MalformedURLException {
for (String jarName : jars) {
if (added) {
ILibraryManagerService librairesService = (ILibraryManagerService) GlobalServiceRegister.getDefault().getService(
ILibraryManagerService.class);
librairesService.retrieve(jarName, libPath, true, new NullProgressMonitor());
}
String jarPath = libPath + PATH_SEPARATOR + jarName;
File jarFile = new File(jarPath);
URL jarUrl = jarFile.toURI().toURL();
if (jarFile.exists()) {
if (added && !urlList.contains(jarUrl)) {
urlList.add(jarUrl);
}
if (!added && urlList.contains(jarUrl)) {
urlList.remove(jarUrl);
}
}
}
}
}

View File

@@ -113,7 +113,8 @@ public enum EDatabaseTypeName {
REDSHIFT(
"Redshift", "Redshift", Boolean.TRUE, "REDSHIFT", "REDSHIFT", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.Schema), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
IMPALA("IMPALA", "Impala", Boolean.TRUE, "IMPALA", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.None), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
IMPALA(
"IMPALA", "Impala", Boolean.TRUE, "IMPALA", EDatabaseSchemaOrCatalogMapping.None, EDatabaseSchemaOrCatalogMapping.Schema), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
HBASE(
"HBase", "HBase", Boolean.FALSE, "HBASE", EDatabaseSchemaOrCatalogMapping.Sid, EDatabaseSchemaOrCatalogMapping.Column_Family, true); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$

View File

@@ -50,10 +50,18 @@ public class ConnParameterKeys {
public static final String CONN_PARA_KEY_USE_KRB = "CONN_PARA_KEY_USE_KRB"; //$NON-NLS-1$
public static final String CONN_PARA_KEY_USEKEYTAB = "CONN_PARA_KEY_USEKEYTAB";//$NON-NLS-1$
public static final String CONN_PARA_KEY_KEYTAB_PRINCIPAL = "CONN_PARA_KEY_KEYTAB_PRINCIPLA";//$NON-NLS-1$
public static final String CONN_PARA_KEY_KEYTAB = "CONN_PARA_KEY_KEYTAB";//$NON-NLS-1$
public static final String CONN_PARA_KEY_NAME_NODE_PRINCIPAL = "CONN_PARA_KEY_NAME_NODE_PRINCIPAL"; //$NON-NLS-1$
public static final String CONN_PARA_KEY_JOB_TRACKER_PRINCIPAL = "CONN_PARA_KEY_JOB_TRACKER_PRINCIPAL"; //$NON-NLS-1$
public static final String CONN_PARA_KEY_JOB_HISTORY_PRINCIPAL = "CONN_PARA_KEY_JOB_HISTORY_PRINCIPAL"; //$NON-NLS-1$
public static final String CONN_PARA_KEY_USERNAME = "CONN_PARA_KEY_USERNAME"; //$NON-NLS-1$
/**
@@ -81,6 +89,8 @@ public class ConnParameterKeys {
public static final String CONN_PARA_KEY_HIVE_PROPERTIES = "CONN_PARA_KEY_HIVE_PROPERTIES"; //$NON-NLS-1$
public static final String CONN_PARA_KEY_HIVE_JDBC_PROPERTIES = "CONN_PARA_KEY_HIVE_JDBC_PROPERTIES"; //$NON-NLS-1$
public static final String HIVE_AUTHENTICATION_HIVEPRINCIPLA = "HIVE_AUTHENTICATION_HIVEPRINCIPLA";//$NON-NLS-1$
public static final String HIVE_AUTHENTICATION_METASTOREURL = "HIVE_AUTHENTICATION_METASTOREURL";//$NON-NLS-1$
@@ -93,12 +103,6 @@ public class ConnParameterKeys {
public static final String HIVE_AUTHENTICATION_PASSWORD = "HIVE_AUTHENTICATION_PASSWORD";//$NON-NLS-1$
public static final String HIVE_AUTHENTICATION_USEKEYTAB = "HIVE_AUTHENTICATION_USEKEYTAB";//$NON-NLS-1$
public static final String HIVE_AUTHENTICATION_PRINCIPLA = "HIVE_AUTHENTICATION_PRINCIPLA";//$NON-NLS-1$
public static final String HIVE_AUTHENTICATION_KEYTAB = "HIVE_AUTHENTICATION_KEYTAB";//$NON-NLS-1$
/**
* The key is for metastore server.
*/
@@ -143,6 +147,10 @@ public class ConnParameterKeys {
public static final String CONN_PARA_KEY_HBASE_PROPERTIES = "CONN_PARA_KEY_HBASE_PROPERTIES"; //$NON-NLS-1$
public static final String CONN_PARA_KEY_HBASE_AUTHENTICATION_MASTERPRINCIPAL = "CONN_PARA_KEY_HBASE_AUTHENTICATION_MASTERPRINCIPAL";//$NON-NLS-1$
public static final String CONN_PARA_KEY_HBASE_AUTHENTICATION_REGIONSERVERPRINCIPAL = "CONN_PARA_KEY_HBASE_AUTHENTICATION_REGIONSERVERPRINCIPAL";//$NON-NLS-1$
/**
* Impala keys.
*/

View File

@@ -369,7 +369,11 @@ public class DatabaseConnStrUtil {
if (stringConnection.contains("(description=(address=(protocol=tcp)")) { //$NON-NLS-1$
return EDatabaseConnTemplate.ORACLESN.getDBDisplayName();
} else if (!startTemplateString.equals("") && startTemplateString.equals(startStringConnection)) {
return template.getDBDisplayName();
if (isHive2EmbeddedUrlString(currentDbType, startStringConnection)) {
return currentDbType;
} else {
return template.getDBDisplayName();
}
}
}
}
@@ -378,6 +382,12 @@ public class DatabaseConnStrUtil {
return currentDbType;
}
private static boolean isHive2EmbeddedUrlString(String currentDbType, String urlStringOfConnection) {
// Since Impla has same url string with Hive2 embedded mode,need to judge more
return currentDbType.equals(EDatabaseConnTemplate.HIVE.getDBDisplayName())
&& urlStringOfConnection.equals(getHive2EmbeddedURLString());
}
// test
public static void main(String[] args) {
for (EDatabaseConnTemplate temp : EDatabaseConnTemplate.values()) {

View File

@@ -52,6 +52,8 @@ public enum EDatabaseVersion4Drivers {
HSQLDB_SERVER(new DbVersion4Drivers(EDatabaseTypeName.HSQLDB_SERVER, "hsqldb.jar")), //$NON-NLS-1$
HSQLDB_WEBSERVER(new DbVersion4Drivers(EDatabaseTypeName.HSQLDB_WEBSERVER, "hsqldb.jar")), //$NON-NLS-1$
H2(new DbVersion4Drivers(EDatabaseTypeName.H2, "h2-1.3.160.jar")), //$NON-NLS-1$
//
JAVADB_EMBEDED(new DbVersion4Drivers(EDatabaseTypeName.JAVADB_EMBEDED, "derby.jar")), //$NON-NLS-1$
SQLITE(new DbVersion4Drivers(EDatabaseTypeName.SQLITE, "sqlitejdbc-v056.jar")), //$NON-NLS-1$
@@ -150,6 +152,12 @@ public enum EDatabaseVersion4Drivers {
"slf4j-log4j12-1.6.1.jar", "hive-exec-0.12.0-cdh5.0.4.jar", "httpcore-4.2.5.jar", "httpclient-4.2.5.jar",
"hadoop-core-1.0.0.jar" })),
IMPALA_CDH5_4(new DbVersion4Drivers(EDatabaseTypeName.IMPALA, "Cloudera 5.4", "Cloudera_CDH5_4", new String[] {
"hive-metastore-1.1.0-cdh5.4.0.jar", "hive-jdbc-1.1.0-cdh5.4.0.jar", "hive-service-1.1.0-cdh5.4.0.jar",
"hive-common-1.1.0-cdh5.4.0.jar", "libthrift-0.9.2.jar", "libfb303-0.9.2.jar", "hadoop-common-2.6.0-cdh5.4.0.jar",
"httpcore-4.2.5.jar", "httpclient-4.2.5.jar", "commons-logging-1.1.3.jar", "slf4j-api-1.7.5.jar",
"slf4j-log4j12-1.7.5.jar", "log4j-1.2.17.jar", "guava-11.0.2.jar" })),
REDSHIFT(new DbVersion4Drivers(EDatabaseTypeName.REDSHIFT, "paraccel-jdbc.jar")); //$NON-NLS-1$
private DbVersion4Drivers dbVersionBean;
@@ -184,7 +192,8 @@ public enum EDatabaseVersion4Drivers {
public boolean supportDatabase(String dbType) {
if (dbType != null) {
for (EDatabaseTypeName type : getSupportDbTypes()) {
if (type.getXmlName().equalsIgnoreCase(dbType) || type.getDisplayName().equalsIgnoreCase(dbType)) {
if (type.getXmlName().equalsIgnoreCase(dbType) || type.getDisplayName().equalsIgnoreCase(dbType)
|| type.getXMLType().equalsIgnoreCase(dbType)) {
return true;
}
}

View File

@@ -17,7 +17,9 @@ import java.util.List;
public enum EImpalaDistribution4Versions {
CLOUDERA_CDH5_1(EImpalaDistributions.CLOUDERA, "Cloudera CDH5.1", "Cloudera_CDH5_1"),
CLOUDERA_CDH5_4(EImpalaDistributions.CLOUDERA, "Cloudera CDH5.4", EDatabaseVersion4Drivers.IMPALA_CDH5_4.getVersionValue()),
CLOUDERA_CDH5_1(EImpalaDistributions.CLOUDERA, "Cloudera CDH5.1", EDatabaseVersion4Drivers.IMPALA_CDH5.getVersionValue()),
CUSTOM(EImpalaDistributions.CUSTOM, "", "");

View File

@@ -21,6 +21,9 @@ import org.talend.core.hadoop.version.EHadoopVersion4Drivers;
* DOC ycbai class global comment. Detailled comment
*/
public enum EHBaseDistribution4Versions {
HDP_2_2(EHBaseDistributions.HORTONWORKS, EHadoopVersion4Drivers.HDP_2_2.getVersionDisplay(), EHadoopVersion4Drivers.HDP_2_2
.getVersionValue()),
HDP_2_1(EHBaseDistributions.HORTONWORKS, EHadoopVersion4Drivers.HDP_2_1.getVersionDisplay(), EHadoopVersion4Drivers.HDP_2_1
.getVersionValue()),
@@ -56,6 +59,11 @@ public enum EHBaseDistribution4Versions {
EHadoopVersion4Drivers.APACHE_1_0_0.getVersionDisplay(),
EHadoopVersion4Drivers.APACHE_1_0_0.getVersionValue()),
CLOUDERA_CDH5_4(
EHBaseDistributions.CLOUDERA,
EHadoopVersion4Drivers.CLOUDERA_CDH5_4.getVersionDisplay(),
EHadoopVersion4Drivers.CLOUDERA_CDH5_4.getVersionValue()),
CLOUDERA_CDH5_1(
EHBaseDistributions.CLOUDERA,
EHadoopVersion4Drivers.CLOUDERA_CDH5_1.getVersionDisplay(),

View File

@@ -0,0 +1,37 @@
// ============================================================================
//
// Copyright (C) 2006-2014 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core.exception;
import java.sql.SQLException;
/**
* created by ycbai on 2014年11月17日 Detailled comment
*
*/
public class WarningSQLException extends SQLException {
private static final long serialVersionUID = 6001838275838161372L;
public WarningSQLException(String reason) {
super(reason);
}
public WarningSQLException(String reason, Throwable cause) {
super(reason, cause);
}
public WarningSQLException(Throwable cause) {
super(cause);
}
}

View File

@@ -26,6 +26,8 @@ public enum EHadoopConfigurationJars {
HIVE(new String[] { "hadoop-conf.jar" }, new String[] { "hadoop-conf-kerberos.jar" }), //$NON-NLS-1$ //$NON-NLS-2$
HBASE(new String[] { "hadoop-conf.jar" }, new String[] { "hadoop-conf-kerberos.jar" }), //$NON-NLS-1$ //$NON-NLS-2$
;
private String[] disableSecurityJars;

View File

@@ -0,0 +1,197 @@
// ============================================================================
//
// Copyright (C) 2006-2014 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core.hadoop;
import java.net.MalformedURLException;
import java.util.Set;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.core.classloader.ClassLoaderFactory;
import org.talend.core.classloader.DynamicClassLoader;
/**
*
* created by ycbai on Aug 11, 2014 Detailled comment
*
* <p>
* TODO: Need to improve it and replace {@link HadoopClassLoaderFactory} with it after.
* </p>
*
*/
public class HadoopClassLoaderFactory2 {
public static ClassLoader getHDFSClassLoader(String distribution, String version, boolean useKrb) {
return getClassLoader(EHadoopCategory.HDFS, distribution, version, useKrb);
}
public static ClassLoader getMRClassLoader(String distribution, String version, boolean useKrb) {
return getClassLoader(EHadoopCategory.MAP_REDUCE, distribution, version, useKrb);
}
public static ClassLoader getHiveEmbeddedClassLoader(String distribution, String version, boolean useKrb) {
return getClassLoader(EHadoopCategory.HIVE, distribution, version, useKrb, IHadoopArgs.HIVE_ARG_EMBEDDED);
}
public static ClassLoader getHiveStandaloneClassLoader(String distribution, String version, boolean useKrb) {
return getClassLoader(EHadoopCategory.HIVE, distribution, version, useKrb, IHadoopArgs.HIVE_ARG_STANDALONE);
}
public static ClassLoader getHBaseClassLoader(String distribution, String version, boolean useKrb) {
return getClassLoader(EHadoopCategory.HBASE, distribution, version, useKrb);
}
public static ClassLoader getHadoopCustomClassLoader(String uid, Object customJars) {
return HadoopClassLoaderFactory2.builder().withTypePrefix(EHadoopCategory.CUSTOM.getName()).withUid(uid)
.build(customJars, true);
}
/**
* DOC ycbai Comment method "builder".
*
* <p>
* Build the classloader with some options.
* <p>
*
* @return
*/
public static HadoopClassLoaderFactory2.Builder builder() {
return new HadoopClassLoaderFactory2.Builder();
}
/**
*
* created by ycbai on Aug 11, 2014 Detailled comment
*
*/
public static class Builder {
private static final String INDEX_SEP = ":"; //$NON-NLS-1$
private StringBuffer indexBuffer = new StringBuffer();
public Builder withTypePrefix(String typePrefix) {
withArg(typePrefix);
return this;
}
public Builder withDistribution(String distribution) {
withArg(distribution);
return this;
}
public Builder withVersion(String version) {
withArg(version);
return this;
}
public Builder withUid(String uid) {
withArg(uid);
return this;
}
public Builder withArg(String arg) {
indexBuffer.append(INDEX_SEP).append(arg);
return this;
}
public ClassLoader build() {
return build(null, true);
}
public ClassLoader build(boolean showDownloadIfNotExist) {
return build(null, showDownloadIfNotExist);
}
public ClassLoader build(Object extraArg, boolean showDownloadIfNotExist) {
if (indexBuffer.length() > 0) { // Remove the first colon.
indexBuffer.deleteCharAt(0);
}
return getClassLoader(indexBuffer.toString(), extraArg, showDownloadIfNotExist);
}
}
public static ClassLoader getClassLoader(EHadoopCategory category, String distribution, String version, boolean useKrb,
String... extraArgs) {
Builder builder = HadoopClassLoaderFactory2.builder().withTypePrefix(category.getName()).withDistribution(distribution)
.withVersion(version);
if (extraArgs != null && extraArgs.length > 0) {
for (String arg : extraArgs) {
builder.withArg(arg);
}
}
ClassLoader classLoader = builder.build();
if (classLoader instanceof DynamicClassLoader && useKrb) {
classLoader = createSecurityLoader(category, (DynamicClassLoader) classLoader);
}
return classLoader;
}
private static ClassLoader getClassLoader(String index, Object extraJars, boolean showDownloadIfNotExist) {
ClassLoader loader = null;
if (index.startsWith(EHadoopCategory.CUSTOM.getName())) {
loader = getCustomClassLoader(index, extraJars, showDownloadIfNotExist);
} else {
loader = ClassLoaderFactory.getClassLoader(index, showDownloadIfNotExist);
}
if (loader == null) {
loader = HadoopClassLoaderFactory2.class.getClassLoader();
}
return loader;
}
@SuppressWarnings("unchecked")
private static ClassLoader getCustomClassLoader(String index, Object customJars, boolean showDownloadIfNotExist) {
if (customJars instanceof Set) {
return ClassLoaderFactory.getCustomClassLoader(index, (Set<String>) customJars);
}
return ClassLoaderFactory.getCustomClassLoader(index, String.valueOf(customJars));
}
private static DynamicClassLoader createSecurityLoader(EHadoopCategory category, DynamicClassLoader loader) {
String[] securityJars;
switch (category) {
case HDFS:
securityJars = EHadoopConfigurationJars.HDFS.getEnableSecurityJars();
break;
case MAP_REDUCE:
securityJars = EHadoopConfigurationJars.MAP_REDUCE.getEnableSecurityJars();
break;
case HCATALOG:
securityJars = EHadoopConfigurationJars.HCATALOG.getEnableSecurityJars();
break;
case HIVE:
securityJars = EHadoopConfigurationJars.HIVE.getEnableSecurityJars();
break;
case HBASE:
securityJars = EHadoopConfigurationJars.HBASE.getEnableSecurityJars();
break;
default:
securityJars = new String[0];
break;
}
DynamicClassLoader securityClassLoader = null;
try {
securityClassLoader = DynamicClassLoader.createNewOneBaseLoader(loader, securityJars, null);
} catch (MalformedURLException e) {
ExceptionHandler.process(e);
}
return securityClassLoader;
}
}

View File

@@ -0,0 +1,25 @@
// ============================================================================
//
// Copyright (C) 2006-2014 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core.hadoop;
/**
* created by ycbai on Aug 15, 2014 Detailled comment
*
*/
public interface IHadoopArgs {
public static final String HIVE_ARG_EMBEDDED = "EMBEDDED"; //$NON-NLS-1$
public static final String HIVE_ARG_STANDALONE = "STANDALONE"; //$NON-NLS-1$
}

View File

@@ -192,4 +192,6 @@ public interface IHadoopClusterService extends IService {
*/
public boolean hasDiffsFromClusterToProcess(Item item, IProcess process);
public String getHadoopClusterProperties(Connection hadoopSubConnection);
}

View File

@@ -30,6 +30,8 @@ public enum EHadoopProperties {
RESOURCE_MANAGER_PRINCIPAL,
JOBHISTORY_PRINCIPAL,
HIVE_PRINCIPAL,
DATABASE,

View File

@@ -16,8 +16,13 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang.StringUtils;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.hadoop.IHadoopClusterService;
import org.talend.core.model.metadata.builder.connection.Connection;
import org.talend.core.utils.TalendQuoteUtils;
import org.talend.utils.json.JSONArray;
import org.talend.utils.json.JSONException;
@@ -40,24 +45,29 @@ public class HadoopRepositoryUtil {
* @return
* @throws JSONException
*/
public static String getHadoopPropertiesJsonStr(List<HashMap<String, Object>> properties) throws JSONException {
JSONArray jsonArr = new JSONArray();
if (properties != null && properties.size() > 0) {
for (HashMap<String, Object> map : properties) {
JSONObject object = new JSONObject();
Iterator<String> it = map.keySet().iterator();
while (it.hasNext()) {
String key = it.next();
object.put(key, map.get(key));
public static String getHadoopPropertiesJsonStr(List<Map<String, Object>> properties) {
JSONArray jsonArr = null;
try {
jsonArr = new JSONArray();
if (properties != null && properties.size() > 0) {
for (Map<String, Object> map : properties) {
JSONObject object = new JSONObject();
Iterator<String> it = map.keySet().iterator();
while (it.hasNext()) {
String key = it.next();
object.put(key, map.get(key));
}
jsonArr.put(object);
}
jsonArr.put(object);
}
} catch (JSONException e) {
ExceptionHandler.process(e);
}
return jsonArr.toString();
}
public static List<HashMap<String, Object>> getHadoopPropertiesList(String propertiesJsonStr) throws JSONException {
public static List<Map<String, Object>> getHadoopPropertiesList(String propertiesJsonStr) {
return getHadoopPropertiesList(propertiesJsonStr, false);
}
@@ -73,26 +83,72 @@ public class HadoopRepositoryUtil {
* @return
* @throws JSONException
*/
public static List<HashMap<String, Object>> getHadoopPropertiesList(String propertiesJsonStr, boolean includeQuotes)
throws JSONException {
List<HashMap<String, Object>> properties = new ArrayList<HashMap<String, Object>>();
if (StringUtils.isNotEmpty(propertiesJsonStr)) {
JSONArray jsonArr = new JSONArray(propertiesJsonStr);
for (int i = 0; i < jsonArr.length(); i++) {
HashMap<String, Object> map = new HashMap<String, Object>();
JSONObject object = jsonArr.getJSONObject(i);
Iterator<String> it = object.keys();
while (it.hasNext()) {
String key = it.next();
String value = String.valueOf(object.get(key));
if (includeQuotes) {
value = TalendQuoteUtils.addQuotesIfNotExist(value);
} else {
value = TalendQuoteUtils.removeQuotesIfExist(value);
public static List<Map<String, Object>> getHadoopPropertiesList(String propertiesJsonStr, boolean includeQuotes) {
List<Map<String, Object>> properties = new ArrayList<Map<String, Object>>();
try {
if (StringUtils.isNotEmpty(propertiesJsonStr)) {
JSONArray jsonArr = new JSONArray(propertiesJsonStr);
for (int i = 0; i < jsonArr.length(); i++) {
HashMap<String, Object> map = new HashMap<String, Object>();
JSONObject object = jsonArr.getJSONObject(i);
Iterator<String> it = object.keys();
while (it.hasNext()) {
String key = it.next();
String value = String.valueOf(object.get(key));
if (includeQuotes) {
value = TalendQuoteUtils.addQuotesIfNotExist(value);
} else {
value = TalendQuoteUtils.removeQuotesIfExist(value);
}
map.put(key, value);
}
map.put(key, value);
properties.add(map);
}
}
} catch (JSONException e) {
ExceptionHandler.process(e);
}
return properties;
}
/**
* DOC ycbai Comment method "getHadoopPropertiesFullList".
*
* <p>
* Get the full list type of hadoop properties (with the parent properties of the hadoop cluster it belongs) from
* json string.
* </p>
*
* @param connection
* @param propertiesJsonStr
* @param includeQuotes
* @return
*/
public static List<Map<String, Object>> getHadoopPropertiesFullList(Connection connection, String propertiesJsonStr,
boolean includeQuotes) {
IHadoopClusterService hadoopClusterService = null;
if (GlobalServiceRegister.getDefault().isServiceRegistered(IHadoopClusterService.class)) {
hadoopClusterService = (IHadoopClusterService) GlobalServiceRegister.getDefault().getService(
IHadoopClusterService.class);
}
List<Map<String, Object>> parentProperties = null;
if (hadoopClusterService != null) {
parentProperties = getHadoopPropertiesList(hadoopClusterService.getHadoopClusterProperties(connection), true);
}
List<Map<String, Object>> properties = getHadoopPropertiesList(propertiesJsonStr, true);
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$
propertiesMap.put(property, proMap);
}
if (parentProperties != null) {
for (Map<String, Object> parentProMap : parentProperties) {
String property = String.valueOf(parentProMap.get("PROPERTY")); //$NON-NLS-1$
if (!propertiesMap.containsKey(property)) {
propertiesMap.put(property, parentProMap);
properties.add(parentProMap);
}
properties.add(map);
}
}

View File

@@ -22,6 +22,12 @@ import org.apache.commons.lang.ArrayUtils;
*/
public enum EHadoopVersion4Drivers {
HDP_2_2(EHadoopDistributions.HORTONWORKS, "Hortonworks Data Platform V2.2.0", //$NON-NLS-1$
"HDP_2_2", //$NON-NLS-1$
true,
false,
new EMRVersion[] { EMRVersion.YARN }),
HDP_2_1(EHadoopDistributions.HORTONWORKS, "Hortonworks Data Platform V2.1.0(Baikal)", //$NON-NLS-1$
"HDP_2_1", //$NON-NLS-1$
true,
@@ -48,6 +54,12 @@ public enum EHadoopVersion4Drivers {
APACHE_0_20_2(EHadoopDistributions.APACHE, "Apache 0.20.2", "APACHE_0_20_2", false, true), //$NON-NLS-1$ //$NON-NLS-2$
CLOUDERA_CDH5_4(EHadoopDistributions.CLOUDERA, "Cloudera CDH5.4(YARN mode)", //$NON-NLS-1$
"Cloudera_CDH5_4", //$NON-NLS-1$
true,
false,
new EMRVersion[] { EMRVersion.YARN }),
CLOUDERA_CDH5_1(EHadoopDistributions.CLOUDERA, "Cloudera CDH5.1(YARN mode)", //$NON-NLS-1$
"Cloudera_CDH5_1", //$NON-NLS-1$
true,

View File

@@ -148,6 +148,7 @@ public class HadoopCustomVersionDefineDialog extends TitleAreaDialog {
super(parentShell);
this.currentLibMap = currentLibMap;
customLibUtil = new HadoopCustomLibrariesUtil();
initLibMap();
}
@Override
@@ -441,6 +442,22 @@ public class HadoopCustomVersionDefineDialog extends TitleAreaDialog {
private void init() {
libsManager = CustomVersionLibsManager.getInstance();
// initLibMap();// move it to constructor
ECustomVersionGroup selectedType = getSelectedType();
if (selectedType != null) {
selectLibFileSet = libMap.get(selectedType.getName());
viewer.setInput(selectLibFileSet);
}
}
/**
* Initialize the libMap.<br>
* <b>NOTE:</b><br>
* 1. Can call this method when currentLibMap is changed;<br>
* 2. This method will be called automatically in the constructor.
*/
public void initLibMap() {
if (currentLibMap != null) {
ECustomVersionGroup[] groups = ECustomVersionGroup.values();
for (ECustomVersionGroup group : groups) {
@@ -451,11 +468,6 @@ public class HadoopCustomVersionDefineDialog extends TitleAreaDialog {
libMap.put(group.getName(), customLibUtil.convertToLibraryFile(set));
}
}
ECustomVersionGroup selectedType = getSelectedType();
if (selectedType != null) {
selectLibFileSet = libMap.get(selectedType.getName());
viewer.setInput(selectLibFileSet);
}
}
private boolean isSupportHadoop() {

View File

@@ -31,21 +31,21 @@ import org.talend.core.model.temp.ECodePart;
*/
public interface IComponent {
String JOBLET_PID = "org.talend.designer.joblet"; //$NON-NLS-1$
String JOBLET_PID = "org.talend.designer.joblet"; //$NON-NLS-1$
String PROP_NAME = "NAME"; //$NON-NLS-1$
String PROP_NAME = "NAME"; //$NON-NLS-1$
String PROP_LONG_NAME = "LONG_NAME"; //$NON-NLS-1$
String PROP_LONG_NAME = "LONG_NAME"; //$NON-NLS-1$
String PROP_FAMILY = "FAMILY"; //$NON-NLS-1$
String PROP_FAMILY = "FAMILY"; //$NON-NLS-1$
String PROP_MENU = "MENU"; //$NON-NLS-1$
String PROP_MENU = "MENU"; //$NON-NLS-1$
String PROP_LINK = "LINK"; //$NON-NLS-1$
String PROP_LINK = "LINK"; //$NON-NLS-1$
String PROP_HELP = "HELP"; //$NON-NLS-1$
String PROP_HELP = "HELP"; //$NON-NLS-1$
String FAMILY = "Joblets";//$NON-NLS-1$
String FAMILY = "Joblets"; //$NON-NLS-1$
public String getName();
@@ -151,6 +151,8 @@ public interface IComponent {
public String getRepositoryType();
public boolean isLog4JEnabled();
/**
* This is just added in <code>HEADER</code>, it is used to present the component belongs to common process, M/R
* process and etc. About the type please refer to the {@link ComponentCategory}. Added by Marvin Wang on Jan 11,

View File

@@ -12,6 +12,7 @@
// ============================================================================
package org.talend.core.model.context;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
@@ -21,6 +22,7 @@ import java.util.Map;
import java.util.Set;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jdt.core.JavaConventions;
import org.eclipse.jdt.core.JavaCore;
import org.talend.commons.exception.ExceptionHandler;
@@ -51,16 +53,26 @@ import org.talend.repository.model.IProxyRepositoryFactory;
*/
public class ContextUtils {
private static final Set<String> JAVA_KEYWORDS = new HashSet<String>(Arrays.asList("abstract", "continue", "for", "new", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
"switch", "assert", "default", "goto", "package", "synchronized", "boolean", "do", "if", "private", "this", "break", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$ //$NON-NLS-11$ //$NON-NLS-12$
"double", "implements", "protected", "throw", "byte", "else", "import", "public", "throws", "case", "enum", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$ //$NON-NLS-11$
"instanceof", "return", "transient", "catch", "extends", "int", "short", "try", "char", "final", "interface", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$ //$NON-NLS-11$
"static", "void", "class", "finally", "long", "strictfp", "volatile", "const", "float", "native", "super", "while")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$ //$NON-NLS-11$ //$NON-NLS-12$
/**
*
* ggu Comment method "isJavaKeyWords".
*
*/
public static boolean isJavaKeyWords(final String name) {
IStatus status = JavaConventions.validateFieldName(name, JavaCore.getOption(JavaCore.COMPILER_SOURCE),
JavaCore.getOption(JavaCore.COMPILER_COMPLIANCE));
if (status.getSeverity() == IStatus.ERROR) {
return true;
if (Platform.isRunning()) {
IStatus status = JavaConventions.validateFieldName(name, JavaCore.getOption(JavaCore.COMPILER_SOURCE),
JavaCore.getOption(JavaCore.COMPILER_COMPLIANCE));
if (status.getSeverity() == IStatus.ERROR) {
return true;
}
} else {// MOD sizhaoliu TDQ-9679 avoid calling JavaCore class when this method is called in components
return name == null ? false : JAVA_KEYWORDS.contains(name.toLowerCase());
}
return false;
}
@@ -132,9 +144,10 @@ public class ContextUtils {
ContextType defaultContextType = null;
for (ContextType type : contextTypeList) {
// Modified by Marvin Wang on Jun. 21, 2012 for bug TDI-21009. To avoid case sensitive.
if (contextName != null && type.getName().toLowerCase().equals(contextName.toLowerCase())) {
if (contextName != null && type.getName() != null && type.getName().toLowerCase().equals(contextName.toLowerCase())) {
contextType = type;
} else if (defaultContextName != null && type.getName().toLowerCase().equals(defaultContextName.toLowerCase())) {
} else if (defaultContextName != null && type.getName() != null
&& type.getName().toLowerCase().equals(defaultContextName.toLowerCase())) {
defaultContextType = type;
}
}
@@ -485,6 +498,12 @@ public class ContextUtils {
// if (!sourceParam.getName().equals(targetParamType.getName())) {
// return false;
// }
if (sourceParam.getComment() == null) {
sourceParam.setComment("");
}
if (targetParamType.getComment() == null) {
targetParamType.setComment("");
}
if (!sourceParam.getComment().equals(targetParamType.getComment())) {
return false;
}

View File

@@ -44,7 +44,6 @@ public class ConnectionBean implements Cloneable {
private static final String USER = "user"; //$NON-NLS-1$
// this is kept for compatibility purpose but not used anymore.
private static final String WORKSPACE = "workSpace"; //$NON-NLS-1$
private static final String DYNAMICFIELDS = "dynamicFields"; //$NON-NLS-1$
@@ -226,7 +225,35 @@ public class ConnectionBean implements Cloneable {
}
}
@Deprecated
/**
* Getter for workSpace.
*
* @return the workSpace
*/
public String getWorkSpace() {
try {
if (conDetails.has(WORKSPACE)) {
return conDetails.getString(WORKSPACE);
}
} catch (JSONException e) {
ExceptionHandler.process(e);
}
return "";
}
/**
* Sets the workSpace.
*
* @param workSpace the workSpace to set
*/
public void setWorkSpace(String workSpace) {
try {
conDetails.put(WORKSPACE, workSpace);
} catch (JSONException e) {
ExceptionHandler.process(e);
}
}
public Map<String, String> getDynamicFields() {
return dynamicFields;
}
@@ -274,7 +301,7 @@ public class ConnectionBean implements Cloneable {
toReturn.setDescription(st[i++]);
toReturn.setUser(st[i++]);
toReturn.setPassword(st[i++]);
i++;// because of TUP-1785, workspace removed from connections
toReturn.setWorkSpace(st[i++]);
toReturn.setComplete(new Boolean(st[i++]));
JSONObject dynamicJson = new JSONObject();
toReturn.getConDetails().put(DYNAMICFIELDS, dynamicJson);

View File

@@ -70,6 +70,11 @@ public class Project {
this.project = project;
}
public Project(org.talend.core.model.properties.Project project, boolean isMainProject) {
this.project = project;
mainProject = isMainProject;
}
public Project(String label) {
this.project = PropertiesFactory.eINSTANCE.createProject();
project.setLabel(label);

View File

@@ -0,0 +1,22 @@
// ============================================================================
//
// Copyright (C) 2006-2014 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core.model.metadata;
/**
* created by ldong on Jan 13, 2015 Detailled comment
*
*/
public interface IDatabaseConstant {
public static final String REDSHIFT = "DATABASE:REDSHIFT";
}

View File

@@ -240,12 +240,14 @@ public class MappingTypeRetriever {
DbPreBeforeLength dbPBL = (DbPreBeforeLength) preBeforeLen.get(i);
if (dbPBL.getDbType().equals(dbType)) {
before = dbPBL.getPreBeforeLen();
if (before == null)
if (before == null) {
return false;
if (before.equals("true")) //$NON-NLS-1$
}
if (before.equals("true")) { //$NON-NLS-1$
return true;
else
} else {
return false;
}
}
}
return false;
@@ -299,7 +301,7 @@ public class MappingTypeRetriever {
if (!corePluginNode.getBoolean(ITalendCorePrefConstants.FORBIDDEN_MAPPING_LENGTH_PREC_LOGIC, false)) {
TalendTypePreLenRetriever talendTypePre = new TalendTypePreLenRetriever(mappingTypeOrigin, length, precison);
String mappingType = talendTypePre.getMappingType();
if (listMappingtype.size() != 0) {
if (listMappingtype != null && listMappingtype.size() != 0) {
for (MappingType type : listMappingtype) {
if (type.getTalendType().equals(mappingType)) {
return type.getTalendType();

View File

@@ -206,6 +206,7 @@ public class MetadataSchema {
final Node defaultValue = nodeMap.getNamedItem("default"); //$NON-NLS-1$
final Node comment = nodeMap.getNamedItem("comment"); //$NON-NLS-1$
final Node pattern = nodeMap.getNamedItem("pattern"); //$NON-NLS-1$
final Node originalLength = nodeMap.getNamedItem("originalLength");//$NON-NLS-1$
// see feature 4456
String nodeValue = MetadataToolHelper.validateColumnName(label.getNodeValue(), 0);
@@ -222,6 +223,16 @@ public class MetadataSchema {
} else {
metadataColumn.setOriginalDbColumnName(nodeValue);
}
if (originalLength != null && originalLength.getNodeValue() != null) {
try {
metadataColumn.setOriginalLength(Integer.parseInt(originalLength.getNodeValue()));
} catch (final NumberFormatException e) {
metadataColumn.setOriginalLength(null);
}
} else {
metadataColumn.setOriginalLength(null);
}
if (length.getNodeValue() != null) {
try {
metadataColumn.setLength(Integer.parseInt(length.getNodeValue()));
@@ -784,6 +795,14 @@ public class MetadataSchema {
}
column.setAttributeNode(length);
Attr originalLength = document.createAttribute("originalLength"); //$NON-NLS-1$
if (metadataColumn.getOriginalLength() == null) {
originalLength.setNodeValue("-1"); //$NON-NLS-1$
} else {
originalLength.setNodeValue(String.valueOf(metadataColumn.getOriginalLength()));
}
column.setAttributeNode(originalLength);
Attr precision = document.createAttribute("precision"); //$NON-NLS-1$
if (metadataColumn.getPrecision() == null) {
precision.setNodeValue("-1"); //$NON-NLS-1$

View File

@@ -404,7 +404,21 @@ public final class MetadataTalendType {
return dbms;
}
}
ExceptionHandler.log(Messages.getString("MetadataTalendType.dbIdNotFound", dbmsId));
ExceptionHandler.log(Messages.getString("MetadataTalendType.dbIdNotFound", dbmsId)); //$NON-NLS-1$
return null;
}
public static Dbms getDbmsByProduct(String product) {
if (product == null) {
throw new IllegalArgumentException();
}
Dbms[] allDbmsArray = getAllDbmsArray();
for (Dbms dbms : allDbmsArray) {
if (product.equals(dbms.getProduct())) {
return dbms;
}
}
ExceptionHandler.log(Messages.getString("MetadataTalendType.dbIdNotFound", product)); //$NON-NLS-1$
return null;
}
@@ -597,4 +611,21 @@ public final class MetadataTalendType {
System.out.println();
}
/**
* DOC xqliu Comment method "getMappingTypeProduct".
*
* @param product
* @return
*/
public static MappingTypeRetriever getMappingTypeRetrieverByProduct(String product) {
if (product == null) {
throw new IllegalArgumentException();
}
Dbms dbms = getDbmsByProduct(product);
if (dbms == null) {
return null;
}
return new MappingTypeRetriever(dbms);
}
}

View File

@@ -696,7 +696,15 @@ public final class MetadataToolHelper {
if (connection != null) {
if (connection instanceof SAPConnection) {
// Changed by Marvin Wang on Jun. 19, 2012 for subtask TDI-21657.
return getMetadataTableFromSAPFunction((SAPConnection) connection, metaRepositoryId);
// return getMetadataTableFromSAPFunction((SAPConnection) connection, metaRepositoryId);
if (tableName == null) {
return null;
}
if (tableName.contains("/")) { //$NON-NLS-1$
// if tableName contains "/", means the selected table name is from SAPFunction; else it is from SAP
// table, then just go the common codes
return getMetadataTableFromSAPFunction((SAPConnection) connection, metaRepositoryId);
}
}
Set tables = ConnectionHelper.getTables(connection);
for (Object tableObj : tables) {
@@ -751,7 +759,7 @@ public final class MetadataToolHelper {
return null;
}
String[] split = tableName.split("/");
String[] split = tableName.split("/"); //$NON-NLS-1$
if (split.length == 3) {
functionName = split[0];
String type = split[1];
@@ -1029,6 +1037,7 @@ public final class MetadataToolHelper {
if (param.getValue() instanceof IMetadataTable) {
param.setValueToDefault(elementParameters);
IMetadataTable table = (IMetadataTable) param.getValue();
String metadataTableName = metadataTable.getTableName();
if (mappingParameter != null) {
if (mappingParameter.getValue() != null && (!mappingParameter.getValue().equals(""))) { //$NON-NLS-1$
table.setDbms((String) mappingParameter.getValue());
@@ -1056,7 +1065,11 @@ public final class MetadataToolHelper {
}
}
if (oldColumn != null) {
boolean update = true;
if (metadataTableName != null && !metadataTableName.equals(table.getTableName())) {
update = newColumn.isCustom();
}
if (oldColumn != null && update) {
// if column exists, then override read only /
// custom
oldColumn.setReadOnly(newColumn.isReadOnly());
@@ -1074,10 +1087,6 @@ public final class MetadataToolHelper {
oldColumn.setTalendType(newColumn.getTalendType());
oldColumn.setComment(newColumn.getComment());
}
} else { // if column doesn't exist, then add it.
// if (newColumn.isReadOnly() || newColumn.isCustom() || table.isReadOnly()) {
// metadataTable.getListColumns().add(newColumn);
// }
}
}
}

View File

@@ -32,6 +32,7 @@ import org.talend.core.model.metadata.IMetadataColumn;
import org.talend.core.model.metadata.IMetadataConnection;
import org.talend.core.model.metadata.IMetadataTable;
import org.talend.core.model.metadata.MetadataTalendType;
import org.talend.core.model.metadata.MetadataToolHelper;
import org.talend.core.model.metadata.builder.connection.AbstractMetadataObject;
import org.talend.core.model.metadata.builder.connection.Connection;
import org.talend.core.model.metadata.builder.connection.ConnectionFactory;
@@ -350,7 +351,7 @@ public final class ConvertionHelper {
newColumn.setDefault(column.getDefaultValue());
newColumn.setKey(column.isKey());
String label2 = column.getLabel();
if (KeywordsValidator.isKeyword(label2)) {
if (!MetadataToolHelper.isValidColumnName(label2)) {
label2 = "_" + label2; //$NON-NLS-1$
}
newColumn.setLabel(label2);

View File

@@ -232,6 +232,11 @@ public class HiveConnUtils {
private static boolean isSupportStandalone(HiveConnVersionInfo hiveVersionObj, int hiveServerIndex) {
boolean isHiveServer1 = "HIVE".equals(HiveServerVersionUtils.extractKey(hiveServerIndex)); //$NON-NLS-1$
if (isHiveServer1 && HiveConnVersionInfo.Cloudera_CDH5_4.equals(hiveVersionObj)) {
return false;
}
return !(HiveConnVersionInfo.HDP_1_0.equals(hiveVersionObj) || isHiveServer1
&& (HiveConnVersionInfo.HDP_1_2.equals(hiveVersionObj) || HiveConnVersionInfo.HDP_1_3.equals(hiveVersionObj) || HiveConnVersionInfo.HDP_2_0
.equals(hiveVersionObj)));

View File

@@ -46,6 +46,16 @@ public enum HiveConnVersionInfo {
DISTRO_CUSTOM(0, EHadoopDistributions.CUSTOM.getName(), EHadoopDistributions.CUSTOM.getDisplayName(), false),
HDP_2_2(
1,
EHadoopVersion4Drivers.HDP_2_2.getVersionValue(),
EHadoopVersion4Drivers.HDP_2_2.getVersionDisplay(),
true,
false,
true,
true,
HiveConnVersionInfo.HORTONWORKS),
HDP_2_1(
1,
EHadoopVersion4Drivers.HDP_2_1.getVersionValue(),
@@ -95,6 +105,9 @@ public enum HiveConnVersionInfo {
APACHE_0_20_203(1, EHadoopVersion4Drivers.APACHE_0_20_203.getVersionValue(), EHadoopVersion4Drivers.APACHE_0_20_203
.getVersionDisplay(), false, HiveConnVersionInfo.APACHE),
Cloudera_CDH5_4(1, EHadoopVersion4Drivers.CLOUDERA_CDH5_4.getVersionValue(), EHadoopVersion4Drivers.CLOUDERA_CDH5_4
.getVersionDisplay(), true, false, true, true, HiveConnVersionInfo.CLOUDERA),
Cloudera_CDH5_1(1, EHadoopVersion4Drivers.CLOUDERA_CDH5_1.getVersionValue(), EHadoopVersion4Drivers.CLOUDERA_CDH5_1
.getVersionDisplay(), true, false, true, true, HiveConnVersionInfo.CLOUDERA),
@@ -173,11 +186,15 @@ public enum HiveConnVersionInfo {
false,
HiveConnVersionInfo.MAPR),
APACHE_2_4_0_EMR(1, EHadoopVersion4Drivers.APACHE_2_4_0_EMR.getVersionValue(), EHadoopVersion4Drivers.APACHE_2_4_0_EMR
.getVersionDisplay(), true, HiveConnVersionInfo.AMAZON_EMR),
APACHE_2_4_0_EMR(
1,
EHadoopVersion4Drivers.APACHE_2_4_0_EMR.getVersionValue(),
"Apache 2.4.0 (Hive 0.11.0)", true, HiveConnVersionInfo.AMAZON_EMR), //$NON-NLS-1$
APACHE_1_0_3_EMR(1, EHadoopVersion4Drivers.APACHE_1_0_3_EMR.getVersionValue(), EHadoopVersion4Drivers.APACHE_1_0_3_EMR
.getVersionDisplay(), false, HiveConnVersionInfo.AMAZON_EMR),
APACHE_1_0_3_EMR(
1,
EHadoopVersion4Drivers.APACHE_1_0_3_EMR.getVersionValue(),
"Apache 1.0.3 (Hive 0.8.1)", false, HiveConnVersionInfo.AMAZON_EMR), //$NON-NLS-1$
MapR_EMR(
1,
@@ -202,12 +219,14 @@ public enum HiveConnVersionInfo {
HiveConnVersionInfo.HDP_1_3,
HiveConnVersionInfo.HDP_2_0,
HiveConnVersionInfo.HDP_2_1,
HiveConnVersionInfo.HDP_2_2,
HiveConnVersionInfo.APACHE_1_0_0,
HiveConnVersionInfo.Cloudera_CDH4,
HiveConnVersionInfo.Cloudera_CDH4_YARN,
HiveConnVersionInfo.Cloudera_CDH5,
HiveConnVersionInfo.Cloudera_CDH5_1,
HiveConnVersionInfo.Cloudera_CDH5_1_MR1,
HiveConnVersionInfo.Cloudera_CDH5_4,
HiveConnVersionInfo.MAPR2,
HiveConnVersionInfo.MAPR2_1_2,
HiveConnVersionInfo.MAPR2_1_3,
@@ -227,6 +246,7 @@ public enum HiveConnVersionInfo {
HiveConnVersionInfo.HDP_1_3,
HiveConnVersionInfo.HDP_2_0,
HiveConnVersionInfo.HDP_2_1,
HiveConnVersionInfo.HDP_2_2,
HiveConnVersionInfo.APACHE_0_20_203,
HiveConnVersionInfo.APACHE_1_0_0,
HiveConnVersionInfo.Cloudera_CDH3,
@@ -235,6 +255,7 @@ public enum HiveConnVersionInfo {
HiveConnVersionInfo.Cloudera_CDH5,
HiveConnVersionInfo.Cloudera_CDH5_1,
HiveConnVersionInfo.Cloudera_CDH5_1_MR1,
HiveConnVersionInfo.Cloudera_CDH5_4,
HiveConnVersionInfo.MAPR1,
HiveConnVersionInfo.MAPR2,
HiveConnVersionInfo.MAPR2_1_2,
@@ -266,8 +287,9 @@ public enum HiveConnVersionInfo {
private boolean supportSecurity;
private static HiveConnVersionInfo[] hiveVersions = new HiveConnVersionInfo[] { HiveConnVersionInfo.Cloudera_CDH5,
HiveConnVersionInfo.Cloudera_CDH5_1, HiveConnVersionInfo.Cloudera_CDH5_1_MR1, HiveConnVersionInfo.HDP_2_1,
HiveConnVersionInfo.HDP_2_0, HiveConnVersionInfo.PIVOTAL_HD_2_0 };
HiveConnVersionInfo.Cloudera_CDH5_1, HiveConnVersionInfo.Cloudera_CDH5_1_MR1, HiveConnVersionInfo.Cloudera_CDH5_4,
HiveConnVersionInfo.HDP_2_2, HiveConnVersionInfo.HDP_2_1, HiveConnVersionInfo.HDP_2_0,
HiveConnVersionInfo.PIVOTAL_HD_2_0, HiveConnVersionInfo.APACHE_2_4_0_EMR };
private HiveConnVersionInfo(int level, String key, String displayName, boolean supportSecurity,
HiveConnVersionInfo... follows) {

View File

@@ -91,7 +91,6 @@ import org.talend.core.service.IMetadataManagmentUiService;
import org.talend.core.utils.KeywordsValidator;
import org.talend.core.utils.TalendQuoteUtils;
import org.talend.cwm.helper.ConnectionHelper;
import org.talend.utils.json.JSONException;
/**
* DOC nrousseau class global comment. Detailled comment <br/>
@@ -399,7 +398,11 @@ public class RepositoryToComponentProperty {
Map<String, Object> map = new HashMap<String, Object>();
if (property.getPropertyName() != null && !"".equals(property.getPropertyName())) {
map.put("PROPERTY", TalendQuoteUtils.addQuotes(property.getPropertyName()));//$NON-NLS-1$
map.put("VALUE", TalendQuoteUtils.addQuotes(property.getValue()));//$NON-NLS-1$
if (isContextMode(connection, property.getValue())) {
map.put("VALUE", property.getValue());//$NON-NLS-1$
} else {
map.put("VALUE", TalendQuoteUtils.addQuotes(property.getValue()));//$NON-NLS-1$
}
values.add(map);
}
}
@@ -485,15 +488,21 @@ public class RepositoryToComponentProperty {
return "CustomModule"; //$NON-NLS-1$
} else {
if (table != null) {
EList<SalesforceModuleUnit> moduleList = connection.getModules();
for (SalesforceModuleUnit unit : moduleList) {
if (table.getLabel().equals(unit.getModuleName())) {
return unit.getModuleName();
}
SalesforceModuleUnit currentUnit = getSaleforceModuleUnitByTable(table, connection.getModules());
if (currentUnit != null) {
return currentUnit.getModuleName();
}
}
return connection.getModuleName();
}
} else if ("CUSTOM_MODULE_NAME".equals(value)) { //$NON-NLS-1$
if (table != null) {
SalesforceModuleUnit currentUnit = getSaleforceModuleUnitByTable(table, connection.getModules());
if (currentUnit != null) {
return TalendQuoteUtils.addQuotes(currentUnit.getModuleName());
}
}
return TalendQuoteUtils.addQuotes(connection.getModuleName());
} else if ("QUERY_CONDITION".equals(value)) { //$NON-NLS-1$
if (isContextMode(connection, connection.getQueryCondition())) {
return connection.getQueryCondition();
@@ -581,6 +590,15 @@ public class RepositoryToComponentProperty {
return null;
}
private static SalesforceModuleUnit getSaleforceModuleUnitByTable(IMetadataTable table, EList<SalesforceModuleUnit> moduleList) {
for (SalesforceModuleUnit unit : moduleList) {
if (table.getLabel().equals(unit.getModuleName())) {
return unit;
}
}
return null;
}
/**
* DOC qzhang Comment method "getWSDLValue".
*
@@ -1113,6 +1131,10 @@ public class RepositoryToComponentProperty {
return null;
}
}
} else {
Map<String, Object> line = new HashMap<String, Object>();
line.put("JAR_NAME", jar);
value2.add(line);
}
}
if (deployed) {
@@ -1197,17 +1219,23 @@ public class RepositoryToComponentProperty {
return connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_HBASE_VERSION);
}
if (value.equals("HBASE_MASTER_PRINCIPAL")) {
return TalendQuoteUtils.addQuotes(connection.getParameters().get(
ConnParameterKeys.CONN_PARA_KEY_HBASE_AUTHENTICATION_MASTERPRINCIPAL));
}
if (value.equals("HBASE_REGIONSERVER_PRINCIPAL")) {
return TalendQuoteUtils.addQuotes(connection.getParameters().get(
ConnParameterKeys.CONN_PARA_KEY_HBASE_AUTHENTICATION_REGIONSERVERPRINCIPAL));
}
if (value.equals("HIVE_SERVER")) {
return connection.getParameters().get(ConnParameterKeys.HIVE_SERVER_VERSION);
}
if (value.equals("HBASE_PARAMETERS")) {
try {
String message = connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_HBASE_PROPERTIES);
return HadoopRepositoryUtil.getHadoopPropertiesList(message, true);
} catch (JSONException e) {
ExceptionHandler.process(e);
}
String message = connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_HBASE_PROPERTIES);
return HadoopRepositoryUtil.getHadoopPropertiesFullList(connection, message, true);
}
if (value.equals("HADOOP_ADVANCED_PROPERTIES")) {
@@ -1217,11 +1245,12 @@ public class RepositoryToComponentProperty {
} else if (EDatabaseTypeName.HBASE.getDisplayName().equals(databaseType)) {
message = connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_HBASE_PROPERTIES);
}
try {
return HadoopRepositoryUtil.getHadoopPropertiesList(message, true);
} catch (JSONException e) {
ExceptionHandler.process(e);
}
return HadoopRepositoryUtil.getHadoopPropertiesFullList(connection, message, true);
}
if (value.equals("ADVANCED_PROPERTIES") && EDatabaseTypeName.HIVE.getDisplayName().equals(databaseType)) {
String message = connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_HIVE_JDBC_PROPERTIES);
return HadoopRepositoryUtil.getHadoopPropertiesList(message, true);
}
if (value.equals("HADOOP_CUSTOM_JARS")) {
@@ -1317,12 +1346,26 @@ public class RepositoryToComponentProperty {
}
}
if (value.equals("JOBTRACKER_PRINCIPAL")) {
String jobTrackerPrincipal = connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_JOB_TRACKER_PRINCIPAL);
if (jobTrackerPrincipal == null) {
return jobTrackerPrincipal;
/**
* 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")) {
String jtOrRmPrincipal = connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_JOB_TRACKER_PRINCIPAL);
if (jtOrRmPrincipal == null) {
return jtOrRmPrincipal;
} else {
return TalendQuoteUtils.addQuotesIfNotExist(StringUtils.trimToNull(jobTrackerPrincipal));
return TalendQuoteUtils.addQuotesIfNotExist(StringUtils.trimToNull(jtOrRmPrincipal));
}
}
if (value.equals("JOBHISTORY_PRINCIPAL")) {
String jobHistoryPrincipal = connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_JOB_HISTORY_PRINCIPAL);
if (jobHistoryPrincipal == null) {
return jobHistoryPrincipal;
} else {
return TalendQuoteUtils.addQuotesIfNotExist(StringUtils.trimToNull(jobHistoryPrincipal));
}
}
@@ -1368,7 +1411,7 @@ public class RepositoryToComponentProperty {
}
if (value.equals("USE_KEYTAB")) {
String USE_KEYTAB = connection.getParameters().get(ConnParameterKeys.HIVE_AUTHENTICATION_USEKEYTAB);
String USE_KEYTAB = connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_USEKEYTAB);
if (USE_KEYTAB != null && USE_KEYTAB.equals("true")) {
return Boolean.TRUE;
} else {
@@ -1376,18 +1419,30 @@ public class RepositoryToComponentProperty {
}
}
if (value.equals("PRINCIPAL")) {
return TalendQuoteUtils.addQuotes(connection.getParameters().get(ConnParameterKeys.HIVE_AUTHENTICATION_PRINCIPLA));
if (value.equals("PRINCIPAL") || value.equals("KEYTAB_PRINCIPAL")) {
return TalendQuoteUtils.addQuotes(connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_KEYTAB_PRINCIPAL));
}
if (value.equals("KEYTAB_PATH")) {
return TalendQuoteUtils.addQuotes(connection.getParameters().get(ConnParameterKeys.HIVE_AUTHENTICATION_KEYTAB));
return TalendQuoteUtils.addQuotes(connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_KEYTAB));
}
if (value.equals("IMPALA_PRINCIPAL")) {
return TalendQuoteUtils.addQuotes(connection.getParameters().get(ConnParameterKeys.IMPALA_AUTHENTICATION_PRINCIPLA));
}
if (value.equals("IMPALA_VERSION")) {
String impalaVersion = connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_IMPALA_VERSION);
if (impalaVersion != null) {
// The value for IMPALA_CDH5 is wrong for a long time, so need to change it manaully, so can avoid to
// add migration task
if (EDatabaseVersion4Drivers.IMPALA_CDH5.getVersionValue().equals(impalaVersion)) {
impalaVersion = "Cloudera_CDH5_1";
}
}
return impalaVersion;
}
return null;
}
@@ -1923,6 +1978,100 @@ public class RepositoryToComponentProperty {
}
}
/**
* qiang.zhang Comment method "getTableXMLMappingValue".
*
* @param connection
* @param tableInfo
* @param metaTable
*/
public static void getTableXMLMappingValue(Connection connection, List<Map<String, Object>> tableInfo,
IMetadataTable metaTable, Map<String, String> colRenameMap) {
if (connection instanceof XmlFileConnection) {
XmlFileConnection xmlConnection = (XmlFileConnection) connection;
if (xmlConnection.isInputModel()) {
EList objectList = xmlConnection.getSchema();
XmlXPathLoopDescriptor xmlDesc = (XmlXPathLoopDescriptor) objectList.get(0);
List<SchemaTarget> schemaTargets = xmlDesc.getSchemaTargets();
tableInfo.clear();
List<IMetadataColumn> listColumns = metaTable.getListColumns();
String tagName;
for (int j = 0; j < schemaTargets.size(); j++) {
SchemaTarget schemaTarget = schemaTargets.get(j);
boolean foundColumn = false;
for (IMetadataColumn metadataColumn : listColumns) {
if (metadataColumn.getLabel().equals(schemaTarget.getTagName())) {
foundColumn = true;
tagName = "" + schemaTarget.getTagName().trim().replaceAll(" ", "_"); //$NON-NLS-1$ //$NON-NLS-2$
tagName = MetadataToolHelper.validateColumnName(tagName, j);
Map<String, Object> map = new HashMap<String, Object>();
map.put("SCHEMA_COLUMN", tagName); //$NON-NLS-1$
map.put("QUERY", TalendQuoteUtils.addQuotes(schemaTarget.getRelativeXPathQuery())); //$NON-NLS-1$
tableInfo.add(map);
}
}
// if can not found noramlly,so maybe the column name changed,use rename map we always found the new
// column name here
if (!foundColumn && colRenameMap != null && !colRenameMap.isEmpty()) {
Set<String> newNameSet = colRenameMap.keySet();
for (IMetadataColumn metadataColumn : listColumns) {
if (newNameSet.contains(metadataColumn.getLabel())) {
String oldColLabel = colRenameMap.get((metadataColumn.getLabel()));
if (schemaTarget.getTagName().equals(oldColLabel)) {
foundColumn = true;
schemaTarget.setTagName(metadataColumn.getLabel());
Map<String, Object> map = new HashMap<String, Object>();
map.put("SCHEMA_COLUMN", metadataColumn.getLabel()); //$NON-NLS-1$
map.put("QUERY", TalendQuoteUtils.addQuotes(schemaTarget.getRelativeXPathQuery())); //$NON-NLS-1$
tableInfo.add(map);
}
}
}
}
}
}
}
if (connection instanceof MDMConnection) {
MDMConnection xmlConnection = (MDMConnection) connection;
EList objectList = xmlConnection.getSchemas();
for (Concept concept : (List<Concept>) objectList) {
if (concept.getLabel() == null || concept.getLabel().equals(metaTable.getLabel())) {
List<ConceptTarget> conceptTargets = concept.getConceptTargets();
tableInfo.clear();
List<IMetadataColumn> listColumns = metaTable.getListColumns();
for (IMetadataColumn metadataColumn : listColumns) {
for (ConceptTarget schema : conceptTargets) {
if (metadataColumn.getLabel().equals(schema.getTargetName())) {
Map<String, Object> map = new HashMap<String, Object>();
map.put("SCHEMA_COLUMN", schema.getTargetName()); //$NON-NLS-1$
map.put("QUERY", TalendQuoteUtils.addQuotes(schema.getRelativeLoopExpression())); //$NON-NLS-1$
tableInfo.add(map);
}
}
}
break;
}
}
}
if (connection instanceof EDIFACTConnection) {
EDIFACTConnection edifactConnection = (EDIFACTConnection) connection;
List<IMetadataColumn> objectList = metaTable.getListColumns();
Map<String, Object> map = new HashMap<String, Object>();
for (IMetadataColumn column : objectList) {
if (column instanceof EDIFACTColumn) {
EDIFACTColumn edicolumn = (EDIFACTColumn) column;
String ediColumnName = edicolumn.getEDIColumnName();
String ediXpath = edicolumn.getEDIXpath();
map.put("COLUMN_NAME", ediColumnName); //$NON-NLS-1$
map.put("XPATH", ediXpath); //$NON-NLS-1$
tableInfo.add(map);
}
}
}
}
public static void getTableXMLMappingValue(Connection connection, List<Map<String, Object>> tableInfo, INode node) {
List<IMetadataTable> metaTables = node.getMetadataList();
@@ -2198,7 +2347,8 @@ public class RepositoryToComponentProperty {
* @param metadataTable
* @return
*/
public static List<Map<String, Object>> getXMLMappingValue(Connection connection, List<IMetadataTable> metadataTables) {
public static List<Map<String, Object>> getXMLMappingValue(Connection connection, List<IMetadataTable> metadataTables,
Map<String, String> colRenameMap) {
if (metadataTables == null || metadataTables.isEmpty()) {
return new ArrayList<Map<String, Object>>();
}
@@ -2213,15 +2363,30 @@ public class RepositoryToComponentProperty {
List<SchemaTarget> schemaTargets = xmlDesc.getSchemaTargets();
List<Map<String, Object>> maps = new ArrayList<Map<String, Object>>();
for (IMetadataColumn col : metadataTable.getListColumns()) {
boolean foundColumn = false;
Map<String, Object> map = new HashMap<String, Object>();
map.put("QUERY", null); //$NON-NLS-1$
for (int i = 0; i < schemaTargets.size(); i++) {
SchemaTarget sch = schemaTargets.get(i);
if (col.getLabel().equals(sch.getTagName())) {
// map.put("SCHEMA_COLUMN", sch.getTagName());
foundColumn = true;
map.put("QUERY", TalendQuoteUtils.addQuotes(sch.getRelativeXPathQuery())); //$NON-NLS-1$
}
}
if (!foundColumn && colRenameMap != null && !colRenameMap.isEmpty()) {
Set<String> newNameSet = colRenameMap.keySet();
for (int i = 0; i < schemaTargets.size(); i++) {
SchemaTarget sch = schemaTargets.get(i);
if (newNameSet.contains(sch.getTagName())) {
String oldColLabel = colRenameMap.get(sch.getTagName());
if (col.getLabel().equals(oldColLabel)) {
foundColumn = true;
map.put("QUERY", TalendQuoteUtils.addQuotes(sch.getRelativeXPathQuery())); //$NON-NLS-1$
}
}
}
}
// if the Xml File Connection have the Keyword Column, can not get QUERY value .
if (map.get(UpdatesConstants.QUERY) == null) {
if (col.getLabel() != null && col.getLabel().startsWith("Column")) {

View File

@@ -37,9 +37,10 @@ import org.talend.core.model.metadata.MetadataTalendType;
public class ContextParameterJavaTypeManager {
private static final JavaType[] JAVA_TYPES = new JavaType[] { JavaTypesManager.BOOLEAN, JavaTypesManager.CHARACTER,
JavaTypesManager.DATE, JavaTypesManager.DOUBLE, JavaTypesManager.FLOAT, JavaTypesManager.INTEGER, JavaTypesManager.LONG,
JavaTypesManager.SHORT, JavaTypesManager.STRING, JavaTypesManager.OBJECT, JavaTypesManager.BIGDECIMAL, JavaTypesManager.FILE,
JavaTypesManager.DIRECTORY, JavaTypesManager.VALUE_LIST, JavaTypesManager.PASSWORD };
JavaTypesManager.DATE, JavaTypesManager.DOUBLE, JavaTypesManager.FLOAT, JavaTypesManager.INTEGER,
JavaTypesManager.LONG, JavaTypesManager.SHORT, JavaTypesManager.STRING, JavaTypesManager.OBJECT,
JavaTypesManager.BIGDECIMAL, JavaTypesManager.FILE, JavaTypesManager.DIRECTORY, JavaTypesManager.VALUE_LIST,
JavaTypesManager.PASSWORD };
public static final String PERL_FILE = JavaTypesManager.FILE.getLabel();
@@ -99,11 +100,13 @@ public class ContextParameterJavaTypeManager {
if ("true".equals(configurationElement.getAttribute("displayInContext"))) {
try {
String className = configurationElement.getAttribute("nullableClass");
Class myClass = Platform.getBundle(configurationElement.getContributor().getName()).loadClass(className);
boolean isGenerateWithCanonicalName = configurationElement.getAttribute("generateWithCanonicalName") == null ? false
: Boolean.valueOf(configurationElement.getAttribute("generateWithCanonicalName"));
boolean isObjectBased = configurationElement.getAttribute("objectBased") == null ? false : Boolean
.valueOf(configurationElement.getAttribute("objectBased"));
Class myClass = Platform.getBundle(configurationElement.getContributor().getName()).loadClass(
className);
boolean isGenerateWithCanonicalName = configurationElement
.getAttribute("generateWithCanonicalName") == null ? false : Boolean
.valueOf(configurationElement.getAttribute("generateWithCanonicalName"));
boolean isObjectBased = configurationElement.getAttribute("objectBased") == null ? false
: Boolean.valueOf(configurationElement.getAttribute("objectBased"));
JavaType javaType = new JavaType(myClass, isGenerateWithCanonicalName, isObjectBased);
addJavaType(javaType);
} catch (InvalidRegistryObjectException e) {
@@ -315,7 +318,7 @@ public class ContextParameterJavaTypeManager {
return JavaTypesManager.DEFAULT_NUMBER;
}
} else {
return JavaTypesManager.NULL;
return JavaTypesManager.DEFAULT_STRING;
}
}
@@ -324,8 +327,8 @@ public class ContextParameterJavaTypeManager {
* Return the default value for a given type, if the given parameter "defaultValue" is set, this value is returned.
*
* @param type
* @return string value if the case is valid or the default value is valid. If the type is primitive and the <code>defaultValue</code>
* is not set, java null is returned.
* @return string value if the case is valid or the default value is valid. If the type is primitive and the
* <code>defaultValue</code> is not set, java null is returned.
*/
public static String getDefaultValueFromJavaType(String type, String defaultValue) {
if (defaultValue != null && defaultValue.length() > 0) {

View File

@@ -46,6 +46,8 @@ public final class JavaTypesManager {
public static final String DEFAULT_NUMBER = "0"; //$NON-NLS-1$
public static final String DEFAULT_STRING = ""; //$NON-NLS-1$
public static final String NULL = "null"; //$NON-NLS-1$
public static final String JAVA_PRIMITIVE_CHAR = "char"; //$NON-NLS-1$

View File

@@ -92,6 +92,11 @@ public abstract class AbstractNode implements INode {
private List<ModuleNeeded> modulesNeeded = new ArrayList<ModuleNeeded>();
// for DI job, and indicate if the component after the iterator
// connection which enable parallel, even this component after
// onComponentOk
private String parallelIterator = null;
// as the talend job contains multiple mapreduce jobs, use this to indicate
// which mapreduce job contains this
// graphic node
@@ -1201,4 +1206,22 @@ public abstract class AbstractNode implements INode {
public void setRefNode(boolean isRefNode) {
this.isRefNode = isRefNode;
}
/**
* Getter for parallelIterator.
*
* @return the parallelIterator
*/
public String getParallelIterator() {
return parallelIterator;
}
/**
* Sets the parallelIterator.
*
* @param parallelIterator the parallelIterator to set
*/
public void setParallelIterator(String parallelIterator) {
this.parallelIterator = parallelIterator;
}
}

View File

@@ -224,4 +224,8 @@ public interface IElementParameter {
public boolean isRaw();
public void setRaw(boolean raw);
public void setLog4JEnabled(boolean enable);
public boolean isLog4JEnabled();
}

View File

@@ -15,6 +15,7 @@ package org.talend.core.model.process;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
import java.util.Map;
import org.eclipse.ui.IEditorPart;
import org.talend.commons.exception.PersistenceException;
@@ -94,9 +95,7 @@ public interface IProcess2 extends IRepositoryObject, IProcess {
public IUpdateManager getUpdateManager();
public byte[] getScreenshot();
public void setScreenshot(byte[] image);
public Map<String, byte[]> getScreenshots();
public void dispose();
@@ -123,6 +122,8 @@ public interface IProcess2 extends IRepositoryObject, IProcess {
public void setLastRunContext(IContext context);
public Map<Object, Object> getAdditionalProperties();
boolean isSubjobEnabled();
void removeProblems4ProcessDeleted();
@@ -133,4 +134,5 @@ public interface IProcess2 extends IRepositoryObject, IProcess {
String getSpringContent();
// END TESB-7887
public void refreshProcess();
}

View File

@@ -443,6 +443,8 @@ public class ERepositoryObjectType extends DynaEnum<ERepositoryObjectType> {
public final static ERepositoryObjectType METADATA_EDIFACT = ERepositoryObjectType.valueOf("METADATA_EDIFACT");
public final static ERepositoryObjectType PROCESS_STORM = ERepositoryObjectType.valueOf("PROCESS_STORM");
ERepositoryObjectType(String key, String folder, String type, boolean isStaticNode, int ordinal, String[] products,
String[] userRight, boolean... isResouce) {
super(key, type, isStaticNode, ordinal);
@@ -1230,4 +1232,20 @@ public class ERepositoryObjectType extends DynaEnum<ERepositoryObjectType> {
}
return null;
}
public static List<ERepositoryObjectType> getAllTypesOfProcess() {
List<ERepositoryObjectType> allTypes = new ArrayList<ERepositoryObjectType>();
if (ERepositoryObjectType.PROCESS != null) {
allTypes.add(ERepositoryObjectType.PROCESS);
}
if (ERepositoryObjectType.PROCESS_MR != null) {
allTypes.add(ERepositoryObjectType.PROCESS_MR);
}
if (ERepositoryObjectType.PROCESS_STORM != null) {
allTypes.add(ERepositoryObjectType.PROCESS_STORM);
}
return allTypes;
}
}

View File

@@ -114,6 +114,8 @@ public class RepositoryViewObject implements IRepositoryViewObject {
private static final String TIP = "same name item with other project";
private boolean avoidGuiInfos;
public RepositoryViewObject(Property property, boolean avoidGuiInfos) {
this.id = property.getId();
this.author = property.getAuthor();
@@ -140,6 +142,7 @@ public class RepositoryViewObject implements IRepositoryViewObject {
informationStatus = factory.getStatus(informationLevel);
modified = factory.isModified(property);
}
this.avoidGuiInfos = avoidGuiInfos;
if (!avoidGuiInfos) {
if (type == ERepositoryObjectType.JOBLET) {
JobletProcessItem item = (JobletProcessItem) property.getItem();
@@ -315,39 +318,41 @@ public class RepositoryViewObject implements IRepositoryViewObject {
repositoryStatus = factory.getStatus(property.getItem());
InformationLevel informationLevel = property.getMaxInformationLevel();
informationStatus = factory.getStatus(informationLevel);
if (type == ERepositoryObjectType.JOBLET) {
JobletProcessItem item = (JobletProcessItem) property.getItem();
if (item.getIcon() != null && item.getIcon().getInnerContent() != null
&& item.getIcon().getInnerContent().length != 0) {
customImage = getJobletCustomIcon(property);
customImage = ImageUtils.propertyLabelScale(property.getId(), customImage, ICON_SIZE.ICON_16);
}
IComponentsService service = (IComponentsService) GlobalServiceRegister.getDefault().getService(
IComponentsService.class);
IJobletProviderService jobletservice = (IJobletProviderService) GlobalServiceRegister.getDefault().getService(
IJobletProviderService.class);
if (service != null && jobletservice != null) {
IComponentsFactory factorySingleton = service.getComponentsFactory();
IComponent component = factorySingleton.get(property.getLabel(), DI);
if (component != null) {
try {
Property tProperty = jobletservice.getJobletComponentItem(component);
if (!tProperty.getId().equals(this.id)) {
informationStatus = ERepositoryStatus.WARN;
property.setDescription(TIP);
if (!this.avoidGuiInfos) {
if (type == ERepositoryObjectType.JOBLET) {
JobletProcessItem item = (JobletProcessItem) property.getItem();
if (item.getIcon() != null && item.getIcon().getInnerContent() != null
&& item.getIcon().getInnerContent().length != 0) {
customImage = getJobletCustomIcon(property);
customImage = ImageUtils.propertyLabelScale(property.getId(), customImage, ICON_SIZE.ICON_16);
}
IComponentsService service = (IComponentsService) GlobalServiceRegister.getDefault().getService(
IComponentsService.class);
IJobletProviderService jobletservice = (IJobletProviderService) GlobalServiceRegister.getDefault()
.getService(IJobletProviderService.class);
if (service != null && jobletservice != null) {
IComponentsFactory factorySingleton = service.getComponentsFactory();
IComponent component = factorySingleton.get(property.getLabel(), DI);
if (component != null) {
try {
Property tProperty = jobletservice.getJobletComponentItem(component);
if (!tProperty.getId().equals(this.id)) {
informationStatus = ERepositoryStatus.WARN;
property.setDescription(TIP);
}
} catch (Exception e) {
// tProperty is null
}
} catch (Exception e) {
// tProperty is null
}
}
}
} else if (type == ERepositoryObjectType.DOCUMENTATION) {
this.customImage = ImageProvider.getImage(RepositoryImageProvider.getIcon(type));
Item item = property.getItem();
if (item instanceof DocumentationItem) {
customImage = coreSerivce.getImageWithDocExt(((DocumentationItem) item).getExtension());
} else if (item instanceof LinkDocumentationItem) {
customImage = coreSerivce.getImageWithSpecial(customImage).createImage();
} else if (type == ERepositoryObjectType.DOCUMENTATION) {
this.customImage = ImageProvider.getImage(RepositoryImageProvider.getIcon(type));
Item item = property.getItem();
if (item instanceof DocumentationItem) {
customImage = coreSerivce.getImageWithDocExt(((DocumentationItem) item).getExtension());
} else if (item instanceof LinkDocumentationItem) {
customImage = coreSerivce.getImageWithSpecial(customImage).createImage();
}
}
}
return property;

View File

@@ -35,6 +35,9 @@ public abstract class AbstractUpdateManager implements IUpdateManager {
// for repository schema rename
private Map<String, String> schemaRenamedMap = new HashMap<String, String>();
// for repository file connection column rename
private Map<String, String> columnRenamedMap = new HashMap<String, String>();
/* for table deleted and reselect on database wizard table */
private Map<String, EUpdateResult> deletedOrReselectTablesMap = new HashMap<String, EUpdateResult>();
@@ -78,6 +81,27 @@ public abstract class AbstractUpdateManager implements IUpdateManager {
}
/**
*
* ldong Comment method "getColumnRenamedMap".
*
* used for file connection column rename update.
*/
public Map<String, String> getColumnRenamedMap() {
return this.columnRenamedMap;
}
public void setColumnRenamedMap(Map<String, String> columnRenamedMap) {
this.columnRenamedMap.clear();
if (columnRenamedMap == null) {
return;
}
for (String old : columnRenamedMap.keySet()) {
this.columnRenamedMap.put(old, columnRenamedMap.get(old));
}
}
public boolean isFromRepository() {
return this.fromRepository;
}

View File

@@ -0,0 +1,57 @@
// ============================================================================
//
// Copyright (C) 2006-2014 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core.model.update;
import java.util.HashMap;
import java.util.Map;
/**
* created by ldong on Feb 6, 2015 Detailled comment
*
*/
public class ConnectionColumnUpdateManager {
private static ConnectionColumnUpdateManager columnManager = null;
private Map<String, String> columnRenameMap = new HashMap<String, String>();
private ConnectionColumnUpdateManager() {
}
public synchronized static ConnectionColumnUpdateManager getInstance() {
if (columnManager == null) {
columnManager = new ConnectionColumnUpdateManager();
}
return columnManager;
}
public Map<String, String> getColumnRenameMap() {
return this.columnRenameMap;
}
public void addNewName(String newName, String oldName) {
String name = columnRenameMap.get(oldName);
if (name != null) {
columnRenameMap.remove(oldName);
columnRenameMap.put(newName, name);
} else {
columnRenameMap.put(newName, oldName);
}
}
public void setColumnRenameMap(Map<String, String> columnRenameMap) {
this.columnRenameMap = columnRenameMap;
}
}

View File

@@ -35,6 +35,8 @@ import org.talend.commons.exception.PersistenceException;
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.ICoreService;
import org.talend.core.IRepositoryContextUpdateService;
import org.talend.core.IService;
import org.talend.core.hadoop.IHadoopClusterService;
import org.talend.core.model.context.ContextUtils;
import org.talend.core.model.context.JobContext;
@@ -42,6 +44,7 @@ import org.talend.core.model.context.JobContextManager;
import org.talend.core.model.metadata.IMetadataColumn;
import org.talend.core.model.metadata.IMetadataTable;
import org.talend.core.model.metadata.MetadataSchemaType;
import org.talend.core.model.metadata.builder.connection.AdditionalConnectionProperty;
import org.talend.core.model.metadata.builder.connection.Connection;
import org.talend.core.model.metadata.builder.connection.DatabaseConnection;
import org.talend.core.model.metadata.builder.connection.DelimitedFileConnection;
@@ -52,6 +55,7 @@ import org.talend.core.model.metadata.builder.connection.PositionalFileConnectio
import org.talend.core.model.metadata.builder.connection.QueriesConnection;
import org.talend.core.model.metadata.builder.connection.Query;
import org.talend.core.model.metadata.builder.connection.RegexpFileConnection;
import org.talend.core.model.metadata.builder.connection.SAPConnection;
import org.talend.core.model.metadata.builder.connection.SAPFunctionUnit;
import org.talend.core.model.metadata.builder.connection.SAPIDocUnit;
import org.talend.core.model.metadata.builder.connection.SalesforceSchemaConnection;
@@ -99,6 +103,8 @@ public abstract class RepositoryUpdateManager {
private Map<String, String> schemaRenamedMap = new HashMap<String, String>();
private Map<String, String> columnRenamedMap = new HashMap<String, String>();
/**
* for context group
*/
@@ -214,6 +220,14 @@ public abstract class RepositoryUpdateManager {
this.schemaRenamedMap = schemaRenamedMap;
}
public Map<String, String> getColumnRenamedMap() {
return this.columnRenamedMap;
}
public void setColumnRenamedMap(Map<String, String> columnRenamedMap) {
this.columnRenamedMap = columnRenamedMap;
}
public abstract Set<? extends IUpdateItemType> getTypes();
public static boolean openPropagationDialog() {
@@ -330,6 +344,7 @@ public abstract class RepositoryUpdateManager {
openNoModificationDialog();
}
}
getColumnRenamedMap().clear();
return false;
}
@@ -435,6 +450,9 @@ public abstract class RepositoryUpdateManager {
return true;
}
}
if (isSameConnection(object, parameter)) {
return true;
}
if (object instanceof List) {
List list = ((List) object);
if (!list.isEmpty()) {
@@ -477,10 +495,31 @@ public abstract class RepositoryUpdateManager {
return false;
}
private boolean isSameConnection(Object obj1, Object obj2) {
Connection conn1 = getConnection(obj1);
Connection conn2 = getConnection(obj2);
if (conn1 != null && conn2 != null && conn1.equals(conn2)) {
return true;
}
return false;
}
private Connection getConnection(Object obj) {
Connection conn = null;
if (obj instanceof Connection) {
conn = (Connection) obj;
} else if (obj instanceof ConnectionItem) {
conn = ((ConnectionItem) obj).getConnection();
}
return conn;
}
private boolean checkHadoopRelevances(Object resultParam) {
if (resultParam != null && resultParam instanceof Connection && parameter instanceof Connection) {
Connection parentConnection = (Connection) parameter;
Connection childConnection = (Connection) resultParam;
if (resultParam != null) {
Connection parentConnection = getConnection(parameter);
Connection childConnection = getConnection(resultParam);
IHadoopClusterService hadoopClusterService = null;
if (GlobalServiceRegister.getDefault().isServiceRegistered(IHadoopClusterService.class)) {
hadoopClusterService = (IHadoopClusterService) GlobalServiceRegister.getDefault().getService(
@@ -921,6 +960,68 @@ public abstract class RepositoryUpdateManager {
}
}
}
List<IRepositoryViewObject> sapConnList = factory.getAll(ERepositoryObjectType.METADATA_SAPCONNECTIONS, true);
for (IRepositoryViewObject obj : sapConnList) {
Item item = obj.getProperty().getItem();
if (item instanceof ConnectionItem) {
Connection conn = ((ConnectionItem) item).getConnection();
if (conn.isContextMode()) {
ContextItem contextItem = ContextUtils.getContextItemById2(conn.getContextId());
if (contextItem == null) {
continue;
}
if (citem == contextItem) {
if (conn instanceof SAPConnection) {
SAPConnection sapConn = (SAPConnection) conn;
if (sapConn.getClient() != null && sapConn.getClient().equals(oldValue)) {
sapConn.setClient(newValue);
} else if (sapConn.getUsername() != null && sapConn.getUsername().equals(oldValue)) {
sapConn.setUsername(newValue);
} else if (sapConn.getPassword() != null && sapConn.getPassword().equals(oldValue)) {
sapConn.setPassword(newValue);
} else if (sapConn.getHost() != null && sapConn.getHost().equals(oldValue)) {
sapConn.setHost(newValue);
} else if (sapConn.getSystemNumber() != null && sapConn.getSystemNumber().equals(oldValue)) {
sapConn.setSystemNumber(newValue);
} else if (sapConn.getLanguage() != null && sapConn.getLanguage().equals(oldValue)) {
sapConn.setLanguage(newValue);
} else {
for (AdditionalConnectionProperty sapProperty : sapConn.getAdditionalProperties()) {
if (sapProperty.getValue() != null && sapProperty.getValue().equals(oldValue)) {
sapProperty.setValue(newValue);
}
}
}
factory.save(item);
}
}
}
}
}
List<IRepositoryViewObject> noSqlConnList = factory.getAll(
ERepositoryObjectType.valueOf(ERepositoryObjectType.class, "METADATA_NOSQL_CONNECTIONS"), true); //$NON-NLS-1$
for (IRepositoryViewObject obj : noSqlConnList) {
Item item = obj.getProperty().getItem();
if (item instanceof ConnectionItem) {
Connection conn = ((ConnectionItem) item).getConnection();
if (conn.isContextMode()) {
ContextItem contextItem = ContextUtils.getContextItemById2(conn.getContextId());
if (contextItem == null) {
continue;
}
if (citem == contextItem) {
if (GlobalServiceRegister.getDefault().isServiceRegistered(IRepositoryContextUpdateService.class)) {
IService service = GlobalServiceRegister.getDefault().getService(
IRepositoryContextUpdateService.class);
IRepositoryContextUpdateService repositoryContextUpdateService = (IRepositoryContextUpdateService) service;
repositoryContextUpdateService.updateRelatedContextVariableName(conn, oldValue, newValue);
}
factory.save(item);
}
}
}
}
}
}
@@ -1055,6 +1156,10 @@ public abstract class RepositoryUpdateManager {
if (getSchemaRenamedMap() != null && !getSchemaRenamedMap().isEmpty()) {
manager.setSchemaRenamedMap(getSchemaRenamedMap());
}
if (getColumnRenamedMap() != null && !getColumnRenamedMap().isEmpty()) {
manager.setColumnRenamedMap(getColumnRenamedMap());
}
if (getDeletedOrReselectTablesMap() != null && !getDeletedOrReselectTablesMap().isEmpty()) {
manager.setDeletedOrReselectTablesMap(getDeletedOrReselectTablesMap());
}
@@ -1231,7 +1336,7 @@ public abstract class RepositoryUpdateManager {
}
/**
* DOC PLV Comment method "updateFileConnection".
* DOC PLV Comment method "updateFileConnection".For now only used in File xml connecton
*
* @param connectionItem
* @param oldMetadataTable
@@ -1268,6 +1373,10 @@ public abstract class RepositoryUpdateManager {
}
};
if (!ConnectionColumnUpdateManager.getInstance().getColumnRenameMap().isEmpty()) {
repositoryUpdateManager.setColumnRenamedMap(ConnectionColumnUpdateManager.getInstance().getColumnRenameMap());
}
return repositoryUpdateManager.doWork(show, onlySimpleShow);
}
@@ -1817,6 +1926,11 @@ public abstract class RepositoryUpdateManager {
// set renamed schema
repositoryUpdateManager.setSchemaRenamedMap(schemaRenamedMap);
// set rename column
if (!ConnectionColumnUpdateManager.getInstance().getColumnRenameMap().isEmpty()) {
repositoryUpdateManager.setColumnRenamedMap(ConnectionColumnUpdateManager.getInstance().getColumnRenameMap());
}
return repositoryUpdateManager.doWork(show, onlySimpleShow);
}

View File

@@ -32,4 +32,19 @@ public abstract class AbstractDragAndDropServiceHandler implements IDragAndDropS
public Object getComponentValue(Connection connection, String value, IMetadataTable table) {
return getComponentValue(connection, value, table, null);
}
/*
* (non-Javadoc)
*
* @see org.talend.core.model.utils.IDragAndDropServiceHandler#isValidForDataViewer(org.talend.core.model.metadata.
* IMetadataTable)
*/
@Override
public boolean isValidForDataViewer(Connection connection, IMetadataTable metadataTable) {
if (!canHandle(connection)) {
return false;
}
return true;
}
}

View File

@@ -98,4 +98,15 @@ public interface IDragAndDropServiceHandler {
*/
public void handleTableRelevantParameters(Connection connection, IElement ele, IMetadataTable metadataTable);
/**
* DOC ycbai Comment method "isValidForDataViewer".
* <p>
* Check if the table can do data viewer.
*
* @param connection
* @param metadataTable
* @return
*/
public boolean isValidForDataViewer(Connection connection, IMetadataTable metadataTable);
}

View File

@@ -691,14 +691,34 @@ public class NodeUtil {
*/
public static INode getNodeByUniqueName(final IProcess process, String uniqueName) {
return getNodeByUniqueName(process,uniqueName,false);
}
/**
* DOC jzhao
* <p>
* function:get the node(maybe include virtual node) from generating nodes by unique name. aim:to get the property value from any node.
* </p>
* Notice: It is used to get property values from the pointed node we can also get the virtual node.
*
* @param process: a job process
* @param uniqueName:the unique name of the pointed node.
* @param isReturnVirtualNode: specify whether return the virtual node.
*
* @return
*/
public static INode getNodeByUniqueName(final IProcess process, String uniqueName ,boolean isReturnVirtualNode) {
List<INode> nodes = (List<INode>) process.getGeneratingNodes();
INode return_node = null;
for (INode current_node : nodes) {
if(isReturnVirtualNode && current_node.isVirtualGenerateNode()){
current_node = getVirtualNode(current_node);
}
if (uniqueName.equals(current_node.getUniqueName())) {
return_node = current_node;
return current_node;
}
}
return return_node;
return null;
}
/**
@@ -813,8 +833,7 @@ public class NodeUtil {
List<IElementParameter> reps = new ArrayList<IElementParameter>();
// should ignore Parallelize?
List<String> ignorePs = Arrays.asList("CONNECTION_FORMAT", "INFORMATION", "COMMENT", "VALIDATION_RULES", "LABEL", "HINT",
"ACTIVATE", "TSTATCATCHER_STATS", "PARALLELIZE", "PROPERTY", "SQLPATTERN_VALUE", "ROWS_BUFFER_SIZE",
"TEMPORARY_DATA_DIRECTORY");
"ACTIVATE", "TSTATCATCHER_STATS", "PARALLELIZE", "PROPERTY");
// Exclude SQLPATTERN_VALUE.
for (IElementParameter ep : eps) {
if (ep.isShow(eps)) {
@@ -853,7 +872,7 @@ public class NodeUtil {
if (!linesIter.hasNext()) {
return "\"[]\"";
}
value.append("\"[");
value.append("new StringBuilder().append(\"[");
for (;;) {
Map<String, String> columns = linesIter.next();
Iterator<Entry<String, String>> columnsIter = columns.entrySet().iterator();
@@ -869,11 +888,9 @@ public class NodeUtil {
printedColumnExist = true;
value.append(column.getKey());
value.append("=\"+(");
value.append("=\").append(");
value.append(getNormalizeParameterValue(column.getValue(), types.get(column.getKey()), true));
value.append(")+\"");
value.append(").append(\"");
if (columnsIter.hasNext()) {
value.append(", ");
@@ -885,7 +902,7 @@ public class NodeUtil {
value.append("}");
if (!linesIter.hasNext()) {
return value.append("]\"").toString();
return value.append("]\").toString()").toString();
}
value.append(",").append(" ");
}
@@ -900,68 +917,14 @@ public class NodeUtil {
}
private static String getNormalizeParameterValue(String value, IElementParameter ep, boolean itemFromTable) {
// !!!no need these code because we treat it when ep.isRaw()
// List<EParameterFieldType> escapeQuotation = Arrays.asList(EParameterFieldType.MEMO_JAVA,
// EParameterFieldType.SCHEMA_XPATH_QUERYS);// TODO: no need for SCHEMA_XPATH_QUERYS, and remove the
// // RAW="true" on component xml
// if (escapeQuotation.contains(ep.getFieldType()) && ep.isRaw()) {
// value = value.replaceAll("\\\\", "\\\\\\\\");
// value = value.replaceAll("\\\"", "\\\\\\\"");
// }
List<EParameterFieldType> needRemoveCRLFList = Arrays.asList(EParameterFieldType.MEMO, EParameterFieldType.MEMO_JAVA,
EParameterFieldType.MEMO_SQL, EParameterFieldType.MEMO_IMPORT, EParameterFieldType.MEMO_MESSAGE);
if (needRemoveCRLFList.contains(ep.getFieldType())) {
value = value.replaceAll("[\r\n]", " ");
if (value == null) {
value = "";
}
List<EParameterFieldType> needQuoteList = Arrays.asList(EParameterFieldType.CLOSED_LIST,
EParameterFieldType.COMPONENT_LIST, EParameterFieldType.COLUMN_LIST, EParameterFieldType.PREV_COLUMN_LIST,
EParameterFieldType.CONNECTION_LIST, EParameterFieldType.LOOKUP_COLUMN_LIST,
EParameterFieldType.CONTEXT_PARAM_NAME_LIST, EParameterFieldType.PROCESS_TYPE, EParameterFieldType.COLOR,
EParameterFieldType.TABLE_BY_ROW, EParameterFieldType.HADOOP_JARS_DIALOG);
List<EParameterFieldType> needQuoteListForItem = itemFromTable ? Arrays.asList(EParameterFieldType.SCHEMA_TYPE,
EParameterFieldType.SAP_SCHEMA_TYPE, EParameterFieldType.MODULE_LIST) : new ArrayList<EParameterFieldType>();
// TODO: add RAW attribute when SCHEMA_COLUMN generated by BASED_ON_SCHEMA
List<String> needQuoteListByName = Arrays.asList("SCHEMA_COLUMN");// SCHEMA_COLUMN for BASED_ON_SCHEMA="true"
value = value.replaceAll("[\r\n]", " ");// for multiple lines
value = value.replaceAll("\\\\", "\\\\\\\\");// escape all \\
value = value.replaceAll("\\\"", "\\\\\\\"");// escape all \"
value = "\"" + value + "\"";// wrap double quote make it as string
if (needQuoteList.contains(ep.getFieldType()) || needQuoteListForItem.contains(ep.getFieldType())
|| needQuoteListByName.contains(ep.getName()) || ep.isRaw()) {
value = value.replaceAll("\\\\", "\\\\\\\\");
value = value.replaceAll("\\\"", "\\\\\\\"");
value = "\"" + value + "\"";
}
if (itemFromTable) {
if ("*".equals(value)) {
value = "\"" + value + "\"";
}
if (value != null && value.endsWith(";")) {
value = value.substring(0, value.length() - 1);
}
}
// copied it from Log4jFileUtil.javajet but need more comment for this script
if (value == null || "".equals(value.trim())) {// for the value which empty
value = "\"\"";
} else if ("\"\\n\"".equals(value) || "\"\\r\"".equals(value) || "\"\\r\\n\"".equals(value)) {
// for the value is "\n" "\r" "\r\n"
value = value.replaceAll("\\\\", "\\\\\\\\");
} else if ("\"\"\"".equals(value)) {
value = "\"" + "\\" + "\"" + "\"";
} else if ("\"\"\\r\\n\"\"".equals(value)) {
value = "\"\\\\r\\\\n\"";
} else if ("\"\"\\r\"\"".equals(value)) {
value = "\"\\\\r\"";
} else if ("\"\"\\n\"\"".equals(value)) {
value = "\"\\\\n\"";
}
// ftom 20141008 - patch to fix javajet compilation errors due to hard-coded studio TableEditor mechanism
// linked to BUILDIN properties checks, this item is a boolean set to TRUE or FALSE
// fix is just transforming into true or false to make logging OK
else if ("BUILDIN".equals(ep.getName())) {
value = value.toLowerCase();
} else if (value.endsWith("*")) {
value = value.substring(0, value.length() - 1) + "\"*\"";
}
return value;
}
@@ -1038,4 +1001,33 @@ public class NodeUtil {
}
return null;
}
public static boolean containsMultiThreadComponent(IProcess process) {
List<? extends INode> multiThreadComponentList = process.getNodesOfType("tWriteXMLFieldOut");
if (multiThreadComponentList != null && multiThreadComponentList.size() > 0) {
return true;
}
return false;
}
public static boolean subBranchContainsParallelIterate(INode node) {
for (IConnection connection : node.getIncomingConnections()) {
if(connection==null || !connection.isActivate()) {
continue;
}
if(!(connection.getLineStyle().hasConnectionCategory(IConnectionCategory.MAIN | IConnectionCategory.USE_ITERATE))) {
continue;
}
if(connection.getLineStyle().hasConnectionCategory(IConnectionCategory.USE_ITERATE)) {
if (Boolean.TRUE.toString().equals(ElementParameterParser.getValue(connection, "__ENABLE_PARALLEL__"))) {
return true;
}
}
return subBranchContainsParallelIterate(connection.getSource());
}
return false;
}
}

View File

@@ -14,12 +14,15 @@ package org.talend.core.model.utils;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.regex.Matcher;
import org.apache.commons.lang.StringUtils;
import org.apache.oro.text.regex.MalformedPatternException;
import org.apache.oro.text.regex.Pattern;
import org.apache.oro.text.regex.PatternCompiler;
@@ -163,18 +166,29 @@ public final class ParameterValueUtil {
// example:"drop table "+context.oracle_schema+".\"TDI_26803\""
// >>>>>>>>_*_(const)__ _____*_(varible)_______ __*_(const)___
/**
* <b>NOTE</b>: This [inputString] variable only used to debug, should not use it in product
*/
inputString = value;
final int length = value.length();
// quotaStrings which stores the start and end point for all const strings in the value
LinkedHashMap<Integer, Integer> quotaStrings = new LinkedHashMap<Integer, Integer>();
List<Point> functionNameAreas = new ArrayList<Point>();
// List<Point> functionNameAreas = new ArrayList<Point>();
List<FunctionInfo> functions = new ArrayList<FunctionInfo>();
// comment String set
Set<String> commentStringSet = new HashSet<String>();
// get and store all start and end point of const strings
int start = -1;
int end = -2;
char ch;
boolean isInConstString = false;
boolean isInCommentString = false;
Character commentType = null;
for (int i = 0; i < length; i++) {
ch = value.charAt(i);
if (ch == '\"') {
if (isInCommentString == false && ch == '\"') {
// in case of cases :
// case 1 : [ "select * from " + context.table + " where value = \"context.table\"" ]
// case 2 : [ "select * from " + context.table + " where value = \"\\" + context.table +
@@ -183,12 +197,41 @@ public final class ParameterValueUtil {
continue;
}
isInConstString = !isInConstString;
// [0 <= start] >> in case the first const String position compute error
if (0 <= start && end < start) {
// if (0 <= start && end < start) {
// end = i;
// quotaStrings.put(start, end);
// } else {
// start = i;
// }
if (isInConstString) {
start = i;
} else {
end = i;
quotaStrings.put(start, end);
}
} else if (isInConstString == false) {
if (isInCommentString) {
if (commentType != null && commentType.equals('/') && (ch == '\r' || ch == '\n')) {
isInCommentString = false;
commentType = null;
end = i;
} else if (commentType != null && commentType.equals('*') && ch == '/' && value.charAt(i - 1) == '*') {
isInCommentString = false;
commentType = null;
end = i;
}
if (isInCommentString == false) {
quotaStrings.put(start, end);
commentStringSet.add(start + ":" + end); //$NON-NLS-1$
}
} else {
start = i;
if ((ch == '/' || ch == '*') && 0 < i && (i - 1) != end && value.charAt(i - 1) == '/') {
isInCommentString = true;
commentType = ch;
start = i - 1;
}
}
}
}
@@ -214,38 +257,64 @@ public final class ParameterValueUtil {
String subString = null;
int vStart = 0;
int vEnd = 0;
int methodMaxIndex = 0;
int calcMaxIndex = 0;
int methodMaxIndex = -1;
vStart = 0;
vEnd = 0;
start = 0;
end = 0;
for (Entry<Integer, Integer> entry : quotaStrings.entrySet()) {
start = entry.getKey();
end = entry.getValue() + 1;
vEnd = start;
if (vStart == start) {
// const string follow with const string, maybe won't happen...
if (vStart < vEnd) {
subString = value.substring(vStart, vEnd);
calcMethodArea(subString, value, vStart, functions);
}
vStart = end;
}
vStart = 0;
vEnd = 0;
start = 0;
end = 0;
for (Entry<Integer, Integer> entry : quotaStrings.entrySet()) {
start = entry.getKey();
end = entry.getValue() + 1;
vEnd = start;
if (vEnd <= vStart) {
// const string follow with const string, will be happen like this:
// [String a = "string"/* it's a string*/;]
// get the const string
subString = value.substring(start, end);
if (start < methodMaxIndex) {
if (!commentStringSet.contains(start + ":" + (end - 1)) && start < methodMaxIndex) { //$NON-NLS-1$
subString = subString.replaceAll(oldName, newName);
}
} else {
// get the varible string, do replace, then append it
subString = value.substring(vStart, vEnd);
calcMaxIndex = calcMethodArea(subString, value, vStart, functionNameAreas, methodMaxIndex);
// calcMaxIndex = calcMethodArea(subString, value, vStart, functions, methodMaxIndex);
if (methodMaxIndex < calcMaxIndex) {
methodMaxIndex = calcMaxIndex;
if (methodMaxIndex < start) {
methodMaxIndex = FunctionInfo.getMaxIndexForCurrentParentFunction(start, functions);
}
String replacedString = doVaribleReplace(oldName, newName, value, functionNameAreas, vStart, vEnd);
String replacedString = doVaribleReplace(oldName, newName, value, functions, vStart, vEnd);
strBuffer.append(replacedString);
// get the const string
// deal with: context.getProperty("test") + "test"
subString = value.substring(start, end);
if (start < methodMaxIndex) {
subString = subString.replaceAll(oldName, newName);
if (!commentStringSet.contains(start + ":" + (end - 1)) && start < methodMaxIndex) { //$NON-NLS-1$
FunctionInfo function = FunctionInfo.getParentFunctionFromList(start, end, functions);
Point funcNameArea = function.getNameArea();
String functionName = value.substring(funcNameArea.x, funcNameArea.y);
if (functionName.matches("^globalMap\\..+")) { //$NON-NLS-1$
subString = subString.replaceAll(oldName, newName);
} else {
if (subString.equals("\"" + oldName + "\"")) { //$NON-NLS-1$ //$NON-NLS-2$
subString = "\"" + newName + "\""; //$NON-NLS-1$ //$NON-NLS-2$
}
}
}
}
// append the const string
@@ -258,13 +327,158 @@ public final class ParameterValueUtil {
// then get it, and do replace, finally append it.
if (vStart < length) {
vEnd = length;
String replacedString = doVaribleReplace(oldName, newName, value, functionNameAreas, vStart, vEnd);
String replacedString = doVaribleReplace(oldName, newName, value, functions, vStart, vEnd);
strBuffer.append(replacedString);
}
return strBuffer.toString();
}
/**
* <b>NOTE</b>: This variable only used to debug, should not use it in product
*/
private static String inputString = ""; //$NON-NLS-1$
private static class FunctionInfo {
private Point nameArea;
private Point paramArea;
private List<FunctionInfo> subFunctions = new ArrayList<FunctionInfo>();
public FunctionInfo(Point _nameArea) {
nameArea = _nameArea;
}
public Point getNameArea() {
return this.nameArea;
}
public void setParamArea(Point paramArea) {
this.paramArea = paramArea;
}
public Point getParamArea() {
return this.paramArea;
}
public int getFuncAreaMinIndex() {
return nameArea.x;
}
public int getFuncAreaMaxIndex() {
return paramArea.y;
}
public FunctionInfo getParentFunction(int x, int y) {
FunctionInfo parentFunction = null;
for (FunctionInfo funcInfo : subFunctions) {
int paramX = funcInfo.paramArea.x;
int paramY = funcInfo.paramArea.y;
if (paramX <= x && y <= paramY) {
if (!funcInfo.subFunctions.isEmpty()) {
FunctionInfo retFuncInfo = funcInfo.getParentFunction(x, y);
if (retFuncInfo != null) {
return retFuncInfo;
}
}
return funcInfo;
}
}
int paramX = this.paramArea.x;
int paramY = this.paramArea.y;
if (paramX <= x && y <= paramY) {
parentFunction = this;
}
return parentFunction;
}
public void addSubFunction(FunctionInfo subFunc) {
this.subFunctions.add(subFunc);
}
public List<FunctionInfo> getSubFunctions() {
return this.subFunctions;
}
public static void addFunctionToList(FunctionInfo funcInfo, List<FunctionInfo> functionList) {
if (functionList != null) {
for (FunctionInfo iFuncInfo : functionList) {
FunctionInfo parentFuncInfo = iFuncInfo.getParentFunction(funcInfo.getFuncAreaMinIndex(),
funcInfo.getFuncAreaMaxIndex());
if (parentFuncInfo != null) {
parentFuncInfo.addSubFunction(funcInfo);
return;
}
}
// if can not found, add it to the functionList dirrectly
functionList.add(funcInfo);
}
}
public static FunctionInfo getParentFunctionFromList(int x, int y, List<FunctionInfo> functionList) {
if (functionList != null) {
for (FunctionInfo funcInfo : functionList) {
FunctionInfo parentFunction = funcInfo.getParentFunction(x, y);
if (parentFunction != null) {
return parentFunction;
}
}
}
return null;
}
public static int getMaxIndexForCurrentParentFunction(int index, List<FunctionInfo> functionList) {
int maxIndex = -1;
if (functionList != null) {
for (FunctionInfo funcInfo : functionList) {
Point paramArea = funcInfo.getParamArea();
if (paramArea.x <= index && index <= paramArea.y) {
return paramArea.y;
}
}
}
return maxIndex;
}
public static List<FunctionInfo> getFunctionsInSpecifiedAreaFromList(int x, int y, List<FunctionInfo> functionList) {
List<FunctionInfo> findedList = new ArrayList<FunctionInfo>();
for (FunctionInfo funcInfo : functionList) {
Point nameArea = funcInfo.getNameArea();
if (y < nameArea.y) {
break;
}
if (x <= nameArea.x && nameArea.y <= y) {
findedList.add(funcInfo);
List<FunctionInfo> subFuncs = funcInfo.getSubFunctions();
if (subFuncs != null && !subFuncs.isEmpty()) {
List<FunctionInfo> findedListInSubFuncs = getFunctionsInSpecifiedAreaFromList(x, y, subFuncs);
if (findedListInSubFuncs != null && !findedListInSubFuncs.isEmpty()) {
findedList.addAll(findedListInSubFuncs);
}
}
}
}
return findedList;
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
if (getFuncAreaMaxIndex() < getFuncAreaMinIndex()) {
return "not available"; //$NON-NLS-1$
}
return inputString.substring(getFuncAreaMinIndex(), getFuncAreaMaxIndex() + 1);
}
}
/**
* DOC cmeng Comment method "doVaribleReplace".
*
@@ -275,13 +489,18 @@ public final class ParameterValueUtil {
* @param vStart
* @param vEnd
*/
private static String doVaribleReplace(String oldName, String newName, String value, List<Point> functionNameAreas,
private static String doVaribleReplace(String oldName, String newName, String value, List<FunctionInfo> functions,
int vStart, int vEnd) {
if (value.trim().isEmpty()) {
return value;
}
StringBuffer replacedString = new StringBuffer();
int replaceableStart = vStart;
int replaceableEnd = vEnd;
for (Point functionNameArea : functionNameAreas) {
List<FunctionInfo> replaceableFunctions = FunctionInfo.getFunctionsInSpecifiedAreaFromList(vStart, vEnd, functions);
for (FunctionInfo funcInfo : replaceableFunctions) {
Point functionNameArea = funcInfo.getNameArea();
if (vEnd <= functionNameArea.x) {
break;
}
@@ -292,9 +511,9 @@ public final class ParameterValueUtil {
replaceableEnd = functionNameArea.x;
String replaceableString = value.substring(replaceableStart, replaceableEnd);
replacedString.append(doReplace(oldName, newName, replaceableString));
replacedString.append(value.substring(functionNameArea.x, functionNameArea.y));
replacedString.append(doReplace(oldName, newName, value.substring(functionNameArea.x, functionNameArea.y)));
} else {
replacedString.append(value.substring(functionNameArea.x, functionNameArea.y));
replacedString.append(doReplace(oldName, newName, value.substring(functionNameArea.x, functionNameArea.y)));
}
replaceableStart = functionNameArea.y;
}
@@ -306,11 +525,14 @@ public final class ParameterValueUtil {
}
private static String doReplace(String oldName, String newName, String value) {
if (value.trim().isEmpty()) {
return value;
}
String vOldName = oldName.replaceAll("\\.", "\\\\."); //$NON-NLS-1$ //$NON-NLS-2$
// ((\b\w+\s*\.\s*)+schema(\s*\.\s*\w+)*)|((\b\w+\s*\.\s*)*schema(\s*\.\s*\w+)+)
String regex = "((\\b\\w+\\s*\\.\\s*)+" + vOldName + "(\\s*\\.\\s*\\w+)*)|((\\b\\w+\\s*\\.\\s*)*" + vOldName + "(\\s*\\.\\s*\\w+)+)"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
String regex = "((\\b\\w+\\s*\\.\\s*)+" + vOldName + "\\b)|(\\b" + vOldName + "\\s*\\()"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
// obtain all varibles
String[] split = value.split(regex);
Map<String, String> replacedStrings = new HashMap<String, String>();
@@ -323,7 +545,7 @@ public final class ParameterValueUtil {
replacedStrings.put(s, s);
}
}
if (split.length == 1) {
if (split.length == 1 && split[0].length() == value.length()) {
returnValue.append(replacedStrings.get(split[0]));
}
// obtain consts & concat the consts with the variables
@@ -336,6 +558,10 @@ public final class ParameterValueUtil {
int valueLength = value.length();
String oldFill = null;
String newFill = null;
String subRegEx = "^" + vOldName + "(\\s*\\.\\s*\\w+)+"; //$NON-NLS-1$ //$NON-NLS-2$
java.util.regex.Pattern subPattern = java.util.regex.Pattern.compile(subRegEx);
while (true) {
if (curPos == valueLength) {
break;
@@ -350,7 +576,13 @@ public final class ParameterValueUtil {
curPos = x;
continue;
}
returnValue.append(matcher.group());
String matchedString = matcher.group();
Matcher subMatcher = subPattern.matcher(matchedString);
if (subMatcher.find()) {
returnValue.append(matchedString.replaceFirst(vOldName, newName));
} else {
returnValue.append(matchedString);
}
curPos = y;
if (!matcher.find()) {
x = valueLength;
@@ -382,35 +614,63 @@ public final class ParameterValueUtil {
return isEscapeSequence;
}
private static int calcMethodArea(String varibleString, String wholeString, int beginIndex, List<Point> functionNameAreas,
int lastIndex) {
private static int calcMethodArea(String varibleString, String wholeString, int beginIndex, List<FunctionInfo> functions) {
// globalMap.get(...)
// String regex = "\\b\\S*\\s*\\.\\s*\\S*\\s*\\(\\z"; //$NON-NLS-1$
// maybe get(...) also is target
String regex = "\\b[\\S\\.]*?\\s*\\("; //$NON-NLS-1$
String regex = "\\b[\\w\\.]*?\\s*\\("; //$NON-NLS-1$
java.util.regex.Pattern pattern = java.util.regex.Pattern.compile(regex);
Matcher matcher = pattern.matcher(varibleString);
int i = 0;
int varibleStringMaxIndex = beginIndex + varibleString.length() - 1;
int currentMaxIndex = i;
while (matcher.find()) {
boolean isInQuota = false;
boolean isInComment = false;
Character commentType = null;
int parenthesisNum = 0;
Point functionNameArea = new Point(beginIndex + matcher.start(), beginIndex + matcher.end());
functionNameAreas.add(functionNameArea);
int lastCommentEndIndex = -1;
int matchedStart = matcher.start();
int matchedEnd = matcher.end();
Point functionNameArea = new Point(beginIndex + matchedStart, beginIndex + matchedEnd);
FunctionInfo funcInfo = new FunctionInfo(functionNameArea);
if (varibleStringMaxIndex < i || varibleStringMaxIndex < lastIndex) {
continue;
}
Point functionParamArea = new Point(-1, -1);
funcInfo.setParamArea(functionParamArea);
for (i = matcher.end(); i < wholeString.length(); i++) {
i = beginIndex + matchedEnd;
functionParamArea.x = i;
for (; i < wholeString.length(); i++) {
char ch = wholeString.charAt(i);
if (ch == '\"' && !isEscapeSequence(wholeString, i)) {
if (isInComment == false && ch == '\"' && !isEscapeSequence(wholeString, i)) {
isInQuota = !isInQuota;
}
if (isInQuota) {
continue;
} else if (isInQuota) {
continue;
} else if (isInQuota == false) {
if (isInComment) {
if (commentType != null && commentType.equals('/') && (ch == '\r' || ch == '\n')) {
isInComment = false;
commentType = null;
lastCommentEndIndex = i;
} else if (commentType != null && commentType.equals('*') && ch == '/'
&& wholeString.charAt(i - 1) == '*') {
isInComment = false;
commentType = null;
lastCommentEndIndex = i;
}
continue;
} else {
if ((ch == '/' || ch == '*') && 0 < i && (i - 1) != lastCommentEndIndex
&& wholeString.charAt(i - 1) == '/') {
isInComment = true;
commentType = ch;
continue;
}
}
}
if (ch == '(') {
parenthesisNum++;
} else if (ch == ')') {
@@ -420,8 +680,13 @@ public final class ParameterValueUtil {
break;
}
}
functionParamArea.y = i;
FunctionInfo.addFunctionToList(funcInfo, functions);
if (currentMaxIndex < i) {
currentMaxIndex = i;
}
}
return i;
return currentMaxIndex;
}
public static boolean isUseData(final IElementParameter param, final String name) {
@@ -543,7 +808,7 @@ public final class ParameterValueUtil {
if (contextParam != null) {
String docValue = contextParam.getValue();
if (docValue != null) {
String encryptValue = CryptoHelper.DEFAULT.encrypt(docValue);
String encryptValue = CryptoHelper.getDefault().encrypt(docValue);
if (encryptValue != null) {
return encryptValue;
}
@@ -579,7 +844,7 @@ public final class ParameterValueUtil {
if (param != null) {
Object docValue = param.getValue();
if (docValue != null && docValue instanceof String) {
String encryptValue = CryptoHelper.DEFAULT.encrypt(docValue.toString());
String encryptValue = CryptoHelper.getDefault().encrypt(docValue.toString());
if (encryptValue != null) {
return encryptValue;
}
@@ -610,4 +875,33 @@ public final class ParameterValueUtil {
}
return false;
}
/**
* add \ before \ and " in the string.
*
* @param str
* @return
*/
public static String handleSpecialCharacters(String str) {
// handle backlash first, then handle double quotation mark
String result = replaceAll(str, "\\", "\\\\"); //$NON-NLS-1$ //$NON-NLS-2$
result = replaceAll(result, "\"", "\\\""); //$NON-NLS-1$ //$NON-NLS-2$
return result;
}
private static String replaceAll(String str, String regex, String replacement) {
List<String> list = new ArrayList<String>();
splitString(str, list, regex);
return StringUtils.join(list.toArray(new String[list.size()]), replacement);
}
private static void splitString(String str, List<String> list, String regex) {
int indexOf = str.indexOf(regex);
if (indexOf > -1) {
list.add(str.substring(0, indexOf));
splitString(str.substring(indexOf + 1, str.length()), list, regex);
} else {
list.add(str);
}
}
}

View File

@@ -156,4 +156,8 @@ public interface ITalendCorePrefConstants {
public static final String CoreUIPlugin_ID = "org.talend.core.ui"; //$NON-NLS-1$
public static final String TOP_INSTALL_DONE = "top.install.done"; //$NON-NLS-1$
public static final String SVN_UPDATE_INFO_AUTO_CHECK = "PerformancePreferencePage.svn_update_info_auto_check"; //$NON-NLS-1$
public static final String SVN_UPDATE_INFO_AUTO_CHECK_TIME_INTERVAL = "PerformancePreferencePage.svn_update_info_auto_check_time_interval"; //$NON-NLS-1$
}

View File

@@ -12,6 +12,8 @@
// ============================================================================
package org.talend.core.repository;
import java.util.List;
import org.talend.core.model.components.IComponent;
import org.talend.core.model.properties.Item;
import org.talend.core.model.repository.ERepositoryObjectType;
@@ -28,6 +30,7 @@ public class DefaultRepositoryComponentDndFilter implements IRepositoryComponent
super();
}
@Override
public String getRepositoryType(Item item, ERepositoryObjectType type) {
RepositoryComponentSetting setting = RepositoryComponentManager.getSetting(item, type);
if (setting != null) {
@@ -36,11 +39,13 @@ public class DefaultRepositoryComponentDndFilter implements IRepositoryComponent
return null;
}
@Override
public boolean except(Item item, ERepositoryObjectType type, RepositoryNode seletetedNode, IComponent component,
String repositoryType) {
return false; // default, no except components to valid
}
@Override
public boolean valid(Item item, ERepositoryObjectType type, RepositoryNode seletetedNode, IComponent component,
String repositoryType) {
if (component == null || repositoryType == null) {
@@ -66,4 +71,9 @@ public class DefaultRepositoryComponentDndFilter implements IRepositoryComponent
return tableWithMap;
}
@Override
public List<IComponent> sort(List<IComponent> components, Item item, ERepositoryObjectType type, RepositoryNode seletetedNode) {
return components;
}
}

View File

@@ -12,6 +12,8 @@
// ============================================================================
package org.talend.core.repository;
import java.util.List;
import org.talend.core.model.components.IComponent;
import org.talend.core.model.properties.Item;
import org.talend.core.model.repository.ERepositoryObjectType;
@@ -36,4 +38,6 @@ public interface IRepositoryComponentDndFilter {
*/
public boolean except(Item item, ERepositoryObjectType type, RepositoryNode seletetedNode, IComponent component,
String repositoryType);
public List<IComponent> sort(List<IComponent> components, Item item, ERepositoryObjectType type, RepositoryNode seletetedNode);
}

View File

@@ -15,6 +15,7 @@ package org.talend.core.repository;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
import java.util.regex.Matcher;
@@ -396,7 +397,7 @@ public final class RepositoryComponentManager {
}
}
List<IComponent> sortedComponents = new ArrayList<IComponent>();
List<IComponent> sortedComponents = new LinkedList<IComponent>();
sortedComponents.addAll(specialTopComponents);
sortedComponents.addAll(normalTopComponents);
@@ -405,6 +406,13 @@ public final class RepositoryComponentManager {
neededComponents.removeAll(normalTopComponents);
sortedComponents.addAll(neededComponents);
for (RepositoryComponentDndFilterSetting dndFilter : getDndFilterSettings()) {
IRepositoryComponentDndFilter filter = dndFilter.getFilter();
if (filter != null) {
sortedComponents = filter.sort(sortedComponents, item, type, seletetedNode);
}
}
return sortedComponents;
}

View File

@@ -387,6 +387,8 @@ repository.concept=Concept
repository.metadataSAPConnections=SAP Connections
repository.metadataSAPConnections.alias=SAP
repository.SAPFunction=SAP Function
repository.SAPIDoc=SAP IDoc
repository.SAPTable=SAP Table
repository.metadataSQLPatterns=SQL Templates
repository.metadataSQLPatterns.alias=SQLTemplates
repository.metadataFileDelimited=File delimited
@@ -451,7 +453,7 @@ repository.systemIndicators.textStatistics=Text Statistics
repository.tdqExchange=Exchange
repository.systemIndicators.phoneNumberStatistics=Phone Number Statistics
repository.systemIndicators.fraudDetection=Fraud Detection
repository.metadataSalesforceModule=SalesforceModule(AccountHistory)
repository.metadataSalesforceModule=SalesforceModule
EUpdateItemType.Property=Property
EUpdateItemType.MapReduce=Map Reduce
EUpdateItemType.Schema=Schema
@@ -597,4 +599,9 @@ Parameter.Type=type \:
Parameter.Value=value \:
GenerateSelectSQLAction.NewQuery=new Query {0}
AContextualAction.EditorManager_saveChangesQuestion=''{0}'' has been modified. Save changes?
AContextualAction.Save_Resource=Save Resource
AContextualAction.Save_Resource=Save Resource
ProgressMonitorDialogWithCancel.executeMessage.default=Executing...
ProgressMonitorDialogWithCancel.waitingFinishMessage.default=Can not interrupt the Check Connection action normally,\n
ProgressMonitorDialogWithCancel.executeTimeout=Execute time out, Studio has tried to interrupt this checking action at background.
ProgressMonitorDialogWithCancel.CheckingConnectionJob.waitingFinish=waiting {0} finish...
ProgressMonitorDialogWithCancel.CheckingConnectionJob.emptyWaitingfinish=waiting to finish...

View File

@@ -0,0 +1,33 @@
// ============================================================================
//
// Copyright (C) 2006-2014 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core.service;
import org.talend.core.IService;
import org.talend.core.model.metadata.IMetadataTable;
import org.talend.core.model.process.IConnection;
/**
* created by talend on Dec 17, 2014 Detailled comment
*
*/
public interface IDQComponentService extends IService {
/**
*
* Handle component chaged
*
* @param oldConnection
* @param newMetadataTable
*/
void externalComponentChange(IConnection oldConnection, IMetadataTable newMetadataTable);
}

View File

@@ -17,6 +17,7 @@ import java.util.List;
import org.eclipse.ui.IEditorPart;
import org.talend.core.IService;
import org.talend.core.model.general.Project;
import org.talend.core.model.process.INode;
import org.talend.core.model.process.IProcess2;
import org.talend.core.model.properties.Item;
import org.talend.core.model.repository.IRepositoryViewObject;
@@ -46,4 +47,6 @@ public interface IMRProcessService extends IService {
public void generateMRInfosParameter(IProcess2 process);
public boolean isProgressBarNeeded(IProcess2 process);
public void refreshMRStatus(List<INode> nodeList);
}

View File

@@ -0,0 +1,27 @@
// ============================================================================
//
// Copyright (C) 2006-2014 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core.service;
import java.util.Properties;
import org.talend.core.IService;
/**
* created by wchen on Mar 4, 2015 Detailled comment
*
*/
public interface IMapperIDocService extends IService {
public void launchIDocImporter(Properties properties);
}

View File

@@ -0,0 +1,31 @@
// ============================================================================
//
// Copyright (C) 2006-2014 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core.ui;
import java.util.Map;
import org.talend.core.IProviderService;
import org.talend.core.model.process.INode;
import org.talend.core.model.repository.ERepositoryObjectType;
/**
* DOC wanghong class global comment. Detailled comment
*/
public interface IJSONProviderService extends IProviderService {
public boolean isJSONNode(final INode node);
public boolean isRepositorySchemaLine(INode node, Map<String, Object> lineValue);
public ERepositoryObjectType getJSONRepositoryType();
}

View File

@@ -59,7 +59,7 @@ public class RepositoryImageProvider {
return ECoreImage.METADATA_SAPCONNECTION_ICON;
} else if (type == ERepositoryObjectType.SQLPATTERNS) {
return ECoreImage.METADATA_SQLPATTERN_ICON;
} else if (type == ERepositoryObjectType.METADATA_CON_TABLE) {
} else if (type == ERepositoryObjectType.METADATA_CON_TABLE || type == ERepositoryObjectType.METADATA_SAP_IDOC) {
return ECoreImage.METADATA_TABLE_ICON;
} else if (type == ERepositoryObjectType.METADATA_CON_COLUMN) {
return ECoreImage.METADATA_COLUMN_ICON;

View File

@@ -29,7 +29,9 @@ import org.talend.designer.codegen.ITalendSynchronizer;
import org.talend.designer.core.model.utils.emf.talendfile.ProcessType;
/**
* DOC guanglong.du class global comment. Detailled comment
* DOC guanglong.du class global comment. Detailled comment<br/>
* <b>!!!NOTE!!!</b> ICamelDesignerCoreService should also be usable for commandline, should not add UI related codes;
* for UI related codes, please add them into ICamelDesignerCoreUIService
*/
public interface ICamelDesignerCoreService extends IService {
@@ -40,9 +42,9 @@ public interface ICamelDesignerCoreService extends IService {
public boolean isInstanceofCamelRoutes(Item item);
public ERepositoryObjectType getRoutes();
public ERepositoryObjectType getRouteDocType();
public ERepositoryObjectType getRouteDocsType();
public ProcessType getCamelProcessType(Item item);
@@ -57,23 +59,23 @@ public interface ICamelDesignerCoreService extends IService {
public boolean isCamelMulitPageEditor(IEditorPart editor);
/**
* Synchronized Route resource
*
* @param item
*/
public List<IPath> synchronizeRouteResource(Item item);
public String getDeleteFolderName(ERepositoryObjectType type);
public boolean isRouteBuilderNode(INode node);
/**
* Synchronized Route resource
*
* @param item
*/
public List<IPath> synchronizeRouteResource(Item item);
public boolean canCreateNodeOnLink(IConnection connection, INode node);
public EConnectionType getTargetConnectionType(INode node);
public String getDeleteFolderName(ERepositoryObjectType type);
public void appendRouteInfo2Doc(Item item, Element jobElement);
public boolean isRouteBuilderNode(INode node);
public FileItem newRouteDocumentationItem();
public boolean canCreateNodeOnLink(IConnection connection, INode node);
public EConnectionType getTargetConnectionType(INode node);
public void appendRouteInfo2Doc(Item item, Element jobElement);
public FileItem newRouteDocumentationItem();
}

View File

@@ -0,0 +1,33 @@
// ============================================================================
//
// Copyright (C) 2006-2015 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.designer.core;
import org.talend.commons.exception.PersistenceException;
import org.talend.core.IService;
import org.talend.core.model.properties.Item;
import org.talend.core.model.properties.ProcessItem;
import org.talend.core.model.repository.IRepositoryEditorInput;
/**
* ESB service for UI part; ICamelDesignerCoreService should also be usable for commandline, should not add UI related
* codes.
*/
public interface ICamelDesignerCoreUIService extends IService {
public boolean isInstanceofCamelRoutes(Item item);
public IRepositoryEditorInput getRouteEditorInput(ProcessItem processItem, boolean load, Boolean lastVersion)
throws PersistenceException;
public String getRouteEditorId(ProcessItem processItem);
}

View File

@@ -51,9 +51,9 @@ import org.talend.designer.runprocess.ProcessorException;
/**
* Provides Designer core services for other components <br/>
* .
*
* $Id: IDesignerCore.java 1 2006-12-19 上午10:16:43 bqian
*
*
* $Id: IDesignerCore.java 1 2006 -12 -19 上午10:16:43 bqian
*
*/
public interface IDesignerCoreService extends IService {
@@ -101,7 +101,7 @@ public interface IDesignerCoreService extends IService {
/**
* tang Comment method "getProcessFromJobletProcessItem".
*
*
* @param item
* @return
*/
@@ -118,9 +118,9 @@ public interface IDesignerCoreService extends IService {
public Map<String, Date> getLastGeneratedJobsDateMap();
/**
*
*
* DOC YeXiaowei Comment method "getDisplayForProcessParameterFromName".
*
*
* @param name
* @return
*/
@@ -154,6 +154,8 @@ public interface IDesignerCoreService extends IService {
public Set<ModuleNeeded> getNeededLibrariesForProcess(IProcess process, boolean withChildrens);
public Set<ModuleNeeded> getNeededModules(INode node, boolean withChildrens);
public void switchToCurContextsView();
public void switchToCurComponentSettingsView();
@@ -162,7 +164,7 @@ public interface IDesignerCoreService extends IService {
/**
* When database connection is renamed, refresh the connection label in the component view of job.
*
*
* @param item
*/
public void refreshComponentView(Item item);

View File

@@ -53,6 +53,8 @@ public class FunctionManager {
public static final String FUN_SUFFIX = ")"; //$NON-NLS-1$
public static final String EMPTY_STRING = " "; //$NON-NLS-1$
/**
* qzhang Comment method "getFunctionByName".
*

View File

@@ -55,21 +55,21 @@ import org.talend.repository.model.RepositoryConstants;
*/
public class ExpressionPersistance {
public static final String EXPRESSION_FOLDER_NAME = "ExpressionBuilder"; //$NON-NLS-1$
public static final String EXPRESSION_FOLDER_NAME = "ExpressionBuilder"; //$NON-NLS-1$
public static final String CONFIGURATION_FOLDER_NAME = "configuration"; //$NON-NLS-1$
public static final String CONFIGURATION_FOLDER_NAME = "configuration"; //$NON-NLS-1$
private String ownerId;
private String ownerId;
private static ExpressionPersistance expressionPersistance;
private String path;
private String path;
private ResourceSet resourceSet;
private ResourceSet resourceSet;
private EList<EObject> contents;
private EList<EObject> contents;
private String rootFolderPath;
private String rootFolderPath;
/**
* yzhang ExpressionPersistance constructor comment.
@@ -190,9 +190,12 @@ public class ExpressionPersistance {
}
}
}
this.contents.clear();
this.contents.add(emfExpression);
resource.getContents().clear();
resource.getContents().addAll(this.contents);
} else {
resource.getContents().clear();
resource.getContents().add(emfExpression);
}

View File

@@ -131,7 +131,7 @@ public final class ProjectManager {
if (parentBranch != null) {
for (ProjectReference pr : (List<ProjectReference>) p.getReferencedProjects()) {
if (pr.getBranch() == null || parentBranch.equals(pr.getBranch())) {
Project project = new Project(pr.getReferencedProject());
Project project = new Project(pr.getReferencedProject(), false);
allReferencedprojects.add(project);
resolveSubRefProject(pr.getReferencedProject(), allReferencedprojects); // only to resolve all
}
@@ -208,7 +208,7 @@ public final class ProjectManager {
.getReferencedProjects(this.getCurrentProject());
if (rProjects != null) {
for (org.talend.core.model.properties.Project p : rProjects) {
Project project = new Project(p);
Project project = new Project(p, false);
allReferencedprojects.add(project);
resolveSubRefProject(p, allReferencedprojects);
}
@@ -234,7 +234,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())) {
refProjects.add(new Project(refProject.getReferencedProject()));
refProjects.add(new Project(refProject.getReferencedProject(), false));
}
}
return refProjects;

View File

@@ -26,6 +26,8 @@ public class RepositoryConstants {
public static final String TEMP_DIRECTORY = "temp"; //$NON-NLS-1$
public static final String SETTING_DIRECTORY = ".settings"; //$NON-NLS-1$
public static final String IMG_DIRECTORY = "images"; //$NON-NLS-1$
public static final String IMG_DIRECTORY_OF_JOB_OUTLINE = "images/job_outlines"; //$NON-NLS-1$
@@ -42,7 +44,7 @@ public class RepositoryConstants {
public static final String USER_DEFINED = "UserDefined"; //$NON-NLS-1$
public static final String CONTEXT_AND_VARIABLE_PATTERN = "^[a-zA-Z]+[a-zA-Z0-9\\_]*$"; //$NON-NLS-1$
public static final String CONTEXT_AND_VARIABLE_PATTERN = "^[a-zA-Z\\_]+[a-zA-Z0-9\\_]*$"; //$NON-NLS-1$
public static final String PROJECT_PATTERN = "^[a-zA-Z]+[a-zA-Z0-9 \\-_]*$"; //$NON-NLS-1$
@@ -95,9 +97,7 @@ public class RepositoryConstants {
public static String getPattern(ERepositoryObjectType type) {
if (type == ERepositoryObjectType.FOLDER) {
return FOLDER_PATTERN;
} else if (type == ERepositoryObjectType.PROCESS || type == ERepositoryObjectType.JOBLET
// Added the m/r for TDI-25928.
|| type == ERepositoryObjectType.PROCESS_MR) {
} else if (ERepositoryObjectType.getAllTypesOfProcess().contains(type) || type == ERepositoryObjectType.JOBLET) {
return CODE_ITEM_PATTERN;
} else if (type == ERepositoryObjectType.ROUTINES || type == ERepositoryObjectType.PIG_UDF
|| "BEANS".equals(type.getType())) {

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