Compare commits
294 Commits
release/5.
...
patch/5.6.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
63cfdc42e6 | ||
|
|
2032376f19 | ||
|
|
a8cb3e3d8b | ||
|
|
0eb1a2c7c4 | ||
|
|
1e70e83d6c | ||
|
|
0b56bc83bc | ||
|
|
cc3d31c485 | ||
|
|
cc4f6dbe2a | ||
|
|
b48614901b | ||
|
|
751f1797a8 | ||
|
|
91723e3e3b | ||
|
|
88ea8c0d35 | ||
|
|
d69591b1c4 | ||
|
|
f4b2e4a961 | ||
|
|
6fce0bf810 | ||
|
|
cc72a08f73 | ||
|
|
9e55460726 | ||
|
|
2270d6b884 | ||
|
|
a1c6cf217d | ||
|
|
84ec465fe7 | ||
|
|
2651e07e2c | ||
|
|
05982475b4 | ||
|
|
70080e2897 | ||
|
|
29f7ccdb20 | ||
|
|
e74f6212ef | ||
|
|
045b05cdcb | ||
|
|
40e4782d91 | ||
|
|
dd31eff3ef | ||
|
|
189aa4391f | ||
|
|
8b7ff0ef10 | ||
|
|
2e378750f5 | ||
|
|
a97896078d | ||
|
|
762a616388 | ||
|
|
d00f13a4f6 | ||
|
|
bcea76fd7d | ||
|
|
0e4592d24f | ||
|
|
568c234fd1 | ||
|
|
cc6db192a8 | ||
|
|
4e7e1f7fb1 | ||
|
|
1a6879abbd | ||
|
|
6185aceb1f | ||
|
|
b7607091c7 | ||
|
|
d8c0cedff4 | ||
|
|
0cb81d2ef0 | ||
|
|
5b77b07402 | ||
|
|
a376b56bd5 | ||
|
|
b32ebabf50 | ||
|
|
3b4c4246f7 | ||
|
|
e2e374ba68 | ||
|
|
1aa2cd76e7 | ||
|
|
7b9bd9128b | ||
|
|
058a84513a | ||
|
|
1e01d4d568 | ||
|
|
fab9aa46c2 | ||
|
|
59aa8d256f | ||
|
|
b2bdcd5fd0 | ||
|
|
3d07cf391c | ||
|
|
17b068d21c | ||
|
|
7bb88fee20 | ||
|
|
b7bebaba7c | ||
|
|
29c00d2489 | ||
|
|
34f8dd8d1d | ||
|
|
941ff55143 | ||
|
|
397dd1d955 | ||
|
|
e0c04223f4 | ||
|
|
d1dd090b33 | ||
|
|
52e0760e73 | ||
|
|
dd54af237b | ||
|
|
791b35f663 | ||
|
|
cfbd1f44e4 | ||
|
|
2877da8123 | ||
|
|
7a312a42c3 | ||
|
|
a064ab73f9 | ||
|
|
8c6393250c | ||
|
|
b9ed000511 | ||
|
|
143115a8fd | ||
|
|
99f1ee03a1 | ||
|
|
bf39ddd570 | ||
|
|
4366d1a8f3 | ||
|
|
2c8c4d8719 | ||
|
|
db9ad40dca | ||
|
|
ff93d61119 | ||
|
|
176146f91b | ||
|
|
cfaccd6dfb | ||
|
|
a5de645037 | ||
|
|
78e957fc0d | ||
|
|
8fa66fec43 | ||
|
|
b6b135110b | ||
|
|
019750ab52 | ||
|
|
9d84478866 | ||
|
|
6580500330 | ||
|
|
bc29c5c419 | ||
|
|
5f01b94bbc | ||
|
|
d580207102 | ||
|
|
2e709ae941 | ||
|
|
efca42296b | ||
|
|
06737945a1 | ||
|
|
a7d74c37be | ||
|
|
bf93d1f4ee | ||
|
|
f76f1f891c | ||
|
|
05a078c78b | ||
|
|
92bbb3d92b | ||
|
|
907dce15b1 | ||
|
|
203841e299 | ||
|
|
64223affda | ||
|
|
3e440a1a48 | ||
|
|
d791226489 | ||
|
|
02d1842a48 | ||
|
|
7a7bdd1304 | ||
|
|
49640dc098 | ||
|
|
499d771a09 | ||
|
|
7aa17338e8 | ||
|
|
f63cb69983 | ||
|
|
e44f70719f | ||
|
|
bb632c8427 | ||
|
|
f298a5e768 | ||
|
|
8397fa3f0a | ||
|
|
6a6624b346 | ||
|
|
041af5ca86 | ||
|
|
ea2bc4ded1 | ||
|
|
ee93748000 | ||
|
|
1fc3b9b827 | ||
|
|
4b0a447523 | ||
|
|
6ecc4602c6 | ||
|
|
02c4087da8 | ||
|
|
50b7a5411f | ||
|
|
06ea71267b | ||
|
|
e851d208cc | ||
|
|
6dccd92692 | ||
|
|
606af0695d | ||
|
|
4706f2b826 | ||
|
|
e73cdc9d1f | ||
|
|
d762b9e163 | ||
|
|
863080eb9b | ||
|
|
039ca47173 | ||
|
|
9c93731ffb | ||
|
|
2f53fd6dca | ||
|
|
730d75f774 | ||
|
|
ddf3af5098 | ||
|
|
ccb76fc453 | ||
|
|
8733a729a5 | ||
|
|
39dc446c3f | ||
|
|
506f96c24a | ||
|
|
abe4f85633 | ||
|
|
b551521943 | ||
|
|
56432bf9fc | ||
|
|
8b446480a2 | ||
|
|
4973ec2ebb | ||
|
|
5491ac08c0 | ||
|
|
bd6f07ace9 | ||
|
|
46cd0dd0f2 | ||
|
|
c7119be498 | ||
|
|
b81e9aa69e | ||
|
|
273f670161 | ||
|
|
98f2e9f9fe | ||
|
|
78f8887dc4 | ||
|
|
2032a21b57 | ||
|
|
5906567331 | ||
|
|
02d1b86214 | ||
|
|
543f437175 | ||
|
|
df05d2c06f | ||
|
|
4c9f1ffcac | ||
|
|
4845b6a1f3 | ||
|
|
27ba23ae9a | ||
|
|
1cb01a53f8 | ||
|
|
76a2ba4d8b | ||
|
|
c002b50a69 | ||
|
|
51dad4ff8e | ||
|
|
e010f552c7 | ||
|
|
76ed270542 | ||
|
|
d52498bfab | ||
|
|
887529a1cb | ||
|
|
0f8c65b933 | ||
|
|
ba19fc6002 | ||
|
|
4d56b928d5 | ||
|
|
f8c67a7336 | ||
|
|
2d4cd387fe | ||
|
|
456f2e323e | ||
|
|
2b17f21374 | ||
|
|
1de90da548 | ||
|
|
f228ad97d5 | ||
|
|
370f86bc30 | ||
|
|
244f1e4987 | ||
|
|
e2a7f2dc93 | ||
|
|
3fc56e6415 | ||
|
|
c6a09f9f7c | ||
|
|
28e7e0db85 | ||
|
|
fe5cad4ea0 | ||
|
|
106be8ffc0 | ||
|
|
220d6d0ce6 | ||
|
|
2684524cee | ||
|
|
f334ec8dd8 | ||
|
|
fc1265dea1 | ||
|
|
3e80a096d5 | ||
|
|
2122466105 | ||
|
|
3ba3c678c9 | ||
|
|
17b6ccc4be | ||
|
|
3bae8af045 | ||
|
|
aa866137fb | ||
|
|
0bb3bab57b | ||
|
|
3341ecd8fb | ||
|
|
3c822bfc23 | ||
|
|
5e2985d081 | ||
|
|
c0561c5722 | ||
|
|
6c9534bc4f | ||
|
|
eb90ce13bd | ||
|
|
f56ad186af | ||
|
|
1105a5460e | ||
|
|
32b8fe77de | ||
|
|
9568679f05 | ||
|
|
017d6da371 | ||
|
|
9dfc2367cf | ||
|
|
4208e8b96a | ||
|
|
3df5b70b36 | ||
|
|
538784da75 | ||
|
|
b20a139c08 | ||
|
|
c8b6058dd5 | ||
|
|
772ffe0b31 | ||
|
|
ebe76b0edd | ||
|
|
b3b1d83001 | ||
|
|
018304de1e | ||
|
|
4998b34014 | ||
|
|
37ef13c438 | ||
|
|
ebf96cc76a | ||
|
|
d18cbb0b6c | ||
|
|
f02b1b6902 | ||
|
|
a3a5139f19 | ||
|
|
4ef4144391 | ||
|
|
5f2e52150a | ||
|
|
af307c720b | ||
|
|
abf3e167ac | ||
|
|
bdf8dfec0c | ||
|
|
a3a88d51e8 | ||
|
|
2edd69fc6d | ||
|
|
6fa1c4b1e2 | ||
|
|
341a79ded9 | ||
|
|
470a91d431 | ||
|
|
154629aed9 | ||
|
|
0f2c0e15f5 | ||
|
|
a3699c6ee0 | ||
|
|
ebe2c3971a | ||
|
|
a89180f042 | ||
|
|
b0df757099 | ||
|
|
a828fa7b62 | ||
|
|
ff88fca324 | ||
|
|
e0ae30ea49 | ||
|
|
936cbb0038 | ||
|
|
cb8b3b6237 | ||
|
|
ed734b0a73 | ||
|
|
3e89b6ef44 | ||
|
|
749bee61e4 | ||
|
|
bf96d2fab0 | ||
|
|
82750475ce | ||
|
|
72e3f208b4 | ||
|
|
9acc3b0600 | ||
|
|
aced75d8d5 | ||
|
|
275dfda8d1 | ||
|
|
53c4fbaa89 | ||
|
|
c3995e7b37 | ||
|
|
28b5d5fec7 | ||
|
|
1bdaf027dc | ||
|
|
9ba08ee7e8 | ||
|
|
8364505379 | ||
|
|
c029631bd3 | ||
|
|
08612d635b | ||
|
|
5b2ff566ca | ||
|
|
7906bfcff9 | ||
|
|
4e15071689 | ||
|
|
e405292398 | ||
|
|
869d6dae1e | ||
|
|
74d22b00e6 | ||
|
|
b061aaacb3 | ||
|
|
7cbcc5d181 | ||
|
|
0431c3e82f | ||
|
|
6d9f6bc9e1 | ||
|
|
9969c5eddf | ||
|
|
892d753208 | ||
|
|
07fad3df80 | ||
|
|
95998cb027 | ||
|
|
8e6381d57a | ||
|
|
55adf2497b | ||
|
|
9fd32f24c6 | ||
|
|
4e3c339740 | ||
|
|
a0b55a1b92 | ||
|
|
cda01ec386 | ||
|
|
7c2d54307d | ||
|
|
6e517eabc2 | ||
|
|
e8fa4df277 | ||
|
|
2a990d3234 | ||
|
|
273e4cc7e4 | ||
|
|
a90288194c | ||
|
|
9b7c5c6f42 | ||
|
|
5ddd559d03 | ||
|
|
7025474b39 |
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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=%
|
||||
|
||||
BIN
main/plugins/org.talend.common.ui.runtime/icons1/map.gif
Normal file
BIN
main/plugins/org.talend.common.ui.runtime/icons1/map.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.9 KiB |
BIN
main/plugins/org.talend.common.ui.runtime/icons1/reduce.gif
Normal file
BIN
main/plugins/org.talend.common.ui.runtime/icons1/reduce.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.2 KiB |
@@ -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);
|
||||
|
||||
@@ -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$
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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$
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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)
|
||||
*
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
talend.version=5.6.0
|
||||
talend.version=5.6.2
|
||||
@@ -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);
|
||||
|
||||
@@ -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>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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>
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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()) {
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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" />
|
||||
|
||||
@@ -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"/>
|
||||
|
||||
@@ -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" />
|
||||
|
||||
@@ -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": {
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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$
|
||||
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
@@ -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()) {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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, "", "");
|
||||
|
||||
|
||||
@@ -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(),
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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$
|
||||
|
||||
}
|
||||
@@ -192,4 +192,6 @@ public interface IHadoopClusterService extends IService {
|
||||
*/
|
||||
public boolean hasDiffsFromClusterToProcess(Item item, IProcess process);
|
||||
|
||||
public String getHadoopClusterProperties(Connection hadoopSubConnection);
|
||||
|
||||
}
|
||||
|
||||
@@ -30,6 +30,8 @@ public enum EHadoopProperties {
|
||||
|
||||
RESOURCE_MANAGER_PRINCIPAL,
|
||||
|
||||
JOBHISTORY_PRINCIPAL,
|
||||
|
||||
HIVE_PRINCIPAL,
|
||||
|
||||
DATABASE,
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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";
|
||||
}
|
||||
@@ -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();
|
||||
|
||||
@@ -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$
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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)));
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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")) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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$
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -224,4 +224,8 @@ public interface IElementParameter {
|
||||
public boolean isRaw();
|
||||
|
||||
public void setRaw(boolean raw);
|
||||
|
||||
public void setLog4JEnabled(boolean enable);
|
||||
|
||||
public boolean isLog4JEnabled();
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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$
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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...
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
@@ -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".
|
||||
*
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
Reference in New Issue
Block a user