Compare commits
10 Commits
release/5.
...
release/5.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0801504e07 | ||
|
|
ac402846f0 | ||
|
|
3263ab3c56 | ||
|
|
1e176ed6d6 | ||
|
|
056197eccc | ||
|
|
be58d3d48c | ||
|
|
6a6803a8df | ||
|
|
2ee02183d4 | ||
|
|
3a6f338f8b | ||
|
|
9c40e53170 |
@@ -740,7 +740,7 @@
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
unpack="true"/>
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="org.eclipse.jet.core"
|
||||
|
||||
@@ -46,6 +46,7 @@ ComponentProjectPreferencePage.Warning=Warnung
|
||||
AbstractXMLConfigPage.VERSIONTip=Ein Dezimalwert zur Angabe der Version Ihrer neuen Komponente.
|
||||
WizardJetFilesChoosePage.Directory=Verzeichnis:
|
||||
CreateComponentWizard.NewComponent=Neue Komponente
|
||||
WizardComponentFolderPage.Name=Name
|
||||
RemoveResourceAction.Remove=Entfernen
|
||||
WizardJetFilesChoosePage.UseIconFrom=Verwende Icon von:
|
||||
ImportComponentDialog.ImportFinished=Import der Komponente abgeschlossen
|
||||
|
||||
@@ -4,7 +4,7 @@ EditComponentActionProvider.Edit=Editer ce composant
|
||||
ImportComponentDialog.ErrorMSG4=Aucun composant sélectionné pour l'import
|
||||
ProjectSelectionDialog.SelectPath=Sélectionner le chemin du projet
|
||||
AbstractXMLConfigPage.TYPETip=Type de données.
|
||||
PushToPaletteActionProvider.Error2=ERROR
|
||||
PushToPaletteActionProvider.Error2=Erreur
|
||||
CopyFromPaletteActionProvider.Label2=Importer les composants de la Palette
|
||||
AbstractXMLConfigPage.MAXOUTPUTTip=Entier. Nombre maximum de sorties pour cette connexion.
|
||||
ImportComponentDialog.Browser=Parcourir...
|
||||
@@ -18,7 +18,7 @@ CreateComponentWizard.SpecifyRes=Sp
|
||||
AbstractXMLConfigPage.REPOSITORYVALUETip=Référentiel de Métadonnées à sélectionner.
|
||||
PushToPaletteActionProvider.ErrorMSG=Le répertoire des composants utilisateur n'est pas défini.
|
||||
AbstractXMLConfigPage.NUMROWTip=Entier. Position de ligne du paramètre dans la vue Composant
|
||||
PushToPaletteActionProvider.Error=ERROR
|
||||
PushToPaletteActionProvider.Error=Erreur
|
||||
ComponentProjectManager.InternalErrorMsg=Erreur interne \: {(0)}
|
||||
AbstractXMLConfigPage.IntValue=Entier
|
||||
ImportComponentDialog.ImportCanceled=Import des composants annulé
|
||||
|
||||
@@ -19,21 +19,16 @@ WizardComponentFolderPage.ErrMSG1=Nije ozna\u010Den jezik za komponentu
|
||||
CreateComponentWizard.FillIn=Popuni svojstva komponente
|
||||
ComponentProjectPreferencePage.Warning=Upozorenje
|
||||
AbstractXMLConfigPage.VERSIONTip=Decimalna vrijednost koja ozna\u010Dava verziju va\u0161e nove komponente.
|
||||
WizardJetFilesChoosePage.Directory=Direktorij:
|
||||
WizardComponentFolderPage.Name=Ime
|
||||
RemoveResourceAction.Remove=Ukloni
|
||||
WizardJetFilesChoosePage.UseIconFrom=Koristi ikonu iz:
|
||||
AbstractXMLConfigPage.SetProperties=Postavi svojstva odabranog elementa.
|
||||
AddResourceAction.AddLib=Dodaj biblioteke...
|
||||
WizardComponentFolderPage.Perl=Perl
|
||||
AbstractXMLConfigPage.NBLINESTip=Cjelobrojna vrijednost. Linije se prote\u017Eu od tog parametra unutar Component pogleda.
|
||||
AbstractXMLConfigPage.MININPUTTip=Integer vrijednost. Najmanji broj ulaza za ovu vezu.
|
||||
WizardJetFilesChoosePage.UseDefaultIcon=Koristi zadanu ikonu
|
||||
WizardComponentFolderPage.LongName=Duga\u010Dko ime (mouseover tooltip)
|
||||
CopyComponentActionProvider.CopyComponent=Kopiraj tu komponentu
|
||||
AddExternalResourceAction.ErrorMsg=Ozna\u010Dena vanjska arhiva nije dostupna ili ne postoji.
|
||||
CopyFromPaletteActionProvider.Label=Kopiraj komponentu iz izbornika Palette
|
||||
WizardJetFilesChoosePage.ChoseAIcon=Odaberi ikonu
|
||||
AbstractXMLConfigPage.LINESTYLETip=Cjelobrojna vrijednost'. Stil spojne linije (1. Puna, 2: Crtkana, 3: To\u010Dka, 4: Crta-To\u010Dka)
|
||||
ComponentProjectPreferencePage.ButtonLabel0=U redu
|
||||
CreateComponentWizard.MainProperties=Glavna svojstva
|
||||
|
||||
@@ -2,12 +2,6 @@ PushToPaletteActionProvider.Error2=Fout
|
||||
PushToPaletteActionProvider.Error=Fout
|
||||
NewActionProvider.New=Nieuw
|
||||
NewActionProvider.NewComponent=Nieuw Component
|
||||
AbstractXMLConfigPage.Delete=Verwijderen
|
||||
WizardJetFilesChoosePage.Directory=Directory:
|
||||
CreateComponentWizard.NewComponent=Nieuw Component
|
||||
WizardComponentFolderPage.Name=Naam
|
||||
WizardComponentFolderPage.Perl=Perl
|
||||
WizardJetFilesChoosePage.UseDefaultIcon=Gebruik default icon
|
||||
WizardJetFilesChoosePage.ChoseAIcon=Kies een icon
|
||||
AbstractXMLConfigPage.New=Nieuw
|
||||
WizardComponentFolderPage.Java=Java
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
PushToPaletteActionProvider.Error2=Gre\u0161ka
|
||||
PushToPaletteActionProvider.Error=Gre\u0161ka
|
||||
AbstractXMLConfigPage.Delete=DELETE
|
||||
|
||||
@@ -1,88 +0,0 @@
|
||||
FileCopy.ExceptionMSG=\u6E90\u6587\u4EF6"
|
||||
EditComponentActionProvider.Edit=\u7F16\u8F91\u7EC4\u4EF6
|
||||
ImportComponentDialog.ErrorMSG4=\u6CA1\u6709\u9009\u62E9\u7EC4\u4EF6\u5BFC\u5165
|
||||
AbstractXMLConfigPage.TYPETip=%u8CC7%u6599%u578B%u614B.
|
||||
PushToPaletteActionProvider.Error2=\u9519\u8BEF
|
||||
CopyFromPaletteActionProvider.Label2=\u4ECEpalette\u5BFC\u5165\u7EC4\u4EF6
|
||||
AbstractXMLConfigPage.MAXOUTPUTTip=\u6574\u6570\u503C.\u8FDE\u63A5\u6700\u5927\u503C\u8F93\u51FA
|
||||
ImportComponentDialog.Browser=\u6D4F\u89C8..
|
||||
ComponentProjectPreferencePage.WarningMSG=\u8B66\u544A,\u8FD9\u79CD\u4FEE\u6539\u4EC5\u4EC5\u5F71\u54CD\u7EC4\u4EF6\u8BBE\u8BA1\u5668\uFF0C\u4E0D\u5F71\u54CDPalette.
|
||||
AbstractXMLConfigPage.MAXINPUTTip=\u6574\u6570\u503C.\u8FDE\u63A5\u6700\u5927\u503C\u8F93\u5165.
|
||||
PushToPaletteActionProvider.ErrorMSG2=\u7528\u6237\u7EC4\u4EF6\u6587\u4EF6\u5939\u4E0D\u5B58\u5728\u3002
|
||||
ComponentProjectManager.CreationProblems=\u95ee\u9898\u521b\u5efa
|
||||
CopyComponentActionProvider.InputName=\u8F93\u5165\u65B0\u7684\u7EC4\u4EF6\u540D
|
||||
CreateComponentWizard.SpecifyRes=\u6307\u5B9A\u8D44\u6E90
|
||||
AbstractXMLConfigPage.REPOSITORYVALUETip=%u9078%u64C7 Metadata %u5132%u85CF%u5EAB.
|
||||
PushToPaletteActionProvider.ErrorMSG=\u7528\u6237\u7EC4\u4EF6\u6587\u4EF6\u5939\u672A\u8BBE\u7F6E\u3002
|
||||
AbstractXMLConfigPage.NUMROWTip=\u6574\u6570\u503C.\u6B64\u53C2\u6570\u5217\u4F4D\u7F6E\u5728\u7EC4\u4EF6\u89C6\u56FE
|
||||
PushToPaletteActionProvider.Error=\u9519\u8BEF
|
||||
ComponentProjectManager.InternalErrorMsg=\u5185\u90E8\u9519\u8BEF\uFF1A{0}
|
||||
AbstractXMLConfigPage.IntValue=%u6574%u6578%u503C
|
||||
ImportComponentDialog.ImportCanceled=\u5BFC\u5165\u7EC4\u4EF6\u5DF2\u53D6\u6D88
|
||||
PushToPaletteActionProvider.OK=\u786E\u5B9A
|
||||
WizardJetFilesChoosePage.BeginFile=\u5F00\u59CB\u6587\u4EF6
|
||||
AbstractXMLConfigPage.COLORTip=RGB\u5341\u516D\u8FDB\u5236.\u4F8B\u5982:"00FF00"
|
||||
CreateComponentWizard.CreateXMLPerl=\u521B\u5EFAPERL\u7EC4\u4EF6\u7684XML\u914D\u7F6E\u6587\u4EF6
|
||||
ImportComponentDialog.SelectDirectoryLabel=\u9009\u62E9\u4E00\u4E2A\u8DEF\u5F84\uFF1A
|
||||
PushToPaletteActionProvider.Information=\u4FE1\u606F
|
||||
PluginConstant.Borwser=\u6D4F\u89C8..
|
||||
NewActionProvider.New=\u65b0
|
||||
AbstractXMLConfigPage.EXTENSIONTip=\u63D2\u4EF6\u540D\u79F0\u5B57\u7B26\u4E32\u503C.\u6B64\u9009\u9879\u7528\u4E8E\u5916\u90E8\u7EC4\u4EF6.
|
||||
ImportComponentDialog.ShowPaletteComponents=\u663E\u793A\u7EC4\u4EF6\u8C03\u8272\u677F
|
||||
ComponentProjectPreferencePage.ChooseProject=\u9009\u62E9\u7EC4\u4EF6\u8BBE\u8BA1\u5DE5\u7A0B\u6587\u4EF6\u5939
|
||||
WizardComponentFolderPage.ErrMSG5=\u7EC4\u4EF6\u65CF\u65E0\u5185\u5BB9
|
||||
AbstractXMLConfigPage.BooleanTip=Boolean\u503C(\u771F\u6216\u5047).
|
||||
AbstractXMLConfigPage.Delete=\u5220\u9664
|
||||
WizardComponentFolderPage.ErrMSG3=\u7EC4\u4EF6\u5DF2\u5B58\u5728
|
||||
WizardComponentFolderPage.ErrMSG2=\u7EC4\u4EF6\u540D\u4E3A\u7A7A
|
||||
WizardComponentFolderPage.ErrMSG1=\u6CA1\u6709\u9009\u62E9\u7EC4\u4EF6\u7684\u8BED\u8A00
|
||||
CreateComponentWizard.FillIn=\u586B\u5199\u7EC4\u4EF6\u5C5E\u6027
|
||||
ImportComponentDialog.ImportCanceledMSG=\u5DF2\u53D6\u6D88\u4ECEPalette\u4E0A\u5BFC\u5165\u7EC4\u4EF6
|
||||
ComponentProjectPreferencePage.Warning=\u8B66\u544A
|
||||
AbstractXMLConfigPage.VERSIONTip=%u8ACB%u7528%u4E00%u500B%u5341%u9032%u4F4D%u6578%u503C%u4F86%u6A19%u8A18%u60A8%u7684%u65B0%u5143%u4EF6%u7248%u672C.
|
||||
WizardJetFilesChoosePage.Directory=\u76EE\u5F55
|
||||
WizardComponentFolderPage.Name=\u8fde\u63a5\u540d
|
||||
RemoveResourceAction.Remove=\u5220\u9664
|
||||
WizardJetFilesChoosePage.UseIconFrom=\u9009\u62E9\u56FE\u6807\uFF1A
|
||||
ImportComponentDialog.ImportFinished=\u5BFC\u5165\u7EC4\u4EF6\u5B8C\u6210
|
||||
AbstractXMLConfigPage.SetProperties=\u8BBE\u7F6E\u9009\u62E9\u5143\u7D20\u5C5E\u6027
|
||||
ProjectSelectionDialog.ChooseFolder=\u5728\u6B64\u4F1A\u8BDD\u4E2D\u9009\u62E9\u4E00\u4E2A\u5DE5\u7A0B\u6587\u4EF6\u5939
|
||||
ComponentProjectPreferencePage.ComponentProject=\u7EC4\u4EF6\u5DE5\u7A0B
|
||||
ImportComponentDialog.ImportFinishedMSG=\u7EC4\u4EF6\u5BFC\u5165\u6210\u529F
|
||||
AddExternalResourceAction.ErrorTitle=\u5916\u90E8\u6863\u6848\u9519\u8BEF
|
||||
AbstractXMLConfigPage.MININPUTTip=\u6574\u6570\u503C.\u8FDE\u63A5\u6700\u5C0F\u503C\u8F93\u51FA
|
||||
WizardJetFilesChoosePage.MainFile=\u4E3B\u6587\u4EF6
|
||||
CreateComponentWizard.CreateXMLJava=\u521B\u5EFAJava\u7EC4\u4EF6\u7684XML\u914D\u7F6E\u6587\u4EF6
|
||||
WizardJetFilesChoosePage.UseDefaultIcon=\u4F7F\u7528\u9ED8\u8BA4\u7684\u56FE\u6807
|
||||
CopyComponentActionProvider.CopyComponent=\u590D\u5236\u8FD9\u4E2A\u7EC4\u4EF6
|
||||
ImportComponentDialog.ChooseComponentsLabel=\u9009\u62E9\u8981\u5BFC\u5165\u7684\u7EC4\u4EF6\uFF1A
|
||||
AddExternalResourceAction.ErrorMsg=\u9009\u5B9A\u7684\u5916\u90E8\u6863\u6848\u662F\u4E0D\u53EF\u7528\u6216\u4E0D\u5B58\u5728.
|
||||
ComponentProjectManager.NewProject=\u65B0\u7EC4\u4EF6\u9879\u76EE
|
||||
CopyFromPaletteActionProvider.Label=\u4ECEPalette\u590D\u5236\u7EC4\u4EF6
|
||||
WizardJetFilesChoosePage.ChoseAIcon=\u9009\u62E9\u6309\u94AE
|
||||
ComponentProjectPreferencePage.SelectPath=\u9009\u62E9\u7EC4\u4EF6\u5DE5\u7A0B\u8DEF\u5F84
|
||||
AbstractXMLConfigPage.LINESTYLETip=\u6574\u6570\u503C.\u8FDE\u63A5\u7EBF\u98CE\u683C(1: Solid, 2: Dash, 3: Dot, 4: Dashdot)
|
||||
WizardJetFilesChoosePage.EndFile=\u7ED3\u675F\u6587\u4EF6
|
||||
PushToPaletteActionProvider.InformationMSG=\u7EC4\u4EF6\u5DF2\u53D1\u5E03\uFF0Cpalette\u5C06\u5237\u65B0\u3002
|
||||
ProjectSelectionDialog.ComponentProject=\u7EC4\u4EF6\u5DE5\u7A0B
|
||||
ComponentProjectPreferencePage.ButtonLabel0=\u786E\u5B9A
|
||||
AbstractXMLConfigPage.New=\u65b0
|
||||
CopyComponentValidator.ComponentExist=\u6B64\u7EC4\u4EF6\u5DF2\u5B58\u5728
|
||||
ImportComponentDialog.WarningMSG=\u64CD\u4F5C\u5C06\u8986\u76D6\u5DE5\u4F5C\u533A\u5DF2\u5B58\u5728\u7684\u7EC4\u4EF6\u3002\u60A8\u771F\u7684\u8981\u5BFC\u5165\u5DF2\u9009\u62E9\u7684\u7EC4\u4EF6\u5417\uFF1F
|
||||
CreateComponentWizard.MainProperties=\u4E3B\u8981\u5C5E\u6027
|
||||
ComponentProjectManager.WarningMsg=\u5E95\u5C42\u6587\u4EF6\u7CFB\u7EDF\u4E0D\u533A\u5206\u5927\u5C0F\u5199\u3002\u5DF2\u7ECF\u5B58\u5728\u4E00\u4E2A\u9879\u76EE\u4E0E{0}\u51B2\u7A81
|
||||
WizardComponentFolderPage.Family=\u65cf
|
||||
PushToPaletteActionProvider.OK3=\u786E\u5B9A
|
||||
PushToPaletteActionProvider.OK2=\u786E\u5B9A
|
||||
CopyComponentActionProvider.CopyComponent2=\u590D\u5236\u7EC4\u4EF6
|
||||
AbstractXMLConfigPage.CTYPETip=\u8FDE\u7ED3\u5668\u7C7B\u578B
|
||||
AddResourceAction.ChooseResource=&\u9009\u62E9\u6DFB\u52A0jars\u548Czips:
|
||||
ImportComponentDialog.WarningTitle=\u8B66\u544A
|
||||
AddExternalResourceAction.AddELibs=\u6DFB\u52A0\u5916\u90E8\u5E93...
|
||||
ImportComponentDialog.NoComponentsAvailable=\u6CA1\u6709\u53EF\u7528\u7684\u7EC4\u4EF6
|
||||
AbstractXMLConfigPage.MINOUTPUTTip=\u6574\u6570\u503C\u3002\u8FDE\u63A5\u6700\u5C0F\u503C\u8F93\u51FA
|
||||
ValidateComponentXMLActionProvider.ok=\u786E\u8BA4
|
||||
ValidateComponentXMLActionProvider.result=\u9A8C\u8BC1\u7ED3\u679C
|
||||
ValidateComponentXMLActionProvider.valid=\u7EC4\u4EF6XML\u6587\u4EF6\u5408\u6CD5\uFF01
|
||||
ValidateComponentXMLActionProvider.validate=\u9A8C\u8BC1\u7EC4\u4EF6XML\u6587\u4EF6
|
||||
PushToPaletteActionProvider.PushToPaletteActionProvider.result=\u9A8C\u8BC1\u7ED3\u679C
|
||||
@@ -1,6 +0,0 @@
|
||||
FileWizard.0=\u6587\u4EF6\u5411\u5BFC
|
||||
\n
|
||||
ApplicationActionBarAdvisor.helpMenu=\u5E2E\u52A9(&H)
|
||||
ApplicationActionBarAdvisor.fileMenu=\u6587\u4EF6(&F)
|
||||
ShowViewAction.actionLabel=\u663E\u793A\u89C6\u56FE...(&v)
|
||||
ApplicationActionBarAdvisor.windowMenu=\u7A97\u53E3(&W)
|
||||
@@ -12,6 +12,10 @@
|
||||
// ============================================================================
|
||||
package org.talend.componentdesigner;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.apache.log4j.PropertyConfigurator;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.jface.resource.ImageDescriptor;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
@@ -42,10 +46,18 @@ public class ComponentDesigenerPlugin extends AbstractUIPlugin {
|
||||
*
|
||||
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
|
||||
*/
|
||||
@Override
|
||||
public void start(BundleContext context) throws Exception {
|
||||
super.start(context);
|
||||
plugin = this;
|
||||
Properties prop = new Properties();
|
||||
try {
|
||||
prop.load(ComponentDesigenerPlugin.class.getResourceAsStream("log4j.properties")); //$NON-NLS-1$
|
||||
} catch (IOException e) {
|
||||
// e.printStackTrace();
|
||||
org.talend.componentdesigner.exception.ExceptionHandler.process(e);
|
||||
}
|
||||
|
||||
PropertyConfigurator.configure(prop);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -53,7 +65,6 @@ public class ComponentDesigenerPlugin extends AbstractUIPlugin {
|
||||
*
|
||||
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
|
||||
*/
|
||||
@Override
|
||||
public void stop(BundleContext context) throws Exception {
|
||||
plugin = null;
|
||||
super.stop(context);
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
### direct log messages to stdout ###
|
||||
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
|
||||
log4j.appender.stdout.Target=System.out
|
||||
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
|
||||
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
|
||||
|
||||
### direct messages to file hibernate.log ###
|
||||
#log4j.appender.file=org.apache.log4j.FileAppender
|
||||
#log4j.appender.file.File=hibernate.log
|
||||
#log4j.appender.file.layout=org.apache.log4j.PatternLayout
|
||||
#log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
|
||||
|
||||
### set log levels - for more verbose logging change 'info' to 'debug' ###
|
||||
|
||||
log4j.rootLogger=warn, stdout
|
||||
|
||||
#log4j.logger.org.hibernate=info
|
||||
log4j.logger.org.hibernate=debug
|
||||
|
||||
### log HQL query parser activity
|
||||
#log4j.logger.org.hibernate.hql.ast.AST=debug
|
||||
|
||||
### log just the SQL
|
||||
#log4j.logger.org.hibernate.SQL=debug
|
||||
|
||||
### log JDBC bind parameters ###
|
||||
log4j.logger.org.hibernate.type=info
|
||||
#log4j.logger.org.hibernate.type=debug
|
||||
|
||||
### log schema export/update ###
|
||||
log4j.logger.org.hibernate.tool.hbm2ddl=debug
|
||||
|
||||
### log HQL parse trees
|
||||
#log4j.logger.org.hibernate.hql=debug
|
||||
|
||||
### log cache activity ###
|
||||
#log4j.logger.org.hibernate.cache=debug
|
||||
|
||||
### log transaction activity
|
||||
#log4j.logger.org.hibernate.transaction=debug
|
||||
|
||||
### log JDBC resource acquisition
|
||||
#log4j.logger.org.hibernate.jdbc=debug
|
||||
|
||||
### enable the following line if you want to track down connection ###
|
||||
### leakages when using DriverManagerConnectionProvider ###
|
||||
#log4j.logger.org.hibernate.connection.DriverManagerConnectionProvider=trace
|
||||
@@ -124,7 +124,6 @@ public final class ComponentProjectManager {
|
||||
// create the new project operation
|
||||
IRunnableWithProgress op = new IRunnableWithProgress() {
|
||||
|
||||
@Override
|
||||
public void run(IProgressMonitor monitor) throws InvocationTargetException {
|
||||
CreateProjectOperation op = new CreateProjectOperation(description,
|
||||
Messages.getString("ComponentProjectManager.NewProject")); //$NON-NLS-1$
|
||||
@@ -184,7 +183,6 @@ public final class ComponentProjectManager {
|
||||
public void configProject(final IProject project, Shell shell) {
|
||||
IRunnableWithProgress op = new IRunnableWithProgress() {
|
||||
|
||||
@Override
|
||||
public void run(IProgressMonitor monitor) throws InvocationTargetException {
|
||||
monitor.beginTask("Configure project...", 4);
|
||||
try {
|
||||
@@ -224,17 +222,15 @@ public final class ComponentProjectManager {
|
||||
if (monitor != null && monitor.isCanceled()) {
|
||||
throw new OperationCanceledException();
|
||||
}
|
||||
if (project == null) {
|
||||
if (project == null)
|
||||
return;
|
||||
}
|
||||
IClasspathEntry[] entries = null;
|
||||
List<IClasspathEntry> cpEntries = new ArrayList<IClasspathEntry>();
|
||||
cpEntries.addAll(Arrays.asList(getDefaultJREClasspathEntries()));
|
||||
cpEntries.addAll(getDefaultUtilClasspathEntries());
|
||||
entries = cpEntries.toArray(new IClasspathEntry[cpEntries.size()]);
|
||||
if (monitor != null) {
|
||||
entries = (IClasspathEntry[]) cpEntries.toArray(new IClasspathEntry[cpEntries.size()]);
|
||||
if (monitor != null)
|
||||
monitor.worked(1);
|
||||
}
|
||||
|
||||
IPath output = getOutputLocation();
|
||||
IProgressMonitor subProgressMonitor = monitor == null ? new NullProgressMonitor() : new SubProgressMonitor(monitor, 2);
|
||||
@@ -264,6 +260,7 @@ public final class ComponentProjectManager {
|
||||
addLibClasspathEntries(ces, "org.talend.metadata.managment"); //$NON-NLS-1$
|
||||
addLibClasspathEntries(ces, "org.talend.core"); //$NON-NLS-1$
|
||||
addLibClasspathEntries(ces, "org.talend.designer.codegen"); //$NON-NLS-1$
|
||||
addLibClasspathEntries(ces, "org.talend.commons"); //$NON-NLS-1$
|
||||
return ces;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,15 +12,11 @@
|
||||
// ============================================================================
|
||||
package org.talend.componentdesigner.ui.preferencepage;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import org.eclipse.jface.dialogs.MessageDialog;
|
||||
import org.eclipse.jface.preference.DirectoryFieldEditor;
|
||||
import org.eclipse.jface.preference.FieldEditorPreferencePage;
|
||||
import org.eclipse.jface.util.PropertyChangeEvent;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.ModifyEvent;
|
||||
import org.eclipse.swt.events.ModifyListener;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.widgets.Label;
|
||||
import org.eclipse.ui.IWorkbench;
|
||||
@@ -31,8 +27,8 @@ import org.talend.componentdesigner.i18n.internal.Messages;
|
||||
|
||||
/**
|
||||
* This class represents a preference page that is contributed to the Preferences dialog. By subclassing
|
||||
* <samp>FieldEditorPreferencePage</samp>, we can use the field support built into JFace that allows us to create a page
|
||||
* that is small and knows how to save, restore and apply itself.
|
||||
* <samp>FieldEditorPreferencePage</samp>, we can use the field support built into JFace that allows us to create a
|
||||
* page that is small and knows how to save, restore and apply itself.
|
||||
* <p>
|
||||
* This page is used to modify preferences only. They are stored in the preference store that belongs to the main
|
||||
* plug-in class. That way, preferences can be accessed directly via the preference store.
|
||||
@@ -54,7 +50,6 @@ public class ComponentProjectPreferencePage extends FieldEditorPreferencePage im
|
||||
*
|
||||
* @see org.eclipse.jface.preference.PreferencePage#performApply()
|
||||
*/
|
||||
@Override
|
||||
protected void performApply() {
|
||||
super.performApply();
|
||||
}
|
||||
@@ -64,47 +59,29 @@ public class ComponentProjectPreferencePage extends FieldEditorPreferencePage im
|
||||
*
|
||||
* @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
|
||||
*/
|
||||
@Override
|
||||
public void createFieldEditors() {
|
||||
Label l = new Label(getFieldEditorParent(), SWT.NONE);
|
||||
l.setText(Messages.getString("ComponentProjectPreferencePage.ChooseProject")); //$NON-NLS-1$
|
||||
GridData gd = new GridData();
|
||||
gd.horizontalSpan = 3;
|
||||
l.setLayoutData(gd);
|
||||
filePathTemp = new DirectoryFieldEditor(PluginConstant.PROJECT_URL,
|
||||
Messages.getString("ComponentProjectPreferencePage.ComponentProject"), //$NON-NLS-1$
|
||||
filePathTemp = new DirectoryFieldEditor(PluginConstant.PROJECT_URL, Messages
|
||||
.getString("ComponentProjectPreferencePage.ComponentProject"), //$NON-NLS-1$
|
||||
getFieldEditorParent());
|
||||
addField(filePathTemp);
|
||||
// addModifyListener for the filePath text
|
||||
filePathTemp.getTextControl(getFieldEditorParent()).addModifyListener(new ModifyListener() {
|
||||
|
||||
@Override
|
||||
public void modifyText(ModifyEvent e) {
|
||||
String newPath = filePathTemp.getTextControl(getFieldEditorParent()).getText();
|
||||
File file = new File(newPath);
|
||||
if (!file.exists() && !"".equals(newPath)) {
|
||||
filePathTemp.showErrorMessage();
|
||||
setValid(false);
|
||||
} else {
|
||||
setValid(true);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.jface.preference.FieldEditorPreferencePage#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
|
||||
* @see org.eclipse.jface.preference.FieldEditorPreferencePage#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
|
||||
*/
|
||||
@Override
|
||||
public void propertyChange(PropertyChangeEvent event) {
|
||||
|
||||
super.propertyChange(event);
|
||||
|
||||
MessageDialog warningMessageDialog = new MessageDialog(getFieldEditorParent().getShell(),
|
||||
Messages.getString("ComponentProjectPreferencePage.Warning"), null, //$NON-NLS-1$
|
||||
|
||||
MessageDialog warningMessageDialog = new MessageDialog(getFieldEditorParent().getShell(), Messages
|
||||
.getString("ComponentProjectPreferencePage.Warning"), null, //$NON-NLS-1$
|
||||
Messages.getString("ComponentProjectPreferencePage.WarningMSG"), MessageDialog.WARNING, //$NON-NLS-1$
|
||||
new String[] { Messages.getString("ComponentProjectPreferencePage.ButtonLabel0") }, 0); //$NON-NLS-1$
|
||||
warningMessageDialog.open();
|
||||
@@ -115,7 +92,6 @@ public class ComponentProjectPreferencePage extends FieldEditorPreferencePage im
|
||||
*
|
||||
* @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
|
||||
*/
|
||||
@Override
|
||||
public void init(IWorkbench workbench) {
|
||||
}
|
||||
|
||||
@@ -124,7 +100,6 @@ public class ComponentProjectPreferencePage extends FieldEditorPreferencePage im
|
||||
*
|
||||
* @see org.eclipse.jface.preference.FieldEditorPreferencePage#performOk()
|
||||
*/
|
||||
@Override
|
||||
public boolean performOk() {
|
||||
ComponentDesigenerPlugin.getDefault().creatComponentProj(filePathTemp.getStringValue());
|
||||
return super.performOk();
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
prefs.configuration.LINK_STYLE.AUTO=\u81EA\u52A8
|
||||
prefs.configuration.title=\u8fd0\u884c\u6b65\u9aa4\u914d\u7f6e
|
||||
prefs.configuration.LINK_STYLE=\u9ED8\u8BA4\u94FE\u63A5\u663E\u793A\u4E3A\uFF1A
|
||||
@@ -12,9 +12,6 @@
|
||||
// ============================================================================
|
||||
package org.talend.designer.abstractmap;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.oro.text.regex.MalformedPatternException;
|
||||
import org.apache.oro.text.regex.Pattern;
|
||||
import org.apache.oro.text.regex.PatternCompiler;
|
||||
@@ -26,16 +23,16 @@ import org.apache.oro.text.regex.Substitution;
|
||||
import org.apache.oro.text.regex.Util;
|
||||
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
|
||||
import org.talend.core.model.context.UpdateContextVariablesHelper;
|
||||
import org.talend.core.model.process.AbstractExternalNode;
|
||||
import org.talend.core.model.process.IElementParameter;
|
||||
import org.talend.core.model.process.node.IExternalMapEntry;
|
||||
import org.talend.core.model.process.node.MapperExternalNode;
|
||||
import org.talend.designer.abstractmap.ui.prefs.MapPrefsConstants;
|
||||
|
||||
/**
|
||||
* DOC amaumont class global comment. Detailled comment <br/>
|
||||
*
|
||||
*/
|
||||
public abstract class AbstractMapComponent extends MapperExternalNode {
|
||||
public abstract class AbstractMapComponent extends AbstractExternalNode {
|
||||
|
||||
/**
|
||||
* DOC amaumont AbstractMapComponent constructor comment.
|
||||
@@ -49,7 +46,6 @@ public abstract class AbstractMapComponent extends MapperExternalNode {
|
||||
*
|
||||
* @see org.talend.core.model.process.IExternalNode#initialize()
|
||||
*/
|
||||
@Override
|
||||
public void initialize() {
|
||||
initElementParameters();
|
||||
}
|
||||
@@ -79,7 +75,7 @@ public abstract class AbstractMapComponent extends MapperExternalNode {
|
||||
|
||||
protected boolean hasDataIntoExpression(Pattern pattern, PatternMatcher matcher, String expression) {
|
||||
if (expression != null) {
|
||||
if (matcher.matches(expression, pattern)) {
|
||||
if (matcher.contains(expression, pattern)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -91,7 +87,6 @@ public abstract class AbstractMapComponent extends MapperExternalNode {
|
||||
*
|
||||
* @see org.talend.core.model.process.INode#useData(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public boolean useData(String name) {
|
||||
if (super.useData(name)) {
|
||||
return true;
|
||||
@@ -108,7 +103,6 @@ public abstract class AbstractMapComponent extends MapperExternalNode {
|
||||
*
|
||||
* @see org.talend.core.model.process.INode#renameData(java.lang.String, java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public void renameData(String oldName, String newName) {
|
||||
super.renameData(oldName, newName);
|
||||
|
||||
@@ -116,17 +110,11 @@ public abstract class AbstractMapComponent extends MapperExternalNode {
|
||||
|
||||
}
|
||||
|
||||
private static Map<String, Pattern> patternsCache = new HashMap<String, Pattern>();
|
||||
|
||||
protected final Pattern getRenamePattern(String oldName) {
|
||||
if (patternsCache.containsKey(oldName)) {
|
||||
return patternsCache.get(oldName);
|
||||
}
|
||||
PatternCompiler compiler = new Perl5Compiler();
|
||||
Pattern pattern = null;
|
||||
try {
|
||||
pattern = compiler.compile("\\b(" + UpdateContextVariablesHelper.replaceSpecialChar(oldName) + ")(\\b|\\_)"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
patternsCache.put(oldName, pattern);
|
||||
return pattern;
|
||||
} catch (MalformedPatternException e) {
|
||||
ExceptionHandler.process(e);
|
||||
@@ -134,15 +122,8 @@ public abstract class AbstractMapComponent extends MapperExternalNode {
|
||||
}
|
||||
}
|
||||
|
||||
private static Map<String, Perl5Substitution> substitutionsCache = new HashMap<String, Perl5Substitution>();
|
||||
|
||||
protected final Perl5Substitution getRenameSubstitution(String newName) {
|
||||
if (substitutionsCache.containsKey(newName)) {
|
||||
return substitutionsCache.get(newName);
|
||||
}
|
||||
Perl5Substitution ps = new Perl5Substitution(newName + "$2", Perl5Substitution.INTERPOLATE_ALL); //$NON-NLS-1$
|
||||
substitutionsCache.put(newName, ps);
|
||||
return ps;
|
||||
return new Perl5Substitution(newName + "$2", Perl5Substitution.INTERPOLATE_ALL); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -14,4 +14,5 @@ AlfrescoOutputModelManager.prefixConflict=Kann das Modell nicht hinzuf
|
||||
AlfrescoOutputModelManager.notYetAdded=Dieses Modell wurde noch nicht hinzugefügt.
|
||||
AlfrescoModelDialog.type=Typ
|
||||
AlfrescoModelDialog.addModelFailed=Modell hinzufügen fehlgeschlagen
|
||||
AlfrescoModelDialog.modelTable.name=Name
|
||||
AlfrescoModelDialog.remove=Entfernen
|
||||
|
||||
@@ -10,5 +10,4 @@ AlfrescoOutputModelManager.prefixConflict=Ne mogu dodati model, prefix je u konf
|
||||
AlfrescoOutputModelManager.notYetAdded=Taj model jo\u0161 nije dodan
|
||||
AlfrescoModelDialog.addModelFailed=Dodavanje modela nije uspjelo
|
||||
AlfrescoModelDialog.modelTable.name=Ime
|
||||
AlfrescoModelDialog.remove=Ukloni
|
||||
AlfrescoOutputManager.failedLoadModel=U\u010Ditavanje modela iz metapodataka komponente nije uspjelo, reinicijaliziram
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
AlfrescoModelDialog.modelTable.title=Ba\u015Fl\u0131k
|
||||
AlfrescoModelDialog.add=Ekle...
|
||||
AlfrescoModelDialog.type=Tip
|
||||
AlfrescoModelDialog.modelTable.name=Ad\u0131
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
AlfrescoModelDialog.missingAspectDefinitions.msg=\u6240\u9009\u62E9\u7684\u65B9\u9762\u6D89\u53CA\u672A\u77E5\u7684Alfresco\u65B9\u9762: ${0}.\u8BF7\u63D0\u4F9Balfresco \u6A21\u578B\u6587\u4EF6\u5B9A\u4E49\u4ED6\u4EEC.
|
||||
AlfrescoModelDialog.modelTable.title=\u6807\u9898
|
||||
AlfrescoModelDialog.availableAspects=\u53EF\u7528\u56E0\u7D20
|
||||
AlfrescoModelDialog.missingAspectDefinitions.title=\u7F3A\u7701\u65B9\u9762\u5B9A\u4E49
|
||||
AlfrescoOutputManager.schemaError.title=schema\u9519\u8BEF
|
||||
AlfrescoModelDialog.missingTypeDefinitions.msg=\u6240\u9009\u62E9\u7684\u7C7B\u578B\u6D89\u53CA\u672A\u77E5\u7684Alfresco\u7C7B\u578B\u6216\u65B9\u9762: ${0}.\uFF0C\u8BF7\u63D0\u4F9Balfresco \u6A21\u578B\u6587\u4EF6\u5B9A\u4E49\u4ED6\u4EEC.
|
||||
AlfrescoModelDialog.missingTypeDefinitions.title=\u7F3A\u7701\u7C7B\u578B\u5B9A\u4E49
|
||||
AlfrescoModelDialog.add=\u6DFB\u52A0...
|
||||
AlfrescoOutputModelManager.errorReadingModel=\u8BFB\u53D6Alfresco\u7684\u6A21\u578B\u6587\u4EF6\u9519\u8BEF
|
||||
AlfrescoModelDialog.aspects=\u65B9\u9762
|
||||
AlfrescoOutputManager.schemaError.msg=\u8BF7\u5148\u540C\u6B65schema
|
||||
AlfrescoOutputModelManager.alreadyAdded=\u8BE5\u6A21\u578B\u5DF2\u6DFB\u52A0
|
||||
AlfrescoModelDialog.removeModelFailed=\u79FB\u9664\u6A21\u578B\u5931\u8D25
|
||||
AlfrescoOutputModelManager.prefixConflict=\u65E0\u6CD5\u6DFB\u52A0\u6A21\u578B\uFF0C\u524D\u7F00\u4E0E\u4EE5\u524D\u6DFB\u52A0\u6A21\u578B\u51B2\u7A81
|
||||
AlfrescoOutputModelManager.notYetAdded=\u8BE5\u6A21\u578B\u5C1A\u672A\u6DFB\u52A0
|
||||
AlfrescoModelDialog.type=\u7C7B\u578B
|
||||
AlfrescoModelDialog.addModelFailed=\u6DFB\u52A0\u6A21\u578B\u5931\u8D25
|
||||
AlfrescoModelDialog.modelTable.name=\u8fde\u63a5\u540d
|
||||
AlfrescoModelDialog.remove=\u5220\u9664
|
||||
AlfrescoOutputManager.failedLoadModel=\u65E0\u6CD5\u52A0\u8F7D\u7684\u7EC4\u4EF6\u5143\u6570\u636E\u6A21\u578B, \u91CD\u65B0\u521D\u59CB\u5316
|
||||
@@ -1 +0,0 @@
|
||||
pluginName=\u7EC4\u4EF6\u6A21\u5757
|
||||
@@ -53,4 +53,3 @@ BusinessNewDiagramFileWizard.SelectDiagramRootElement=\u0627\u062E\u062A\u0631 \
|
||||
BusinessAbstractParser.StringFloatConvertError=\u0644\u0627 \u064A\u0645\u0643\u0646 \u062A\u062D\u0648\u064A\u0644 \u0642\u064A\u0645\u0629 \u0646\u0635\u064A\u0629 \u0625\u0644\u0649 \u0642\u064A\u0645\u0629 \u0639\u0634\u0631\u064A\u0629
|
||||
BusinessAbstractParser.StringValueDoesNotConvertToByteValue=\u0644\u0627 \u064A\u0645\u0643\u0646 \u062A\u062D\u0648\u064A\u0644 \u0642\u064A\u0645\u0629 \u0646\u0635\u064A\u0629 \u0625\u0644\u0649 \u0642\u064A\u0645\u0629 \u0628\u0627\u064A\u062A
|
||||
DeleteAssignmentAction.DeleteAssignment=\u062D\u0630\u0641 \u062A\u0643\u0644\u064A\u0641
|
||||
BusinessDiagramEditor.canNotSaveTitle=\u062A\u062D\u0630\u064A\u0631
|
||||
|
||||
@@ -16,6 +16,7 @@ BusinessModelingAssistantProvider.AvaiableDomainModelElements=Verf
|
||||
BusinessPaletteFactory.BidirectionalRelationShip=Bidirektionale Beziehung
|
||||
BusinessPaletteFactory.CreateDirectionalRelationShip=Direktionale Beziehung hinzufügen
|
||||
BusinessPaletteFactory.CreateBidirectionalRelationShip=Bidirektionale Beziehung hinzufügen
|
||||
AssignmentPropertySection.Name=Name
|
||||
CreateAssignmentCommand.CannotAssign=Zuordnung nicht möglich.
|
||||
BusinessNewDiagramFileWizard.DiagramRootElement=Diagramm root-Element
|
||||
BusinessNewDiagramFileWizard.NoDiagramRootElementSelectedError=Kein Diagram-Root Element ausgewählt
|
||||
@@ -78,4 +79,3 @@ BusinessAbstractParser.StringValueDoesNotConvertToByteValue=String-Wert l
|
||||
BusinessNewDiagramFileWizard.IntialNewEcoreDiagramFile=Neue Ecore-Diagramm-Datei initialisieren
|
||||
BusinessTooltipFigure.assignedMeta={0} zugewiesene Metadaten
|
||||
DeleteAssignmentAction.DeleteAssignment=Zuordnung löschen
|
||||
BusinessDiagramEditor.canNotSaveTitle=Warnung
|
||||
|
||||
@@ -75,4 +75,3 @@ BusinessAbstractParser.StringValueDoesNotConvertToByteValue=\u03A4\u03B9\u03BC\u
|
||||
BusinessNewDiagramFileWizard.IntialNewEcoreDiagramFile=\u0391\u03C1\u03C7\u03B9\u03BA\u03BF\u03C0\u03BF\u03AF\u03B7\u03C3\u03B7 \u03BD\u03AD\u03BF\u03C5 \u03B1\u03C1\u03C7\u03B5\u03AF\u03BF\u03C5 \u03B4\u03B9\u03B1\u03B3\u03C1\u03AC\u03BC\u03BC\u03B1\u03C4\u03BF\u03C2 Ecore
|
||||
BusinessTooltipFigure.assignedMeta={0} \u03BA\u03B1\u03B8\u03BF\u03C1\u03B9\u03C3\u03BC\u03AD\u03BD\u03B1 \u039C\u03B5\u03C4\u03B1\u03B4\u03B5\u03B4\u03BF\u03BC\u03AD\u03BD\u03B1
|
||||
DeleteAssignmentAction.DeleteAssignment=\u0394\u03B9\u03B1\u03B3\u03C1\u03B1\u03C6\u03AE \u0391\u03BD\u03AC\u03B8\u03B5\u03C3\u03B7\u03C2
|
||||
BusinessDiagramEditor.canNotSaveTitle=\u03A0\u03C1\u03BF\u03B5\u03B9\u03B4\u03BF\u03C0\u03BF\u03AF\u03B7\u03C3\u03B7
|
||||
|
||||
@@ -79,5 +79,3 @@ BusinessAbstractParser.StringValueDoesNotConvertToByteValue=String value cannot
|
||||
BusinessNewDiagramFileWizard.IntialNewEcoreDiagramFile=Initialize new Ecore diagram file
|
||||
BusinessTooltipFigure.assignedMeta={0} assigned Metadata
|
||||
DeleteAssignmentAction.DeleteAssignment=Delete Assignment
|
||||
BusinessDiagramEditor.canNotSaveTitle=Warning
|
||||
BusinessDiagramEditor.canNotSaveMessage=Business Model is not locked by user, can not save.
|
||||
|
||||
@@ -46,4 +46,3 @@ BusinessAbstractParser.ValueOfIntegerIsExpected=Se esperaba un valor de tipo Int
|
||||
BusinessNewDiagramFileWizard.SelectDiagramRootElement=Seleccione un elemento del diagrama principal:
|
||||
BusinessAbstractParser.StringFloatConvertError=Valor del String no puede ser convertido a Float
|
||||
BusinessAbstractParser.StringValueDoesNotConvertToByteValue=Valor del String no puede ser convertido a Byte
|
||||
BusinessDiagramEditor.canNotSaveTitle=Advertencia
|
||||
|
||||
@@ -26,7 +26,7 @@ BusinessAbstractParser.ValueOfTypeByteIsExpected=Une valeur de type Byte est att
|
||||
BusinessAbstractParser.ValueOfTypeCharacterIsExpected=Une valeur de type Character est attendue
|
||||
BusinessPaletteFactory.ActionComment=Créer une nouvelle action
|
||||
BusinessAbstractParser.ValueOfTypeStringIsExpected=Une valeur de type String est attendue
|
||||
BusinessInitDiagramFileAction.Error=ERROR
|
||||
BusinessInitDiagramFileAction.Error=Erreur
|
||||
BusinessNewDiagramFileWizard.SelectRootElement=Sélectionnez un élément racine
|
||||
RepositoryFactoryProxyLabelProvider.Deleted=(Supprimé)
|
||||
BusinessPaletteFactory.TerminalComment=Créer un nouveau Terminal
|
||||
@@ -45,7 +45,7 @@ BusinessPaletteFactory.InputComment=Cr
|
||||
BusinessPaletteFactory.Data=Données
|
||||
BusinessPaletteFactory.Ellipse=Ellipse
|
||||
BusinessPaletteFactory.Input=Lecture
|
||||
BusinessPaletteFactory.List=liste
|
||||
BusinessPaletteFactory.List=Liste
|
||||
BusinessPaletteFactory.Relationshop=Relation
|
||||
BusinessAbstractParser.ValueOfBooleanIsExpected=Une valeur de type Boolean est attendue
|
||||
BusinessPaletteFactory.decision=Décision
|
||||
@@ -79,4 +79,3 @@ BusinessAbstractParser.StringValueDoesNotConvertToByteValue=Une valeur de cha
|
||||
BusinessNewDiagramFileWizard.IntialNewEcoreDiagramFile=Initialiser un nouveau fichier diagramme Ecore
|
||||
BusinessTooltipFigure.assignedMeta={0} Métadonnée affectée
|
||||
DeleteAssignmentAction.DeleteAssignment=Effacer l'affectation.
|
||||
BusinessDiagramEditor.canNotSaveTitle=Avertissement
|
||||
|
||||
@@ -64,4 +64,3 @@ BusinessAbstractParser.StringFloatConvertError=String nije mogu\u0107e konvertir
|
||||
BusinessAbstractParser.StringValueDoesNotConvertToByteValue=String nije mogu\u0107e konvertirati u Byte
|
||||
BusinessNewDiagramFileWizard.IntialNewEcoreDiagramFile=Inicijaliziranje nove datoteke za Ecore dijagram
|
||||
DeleteAssignmentAction.DeleteAssignment=Izbri\u0161i pridru\u017Eivanje
|
||||
BusinessDiagramEditor.canNotSaveTitle=Upozorenje
|
||||
|
||||
@@ -77,4 +77,3 @@ BusinessAbstractParser.StringValueDoesNotConvertToByteValue=Valore String non co
|
||||
BusinessNewDiagramFileWizard.IntialNewEcoreDiagramFile=Inizializzare un nuovo file di diagramma Ecore
|
||||
BusinessTooltipFigure.assignedMeta={0} Metadati assegnati
|
||||
DeleteAssignmentAction.DeleteAssignment=Elimina Assegnazione
|
||||
BusinessDiagramEditor.canNotSaveTitle=Avvertimento
|
||||
|
||||
@@ -79,5 +79,3 @@ BusinessAbstractParser.StringValueDoesNotConvertToByteValue=String \u5024\u3092
|
||||
BusinessNewDiagramFileWizard.IntialNewEcoreDiagramFile=\u65B0\u898F Ecore \u30C0\u30A4\u30A2\u30B0\u30E9\u30E0 \u30D5\u30A1\u30A4\u30EB\u306E\u521D\u671F\u5316
|
||||
BusinessTooltipFigure.assignedMeta=\u5272\u308A\u5F53\u3066\u3089\u308C\u305F\u30E1\u30BF\u30C7\u30FC\u30BF {0}
|
||||
DeleteAssignmentAction.DeleteAssignment=\u5272\u308A\u5F53\u3066\u306E\u524A\u9664
|
||||
BusinessDiagramEditor.canNotSaveTitle=\u8B66\u544A
|
||||
BusinessDiagramEditor.canNotSaveMessage=\u4ED6\u306E\u30E6\u30FC\u30B6\u304C\u64CD\u4F5C\u4E2D\u306E\u305F\u3081\u3001\u30D3\u30B8\u30CD\u30B9\u30E2\u30C7\u30EB\u3092\u4FDD\u5B58\u3067\u304D\u307E\u305B\u3093\u3002
|
||||
|
||||
@@ -57,4 +57,3 @@ BusinessAbstractParser.StringFloatConvertError=Warto\u015B\u0107 typu znakowego
|
||||
BusinessAbstractParser.StringValueDoesNotConvertToByteValue=Warto\u015B\u0107 typu znakowego nie mo\u017Ce by\u0107 skonwertowana na warto\u015B\u0107 typu Byte
|
||||
BusinessNewDiagramFileWizard.IntialNewEcoreDiagramFile=Inicjalizuj nowy plik diagramu Ecore
|
||||
DeleteAssignmentAction.DeleteAssignment=Skasuj przypisanie
|
||||
BusinessDiagramEditor.canNotSaveTitle=Ostrze\u017Cenie
|
||||
|
||||
@@ -64,4 +64,3 @@ BusinessNewDiagramFileWizard.SelectSemanticModelElement=Selecione o elemento de
|
||||
BusinessNewDiagramFileWizard.IntialNewEcoreDiagramFile=Iniciar novo arquivo de Diagrama Ecore
|
||||
BusinessTooltipFigure.assignedMeta=Metadados atribuidos à {0}
|
||||
DeleteAssignmentAction.DeleteAssignment=Apagar Cessão
|
||||
BusinessDiagramEditor.canNotSaveTitle=Advertência
|
||||
|
||||
@@ -73,4 +73,3 @@ BusinessAbstractParser.StringValueDoesNotConvertToByteValue=\u0421\u0442\u0440\u
|
||||
BusinessNewDiagramFileWizard.IntialNewEcoreDiagramFile=\u0418\u043D\u0438\u0446\u0438\u0430\u043B\u0438\u0437\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043D\u043E\u0432\u044B\u0439 \u0444\u0430\u0439\u043B \u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u044B Ecore
|
||||
BusinessTooltipFigure.assignedMeta={0} \u043F\u0440\u0438\u0441\u0432\u043E\u0435\u043D\u044B \u043C\u0435\u0442\u0430-\u0434\u0430\u043D\u043D\u044B\u0435
|
||||
DeleteAssignmentAction.DeleteAssignment=\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u043D\u0430\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435
|
||||
BusinessDiagramEditor.canNotSaveTitle=\u041F\u0440\u0435\u0434\u0443\u043F\u0440\u0435\u0436\u0434\u0435\u043D\u0438\u0435
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
AssignmentPropertySection.Type=Tip
|
||||
AssignmentPropertySection.Name=Ad\u0131
|
||||
BusinessInitDiagramFileAction.Error=Hata
|
||||
BusinessPaletteFactory.InputComment=Yeni giri\u015F olu\u015Ftur
|
||||
|
||||
@@ -1,81 +0,0 @@
|
||||
BusinessInitDiagramFileAction.DiagramFile=\u56FE\u8868\u6587\u4EF6
|
||||
BusinessAbstractParser.ValueOfLongIsExpected=\u503C\u7684\u7C7B\u578B\u5E94\u8BE5\u4E3ALong
|
||||
BusinessAbstractParser.ValueOfFloatIsExpected=\u503C\u7684\u7C7B\u578B\u5E94\u8BE5\u4E3AFloat
|
||||
BusinessPaletteFactory.DataComment=\u521B\u5EFA\u65B0\u7684\u6570\u636E
|
||||
CreateDiagramAction.CreateBusinessModel=\u521B\u5EFA\u4E1A\u52A1\u6A21\u578B
|
||||
BusinessCreationWizardPage.CreatenewBusinessDiagram=\u521B\u5EFA\u65B0\u7684\u903B\u8F91\u56FE\u3002
|
||||
BusinessAbstractParser.StringIntegerConvertError=String\u7C7B\u578B\u7684\u503C\u4E0D\u80FD\u8F6C\u6362\u4E3AInteger\u7C7B\u578B
|
||||
BusinessPaletteFactory.CreateGear=\u521B\u5EFA\u9F7F\u8F6E
|
||||
SimpleBusinessCreationWizardPage.Title=\u65B0\u7684\u4E1A\u52A1\u6A21\u578B
|
||||
BusinessNewDiagramFileWizard.CreateNewDiagram=\u521B\u5EFA\u65B0\u7684\u56FE\u8868
|
||||
BusinessAbstractParser.UnknownLiteral=\u65E0\u6548\u7684\u6587\u5B57
|
||||
BusinessAbstractParser.StringLongConverError=String\u7C7B\u578B\u7684\u503C\u4E0D\u80FD\u8F6C\u6362\u4E3ALong\u7C7B\u578B
|
||||
AssignmentPropertySection.DeleteAssignment=\u5220\u9664\u8D4B\u503C
|
||||
AssignmentPropertySection.Type=\u7C7B\u578B
|
||||
BusinessModelingAssistantProvider.AvaiableDomainModelElements=\u65E0\u6548\u7684\u57DF\u6A21\u578B\u5143\u7D20
|
||||
BusinessPaletteFactory.BidirectionalRelationShip=\u53CC\u5411\u5173\u8054
|
||||
BusinessPaletteFactory.CreateDirectionalRelationShip=\u521B\u5EFA\u65B9\u5411\u5173\u8054
|
||||
BusinessPaletteFactory.CreateBidirectionalRelationShip=\u521B\u5EFA\u53CC\u5411\u5173\u8054
|
||||
AssignmentPropertySection.Name=\u540D\u79F0
|
||||
CreateAssignmentCommand.CannotAssign=\u4E0D\u80FD\u5206\u914D\u3002
|
||||
BusinessNewDiagramFileWizard.DiagramRootElement=\u56FE\u8868\u6839\u5143\u7D20
|
||||
BusinessNewDiagramFileWizard.NoDiagramRootElementSelectedError=\u6CA1\u6709\u56FE\u8868\u6839\u5143\u7D20\u88AB\u9009\u4E2D
|
||||
BusinessVisualIDRegistry.ParseError=\u4E0D\u80FD\u628A\u89C6\u56FE\u7C7B\u578B\u5F53\u4F5CvisialID\u6570\u5B57\u6765\u8F6C\u6362
|
||||
OpenDiagramAction.EditBusinessModel=\u7F16\u8F91\u4E1A\u52A1\u6A21\u578B
|
||||
BusinessAbstractParser.ValueOfTypeByteIsExpected=\u503C\u7684\u7C7B\u578B\u5E94\u8BE5\u4E3AByte
|
||||
BusinessAbstractParser.ValueOfTypeCharacterIsExpected=\u503C\u7684\u7C7B\u578B\u5E94\u8BE5\u4E3ACharacter
|
||||
BusinessPaletteFactory.ActionComment=\u521B\u5EFA\u65B0\u7684\u52A8\u4F5C
|
||||
BusinessAbstractParser.ValueOfTypeStringIsExpected=\u503C\u7684\u7C7B\u578B\u5E94\u8BE5\u4E3AString
|
||||
BusinessInitDiagramFileAction.Error=\u9519\u8BEF
|
||||
BusinessNewDiagramFileWizard.SelectRootElement=\u9009\u62E9\u56FE\u8868\u6839\u5143\u7D20
|
||||
RepositoryFactoryProxyLabelProvider.Deleted=\uFF08\u5220\u9664\uFF09
|
||||
BusinessPaletteFactory.TerminalComment=\u521B\u5EFA\u65B0\u7684\u4E2D\u65AD\u70B9
|
||||
BusinessAbstractParser.ValueOfShortIsExpected=\u503C\u7684\u7C7B\u578B\u5E94\u8BE5\u4E3AShort
|
||||
BusinessPaletteFactory.DatabaseComment=\u521B\u5EFA\u65B0\u7684\u6570\u636E\u5E93
|
||||
AssignmentPropertySection.Comment=\u6CE8\u91CA
|
||||
SimpleBusinessCreationWizard.NewBusinessModel=\u65B0\u7684\u4E1A\u52A1\u578B
|
||||
BusinessNewDiagramFileWizard.InvalidDiagramRootElementSelected=\u9009\u4E2D\u4E86\u65E0\u6548\u7684\u56FE\u8868\u6839\u5143\u7D20
|
||||
BusinessInitDiagramFileAction.IntialNew=\u521D\u59CB\u5316\u65B0\u7684
|
||||
FindAssignmentAction.FindAssignments=\u67E5\u627E\u5206\u914D\u4EFB\u52A1
|
||||
RepositoryFactoryProxyLabelProvider.NotFound=\uFF08\u672A\u53D1\u73B0\uFF09
|
||||
BusinessPaletteFactory.Terminal=\u4E2D\u65AD\u70B9
|
||||
BusinessAbstractParser.InvalidInputAt=\u65E0\u6548\u7684\u8F93\u5165\u5728
|
||||
BusinessPaletteFactory.Gear=\u9F7F\u8F6E
|
||||
BusinessPaletteFactory.InputComment=\u521B\u5EFA\u65B0\u7684\u8F93\u5165
|
||||
BusinessPaletteFactory.Data=\u6570\u636E
|
||||
BusinessPaletteFactory.Ellipse=\u692D\u5706
|
||||
BusinessPaletteFactory.Input=\u8F93\u5165
|
||||
BusinessPaletteFactory.List=\u5217\u8868
|
||||
BusinessPaletteFactory.Relationshop=\u5173\u7CFB
|
||||
BusinessAbstractParser.ValueOfBooleanIsExpected=\u503C\u7684\u7C7B\u578B\u5E94\u8BE5\u4E3ABoolean
|
||||
BusinessPaletteFactory.decision=\u51B3\u7B56
|
||||
BusinessPaletteFactory.Document=\u6587\u6863
|
||||
BusinessModelingAssistantProvider.SelectDomainModelElement=\u9009\u62E9\u57DF\u6A21\u578B\u5143\u7D20
|
||||
BusinessPaletteFactory.CreateActor=\u521B\u5EFA\u89D2\u8272
|
||||
BusinessAbstractParser.StringDoubleConvertError=String\u7C7B\u578B\u7684\u503C\u4E0D\u80FD\u8F6C\u6362\u4E3ADoule\u7C7B\u578B
|
||||
BusinessPaletteFactory.Actor=\u89D2\u8272
|
||||
EditAction.Edit=\u7F16\u8F91\u5206\u914D\u4EFB\u52A1
|
||||
BusinessCreationWizardPage.CreateBusinessDiagram=\u521B\u5EFA\u903B\u8F91\u56FE
|
||||
BusinessPaletteFactory.Database=\u6570\u636E\u6E90
|
||||
BusinessPaletteFactory.ListComment=\u521B\u5EFA\u65B0\u7684\u5217\u8868
|
||||
BusinessPaletteFactory.DirectionalRelationShip=\u65B9\u5411\u5173\u8054
|
||||
BusinessPaletteFactory.Action=\u52A8\u4F5C
|
||||
BusinessPaletteFactory.RelationshopComment=\u521B\u5EFA\u65B0\u7684\u5173\u7CFB
|
||||
BusinessInitDiagramFileAction.LoadFaild=\u6A21\u578B\u6587\u4EF6\u88C5\u8F7D\u5931\u8D25
|
||||
BusinessPaletteFactory.DecisionComment=\u521B\u5EFA\u65B0\u7684\u51B3\u7B56
|
||||
BusinessAbstractParser.ValueOfDoubleIsExpected=\u503C\u7684\u7C7B\u578B\u5E94\u8BE5\u4E3ADouble
|
||||
OpenDiagramAction.ReadBusinessModel=\u8BFB\u53D6\u4E1A\u52A1\u6A21\u578B
|
||||
BusinessInitDiagramFileAction.UnableToLoadResource=\u4E0D\u80FD\u53BB\u88C5\u8F7D\u8D44\u6E90:
|
||||
BusinessPaletteFactory.CreateEllipse=\u521B\u5EFA\u692D\u5706
|
||||
BusinessNewDiagramFileWizard.DiagramFile=\u56FE\u8868\u6587\u4EF6
|
||||
BusinessAbstractParser.StringShortConverError=String\u7C7B\u578B\u7684\u503C\u4E0D\u80FD\u8F6C\u6362\u4E3AShort\u7C7B\u578B
|
||||
BusinessPaletteFactory.DocuemntComment=\u521B\u5EFA\u65B0\u7684\u6587\u6863
|
||||
BusinessAbstractParser.ValueOfIntegerIsExpected=\u503C\u7684\u7C7B\u578B\u5E94\u8BE5\u4E3AInteger
|
||||
BusinessNewDiagramFileWizard.SelectDiagramRootElement=\u9009\u62E9\u56FE\u8868\u6839\u5143\u7D20\uFF1A
|
||||
BusinessNewDiagramFileWizard.SelectSemanticModelElement=\u9009\u62E9\u8981\u5728\u56FE\u8868\u4E0A\u63CF\u8FF0\u7684\u8BED\u4E49\u6A21\u578B\u5143\u7D20
|
||||
BusinessAbstractParser.StringFloatConvertError=String\u7C7B\u578B\u7684\u503C\u4E0D\u80FD\u8F6C\u6362\u4E3AFloat\u7C7B\u578B
|
||||
BusinessAbstractParser.StringValueDoesNotConvertToByteValue=String\u7C7B\u578B\u7684\u503C\u4E0D\u80FD\u8F6C\u6362\u4E3AByte\u7C7B\u578B
|
||||
BusinessNewDiagramFileWizard.IntialNewEcoreDiagramFile=\u521D\u59CB\u5316\u65B0\u7684Ecore\u56FE\u8868\u6587\u4EF6
|
||||
BusinessTooltipFigure.assignedMeta={0}\u5206\u914D\u5143\u6570\u636E
|
||||
DeleteAssignmentAction.DeleteAssignment=\u5220\u9664\u8D4B\u503C
|
||||
BusinessDiagramEditor.canNotSaveTitle=\u8B66\u544A
|
||||
@@ -557,16 +557,5 @@
|
||||
level="20"
|
||||
name="ReadDiagramAction"/>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.core.expressions.definitions">
|
||||
<definition
|
||||
id="isActiveEditorOfBusinessModelEditor">
|
||||
<not>
|
||||
<instanceof
|
||||
value="org.talend.designer.business.model.business.diagram.part.BusinessDiagramEditor">
|
||||
</instanceof>
|
||||
</not>
|
||||
</definition>
|
||||
</extension>
|
||||
|
||||
</plugin>
|
||||
|
||||
@@ -82,5 +82,3 @@ RepositoryFactoryProxyLabelProvider.Deleted=\ (Deleted)
|
||||
AssignmentPropertySection.Type=Type
|
||||
AssignmentPropertySection.Name=Name
|
||||
AssignmentPropertySection.Comment=Comment
|
||||
BusinessDiagramEditor.canNotSaveTitle=Warning
|
||||
BusinessDiagramEditor.canNotSaveMessage=Business Model is not locked by user, can not save.
|
||||
|
||||
@@ -13,25 +13,14 @@
|
||||
package org.talend.designer.business.diagram.custom.actions;
|
||||
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.resources.IWorkspace;
|
||||
import org.eclipse.core.resources.IWorkspaceRunnable;
|
||||
import org.eclipse.core.resources.ResourcesPlugin;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.core.runtime.IStatus;
|
||||
import org.eclipse.core.runtime.NullProgressMonitor;
|
||||
import org.eclipse.core.runtime.Status;
|
||||
import org.eclipse.core.runtime.jobs.ISchedulingRule;
|
||||
import org.eclipse.jface.dialogs.MessageDialog;
|
||||
import org.eclipse.jface.wizard.Wizard;
|
||||
import org.eclipse.ui.IWorkbenchPage;
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
import org.eclipse.ui.part.EditorPart;
|
||||
import org.osgi.framework.FrameworkUtil;
|
||||
import org.talend.commons.exception.PersistenceException;
|
||||
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
|
||||
import org.talend.commons.ui.runtime.exception.MessageBoxExceptionHandler;
|
||||
import org.talend.commons.ui.runtime.image.ECoreImage;
|
||||
import org.talend.commons.ui.runtime.image.ImageProvider;
|
||||
import org.talend.core.CorePlugin;
|
||||
@@ -84,8 +73,8 @@ public class SaveAsBusinessModelWizard extends Wizard {
|
||||
RepositoryNode repositoryNode = repositoryEditorInput.getRepositoryNode();
|
||||
// see: RepositoryEditorInput.setRepositoryNode(IRepositoryNode repositoryNode)
|
||||
if (repositoryNode == null) {
|
||||
repositoryNode = (RepositoryNode) CorePlugin.getDefault().getRepositoryService()
|
||||
.getRepositoryNode(repositoryEditorInput.getItem().getProperty().getId(), false);
|
||||
repositoryNode = (RepositoryNode) CorePlugin.getDefault().getRepositoryService().getRepositoryNode(
|
||||
repositoryEditorInput.getItem().getProperty().getId(), false);
|
||||
}
|
||||
|
||||
IRepositoryService service = DesignerPlugin.getDefault().getRepositoryService();
|
||||
@@ -131,7 +120,13 @@ public class SaveAsBusinessModelWizard extends Wizard {
|
||||
isUpdate = isUpdate();
|
||||
|
||||
if (isUpdate) {
|
||||
update();
|
||||
assginVlaues(oldProperty, property);
|
||||
|
||||
repositoryFactory.save(oldBusinessProcessItem);
|
||||
|
||||
// assign value
|
||||
businessProcessItem = oldBusinessProcessItem;
|
||||
|
||||
} else {
|
||||
property.setId(repositoryFactory.getNextId());
|
||||
|
||||
@@ -157,34 +152,6 @@ public class SaveAsBusinessModelWizard extends Wizard {
|
||||
return ok;
|
||||
}
|
||||
|
||||
private void update() {
|
||||
IWorkspaceRunnable runnable = new IWorkspaceRunnable() {
|
||||
|
||||
@Override
|
||||
public void run(IProgressMonitor monitor) throws CoreException {
|
||||
try {
|
||||
assginVlaues(oldProperty, property);
|
||||
|
||||
repositoryFactory.save(oldBusinessProcessItem);
|
||||
// assign value
|
||||
businessProcessItem = oldBusinessProcessItem;
|
||||
} catch (PersistenceException pe) {
|
||||
throw new CoreException(new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(),
|
||||
"persistance error", pe)); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
};
|
||||
IWorkspace workspace = ResourcesPlugin.getWorkspace();
|
||||
try {
|
||||
ISchedulingRule schedulingRule = workspace.getRoot();
|
||||
// the update the project files need to be done in the workspace runnable to avoid all notification
|
||||
// of changes before the end of the modifications.
|
||||
workspace.run(runnable, schedulingRule, IWorkspace.AVOID_UPDATE, null);
|
||||
} catch (CoreException e) {
|
||||
MessageBoxExceptionHandler.process(e.getCause());
|
||||
}
|
||||
}
|
||||
|
||||
public BusinessProcessItem getBusinessProcessItem() {
|
||||
return this.businessProcessItem;
|
||||
}
|
||||
|
||||
@@ -82,7 +82,6 @@ import org.talend.designer.core.ui.views.jobsettings.JobSettingsView;
|
||||
import org.talend.designer.core.ui.views.jobsettings.tabs.AbstractTabComposite;
|
||||
import org.talend.designer.core.utils.EmfPropertyHelper;
|
||||
import org.talend.designer.core.utils.KeyHelper;
|
||||
import org.talend.repository.ProjectManager;
|
||||
import org.talend.repository.model.IRepositoryNode;
|
||||
import org.talend.repository.model.IRepositoryNode.ENodeType;
|
||||
import org.talend.repository.model.IRepositoryNode.EProperties;
|
||||
@@ -412,12 +411,11 @@ public class BusinessAssignmentComposite extends AbstractTabComposite {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ProjectManager.getInstance().isInCurrentMainProject(repositoryNode)) {
|
||||
CorePlugin.getDefault().getDiagramModelService()
|
||||
.addDeleteAssignmentAction(mgr, tableViewer.getSelection());
|
||||
}
|
||||
|
||||
}
|
||||
CorePlugin.getDefault().getDiagramModelService().addDeleteAssignmentAction(mgr, tableViewer.getSelection());
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
Menu menu = menuMgr.createContextMenu(tableViewer.getControl());
|
||||
|
||||
@@ -24,7 +24,6 @@ import org.eclipse.gmf.runtime.diagram.ui.internal.editparts.NoteAttachmentEditP
|
||||
import org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramGraphicalViewer;
|
||||
import org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide.document.StorageDiagramDocumentProvider;
|
||||
import org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide.editor.FileDiagramEditor;
|
||||
import org.eclipse.jface.dialogs.MessageDialog;
|
||||
import org.eclipse.jface.viewers.ISelection;
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.ui.IEditorInput;
|
||||
@@ -58,16 +57,13 @@ import org.talend.designer.business.diagram.custom.dnd.BusinessDiagramDropTarget
|
||||
import org.talend.designer.business.diagram.custom.edit.parts.BaseBusinessItemRelationShipEditPart;
|
||||
import org.talend.designer.business.diagram.custom.edit.parts.BusinessItemShapeEditPart;
|
||||
import org.talend.designer.business.diagram.custom.figures.BusinessItemShapeFigure;
|
||||
import org.talend.designer.business.diagram.i18n.Messages;
|
||||
import org.talend.designer.business.model.business.diagram.edit.parts.BusinessEditPartFactory;
|
||||
import org.talend.designer.business.model.business.diagram.edit.parts.BusinessProcessEditPart;
|
||||
import org.talend.designer.business.model.business.diagram.providers.BusinessDiagramActionProvider;
|
||||
import org.talend.designer.core.ui.ActiveProcessTracker;
|
||||
import org.talend.designer.core.ui.views.jobsettings.JobSettingsView;
|
||||
import org.talend.repository.editor.RepositoryEditorInput;
|
||||
import org.talend.repository.model.ERepositoryStatus;
|
||||
import org.talend.repository.model.IProxyRepositoryFactory;
|
||||
import org.talend.repository.model.IRepositoryService;
|
||||
import org.talend.repository.model.RepositoryNode;
|
||||
|
||||
/**
|
||||
@@ -175,29 +171,10 @@ public class BusinessDiagramEditor extends FileDiagramEditor implements IGotoMar
|
||||
|
||||
@Override
|
||||
public void doSave(IProgressMonitor progressMonitor) {
|
||||
super.doSave(progressMonitor);
|
||||
if (repositoryEditorInput != null) {
|
||||
BusinessProcessItem businessProcessItem = (BusinessProcessItem) repositoryEditorInput.getItem();
|
||||
IRepositoryService service = CorePlugin.getDefault().getRepositoryService();
|
||||
IProxyRepositoryFactory repFactory = service.getProxyRepositoryFactory();
|
||||
try {
|
||||
repFactory.updateLockStatus();
|
||||
// For TDI-23825, if not lock by user try to lock again.
|
||||
boolean locked = repFactory.getStatus(businessProcessItem) == ERepositoryStatus.LOCK_BY_USER;
|
||||
if (!locked) {
|
||||
repFactory.lock(businessProcessItem);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
ERepositoryStatus status = repFactory.getStatus(businessProcessItem);
|
||||
if (!status.equals(ERepositoryStatus.LOCK_BY_USER) && !repFactory.getRepositoryContext().isEditableAsReadOnly()) {
|
||||
MessageDialog.openWarning(getEditorSite().getShell(),
|
||||
Messages.getString("BusinessDiagramEditor.canNotSaveTitle"), //$NON-NLS-1$
|
||||
Messages.getString("BusinessDiagramEditor.canNotSaveMessage")); //$NON-NLS-1$
|
||||
return;
|
||||
}
|
||||
super.doSave(progressMonitor);
|
||||
DiagramResourceManager diagramResourceManager = new DiagramResourceManager();
|
||||
BusinessProcessItem businessProcessItem = (BusinessProcessItem) repositoryEditorInput.getItem();
|
||||
diagramResourceManager.updateFromResource(businessProcessItem, repositoryEditorInput.getFile());
|
||||
// remove the function of sve SVG file because the imported business model can't save SVG file.
|
||||
// saveSVG(businessProcessItem);
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
pluginName=\u7EC4\u4EF6\u6A21\u5757
|
||||
format=\u683C\u5F0F
|
||||
@@ -87,7 +87,7 @@ FAMILY.Misc=Verschiedenes
|
||||
FAMILY.MySQL=MySQL
|
||||
FAMILY.Netezza=Netezza
|
||||
FAMILY.OLAP_Cube=OLAP Würfel
|
||||
FAMILY.Oracle=Oracle
|
||||
FAMILY.Oracle=Dieser Quellcode wurde automatisiert generiert durch {0}
|
||||
FAMILY.Orchestration=Instrumentation
|
||||
FAMILY.Output= Ausgabe
|
||||
FAMILY.ParAccel=Paraccel
|
||||
|
||||
@@ -13,7 +13,6 @@ FAMILY.Access=Access
|
||||
FAMILY.Business=negocio
|
||||
FAMILY.Connections=Conexiones
|
||||
FAMILY.DB2=DB2
|
||||
FAMILY.eXist=Existe
|
||||
FAMILY.File=Fichero
|
||||
FAMILY.FireBird=Firebird
|
||||
FAMILY.Greenplum=Greenplum
|
||||
@@ -34,6 +33,5 @@ FAMILY.PostgreSQL=PostgreSQL
|
||||
FAMILY.PostgresPlus=PostgresPlus
|
||||
FAMILY.SQLite=SQLite
|
||||
FAMILY.Sybase=Sybase
|
||||
FAMILY.System=Sistema
|
||||
FAMILY.Teradata=Teradata
|
||||
FAMILY.Vertica=Vertica
|
||||
|
||||
@@ -43,7 +43,7 @@ CodeGeneratorEmittersPoolFactory.dialogContent=La g
|
||||
CodeGeneratorEmittersPoolFactory.operationCanceled=Opération annulée
|
||||
ComponentsFactory.afterSystemComponent=après le(s) composant(s) système
|
||||
ComponentsFactory.componentNotFound=Impossible de trouver le dossier du composant :
|
||||
ComponentsFactory.load.components=Chargement des composants...
|
||||
ComponentsFactory.load.components=Charger des composants...
|
||||
ComponentsFactory.parentNotRecompiled=Attention\: les parents de *.inc.javajet ne sont pas recompilés.
|
||||
ComponentsLocalProviderService.componentLoadError=Erreur de chargement du composant
|
||||
ComponentsLocalProviderService.talendExchangeError=Erreur de Talend Exchange
|
||||
|
||||
@@ -25,4 +25,3 @@ FAMILY.Input=Unos
|
||||
FAMILY.MySQL=MySQL
|
||||
FAMILY.Oracle=Oracle
|
||||
FAMILY.PostgreSQL=PostgreSQL
|
||||
FAMILY.XML=XML
|
||||
|
||||
@@ -57,8 +57,8 @@ ComponentsProviderManager.unableLoad=\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\
|
||||
ComponenttRunJobPreferencePage.label=tRunJob\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u306E\u30C0\u30D6\u30EB\u30AF\u30EA\u30C3\u30AF\u5F8C\u3001\u5BFE\u5FDC\u30B8\u30E7\u30D6\u3092\u8868\u793A\u3057\u306A\u3044\u3002
|
||||
ComponentJobletPreferencePage.label=Joblet\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u306E\u30C0\u30D6\u30EB\u30AF\u30EA\u30C3\u30AF\u5F8C\u3001\u5BFE\u5FDC\u30B8\u30E7\u30D6\u3092\u8868\u793A\u3057\u306A\u3044\u3002
|
||||
ComponenttRunJobPreferencePage.showCorrespondingJob=tRunJob\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u306E\u30C0\u30D6\u30EB\u30AF\u30EA\u30C3\u30AF\u5F8C\u3001\u5BFE\u5FDC\u30B8\u30E7\u30D6\u3092\u8868\u793A\u3059\u308B\u3002
|
||||
XsdValidationCacheManager.unableLoadxsd=XSD\u30D0\u30EA\u30C7\u30FC\u30B7\u30E7\u30F3\u306E\u30AD\u30E3\u30C3\u30B7\u30E5\u30D5\u30A1\u30A4\u30EB\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3002
|
||||
XsdValidationCacheManager.unableSavexsd=XSD\u30D0\u30EA\u30C7\u30FC\u30B7\u30E7\u30F3\u306E\u30AD\u30E3\u30C3\u30B7\u30E5\u30D5\u30A1\u30A4\u30EB\u3092\u4FDD\u5B58\u3067\u304D\u307E\u305B\u3093
|
||||
XsdValidationCacheManager.unableLoadxsd=XSD\u306E\u30D0\u30EA\u30C7\u30FC\u30B7\u30E7\u30F3\u306E\u30AD\u30E3\u30C3\u30B7\u30E5\u30D5\u30A1\u30A4\u30EB\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3002
|
||||
XsdValidationCacheManager.unableSavexsd=XSD\u306E\u30D0\u30EA\u30C7\u30FC\u30B7\u30E7\u30F3\u306E\u30AD\u30E3\u30C3\u30B7\u30E5\u30D5\u30A1\u30A4\u30EB\u3092\u4FDD\u5B58\u3067\u304D\u307E\u305B\u3093
|
||||
prefs.configuration.LINK_STYLE.AUTO=\u81EA\u52D5
|
||||
prefs.configuration.LINK_STYLE.BEZIER_CURVE=\u66F2\u7DDA
|
||||
prefs.configuration.LINK_STYLE.LINE=\u76F4\u7DDA(\u6700\u901F)
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
CodeGeneratorEmittersPoolFactory.JETEmitters.NoPresent=JETEmitters\u5DE5\u7A0B\u4E0D\u5B58\u5728\uFF0C\u9700\u8981\u91CD\u65B0\u5B8C\u6574\u521D\u59CB\u5316\u3002
|
||||
CodeGeneratorEmittersPoolFactory.Class.NotFound=\u6A21\u677F\u4F9D\u7136\u5B58\u5728\uFF0C\u4F46\u662F\u7C7B{0}
|
||||
CodeGeneratorEmittersPoolFactory.PersitentData.Error=\u6301\u4E45\u5316\u6570\u636E\u4E0D\u80FD\u4FDD\u5B58\uFF1A
|
||||
CodeGeneratorEmittersPoolFactory.initMessage=\u521D\u59CB\u5316\u4EE3\u7801\u751F\u6210\u5F15\u64CE...
|
||||
EmfEmittersPersistence.CodeGen.DataMissing=\u4EE3\u7801\u751F\u6210\u6570\u636E\u6D41\u5931\uFF0C\u5F00\u59CB\u91CD\u65B0\u751F\u6210\u4EE3\u7801\u3002
|
||||
CodeGenerator.JET.TimeOut=JET\u521D\u59CB\u5316\u8D85\u65F6\uFF01
|
||||
generatedcode.copyright.body4=\u4F60\u53EF\u4EE5\u5728\u5728GNU LGPL \u8BB8\u53EF\u8BC1\u4E0B\u652F\u914D\u8FD9\u4E9B\u4EE3\u7801
|
||||
CodeGenerator.Node.NotFound=\u5728\u5F53\u524D
|
||||
generatedcode.copyright.body3=\u4F60\u53EF\u4EE5\u5728www.talend.com\u53D1\u73B0\u66F4\u591A\u5173\u4E8ETalend\u4EA7\u54C1\u4FE1\u606F
|
||||
generatedcode.copyright.body2=/ \u4F5C\u4E1A\u8BBE\u8BA1 (CodeGenerator version {0}).
|
||||
generatedcode.copyright.body1=\u6E90\u4EE3\u7801\u88AB{0}\u81EA\u52A8\u751F\u6210
|
||||
JetSkeletonManager.updateProblem=\u5F53\u66F4\u65B0\u6301\u4E45\u6570\u636E\u65F6\u51FA\u73B0\u9519\u8BEF
|
||||
CodeGeneratorEmittersPoolFactory.codeThread=\u4EE3\u7801\u751F\u6210\u540E\u53F0\u7EBF\u7A0B
|
||||
CodeGeneratorEmittersPoolFactory.componentCompiled=\u7EC4\u4EF6\u7F16\u8BD1{0}\u6BEB\u79D2
|
||||
CodeGeneratorEmittersPoolFactory.failCompail=\u7EC4\u4EF6\u7F16\u8BD1\u5931\u8D25: \r\n
|
||||
CodeGeneratorEmittersPoolFactory.initialException=\u521D\u59CB\u5316\u5F02\u5E38
|
||||
CodeGeneratorEmittersPoolFactory.jetEmitterInitialException=\u521D\u59CB\u5316JetEmitter\u51FA\u9519
|
||||
CodeGeneratorService.invalidLanguage1=\u65E0\u6548\u7684\u8BED\u8A00\u7C7B\u578B.
|
||||
CodeGeneratorService.invalidLanguage2=\u65E0\u6548\u7684\u8BED\u8A00\u7C7B\u578B.
|
||||
CodeGenInit.addMarkers=\u5DE5\u4F5C\u533A\u4E2D\u6DFB\u52A0\u6807\u8BB0
|
||||
CodeGenInit.createProject=\u521B\u5EFA{0} \u5DE5\u7A0B
|
||||
CodeGenInit.deleteProject=\u5220\u9664{0} \u5DE5\u7A0B
|
||||
CodeGenInit.initTemplate=\u521D\u59CB\u5316\u6A21\u677F
|
||||
CodeGenInit.removeLink=\u5220\u9664\u94FE\u63A5\u8D44\u6E90
|
||||
CodeGenInit.saveWorkspace=\u4FDD\u5B58\u5DE5\u4F5C\u533A
|
||||
DocumentRootImpl.mixed=\ (\u6DF7\u5408:
|
||||
ComponentsFactory.afterSystemComponent=\u5728\u7CFB\u7EDF\u7EC4\u4EF6
|
||||
ComponentsLocalProviderService.componentLoadError=\u7EC4\u4EF6\u52A0\u8F7D\u9519\u8BEF
|
||||
ComponentsLocalProviderService.talendExchangeError=Talend Exchange\u9519\u8BEF
|
||||
ComponentsPreferencePage.ButtonLabel0=\u786E\u5B9A
|
||||
ComponentsPreferencePage.configuration.LINK_STYLE=\u9ED8\u8BA4\u94FE\u63A5\u663E\u793A\u4E3A\uFF1A
|
||||
ComponentsPreferencePage.rowLimit=\u884c\u9650\u5236
|
||||
ComponentsPreferencePage.WarningTitle=\u8B66\u544A
|
||||
ComponenttRunJobPreferencePage.label=\u53CC\u51FBtRunJob\u7EC4\u4EF6\u540E\u4E0D\u663E\u793A\u5BF9\u5E94\u7684JOB
|
||||
ComponenttRunJobPreferencePage.showCorrespondingJob=\u53CC\u51FBtRunJob\u7EC4\u4EF6\u540E\u663E\u793A\u5BF9\u5E94JOB
|
||||
XsdValidationCacheManager.unableLoadxsd=\u52A0\u8F7Dxsd\u9A8C\u8BC1\u7F13\u5B58\u6587\u4EF6\u5931\u8D25
|
||||
XsdValidationCacheManager.unableSavexsd=\u4FDD\u5B58xsd\u9A8C\u8BC1\u7F13\u5B58\u6587\u4EF6\u5931\u8D25
|
||||
prefs.configuration.LINK_STYLE.AUTO=\u81EA\u52A8
|
||||
FAMILY.Access=Access
|
||||
FAMILY.Business=\u4E1A\u52A1
|
||||
FAMILY.Business_Intelligence=\u5546\u4E1A\u667A\u80FD
|
||||
FAMILY.File=\u6587\u4ef6
|
||||
FAMILY.Input=\u8F93\u5165
|
||||
FAMILY.Output=\u6807\u51c6\u8f93\u51fa
|
||||
FAMILY.System=\u7CFB\u7EDF
|
||||
@@ -56,7 +56,7 @@
|
||||
<page
|
||||
category="org.talend.designer.codegen.components.localprovider.page1"
|
||||
class="org.talend.designer.components.preference.labelformat.ComponentsFormatPreferencePage"
|
||||
id="org.talend.designer.codegen.components.localprovider.page2"
|
||||
id="org.talend.designer.codegen.components.localprovider.page1"
|
||||
name="%format">
|
||||
</page>
|
||||
</extension>
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
List< ? extends INode> processNodes = (List< ? extends INode>)process.getGeneratingNodes();
|
||||
%>
|
||||
return new RouteBuilder() {
|
||||
public void configure() throws java.lang.Exception {
|
||||
public void configure() throws Exception {
|
||||
<%
|
||||
for (INode node : processNodes) {
|
||||
if (node.getComponent().getName().equals("cCXF")) {
|
||||
@@ -56,7 +56,7 @@
|
||||
if(param != null && !"__UNIQUE_NAME__".equals(param.getValue())){
|
||||
cid = (String)param.getValue()+"_"+cid;
|
||||
}
|
||||
String endpointVar = "endpoint_" + node.getUniqueName();
|
||||
String endpointVar = "endpoint" + cid;
|
||||
String uriRef = "uriMap.get(\"" + cid + "\")";
|
||||
%>
|
||||
// CXF endpoint for <%=cid%>
|
||||
|
||||
@@ -32,19 +32,9 @@ INode node = (INode) codeGenArgument.getArgument();
|
||||
List< ? extends IConnection> connsIf = node.getIncomingConnections();
|
||||
if(connsIf.size()>0) {
|
||||
if(connsIf.get(0).getLineStyle()==EConnectionType.ROUTE_WHEN) {
|
||||
INode sourceNode = connsIf.get(0).getSource();
|
||||
String languageType = connsIf.get(0).getRouteConnectionType();
|
||||
String condition = connsIf.get(0).getCondition();
|
||||
String expression = "none".equals(languageType)?condition:languageType+"("+condition+")";
|
||||
if("cIntercept".equals(sourceNode.getComponent().getName())){
|
||||
%>
|
||||
.when(<%=expression%>)
|
||||
.when().<%=connsIf.get(0).getRouteConnectionType()%>(<%=connsIf.get(0).getCondition()%>)
|
||||
<%
|
||||
}else{
|
||||
%>
|
||||
.when().<%=expression%>
|
||||
<%
|
||||
}
|
||||
} else if(connsIf.get(0).getLineStyle()==EConnectionType.ROUTE_OTHER) {
|
||||
%>
|
||||
.otherwise()
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
try {
|
||||
context.store(baos, "");
|
||||
} catch (java.lang.Exception e) {
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
%>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -29,7 +29,7 @@
|
||||
|
||||
%>
|
||||
|
||||
protected void doStart() throws java.lang.Exception {
|
||||
protected void doStart() throws Exception {
|
||||
// init uriMap first
|
||||
initUriMap();
|
||||
|
||||
@@ -102,7 +102,7 @@ if(librariesSb.length()>0){
|
||||
|
||||
}
|
||||
|
||||
protected void doStop() throws java.lang.Exception {
|
||||
protected void doStop() throws Exception {
|
||||
super.doStop();
|
||||
getCamelContexts().get(0).stop();
|
||||
}
|
||||
@@ -111,11 +111,11 @@ if(librariesSb.length()>0){
|
||||
return getCamelContexts().get(0).createProducerTemplate();
|
||||
}
|
||||
|
||||
public void stop() throws java.lang.Exception {
|
||||
public void stop() throws Exception {
|
||||
super.stop();
|
||||
}
|
||||
|
||||
public void shutdown() throws java.lang.Exception {
|
||||
public void shutdown() throws Exception {
|
||||
super.shutdown();
|
||||
}
|
||||
|
||||
@@ -149,7 +149,7 @@ if(librariesSb.length()>0){
|
||||
}
|
||||
%>
|
||||
Thread.sleep(1000);
|
||||
} catch (java.lang.Exception e) {
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
@@ -312,7 +312,7 @@ for (IContextParameter ctxParam : params) {
|
||||
|
||||
try {
|
||||
run();
|
||||
} catch (java.lang.Exception e) {
|
||||
} catch (Exception e) {
|
||||
System.err.println(e.getMessage());
|
||||
e.printStackTrace();
|
||||
return 1;
|
||||
|
||||
@@ -99,8 +99,8 @@ import java.util.Comparator;
|
||||
String talendJobInterfaces = "TalendJob";
|
||||
|
||||
boolean talendMdmJob = !process.getNodesOfType("tMDMTriggerInput").isEmpty() || !process.getNodesOfType("tMDMTriggerOutput").isEmpty();
|
||||
boolean talendEsbJob = !process.getNodesOfType("tESBProviderRequest").isEmpty() || !process.getNodesOfType("tESBConsumer").isEmpty() || !process.getNodesOfType("tRouteInput").isEmpty();
|
||||
boolean talendEsbJobFactory = !process.getNodesOfType("tESBProviderRequest").isEmpty() || !process.getNodesOfType("tRouteInput").isEmpty();
|
||||
boolean talendEsbJob = !process.getNodesOfType("tESBProviderRequest").isEmpty() || !process.getNodesOfType("tESBConsumer").isEmpty();
|
||||
boolean talendEsbJobFactory = !process.getNodesOfType("tESBProviderRequest").isEmpty();
|
||||
|
||||
if (talendMdmJob) {
|
||||
talendJobInterfaces += ", TalendMDMJob"; // Talend MDM job
|
||||
@@ -126,8 +126,6 @@ public class <%=process.getName()%> implements <%=talendJobInterfaces%> {
|
||||
}
|
||||
talendESBJob.setDataSources(dataSources);
|
||||
}
|
||||
// fix for TESB-7714
|
||||
talendESBJob.setEndpointRegistry(registry);
|
||||
return talendESBJob;
|
||||
}
|
||||
<% } %>
|
||||
@@ -307,30 +305,30 @@ public String getExceptionStackTrace() {
|
||||
return null;
|
||||
}
|
||||
|
||||
private java.lang.Exception exception = null;
|
||||
private Exception exception = null;
|
||||
|
||||
public java.lang.Exception getException() {
|
||||
public Exception getException() {
|
||||
if ("failure".equals(this.getStatus())) {
|
||||
return this.exception;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private class TalendException extends java.lang.Exception {
|
||||
private class TalendException extends Exception {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private java.util.Map<String, Object> globalMap = null;
|
||||
private java.lang.Exception e = null;
|
||||
private Exception e = null;
|
||||
private String currentComponent = null;
|
||||
|
||||
private TalendException(java.lang.Exception e, String errorComponent, final java.util.Map<String, Object> globalMap) {
|
||||
private TalendException(Exception e, String errorComponent, final java.util.Map<String, Object> globalMap) {
|
||||
this.currentComponent= errorComponent;
|
||||
this.globalMap = globalMap;
|
||||
this.e = e;
|
||||
}
|
||||
|
||||
public java.lang.Exception getException() {
|
||||
public Exception getException() {
|
||||
return this.e;
|
||||
}
|
||||
|
||||
@@ -457,6 +455,17 @@ private class TalendException extends java.lang.Exception {
|
||||
}
|
||||
}
|
||||
%>
|
||||
} else {
|
||||
<%
|
||||
if (isRunInMultiThread ) {
|
||||
%>
|
||||
((java.util.Map)threadLocal.get()).put("status", "failure");
|
||||
<%
|
||||
} else {%>
|
||||
status = "failure";
|
||||
<%
|
||||
}
|
||||
%>
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -466,7 +475,7 @@ private class TalendException extends java.lang.Exception {
|
||||
for (INode node : processNodes) {
|
||||
if (node.isActivate()) {
|
||||
%>
|
||||
public void <%=node.getUniqueName() %>_error(java.lang.Exception exception, String errorComponent, final java.util.Map<String, Object> globalMap) throws TalendException {
|
||||
public void <%=node.getUniqueName() %>_error(Exception exception, String errorComponent, final java.util.Map<String, Object> globalMap) throws TalendException {
|
||||
end_Hash.put("<%=node.getUniqueName() %>", System.currentTimeMillis());
|
||||
<%
|
||||
boolean ifBeforRunError = NodeUtil.checkComponentErrorConnectionAfterNode(node);
|
||||
@@ -529,7 +538,7 @@ private class TalendException extends java.lang.Exception {
|
||||
}
|
||||
%>
|
||||
|
||||
} catch (java.lang.Exception e) {
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
<%
|
||||
@@ -600,7 +609,7 @@ private class TalendException extends java.lang.Exception {
|
||||
for (INode node : processNodes) {
|
||||
if (node.isDesignSubjobStartNode()) {
|
||||
%>
|
||||
public void <%=node.getUniqueName() %>_onSubJobError(java.lang.Exception exception, String errorComponent, final java.util.Map<String, Object> globalMap) throws TalendException {
|
||||
public void <%=node.getUniqueName() %>_onSubJobError(Exception exception, String errorComponent, final java.util.Map<String, Object> globalMap) throws TalendException {
|
||||
<%
|
||||
List< ? extends IConnection> conns = node.getOutgoingConnections();
|
||||
int count = 0;
|
||||
@@ -650,7 +659,7 @@ resumeUtil.addLog("SYSTEM_LOG", "NODE:"+ errorComponent, "", Thread.currentThrea
|
||||
<%
|
||||
}
|
||||
%>
|
||||
} catch (java.lang.Exception e) {
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
<%
|
||||
|
||||
@@ -232,7 +232,7 @@ for (INode node : graphicalNodes) {
|
||||
}
|
||||
}
|
||||
String delay = ElementParameterParser.getValue(node, "__DELAY__");
|
||||
if(delay!=null && !delay.trim().equals("")){
|
||||
if(delay!=null && !delay.trim().equals("") && !"1000".equals(delay)){
|
||||
if(sb.length()==0){
|
||||
sb.append("+\"?delay=\"+");
|
||||
sb.append(delay);
|
||||
|
||||
@@ -58,7 +58,7 @@ if(execStat){
|
||||
<%
|
||||
}
|
||||
%>
|
||||
} catch (java.lang.Exception e) {
|
||||
} catch (Exception e) {
|
||||
this.status = "failure";
|
||||
Integer localErrorCode = (Integer) (((java.util.Map) threadLocal.get()).get("errorCode"));
|
||||
if (localErrorCode != null) {
|
||||
|
||||
@@ -203,7 +203,7 @@ if(execStat){
|
||||
for (IConnection inLineConn : allInLineJobConns) {
|
||||
%>
|
||||
if(execStat){
|
||||
runStat.updateStatOnConnection("<%=inLineConn.getUniqueName() %>", 3, 0);
|
||||
runStat.updateStatOnConnection("<%=inLineConn.getUniqueName() %>", 3, "exec" + NB_ITERATE_<%=iterateNodeName %>);
|
||||
}
|
||||
<%
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
if(isParallelize){
|
||||
%>
|
||||
|
||||
} catch (java.lang.Exception e) {
|
||||
} catch (Exception e) {
|
||||
this.status = "failure";
|
||||
Integer localErrorCode = (Integer) (((java.util.Map) threadLocal.get()).get("errorCode"));
|
||||
if (localErrorCode != null) {
|
||||
@@ -84,7 +84,7 @@
|
||||
}
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
} catch (java.lang.Exception te) {
|
||||
} catch (Exception te) {
|
||||
throw new TalendException(te, currentComponent, globalMap);
|
||||
}
|
||||
<%
|
||||
@@ -204,7 +204,7 @@
|
||||
%>
|
||||
|
||||
|
||||
} catch(java.lang.Exception e) {
|
||||
} catch(Exception e) {
|
||||
|
||||
throw new TalendException(e, currentComponent, globalMap);
|
||||
|
||||
@@ -217,7 +217,7 @@
|
||||
<%
|
||||
}
|
||||
%>
|
||||
throw error;
|
||||
throw new java.lang.Error(error);
|
||||
|
||||
}
|
||||
<%
|
||||
|
||||
@@ -134,12 +134,8 @@ public static class <%=conn.getName() %>Struct<%=templateOrigin %> implements ro
|
||||
if (metadata !=null) {
|
||||
for (IMetadataColumn column: metadata.getListColumns()) {
|
||||
JavaType javaType = JavaTypesManager.getJavaTypeFromId(column.getTalendType());
|
||||
String typeToGenerate = JavaTypesManager.getTypeToGenerate(column.getTalendType(), column.isNullable());
|
||||
if("id_Document".equals(javaType.getId())) {
|
||||
typeToGenerate = javaType.getNullableClass().getCanonicalName();
|
||||
}
|
||||
%>
|
||||
public <%= typeToGenerate %> <%=column.getLabel() %><%
|
||||
public <%= JavaTypesManager.getTypeToGenerate(column.getTalendType(), column.isNullable()) %> <%=column.getLabel() %><%
|
||||
|
||||
if(javaType == JavaTypesManager.CHARACTER && !column.isNullable()) {
|
||||
%> = ' '<%
|
||||
@@ -147,11 +143,11 @@ public static class <%=conn.getName() %>Struct<%=templateOrigin %> implements ro
|
||||
|
||||
%>;
|
||||
|
||||
public <%= typeToGenerate %> get<%=column.getLabel().substring(0, 1).toUpperCase()%><%=column.getLabel().substring(1)%> () {
|
||||
public <%= JavaTypesManager.getTypeToGenerate(column.getTalendType(), column.isNullable()) %> get<%=column.getLabel().substring(0, 1).toUpperCase()%><%=column.getLabel().substring(1)%> () {
|
||||
return this.<%=column.getLabel()%>;
|
||||
}
|
||||
<%
|
||||
if((conn.getLineStyle() == EConnectionType.FLOW_REF) && conn.getTarget().getUniqueName().startsWith("tXMLMap") && "id_Document".equals(javaType.getId())) {
|
||||
if("id_Document".equals(javaType.getId())) {
|
||||
%>
|
||||
public java.util.Map<String,Object> documentLookupResult = new java.util.HashMap<String,Object>();
|
||||
<%
|
||||
@@ -564,9 +560,6 @@ public static class <%=conn.getName() %>Struct<%=templateOrigin %> implements ro
|
||||
<%
|
||||
} else if(javaType.isObjectBased() || typeToGenerate.equals("Geometry") || typeToGenerate.equals("Dynamic")) {
|
||||
hasAtLeastOneObjectType = true;
|
||||
if("id_Document".equals(javaType.getId())) {
|
||||
typeToGenerate = javaType.getNullableClass().getCanonicalName();
|
||||
}
|
||||
%>
|
||||
this.<%=column.getLabel() %> = (<%= typeToGenerate %>) dis.readObject();
|
||||
<%
|
||||
@@ -740,9 +733,6 @@ public static class <%=conn.getName() %>Struct<%=templateOrigin %> implements ro
|
||||
<%
|
||||
} else if(typeToGenerate.equals("Object") || typeToGenerate.equals("Geometry") || typeToGenerate.equals("BigDecimal") || typeToGenerate.equals("List") || typeToGenerate.equals("Dynamic") || typeToGenerate.equals("Document")) {
|
||||
hasAtLeastOneObjectType = true;
|
||||
if("id_Document".equals(javaType.getId())) {
|
||||
typeToGenerate = javaType.getNullableClass().getCanonicalName();
|
||||
}
|
||||
%>
|
||||
this.<%=column.getLabel() %> = (<%= typeToGenerate %>) ois.readObject();
|
||||
<%
|
||||
@@ -1015,7 +1005,7 @@ public void <%=subTree.getName() %>Process(final java.util.Map<String, Object> g
|
||||
|
||||
try {
|
||||
|
||||
String currentMethodName = new java.lang.Exception().getStackTrace()[0].getMethodName();
|
||||
String currentMethodName = new Exception().getStackTrace()[0].getMethodName();
|
||||
boolean resumeIt = currentMethodName.equals(resumeEntryMethodName);
|
||||
if( resumeEntryMethodName == null || resumeIt || globalResumeTicket){//start the resume
|
||||
globalResumeTicket = true;
|
||||
|
||||
@@ -48,6 +48,7 @@ public class ComponentFileChecker {
|
||||
checkFiles(currentFolder, languageSuffix);
|
||||
File xmlMainFile = new File(currentFolder, ComponentFilesNaming.getInstance().getMainXMLFileName(currentFolder.getName(),
|
||||
languageSuffix));
|
||||
XsdValidationCacheManager xsdValidationCacheManager = XsdValidationCacheManager.getInstance();
|
||||
|
||||
long currentCRC = 0;
|
||||
FileInputStream fis = null;
|
||||
@@ -57,8 +58,9 @@ public class ComponentFileChecker {
|
||||
// do not check anymore XSD when be in headless mode.
|
||||
// check is mainly usefull for GUI to be able to check why component is not loaded after be developped.
|
||||
// if be in headless mode (like commandline), it's supposed to use only stable components
|
||||
if (!CommonsPlugin.isHeadless()) {
|
||||
if (!CommonsPlugin.isHeadless() && xsdValidationCacheManager.needCheck(xmlMainFile, currentCRC)) {
|
||||
checkXSD(xmlMainFile);
|
||||
xsdValidationCacheManager.setChecked(xmlMainFile, currentCRC);
|
||||
}
|
||||
} catch (FileNotFoundException e) {
|
||||
ExceptionHandler.process(e);
|
||||
|
||||
@@ -14,30 +14,33 @@ package org.talend.designer.codegen.components.model;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileFilter;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.ResourceBundle;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
|
||||
import org.apache.commons.lang.ArrayUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.log4j.Level;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.log4j.Priority;
|
||||
import org.eclipse.core.runtime.FileLocator;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.core.runtime.Path;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
import org.eclipse.core.runtime.SubMonitor;
|
||||
import org.eclipse.emf.common.util.EList;
|
||||
import org.eclipse.emf.common.util.URI;
|
||||
import org.eclipse.emf.ecore.resource.Resource;
|
||||
import org.eclipse.emf.ecore.util.EcoreUtil;
|
||||
@@ -50,14 +53,10 @@ import org.osgi.framework.ServiceReference;
|
||||
import org.osgi.service.packageadmin.PackageAdmin;
|
||||
import org.talend.commons.CommonsPlugin;
|
||||
import org.talend.commons.exception.BusinessException;
|
||||
import org.talend.commons.ui.runtime.CommonUIPlugin;
|
||||
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
|
||||
import org.talend.commons.utils.io.FilesUtils;
|
||||
import org.talend.commons.utils.io.SHA1Util;
|
||||
import org.talend.core.CorePlugin;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.context.Context;
|
||||
import org.talend.core.context.RepositoryContext;
|
||||
import org.talend.core.language.ECodeLanguage;
|
||||
import org.talend.core.language.LanguageManager;
|
||||
import org.talend.core.model.component_cache.ComponentCachePackage;
|
||||
import org.talend.core.model.component_cache.ComponentInfo;
|
||||
@@ -68,8 +67,9 @@ import org.talend.core.model.components.ComponentUtilities;
|
||||
import org.talend.core.model.components.IComponent;
|
||||
import org.talend.core.model.components.IComponentsFactory;
|
||||
import org.talend.core.model.general.Project;
|
||||
import org.talend.core.model.properties.ComponentSetting;
|
||||
import org.talend.core.ui.branding.IBrandingService;
|
||||
import org.talend.core.utils.TalendCacheUtils;
|
||||
import org.talend.core.utils.BrandingChecker;
|
||||
import org.talend.designer.codegen.CodeGeneratorActivator;
|
||||
import org.talend.designer.codegen.i18n.Messages;
|
||||
import org.talend.designer.core.ITisLocalProviderService;
|
||||
@@ -78,7 +78,14 @@ import org.talend.designer.core.model.components.EmfComponent;
|
||||
import org.talend.designer.core.model.components.manager.ComponentManager;
|
||||
import org.talend.designer.core.model.process.AbstractProcessProvider;
|
||||
import org.talend.designer.core.ui.editor.palette.TalendEntryEditPart;
|
||||
import org.talend.repository.model.ComponentsFactoryProvider;
|
||||
import org.talend.repository.ProjectManager;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.NamedNodeMap;
|
||||
import org.w3c.dom.Node;
|
||||
import org.w3c.dom.NodeList;
|
||||
import org.xml.sax.ErrorHandler;
|
||||
import org.xml.sax.SAXException;
|
||||
import org.xml.sax.SAXParseException;
|
||||
|
||||
/**
|
||||
* Component factory that look for each component and load their information. <br/>
|
||||
@@ -100,15 +107,15 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
|
||||
private static HashSet<IComponent> componentList = null;
|
||||
|
||||
private static HashSet<IComponent> customComponentList = null;
|
||||
private static List<IComponent> customComponentList = null;
|
||||
|
||||
private HashSet<IComponent> userComponentList = null;
|
||||
private List<IComponent> userComponentList = null;
|
||||
|
||||
private IProgressMonitor monitor;
|
||||
|
||||
private SubMonitor subMonitor;
|
||||
|
||||
private static Map<String, Map<String, IComponent>> componentsCache = new HashMap<String, Map<String, IComponent>>();
|
||||
private static Map<String, IComponent> componentsCache = new HashMap<String, IComponent>();
|
||||
|
||||
// keep a list of the current provider for the selected component, to have the family translation
|
||||
// only for components that are loaded
|
||||
@@ -116,6 +123,8 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
|
||||
private static Map<String, AbstractComponentsProvider> componentsAndProvider = new HashMap<String, AbstractComponentsProvider>();
|
||||
|
||||
private Map<String, String> allComponents;
|
||||
|
||||
// 1. only the in the directory /components ,not including /resource
|
||||
// 2. include the skeleton files and external include files
|
||||
private static ArrayList<String> skeletonList = null;
|
||||
@@ -124,11 +133,118 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
|
||||
private static final String INCLUDEFILEINJET_SUFFIX = ".inc.javajet"; //$NON-NLS-1$
|
||||
|
||||
private static final String FAMILY_SPEARATOR = "--FAMILY--"; //$NON-NLS-1$
|
||||
|
||||
private boolean isCreated = false;
|
||||
|
||||
private static boolean cleanDone = false;
|
||||
private boolean isReset = false;
|
||||
|
||||
// public XmiResourceManager xmiResourceManager = new XmiResourceManager();
|
||||
|
||||
// this list of component is always needed, they must always be loaded at least, since they can be used for code
|
||||
// generation indirectly.
|
||||
// tFileInputFullRow + tSocketOutput : needed for DataViewer
|
||||
private static final String[] COMPONENTS_ALWAYS_NEEDED = { "tPrejob", "tPostjob", //$NON-NLS-1$ //$NON-NLS-2$
|
||||
"tJava", "tLibraryLoad", "tFileInputFullRow", "tSocketOutput", "tFilterRow", "tELTMysqlMap" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
|
||||
|
||||
public ComponentsFactory() {
|
||||
if (!INCLUDEFILEINJET_SUFFIX.equals(".inc.javajet")) { //$NON-NLS-1$
|
||||
ExceptionHandler.process(new IllegalStateException(Messages.getString("ComponentsFactory.parentNotRecompiled")), //$NON-NLS-1$
|
||||
Priority.WARN);
|
||||
}
|
||||
}
|
||||
|
||||
private List<ComponentSetting> getComponentsFromProject() {
|
||||
// TODO check components used from ref projects.
|
||||
Project currentProject = ProjectManager.getInstance().getCurrentProject();
|
||||
if (currentProject != null && currentProject.getEmfProject() != null) {
|
||||
|
||||
List<ComponentSetting> components = (List<ComponentSetting>) currentProject.getEmfProject().getComponentsSettings();
|
||||
return components;
|
||||
}
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
private boolean isComponentVisible(String componentName) {
|
||||
Boolean visible = Boolean.TRUE;
|
||||
|
||||
if (ArrayUtils.contains(COMPONENTS_ALWAYS_NEEDED, componentName)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
List<ComponentSetting> settingsFromCompName = new ArrayList<ComponentSetting>();
|
||||
// here we just check if the component is visible somewhere in the settings.
|
||||
// if it's visible in any category, we will load the component
|
||||
// if the component is unknown (new component?), we will load also
|
||||
// (technical components will always loaded by default as they're not saved in componentSettings)
|
||||
// to avoid any problem, we also load by default the category named "Technical".
|
||||
|
||||
for (ComponentSetting componentSetting : getComponentsFromProject()) {
|
||||
String name = componentSetting.getName();
|
||||
if (name != null && name.equals(componentName)) {
|
||||
settingsFromCompName.add(componentSetting);
|
||||
// if (componentSetting.isHidden()) {
|
||||
// // hide component only if hidden in all projects
|
||||
// if (manager.getReferencedProjects(manager.getCurrentProject()).size() > 0
|
||||
// && isHiddenInRefProjects(componentName)) {
|
||||
// visible = Boolean.FALSE;
|
||||
// } else {
|
||||
// visible = Boolean.TRUE;
|
||||
// componentSetting.setHidden(false);
|
||||
// }
|
||||
// } else {
|
||||
// return true;
|
||||
// }
|
||||
if ("Technical".equals(componentSetting.getFamily())) { //$NON-NLS-1$
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// load components those visible in any category
|
||||
int hideCount = 0;
|
||||
for (ComponentSetting componentSetting : settingsFromCompName) {
|
||||
if (componentSetting.isHidden()) {
|
||||
// hide component only if hidden in all projects
|
||||
if (isHiddenInRefProjects(componentSetting)) {
|
||||
hideCount++;
|
||||
} else {
|
||||
visible = Boolean.TRUE;
|
||||
componentSetting.setHidden(false);
|
||||
}
|
||||
} else {
|
||||
visible = Boolean.TRUE;
|
||||
}
|
||||
}
|
||||
if (settingsFromCompName.size() > 0 && hideCount == settingsFromCompName.size()) {
|
||||
visible = Boolean.FALSE;
|
||||
}
|
||||
|
||||
return visible;
|
||||
}
|
||||
|
||||
private boolean isHiddenInRefProjects(ComponentSetting settingInMain) {
|
||||
if (settingInMain == null) {
|
||||
return false;
|
||||
}
|
||||
int hiddenCount = 0;
|
||||
ProjectManager manager = ProjectManager.getInstance();
|
||||
List<Project> referencedProjects = manager.getReferencedProjects();
|
||||
for (Project curProject : referencedProjects) {
|
||||
List<ComponentSetting> componentsSettings = (List<ComponentSetting>) curProject.getEmfProject()
|
||||
.getComponentsSettings();
|
||||
for (ComponentSetting setting : componentsSettings) {
|
||||
if (setting.isHidden() && setting.getName().equals(settingInMain.getName())
|
||||
&& setting.getFamily().equals(settingInMain.getFamily())) {
|
||||
hiddenCount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (hiddenCount == referencedProjects.size()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private void init(boolean duringLogon) {
|
||||
@@ -142,38 +258,51 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
// TimeMeasure.begin("initComponents");
|
||||
|
||||
componentList = new HashSet<IComponent>();
|
||||
customComponentList = new HashSet<IComponent>();
|
||||
customComponentList = new ArrayList<IComponent>();
|
||||
skeletonList = new ArrayList<String>();
|
||||
userComponentList = new HashSet<IComponent>();
|
||||
String installLocation = new Path(Platform.getConfigurationLocation().getURL().getPath()).toFile().getAbsolutePath();
|
||||
componentToProviderMap = new HashMap<IComponent, AbstractComponentsProvider>();
|
||||
boolean isNeedClean = !cleanDone && TalendCacheUtils.isSetCleanComponentCache();
|
||||
cleanDone = true; // only check this parameter one time, or it will reinitialize things all the time...
|
||||
boolean isNeedClean = cleanComponentCache();
|
||||
isCreated = hasComponentFile(installLocation) && !isNeedClean;
|
||||
ComponentsCache cache = ComponentManager.getComponentCache();
|
||||
if (isReset) {
|
||||
isCreated = false;
|
||||
}
|
||||
ComponentsCache cache = ComponentManager.getInstance();
|
||||
try {
|
||||
if (isCreated) {
|
||||
// if cache is created and empty, means we never loaded it before.
|
||||
// if it was already loaded, then no need to go again, since it's a static variable, it's still in
|
||||
// memory.
|
||||
// it avoids to reload from disk again even more for commandline at each logon, since it's no use.
|
||||
if (cache.getComponentEntryMap().isEmpty()) {
|
||||
ComponentsCache loadCache = loadComponentResource(installLocation);
|
||||
cache.getComponentEntryMap().putAll(loadCache.getComponentEntryMap());
|
||||
}
|
||||
ComponentsCache loadCache = loadComponentResource(installLocation);
|
||||
cache.getComponentEntryMap().putAll(loadCache.getComponentEntryMap());
|
||||
} else {
|
||||
cache.getComponentEntryMap().clear();
|
||||
}
|
||||
// check if any component is missing from any provider
|
||||
// if yes, re-create the cache.
|
||||
if (isCreated && isAnyComponentMissing()) {
|
||||
cache.getComponentEntryMap().clear();
|
||||
isCreated = false;
|
||||
}
|
||||
} catch (IOException e) {
|
||||
ExceptionHandler.process(e);
|
||||
cache.getComponentEntryMap().clear();
|
||||
isCreated = false;
|
||||
}
|
||||
|
||||
// XsdValidationCacheManager.getInstance().load();
|
||||
XsdValidationCacheManager.getInstance().load();
|
||||
// 1.Load Component from extension point: components_provider
|
||||
if (isCreated) {
|
||||
try {
|
||||
reloadComponentsFromCache();
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
// if any exception happen, reset all cache
|
||||
cache.getComponentEntryMap().clear();
|
||||
isCreated = false;
|
||||
}
|
||||
}
|
||||
|
||||
loadComponentsFromComponentsProviderExtension();
|
||||
if (!isCreated) {
|
||||
loadComponentsFromComponentsProviderExtension();
|
||||
}
|
||||
|
||||
// TimeMeasure.step("initComponents", "loadComponentsFromProvider");
|
||||
// 2.Load Component from extension point: component_definition
|
||||
@@ -182,11 +311,17 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
|
||||
// TimeMeasure.step("initComponents", "reloadFromCache");
|
||||
|
||||
if (!isCreated) {
|
||||
XsdValidationCacheManager.getInstance().save();
|
||||
ComponentManager.saveResource();
|
||||
isReset = false;
|
||||
}
|
||||
// TimeMeasure.step("initComponents", "createCache");
|
||||
|
||||
ComponentManager.saveResource(); // will save only if needed.
|
||||
log.debug(componentList.size() + " components loaded in " + (System.currentTimeMillis() - startTime) + " ms"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
if (!duringLogon) {
|
||||
// CorePlugin.getDefault().getRunProcessService().updateLibraries(new HashSet<String>(), null);
|
||||
}
|
||||
// TimeMeasure.step("initComponents", "updateLibraries");
|
||||
|
||||
// TimeMeasure.end("initComponents");
|
||||
@@ -194,23 +329,117 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
// TimeMeasure.display = false;
|
||||
// TimeMeasure.displaySteps = false;
|
||||
// TimeMeasure.measureActive = false;
|
||||
if (!CommonUIPlugin.isFullyHeadless()) {
|
||||
RepositoryContext repositoryContext = (RepositoryContext) CorePlugin.getContext().getProperty(
|
||||
Context.REPOSITORY_CONTEXT_KEY);
|
||||
if (repositoryContext == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
private boolean isAnyComponentMissing() throws IOException {
|
||||
Iterator it = ComponentManager.getInstance().getComponentEntryMap().entrySet().iterator();
|
||||
List<String> componentsList = new ArrayList<String>();
|
||||
while (it.hasNext()) {
|
||||
Map.Entry<String, ComponentInfo> entry = (Map.Entry<String, ComponentInfo>) it.next();
|
||||
componentsList.add(entry.getKey());
|
||||
}
|
||||
|
||||
ECodeLanguage currentLanguage = LanguageManager.getCurrentLanguage();
|
||||
ComponentsProviderManager componentsProviderManager = ComponentsProviderManager.getInstance();
|
||||
for (AbstractComponentsProvider componentsProvider : componentsProviderManager.getProviders()) {
|
||||
if (componentsProvider.getInstallationFolder().exists()) {
|
||||
File source = componentsProvider.getInstallationFolder();
|
||||
File[] childDirectories;
|
||||
|
||||
FileFilter fileFilter = new FileFilter() {
|
||||
|
||||
public boolean accept(final File file) {
|
||||
return file.isDirectory() && file.getName().charAt(0) != '.'
|
||||
&& !file.getName().equals(IComponentsFactory.EXTERNAL_COMPONENTS_INNER_FOLDER)
|
||||
&& isComponentVisible(file.getName());
|
||||
}
|
||||
|
||||
};
|
||||
if (source == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
childDirectories = source.listFiles(fileFilter);
|
||||
|
||||
for (File component : childDirectories) {
|
||||
if (!componentsList.contains(component.getName())) {
|
||||
String mainXmlFileName = ComponentFilesNaming.getInstance().getMainXMLFileName(component.getName(),
|
||||
currentLanguage.getName());
|
||||
File mainXmlFile = new File(component, mainXmlFileName);
|
||||
if (mainXmlFile.exists()) {
|
||||
return true;
|
||||
}
|
||||
// no xml file for this language, ignore it
|
||||
}
|
||||
}
|
||||
}
|
||||
Project project = repositoryContext.getProject();
|
||||
if (project == null) {
|
||||
return;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* DOC guanglong.du Comment method "reloadComponentsFromCache".
|
||||
*
|
||||
* @throws BusinessException
|
||||
*/
|
||||
private void reloadComponentsFromCache() throws BusinessException {
|
||||
Map<String, String> bundleIdToPath = new HashMap<String, String>();
|
||||
ComponentsCache cache = ComponentManager.getInstance();
|
||||
Iterator it = cache.getComponentEntryMap().entrySet().iterator();
|
||||
while (it.hasNext()) {
|
||||
Map.Entry<String, ComponentInfo> entry = (Map.Entry<String, ComponentInfo>) it.next();
|
||||
ComponentInfo info = entry.getValue();
|
||||
String name = entry.getKey();
|
||||
if (!isComponentVisible(name)) {
|
||||
continue;
|
||||
}
|
||||
org.talend.core.model.properties.Project emfProject = project.getEmfProject();
|
||||
if (emfProject == null) {
|
||||
return;
|
||||
IBrandingService service = (IBrandingService) GlobalServiceRegister.getDefault().getService(IBrandingService.class);
|
||||
String[] availableComponents = service.getBrandingConfiguration().getAvailableComponents();
|
||||
EmfComponent currentComp = new EmfComponent(info.getUriString(), info.getSourceBundleName(), name,
|
||||
info.getPathSource(), cache, true);
|
||||
// if the component is not needed in the current branding,
|
||||
// and that this one IS NOT a specific component for code generation
|
||||
// just don't load it
|
||||
if (availableComponents != null
|
||||
&& !ArrayUtils.contains(availableComponents, currentComp.getName())
|
||||
&& !(ArrayUtils.contains(COMPONENTS_ALWAYS_NEEDED, currentComp.getName())
|
||||
|| currentComp.getOriginalFamilyName().contains("Technical") || currentComp.isTechnical())) {
|
||||
continue;
|
||||
}
|
||||
EList list = emfProject.getComponentsSettings();
|
||||
if (list.isEmpty()) {
|
||||
ComponentsFactoryProvider.saveComponentVisibilityStatus();
|
||||
// if the component is not needed in the current branding,
|
||||
// and that this one IS a specific component for code generation,
|
||||
// hide it
|
||||
if (availableComponents != null
|
||||
&& !ArrayUtils.contains(availableComponents, currentComp.getName())
|
||||
&& (ArrayUtils.contains(COMPONENTS_ALWAYS_NEEDED, currentComp.getName())
|
||||
|| currentComp.getOriginalFamilyName().contains("Technical") || currentComp.isTechnical())) {
|
||||
currentComp.setVisible(false);
|
||||
currentComp.setTechnical(true);
|
||||
}
|
||||
if (currentComp.getSourceBundleName().contains("camel")) {
|
||||
currentComp.setPaletteType("CAMEL");
|
||||
} else {
|
||||
currentComp.setPaletteType("DI");
|
||||
}
|
||||
String applicationPath = bundleIdToPath.get(info.getSourceBundleName());
|
||||
if (applicationPath == null) {
|
||||
try {
|
||||
applicationPath = FileLocator.getBundleFile(Platform.getBundle(info.getSourceBundleName())).getPath();
|
||||
applicationPath = (new Path(applicationPath)).toPortableString();
|
||||
} catch (IOException e2) {
|
||||
ExceptionHandler.process(e2);
|
||||
return;
|
||||
}
|
||||
bundleIdToPath.put(info.getSourceBundleName(), applicationPath);
|
||||
}
|
||||
|
||||
if (!componentList.contains(currentComp)) {
|
||||
currentComp.setResourceBundle(getComponentResourceBundle(currentComp, applicationPath + info.getUriString(),
|
||||
info.getPathSource(), null));
|
||||
|
||||
File currentFile = new File(applicationPath + info.getUriString());
|
||||
loadIcons(currentFile.getParentFile(), currentComp);
|
||||
componentList.add(currentComp);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -253,6 +482,11 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
return file.exists();
|
||||
}
|
||||
|
||||
private boolean cleanComponentCache() {
|
||||
return ArrayUtils.contains(Platform.getApplicationArgs(), "--clean_component_cache")
|
||||
|| ArrayUtils.contains(Platform.getApplicationArgs(), "-clean") || BrandingChecker.isBrandingChanged();
|
||||
}
|
||||
|
||||
private void loadComponentsFromComponentsProviderExtension() {
|
||||
ComponentsProviderManager componentsProviderManager = ComponentsProviderManager.getInstance();
|
||||
for (AbstractComponentsProvider componentsProvider : componentsProviderManager.getProviders()) {
|
||||
@@ -260,6 +494,15 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
}
|
||||
}
|
||||
|
||||
public void loadComponentsFromExtension(String id) {
|
||||
ComponentsProviderManager componentsProviderManager = ComponentsProviderManager.getInstance();
|
||||
for (AbstractComponentsProvider componentsProvider : componentsProviderManager.getProviders()) {
|
||||
if (componentsProvider.getId() != null && componentsProvider.getId().equals(id)) {
|
||||
loadComponents(componentsProvider);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void loadComponents(AbstractComponentsProvider componentsProvider) {
|
||||
if (componentsProvider != null) {
|
||||
try {
|
||||
@@ -274,14 +517,13 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadUserComponentsFromComponentsProviderExtension() {
|
||||
ComponentsProviderManager.getInstance().getProviders();
|
||||
ComponentsProviderManager componentsProviderManager = ComponentsProviderManager.getInstance();
|
||||
AbstractComponentsProvider componentsProvider = componentsProviderManager.loadUserComponentsProvidersFromExtension();
|
||||
// remove old user components
|
||||
if (!this.userComponentList.isEmpty()) {
|
||||
ComponentsCache cache = ComponentManager.getComponentCache();
|
||||
if (this.userComponentList != null) {
|
||||
ComponentsCache cache = ComponentManager.getInstance();
|
||||
for (IComponent component : userComponentList) {
|
||||
if (componentList != null && componentList.contains(component)) {
|
||||
componentList.remove(component);
|
||||
@@ -291,12 +533,13 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
}
|
||||
if (cache.getComponentEntryMap().get(component.getName()) != null) {
|
||||
cache.getComponentEntryMap().remove(component.getName());
|
||||
ComponentManager.setModified(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
loadComponents(componentsProvider);
|
||||
ComponentManager.saveResource();
|
||||
if (!CommonsPlugin.isHeadless()) {
|
||||
ComponentManager.saveResource();
|
||||
}
|
||||
}
|
||||
|
||||
private void removeOldComponentsUserFolder() {
|
||||
@@ -317,6 +560,16 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
|
||||
private void loadComponentsFromFolder(String pathSource, AbstractComponentsProvider provider) {
|
||||
|
||||
if (pathSource != null) {
|
||||
Path userComponent = new Path(pathSource);
|
||||
Path templatePath = new Path(IComponentsFactory.COMPONENTS_INNER_FOLDER + File.separatorChar
|
||||
+ IComponentsFactory.EXTERNAL_COMPONENTS_INNER_FOLDER + File.separatorChar
|
||||
+ ComponentUtilities.getExtFolder(OLD_COMPONENTS_USER_INNER_FOLDER));
|
||||
if (userComponent.equals(templatePath)) {
|
||||
this.userComponentList = new ArrayList<IComponent>();
|
||||
}
|
||||
}
|
||||
|
||||
boolean isCustom = false;
|
||||
if ("org.talend.designer.components.model.UserComponentsProvider".equals(provider.getId())
|
||||
|| "org.talend.designer.components.exchange.ExchangeComponentsProvider".equals(provider.getId())) {
|
||||
@@ -334,10 +587,10 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
|
||||
FileFilter fileFilter = new FileFilter() {
|
||||
|
||||
@Override
|
||||
public boolean accept(final File file) {
|
||||
return file.isDirectory() && file.getName().charAt(0) != '.'
|
||||
&& !file.getName().equals(IComponentsFactory.EXTERNAL_COMPONENTS_INNER_FOLDER);
|
||||
&& !file.getName().equals(IComponentsFactory.EXTERNAL_COMPONENTS_INNER_FOLDER)
|
||||
&& isComponentVisible(file.getName());
|
||||
}
|
||||
|
||||
};
|
||||
@@ -354,7 +607,6 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
|
||||
FileFilter skeletonFilter = new FileFilter() {
|
||||
|
||||
@Override
|
||||
public boolean accept(final File file) {
|
||||
String fileName = file.getName();
|
||||
return file.isFile() && fileName.charAt(0) != '.'
|
||||
@@ -374,14 +626,19 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
if (context == null) {
|
||||
context = CodeGeneratorActivator.getDefault().getBundle().getBundleContext();
|
||||
}
|
||||
// if (Platform.getProduct() != null) {
|
||||
// context = Platform.getProduct().getDefiningBundle().getBundleContext();
|
||||
// } else {
|
||||
// context = CodeGeneratorActivator.getDefault().getBundle().getBundleContext();
|
||||
// }
|
||||
// if (context == null) {
|
||||
// context = Platform.getProduct().getDefiningBundle().getBundleContext();
|
||||
// if (context == null)
|
||||
// context = CodeGeneratorActivator.getDefault().getBundle().getBundleContext();
|
||||
// }
|
||||
ServiceReference sref = context.getServiceReference(PackageAdmin.class.getName());
|
||||
PackageAdmin admin = (PackageAdmin) context.getService(sref);
|
||||
String bundleName;
|
||||
if (!isCustom) {
|
||||
bundleName = admin.getBundle(provider.getClass()).getSymbolicName();
|
||||
} else {
|
||||
bundleName = IComponentsFactory.COMPONENTS_LOCATION;
|
||||
}
|
||||
|
||||
if (childDirectories != null) {
|
||||
if (monitor != null) {
|
||||
this.subMonitor = SubMonitor.convert(monitor,
|
||||
@@ -399,60 +656,26 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
}
|
||||
|
||||
try {
|
||||
ComponentFileChecker.checkComponentFolder(currentFolder, getCodeLanguageSuffix());
|
||||
File xmlMainFile = new File(currentFolder, ComponentFilesNaming.getInstance().getMainXMLFileName(
|
||||
currentFolder.getName(), getCodeLanguageSuffix()));
|
||||
|
||||
String currentXmlSha1 = null;
|
||||
try {
|
||||
currentXmlSha1 = SHA1Util.calculateFromTextStream(new FileInputStream(xmlMainFile));
|
||||
} catch (FileNotFoundException e) {
|
||||
// nothing since exceptions are directly in the check bellow
|
||||
}
|
||||
// Need to check if this component is already in the cache or not.
|
||||
// if yes, then we compare the sha1... and if different we reload the component
|
||||
// if component is not in the cache, of course just load it!
|
||||
ComponentsCache cache = ComponentManager.getComponentCache();
|
||||
boolean foundComponentIsSame = false;
|
||||
ComponentInfo existingComponentInfoInCache = null;
|
||||
if (cache.getComponentEntryMap().containsKey(currentFolder.getName())) {
|
||||
EList<ComponentInfo> infos = cache.getComponentEntryMap().get(currentFolder.getName());
|
||||
for (ComponentInfo info : infos) {
|
||||
if (StringUtils.equals(bundleName, info.getSourceBundleName())) {
|
||||
existingComponentInfoInCache = info;
|
||||
if (StringUtils.equals(info.getSha1(), currentXmlSha1)) {
|
||||
foundComponentIsSame = true;
|
||||
}
|
||||
break; // found component, no matter changed or not
|
||||
}
|
||||
if (CommonsPlugin.isHeadless() && componentsCache.containsKey(xmlMainFile.getAbsolutePath())) {
|
||||
// In headless mode, we assume the components won't change and we will use a cache
|
||||
componentList.add(componentsCache.get(xmlMainFile.getAbsolutePath()));
|
||||
if (isCustom) {
|
||||
customComponentList.add(componentsCache.get(xmlMainFile.getAbsolutePath()));
|
||||
}
|
||||
}
|
||||
if (foundComponentIsSame) {
|
||||
// check if component is already loaded in memory, if yes it will only reload existing xml
|
||||
// it should go here mainly for commandline or if use like ctrl+shift+f3
|
||||
if (componentsCache.containsKey(xmlMainFile.getAbsolutePath())) {
|
||||
IComponent componentFromThisProvider = null;
|
||||
for (IComponent component : componentsCache.get(xmlMainFile.getAbsolutePath()).values()) {
|
||||
if (component instanceof EmfComponent) {
|
||||
if (bundleName.equals(((EmfComponent) component).getSourceBundleName())) {
|
||||
componentFromThisProvider = component;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (componentFromThisProvider != null) {
|
||||
// In headless mode, we assume the components won't change and we will use a cache
|
||||
componentList.add(componentFromThisProvider);
|
||||
if (isCustom) {
|
||||
customComponentList.add(componentFromThisProvider);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!foundComponentIsSame) {
|
||||
ComponentFileChecker.checkComponentFolder(currentFolder, getCodeLanguageSuffix());
|
||||
continue;
|
||||
}
|
||||
String pathName = xmlMainFile.getAbsolutePath();
|
||||
|
||||
String bundleName;
|
||||
if (!isCustom) {
|
||||
bundleName = admin.getBundle(provider.getClass()).getSymbolicName();
|
||||
} else {
|
||||
bundleName = IComponentsFactory.COMPONENTS_LOCATION;
|
||||
}
|
||||
String applicationPath;
|
||||
try {
|
||||
applicationPath = FileLocator.getBundleFile(Platform.getBundle(bundleName)).getPath();
|
||||
@@ -467,38 +690,30 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
// pathName = C:\myapp\plugins\myplugin\components\mycomponent\mycomponent.xml
|
||||
pathName = (new Path(pathName)).toPortableString();
|
||||
// pathName = C:/myapp/plugins/myplugin/components/mycomponent/mycomponent.xml
|
||||
pathName = pathName.replace(applicationPath, ""); //$NON-NLS-1$
|
||||
pathName = pathName.replace(applicationPath, "");
|
||||
|
||||
// pathName = /components/mycomponent/mycomponent.xml
|
||||
|
||||
EmfComponent currentComp = new EmfComponent(pathName, bundleName, xmlMainFile.getParentFile().getName(),
|
||||
pathSource, ComponentManager.getComponentCache(), foundComponentIsSame);
|
||||
if (!foundComponentIsSame) {
|
||||
// force to call some functions to update the cache. (to improve)
|
||||
currentComp.isVisibleInComponentDefinition();
|
||||
currentComp.isTechnical();
|
||||
currentComp.getOriginalFamilyName();
|
||||
currentComp.getTranslatedFamilyName();
|
||||
currentComp.getPluginExtension();
|
||||
currentComp.getVersion();
|
||||
currentComp.getModulesNeeded();
|
||||
currentComp.getPluginDependencies();
|
||||
// end of force cache update.
|
||||
pathSource, ComponentManager.getInstance(), isCreated);
|
||||
// force to call some functions to update the cache. (to improve)
|
||||
currentComp.isVisibleInComponentDefinition();
|
||||
currentComp.isTechnical();
|
||||
currentComp.getOriginalFamilyName();
|
||||
currentComp.getTranslatedFamilyName();
|
||||
currentComp.getPluginExtension();
|
||||
currentComp.getVersion();
|
||||
currentComp.getModulesNeeded();
|
||||
currentComp.getPluginDependencies();
|
||||
// end of force cache update.
|
||||
|
||||
EList<ComponentInfo> componentsInfo = cache.getComponentEntryMap().get(currentFolder.getName());
|
||||
for (ComponentInfo cInfo : componentsInfo) {
|
||||
if (cInfo.getSourceBundleName().equals(bundleName)) {
|
||||
cInfo.setSha1(currentXmlSha1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
ComponentManager.setModified(true); // this will force to save the cache later.
|
||||
}
|
||||
// if the component is not needed in the current branding,
|
||||
// and that this one IS NOT a specific component for code generation
|
||||
// just don't load it
|
||||
if (availableComponents != null && !ArrayUtils.contains(availableComponents, currentComp.getName())
|
||||
&& !(currentComp.getOriginalFamilyName().contains("Technical") || currentComp.isTechnical())) {
|
||||
if (availableComponents != null
|
||||
&& !ArrayUtils.contains(availableComponents, currentComp.getName())
|
||||
&& !(ArrayUtils.contains(COMPONENTS_ALWAYS_NEEDED, currentComp.getName())
|
||||
|| currentComp.getOriginalFamilyName().contains("Technical") || currentComp.isTechnical())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -507,8 +722,10 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
// if the component is not needed in the current branding,
|
||||
// and that this one IS a specific component for code generation,
|
||||
// hide it
|
||||
if (availableComponents != null && !ArrayUtils.contains(availableComponents, currentComp.getName())
|
||||
&& (currentComp.getOriginalFamilyName().contains("Technical") || currentComp.isTechnical())) {
|
||||
if (availableComponents != null
|
||||
&& !ArrayUtils.contains(availableComponents, currentComp.getName())
|
||||
&& (ArrayUtils.contains(COMPONENTS_ALWAYS_NEEDED, currentComp.getName())
|
||||
|| currentComp.getOriginalFamilyName().contains("Technical") || currentComp.isTechnical())) {
|
||||
currentComp.setVisible(false);
|
||||
currentComp.setTechnical(true);
|
||||
}
|
||||
@@ -539,13 +756,9 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
}
|
||||
}
|
||||
|
||||
// componentsCache only used bellow in case of headless (commandline) or if use like
|
||||
// ctrl+shift+f3
|
||||
String componentName = xmlMainFile.getAbsolutePath();
|
||||
if (!componentsCache.containsKey(componentName)) {
|
||||
componentsCache.put(componentName, new HashMap<String, IComponent>());
|
||||
if (CommonsPlugin.isHeadless()) {
|
||||
componentsCache.put(xmlMainFile.getAbsolutePath(), currentComp);
|
||||
}
|
||||
componentsCache.get(xmlMainFile.getAbsolutePath()).put(currentComp.getPaletteType(), currentComp);
|
||||
} catch (MissingMainXMLComponentFileException e) {
|
||||
log.trace(currentFolder.getName() + " is not a " + getCodeLanguageSuffix() + " component", e); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
} catch (BusinessException e) {
|
||||
@@ -700,7 +913,6 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
component.setImageRegistry(componentsImageRegistry);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int size() {
|
||||
if (componentList == null) {
|
||||
init(false);
|
||||
@@ -708,7 +920,6 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
return componentList.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IComponent get(String name) {
|
||||
if (componentList == null) {
|
||||
init(false);
|
||||
@@ -722,7 +933,6 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initializeComponents(IProgressMonitor monitor) {
|
||||
this.monitor = monitor;
|
||||
if (componentList == null) {
|
||||
@@ -732,7 +942,6 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
this.subMonitor = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initializeComponents(IProgressMonitor monitor, boolean duringLogon) {
|
||||
this.monitor = monitor;
|
||||
if (componentList == null) {
|
||||
@@ -747,7 +956,6 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
*
|
||||
* @see org.talend.core.model.components.IComponentsFactory#getComponents()
|
||||
*/
|
||||
@Override
|
||||
public Set<IComponent> getComponents() {
|
||||
if (componentList == null) {
|
||||
init(false);
|
||||
@@ -755,12 +963,28 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
return componentList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IComponent> getCustomComponents() {
|
||||
if (customComponentList == null) {
|
||||
init(false);
|
||||
}
|
||||
return new ArrayList<IComponent>(customComponentList);
|
||||
return customComponentList;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.core.model.components.IComponentsFactory#getComponentPath()
|
||||
*/
|
||||
public URL getComponentPath() throws IOException {
|
||||
String componentsPath = IComponentsFactory.COMPONENTS_LOCATION;
|
||||
IBrandingService breaningService = (IBrandingService) GlobalServiceRegister.getDefault().getService(
|
||||
IBrandingService.class);
|
||||
if (breaningService.isPoweredOnlyCamel()) {
|
||||
componentsPath = IComponentsFactory.CAMEL_COMPONENTS_LOCATION;
|
||||
}
|
||||
Bundle b = Platform.getBundle(componentsPath);
|
||||
URL url = FileLocator.toFileURL(FileLocator.find(b, new Path(IComponentsFactory.COMPONENTS_INNER_FOLDER), null));
|
||||
return url;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -768,7 +992,6 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
*
|
||||
* @see org.talend.core.model.components.IComponentsFactory#getSkeletons()
|
||||
*/
|
||||
@Override
|
||||
public List<String> getSkeletons() {
|
||||
if (skeletonList == null) {
|
||||
init(false);
|
||||
@@ -776,18 +999,22 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
return skeletonList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset() {
|
||||
componentsImageRegistry.clear();
|
||||
componentList = null;
|
||||
skeletonList = null;
|
||||
customComponentList = null;
|
||||
allComponents = null;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resetCache() {
|
||||
componentsImageRegistry.clear();
|
||||
componentList = null;
|
||||
skeletonList = null;
|
||||
customComponentList = null;
|
||||
allComponents = null;
|
||||
isReset = true;
|
||||
if (!CommonsPlugin.isHeadless()) {
|
||||
TalendEntryEditPart.resetImageCache();
|
||||
}
|
||||
@@ -799,7 +1026,6 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
* @see org.talend.core.model.components.IComponentsFactory#getFamilyTranslation(IComponent component,
|
||||
* java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public String getFamilyTranslation(Object component, String text) {
|
||||
String translated = Messages.getString(text);
|
||||
|
||||
@@ -825,17 +1051,156 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
return translated;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.core.model.components.IComponentsFactory#getAllComponentsCanBeProvided()
|
||||
*/
|
||||
public Map<String, String> getAllComponentsCanBeProvided() {
|
||||
List source = new ArrayList();
|
||||
if (allComponents == null) {
|
||||
allComponents = new HashMap<String, String>();
|
||||
source.add(IComponentsFactory.COMPONENTS_INNER_FOLDER);
|
||||
ComponentsProviderManager componentsProviderManager = ComponentsProviderManager.getInstance();
|
||||
source.addAll(componentsProviderManager.getProviders());
|
||||
for (int i = 0; i < source.size(); i++) {
|
||||
String path = null;
|
||||
AbstractComponentsProvider provider = null;
|
||||
Object object = source.get(i);
|
||||
if (object instanceof String) {
|
||||
path = (String) object;
|
||||
} else if (object instanceof AbstractComponentsProvider) {
|
||||
provider = ((AbstractComponentsProvider) object);
|
||||
path = provider.getComponentsLocation();
|
||||
}
|
||||
if (path != null) {
|
||||
// **if the components is from provider,should get components from provider path,see bug TDI-18036
|
||||
File sourceFile = getComponentsLocation(path, provider);
|
||||
File[] childDirectories;
|
||||
|
||||
FileFilter fileFilter = new FileFilter() {
|
||||
|
||||
public boolean accept(final File file) {
|
||||
return file.isDirectory() && file.getName().charAt(0) != '.'
|
||||
&& !file.getName().equals(IComponentsFactory.EXTERNAL_COMPONENTS_INNER_FOLDER);
|
||||
}
|
||||
|
||||
};
|
||||
if (sourceFile == null) {
|
||||
ExceptionHandler.process(new Exception("Component Not Found")); //$NON-NLS-1$
|
||||
continue;
|
||||
}
|
||||
|
||||
childDirectories = sourceFile.listFiles(fileFilter);
|
||||
if (childDirectories != null) {
|
||||
for (File currentFolder : childDirectories) {
|
||||
try {
|
||||
ComponentFileChecker.checkComponentFolder(currentFolder, getCodeLanguageSuffix());
|
||||
} catch (BusinessException e) {
|
||||
continue;
|
||||
}
|
||||
File xmlMainFile = new File(currentFolder, ComponentFilesNaming.getInstance().getMainXMLFileName(
|
||||
currentFolder.getName(), getCodeLanguageSuffix()));
|
||||
List<String> families = getComponentsFamilyFromXML(xmlMainFile);
|
||||
ComponentIconLoading cil = new ComponentIconLoading(componentsImageRegistry, currentFolder);
|
||||
cil.getImage32();
|
||||
if (families != null) {
|
||||
for (String family : families) {
|
||||
allComponents.put(family + FAMILY_SPEARATOR + currentFolder.getName(),
|
||||
currentFolder.getName() + "_32");
|
||||
if (object instanceof AbstractComponentsProvider) {
|
||||
if (!componentsAndProvider.containsKey(family)) {
|
||||
componentsAndProvider.put(family, (AbstractComponentsProvider) object);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return allComponents;
|
||||
}
|
||||
|
||||
private List<String> getComponentsFamilyFromXML(File xmlMainFile) {
|
||||
final DocumentBuilderFactory fabrique = DocumentBuilderFactory.newInstance();
|
||||
final String familysTag = "FAMILIES"; //$NON-NLS-1$
|
||||
final String header = "HEADER"; //$NON-NLS-1$
|
||||
final String technical = "TECHNICAL"; //$NON-NLS-1$
|
||||
|
||||
List<String> familyNames = new ArrayList<String>();
|
||||
|
||||
DocumentBuilder analyseur;
|
||||
try {
|
||||
analyseur = fabrique.newDocumentBuilder();
|
||||
analyseur.setErrorHandler(new ErrorHandler() {
|
||||
|
||||
public void error(final SAXParseException exception) throws SAXException {
|
||||
throw exception;
|
||||
}
|
||||
|
||||
public void fatalError(final SAXParseException exception) throws SAXException {
|
||||
throw exception;
|
||||
}
|
||||
|
||||
public void warning(final SAXParseException exception) throws SAXException {
|
||||
throw exception;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
Document document = analyseur.parse(xmlMainFile);
|
||||
NodeList elementsByTagName = document.getElementsByTagName(header);
|
||||
String technicalValue = null;
|
||||
if (elementsByTagName != null && elementsByTagName.getLength() > 0) {
|
||||
Node item = elementsByTagName.item(0);
|
||||
NamedNodeMap attributes = item.getAttributes();
|
||||
if (attributes != null) {
|
||||
Node namedItem = attributes.getNamedItem(technical);
|
||||
if (namedItem != null) {
|
||||
technicalValue = namedItem.getNodeValue();
|
||||
}
|
||||
}
|
||||
}
|
||||
// techenical node are not visible ,so no need to return it's family
|
||||
if (technicalValue == null || !"true".equals(technicalValue)) { //$NON-NLS-1$
|
||||
NodeList element = document.getElementsByTagName(familysTag);
|
||||
if (element != null && element.getLength() > 0) {
|
||||
Node family = element.item(0);
|
||||
NodeList childNodes = family.getChildNodes();
|
||||
for (int i = 0; i < childNodes.getLength(); i++) {
|
||||
final Node item = childNodes.item(i);
|
||||
if (item instanceof com.sun.org.apache.xerces.internal.dom.DeferredElementImpl
|
||||
|| item instanceof org.apache.xerces.dom.DeferredElementImpl) {
|
||||
familyNames.add(item.getTextContent());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} catch (ParserConfigurationException e) {
|
||||
ExceptionHandler.process(e);
|
||||
} catch (SAXException e) {
|
||||
ExceptionHandler.process(e);
|
||||
} catch (IOException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
|
||||
return familyNames;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.core.model.components.IComponentsFactory#resetSpecificComponents()
|
||||
*/
|
||||
@Override
|
||||
public void resetSpecificComponents() {
|
||||
loadComponentsFromExtensions();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, File> getComponentsProvidersFolder() {
|
||||
Map<String, File> list = new HashMap<String, File>();
|
||||
|
||||
@@ -852,7 +1217,6 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, ImageDescriptor> getComponentsImageRegistry() {
|
||||
return componentsImageRegistry;
|
||||
}
|
||||
|
||||
@@ -16,8 +16,6 @@ import java.io.File;
|
||||
import java.io.FileFilter;
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.eclipse.core.runtime.FileLocator;
|
||||
@@ -99,11 +97,9 @@ public class UserComponentsProvider extends AbstractComponentsProvider {
|
||||
|
||||
// synchroniz shared custom component
|
||||
if (PluginChecker.isSVNProviderPluginLoaded()) {
|
||||
Set<Project> allProjects = new HashSet<Project>();
|
||||
allProjects.add(ProjectManager.getInstance().getCurrentProject());
|
||||
allProjects.addAll(ProjectManager.getInstance().getReferencedProjects());
|
||||
for (Project project : allProjects) {
|
||||
String projectLabel = project.getTechnicalLabel();
|
||||
Project currentProject = ProjectManager.getInstance().getCurrentProject();
|
||||
if (currentProject != null) {
|
||||
String projectLabel = currentProject.getTechnicalLabel();
|
||||
String sourcePath = new Path(Platform.getInstanceLocation().getURL().getPath()).toFile().getPath()
|
||||
+ File.separatorChar + projectLabel + File.separatorChar
|
||||
+ ERepositoryObjectType.getFolderName(ERepositoryObjectType.COMPONENTS);
|
||||
|
||||
@@ -80,14 +80,20 @@ public class XsdValidationCacheManager {
|
||||
|
||||
public boolean needCheck(java.io.File file, long currentCRC) {
|
||||
String path = file.getAbsolutePath();
|
||||
Long lastCheckedCRC = alreadyCheckedXsd.get(path);
|
||||
if (forceXSDAlreadyChecked) {
|
||||
alreadyCheckedXsd.put(path, currentCRC);
|
||||
return false;
|
||||
} else {
|
||||
Long lastCheckedCRC = alreadyCheckedXsd.get(path);
|
||||
|
||||
if (lastCheckedCRC == null) {
|
||||
return true;
|
||||
if (lastCheckedCRC == null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
boolean isChanged = currentCRC != lastCheckedCRC;
|
||||
|
||||
return isChanged;
|
||||
}
|
||||
|
||||
boolean isChanged = currentCRC != lastCheckedCRC;
|
||||
return isChanged;
|
||||
}
|
||||
|
||||
public void setChecked(File file, long currentCRC) {
|
||||
|
||||
@@ -87,7 +87,6 @@ public class ComponentsPreferencePage extends FieldEditorPreferencePage implemen
|
||||
/**
|
||||
* @see org.eclipse.jface.preference.FieldEditor#refreshValidState()
|
||||
*/
|
||||
@Override
|
||||
protected void refreshValidState() {
|
||||
super.refreshValidState();
|
||||
}
|
||||
@@ -96,7 +95,6 @@ public class ComponentsPreferencePage extends FieldEditorPreferencePage implemen
|
||||
* Clears the error message from the message line if the error message is the error message from this field
|
||||
* editor.
|
||||
*/
|
||||
@Override
|
||||
protected void clearErrorMessage() {
|
||||
if (canClearErrorMessage()) {
|
||||
super.clearErrorMessage();
|
||||
@@ -124,7 +122,6 @@ public class ComponentsPreferencePage extends FieldEditorPreferencePage implemen
|
||||
addField(dbTypeField);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void propertyChange(PropertyChangeEvent event) {
|
||||
|
||||
if (event.getSource() == filePathTemp) {
|
||||
@@ -245,7 +242,6 @@ public class ComponentsPreferencePage extends FieldEditorPreferencePage implemen
|
||||
addField(doNotShowJobletAfterDoubleClickCheckBoxField);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createFieldEditors() {
|
||||
final Composite parent = getFieldEditorParent();
|
||||
filePathTemp = new DirectoryFieldEditor(IComponentPreferenceConstant.USER_COMPONENTS_FOLDER,
|
||||
@@ -257,11 +253,10 @@ public class ComponentsPreferencePage extends FieldEditorPreferencePage implemen
|
||||
|
||||
String oldPath = getPreferenceStore().getString(IComponentPreferenceConstant.USER_COMPONENTS_FOLDER);
|
||||
|
||||
@Override
|
||||
public void modifyText(ModifyEvent e) {
|
||||
String newPath = filePathTemp.getTextControl(parent).getText();
|
||||
File file = new File(newPath);
|
||||
if (!file.exists() && !"".equals(newPath)) {
|
||||
if (!file.exists()) {
|
||||
// getPreferenceStore().setValue(IComponentPreferenceConstant.USER_COMPONENTS_FOLDER, "");
|
||||
filePathTemp.showErrorMessage();
|
||||
setValid(false);
|
||||
@@ -292,7 +287,6 @@ public class ComponentsPreferencePage extends FieldEditorPreferencePage implemen
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(IWorkbench workbench) {
|
||||
}
|
||||
|
||||
@@ -305,7 +299,6 @@ public class ComponentsPreferencePage extends FieldEditorPreferencePage implemen
|
||||
|
||||
final IRunnableWithProgress runnable = new IRunnableWithProgress() {
|
||||
|
||||
@Override
|
||||
public void run(final IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
|
||||
monitor.beginTask("Loading user component ......", 100);
|
||||
Display display = Display.getCurrent();
|
||||
@@ -315,7 +308,6 @@ public class ComponentsPreferencePage extends FieldEditorPreferencePage implemen
|
||||
if (display != null) {
|
||||
display.syncExec(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
IComponentsFactory components = ComponentsFactoryProvider.getInstance();
|
||||
|
||||
|
||||
@@ -19,9 +19,6 @@ import org.eclipse.core.runtime.ProgressMonitorWrapper;
|
||||
import org.eclipse.jface.dialogs.Dialog;
|
||||
import org.eclipse.swt.SWTException;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
import org.talend.commons.ui.gmf.util.DisplayUtils;
|
||||
import org.talend.commons.ui.runtime.CommonUIPlugin;
|
||||
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
|
||||
|
||||
/**
|
||||
* DOC mhirt class global comment. Detailled comment <br/>
|
||||
@@ -75,19 +72,7 @@ public class CodeGeneratorProgressMonitor extends ProgressMonitorWrapper impleme
|
||||
* @see org.eclipse.core.runtime.IProgressMonitorWithBlocking#clearBlocked()
|
||||
*/
|
||||
public void clearBlocked() {
|
||||
if (CommonUIPlugin.isFullyHeadless()) {
|
||||
return;
|
||||
}
|
||||
final Display disp = DisplayUtils.getDisplay();
|
||||
|
||||
disp.syncExec(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
Dialog.getBlockedHandler().clearBlocked();
|
||||
}
|
||||
|
||||
});
|
||||
Dialog.getBlockedHandler().clearBlocked();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -155,20 +140,8 @@ public class CodeGeneratorProgressMonitor extends ProgressMonitorWrapper impleme
|
||||
*
|
||||
* @see org.eclipse.core.runtime.IProgressMonitorWithBlocking#setBlocked(org.eclipse.core.runtime.IStatus)
|
||||
*/
|
||||
public void setBlocked(final IStatus reason) {
|
||||
if (CommonUIPlugin.isFullyHeadless()) {
|
||||
return;
|
||||
}
|
||||
final Display disp = DisplayUtils.getDisplay();
|
||||
|
||||
disp.syncExec(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
Dialog.getBlockedHandler().showBlocked(CodeGeneratorProgressMonitor.this, reason, taskName);
|
||||
}
|
||||
|
||||
});
|
||||
public void setBlocked(IStatus reason) {
|
||||
Dialog.getBlockedHandler().showBlocked(this, reason, taskName);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -111,7 +111,7 @@ public class NodesTree {
|
||||
|
||||
for (INode node : nodes) {
|
||||
String componentName = node.getComponent().getName();
|
||||
if ((node.isStart()) && (node.isActivate()) && node.isDesignSubjobStartNode() && !node.isThereLinkWithHash() && (!componentName.equals("tPrejob")) //$NON-NLS-1$
|
||||
if ((node.isStart()) && (node.isActivate()) && (!componentName.equals("tPrejob")) //$NON-NLS-1$
|
||||
&& (!componentName.equals("tPostjob"))) { //$NON-NLS-1$
|
||||
rootNodes.add(node);
|
||||
}
|
||||
|
||||
@@ -14,7 +14,6 @@ package org.talend.designer.codegen.config;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.DataInputStream;
|
||||
import java.io.File;
|
||||
import java.io.InputStream;
|
||||
import java.lang.reflect.Method;
|
||||
@@ -28,6 +27,7 @@ import java.util.StringTokenizer;
|
||||
|
||||
import org.apache.commons.lang.ArrayUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.eclipse.core.resources.IContainer;
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.resources.IFolder;
|
||||
import org.eclipse.core.resources.IMarker;
|
||||
@@ -52,10 +52,12 @@ import org.eclipse.emf.common.util.Monitor;
|
||||
import org.eclipse.jdt.core.IClasspathEntry;
|
||||
import org.eclipse.jdt.core.IJavaModel;
|
||||
import org.eclipse.jdt.core.IJavaProject;
|
||||
import org.eclipse.jdt.core.IPackageFragmentRoot;
|
||||
import org.eclipse.jdt.core.JavaCore;
|
||||
import org.eclipse.jdt.core.JavaModelException;
|
||||
import org.talend.commons.debug.TalendDebugHandler;
|
||||
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
|
||||
import org.talend.core.model.components.ComponentCompilations;
|
||||
import org.talend.designer.codegen.i18n.Messages;
|
||||
|
||||
/**
|
||||
@@ -182,17 +184,21 @@ public class TalendJetEmitter extends JETEmitter {
|
||||
project.create(new SubProgressMonitor(progressMonitor, 1));
|
||||
progressMonitor.subTask(CodeGenPlugin.getPlugin().getString("_UI_JETCreatingProject_message", //$NON-NLS-1$
|
||||
new Object[] { project.getName() }));
|
||||
}
|
||||
if (!project.isOpen()) {
|
||||
project.open(new SubProgressMonitor(progressMonitor, 5));
|
||||
project.refreshLocal(IResource.DEPTH_INFINITE, new SubProgressMonitor(progressMonitor, 1));
|
||||
}
|
||||
IProjectDescription description = project.getDescription();
|
||||
// only in case it's one old workspace and got no nature defined.
|
||||
if (!ArrayUtils.contains(description.getNatureIds(), JavaCore.NATURE_ID)) {
|
||||
IProjectDescription description = workspace.newProjectDescription(project.getName());
|
||||
description.setNatureIds(new String[] { JavaCore.NATURE_ID });
|
||||
description.setLocation(null);
|
||||
project.open(new SubProgressMonitor(progressMonitor, 1));
|
||||
project.setDescription(description, new SubProgressMonitor(progressMonitor, 1));
|
||||
} else {
|
||||
project.open(new SubProgressMonitor(progressMonitor, 5));
|
||||
IProjectDescription description = project.getDescription();
|
||||
// only in case it's one old workspace and got no nature defined.
|
||||
if (!ArrayUtils.contains(description.getNatureIds(), JavaCore.NATURE_ID)) {
|
||||
description.setNatureIds(new String[] { JavaCore.NATURE_ID });
|
||||
project.setDescription(description, new SubProgressMonitor(progressMonitor, 1));
|
||||
}
|
||||
}
|
||||
|
||||
javaProject = JavaCore.create(project);
|
||||
|
||||
progressMonitor.subTask(CodeGenPlugin.getPlugin().getString("_UI_JETInitializingProject_message", //$NON-NLS-1$
|
||||
@@ -294,107 +300,93 @@ public class TalendJetEmitter extends JETEmitter {
|
||||
|
||||
progressMonitor.subTask(CodeGenPlugin.getPlugin().getString("_UI_JETOpeningJavaProject_message", //$NON-NLS-1$
|
||||
new Object[] { project.getName() }));
|
||||
// javaProject.open(new SubProgressMonitor(progressMonitor, 1));
|
||||
|
||||
IPackageFragmentRoot[] packageFragmentRoots = javaProject.getPackageFragmentRoots();
|
||||
IPackageFragmentRoot sourcePackageFragmentRoot = null;
|
||||
for (int j = 0; j < packageFragmentRoots.length; ++j) {
|
||||
IPackageFragmentRoot packageFragmentRoot = packageFragmentRoots[j];
|
||||
if (packageFragmentRoot.getKind() == IPackageFragmentRoot.K_SOURCE) {
|
||||
sourcePackageFragmentRoot = packageFragmentRoot;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
String packageName = jetCompiler.getSkeleton().getPackageName();
|
||||
StringTokenizer stringTokenizer = new StringTokenizer(packageName, "."); //$NON-NLS-1$
|
||||
IProgressMonitor subProgressMonitor = new SubProgressMonitor(progressMonitor, 1);
|
||||
subProgressMonitor.beginTask("", stringTokenizer.countTokens() + 4); //$NON-NLS-1$
|
||||
subProgressMonitor.subTask(CodeGenPlugin.getPlugin().getString("_UI_CreateTargetFile_message")); //$NON-NLS-1$
|
||||
IFolder sourceContainer = project.getFolder("src");
|
||||
|
||||
IContainer sourceContainer = (IContainer) sourcePackageFragmentRoot.getCorrespondingResource();
|
||||
while (stringTokenizer.hasMoreElements()) {
|
||||
String folderName = stringTokenizer.nextToken();
|
||||
sourceContainer = sourceContainer.getFolder(new Path(folderName));
|
||||
if (!sourceContainer.exists()) {
|
||||
try {
|
||||
sourceContainer.create(true, true, new SubProgressMonitor(subProgressMonitor, 1));
|
||||
((IFolder) sourceContainer).create(true, true, new SubProgressMonitor(subProgressMonitor, 1));
|
||||
} catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
boolean needRebuild = true;
|
||||
IFile targetFile = sourceContainer.getFile(new Path(jetCompiler.getSkeleton().getClassName() + ".java")); //$NON-NLS-1$
|
||||
if (!targetFile.exists()) {
|
||||
subProgressMonitor.subTask(CodeGenPlugin.getPlugin().getString("_UI_JETCreating_message", //$NON-NLS-1$
|
||||
new Object[] { targetFile.getFullPath() }));
|
||||
targetFile.create(contents, true, new SubProgressMonitor(subProgressMonitor, 1));
|
||||
} else {
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
|
||||
DataInputStream dis = new DataInputStream(targetFile.getContents());
|
||||
int len = 0;
|
||||
byte[] buf = new byte[1024];
|
||||
while (((len = dis.read(buf))) != -1) {
|
||||
baos.write(buf, 0, len);
|
||||
}
|
||||
dis.close();
|
||||
|
||||
String currentContent = baos.toString();
|
||||
String newContent = outputStream.toString();
|
||||
// since the build is done on linux, if use windows, it will use different rules for \r + \n
|
||||
// so compare without \r, at least to see if original string is the same
|
||||
// if yes, consider all is ok, no need to replace the content and recompile
|
||||
currentContent = currentContent.replace("\r", ""); //$NON-NLS-1$//$NON-NLS-2$
|
||||
newContent = newContent.replace("\r", ""); //$NON-NLS-1$//$NON-NLS-2$
|
||||
if (!newContent.equals(currentContent)) {
|
||||
subProgressMonitor.subTask(CodeGenPlugin.getPlugin().getString("_UI_JETUpdating_message", //$NON-NLS-1$
|
||||
new Object[] { targetFile.getFullPath() }));
|
||||
targetFile.setContents(contents, true, true, new SubProgressMonitor(subProgressMonitor, 1));
|
||||
} else {
|
||||
needRebuild = false;
|
||||
}
|
||||
subProgressMonitor.subTask(CodeGenPlugin.getPlugin().getString("_UI_JETUpdating_message", //$NON-NLS-1$
|
||||
new Object[] { targetFile.getFullPath() }));
|
||||
targetFile.setContents(contents, true, true, new SubProgressMonitor(subProgressMonitor, 1));
|
||||
}
|
||||
|
||||
// if jetEmitter.getMethod() == null, means the class file doesn't exist anymore
|
||||
// it should be impossible to have only the class file deleted and the .java never modified, but still
|
||||
// handle this case.
|
||||
if (needRebuild || jetEmitter.getMethod() == null) {
|
||||
subProgressMonitor.subTask(CodeGenPlugin.getPlugin().getString("_UI_JETBuilding_message", //$NON-NLS-1$
|
||||
new Object[] { project.getName() }));
|
||||
subProgressMonitor.subTask(CodeGenPlugin.getPlugin().getString("_UI_JETBuilding_message", //$NON-NLS-1$
|
||||
new Object[] { project.getName() }));
|
||||
|
||||
if (!ComponentCompilations.getMarkers()) {
|
||||
project.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, new SubProgressMonitor(subProgressMonitor, 1));
|
||||
}
|
||||
|
||||
IMarker[] markers = targetFile.findMarkers(IMarker.PROBLEM, true, IResource.DEPTH_INFINITE);
|
||||
boolean errors = false;
|
||||
for (int i = 0; i < markers.length; ++i) {
|
||||
IMarker marker = markers[i];
|
||||
if (marker.getAttribute(IMarker.SEVERITY, IMarker.SEVERITY_INFO) == IMarker.SEVERITY_ERROR) {
|
||||
errors = true;
|
||||
subProgressMonitor.subTask(marker.getAttribute(IMarker.MESSAGE) + " : " //$NON-NLS-1$
|
||||
+ (CodeGenPlugin.getPlugin().getString("jet.mark.file.line", new Object[] { //$NON-NLS-1$
|
||||
targetFile.getLocation(), marker.getAttribute(IMarker.LINE_NUMBER) })));
|
||||
log.error(jetEmitter.templateURI.substring(jetEmitter.templateURI.lastIndexOf("/") + 1) //$NON-NLS-1$
|
||||
+ Messages.getString(
|
||||
"TalendJetEmitter.compileFail", //$NON-NLS-1$
|
||||
marker.getAttribute(IMarker.MESSAGE),
|
||||
(CodeGenPlugin.getPlugin().getString("jet.mark.file.line", new Object[] { //$NON-NLS-1$
|
||||
targetFile.getLocation(), marker.getAttribute(IMarker.LINE_NUMBER) }))));
|
||||
}
|
||||
IMarker[] markers = targetFile.findMarkers(IMarker.PROBLEM, true, IResource.DEPTH_INFINITE);
|
||||
boolean errors = false;
|
||||
for (int i = 0; i < markers.length; ++i) {
|
||||
IMarker marker = markers[i];
|
||||
if (marker.getAttribute(IMarker.SEVERITY, IMarker.SEVERITY_INFO) == IMarker.SEVERITY_ERROR) {
|
||||
errors = true;
|
||||
subProgressMonitor.subTask(marker.getAttribute(IMarker.MESSAGE) + " : " //$NON-NLS-1$
|
||||
+ (CodeGenPlugin.getPlugin().getString("jet.mark.file.line", new Object[] { //$NON-NLS-1$
|
||||
targetFile.getLocation(), marker.getAttribute(IMarker.LINE_NUMBER) })));
|
||||
log.error(jetEmitter.templateURI.substring(jetEmitter.templateURI.lastIndexOf("/") + 1) //$NON-NLS-1$
|
||||
+ Messages.getString(
|
||||
"TalendJetEmitter.compileFail", //$NON-NLS-1$
|
||||
marker.getAttribute(IMarker.MESSAGE),
|
||||
(CodeGenPlugin.getPlugin().getString("jet.mark.file.line", new Object[] { //$NON-NLS-1$
|
||||
targetFile.getLocation(), marker.getAttribute(IMarker.LINE_NUMBER) }))));
|
||||
}
|
||||
}
|
||||
|
||||
if (!errors) {
|
||||
subProgressMonitor.subTask(CodeGenPlugin.getPlugin().getString("_UI_JETLoadingClass_message", //$NON-NLS-1$
|
||||
new Object[] { jetCompiler.getSkeleton().getClassName() + ".class" })); //$NON-NLS-1$
|
||||
if (!errors) {
|
||||
subProgressMonitor.subTask(CodeGenPlugin.getPlugin().getString("_UI_JETLoadingClass_message", //$NON-NLS-1$
|
||||
new Object[] { jetCompiler.getSkeleton().getClassName() + ".class" })); //$NON-NLS-1$
|
||||
|
||||
// Construct a proper URL for relative lookup.
|
||||
//
|
||||
URL url = new File(project.getLocation()
|
||||
+ "/" + javaProject.getOutputLocation().removeFirstSegments(1) + "/") //$NON-NLS-1$ //$NON-NLS-2$
|
||||
.toURL();
|
||||
URLClassLoader theClassLoader = new URLClassLoader(new URL[] { url }, jetEmitter.classLoader);
|
||||
Class theClass = theClassLoader.loadClass((packageName.length() == 0 ? "" : packageName + ".") //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ jetCompiler.getSkeleton().getClassName());
|
||||
String methodName = jetCompiler.getSkeleton().getMethodName();
|
||||
Method[] methods = theClass.getDeclaredMethods();
|
||||
for (int i = 0; i < methods.length; ++i) {
|
||||
if (methods[i].getName().equals(methodName)) {
|
||||
jetEmitter.setMethod(methods[i]);
|
||||
break;
|
||||
}
|
||||
// Construct a proper URL for relative lookup.
|
||||
//
|
||||
URL url = new File(project.getLocation() + "/" + javaProject.getOutputLocation().removeFirstSegments(1) + "/") //$NON-NLS-1$ //$NON-NLS-2$
|
||||
.toURL();
|
||||
URLClassLoader theClassLoader = new URLClassLoader(new URL[] { url }, jetEmitter.classLoader);
|
||||
Class theClass = theClassLoader.loadClass((packageName.length() == 0 ? "" : packageName + ".") //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ jetCompiler.getSkeleton().getClassName());
|
||||
String methodName = jetCompiler.getSkeleton().getMethodName();
|
||||
Method[] methods = theClass.getDeclaredMethods();
|
||||
for (int i = 0; i < methods.length; ++i) {
|
||||
if (methods[i].getName().equals(methodName)) {
|
||||
jetEmitter.setMethod(methods[i]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
subProgressMonitor.done();
|
||||
} catch (CoreException exception) {
|
||||
TalendDebugHandler.debug(exception);
|
||||
|
||||
@@ -24,11 +24,8 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.lang.ArrayUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.resources.IProjectDescription;
|
||||
import org.eclipse.core.resources.IResource;
|
||||
import org.eclipse.core.resources.IWorkspace;
|
||||
import org.eclipse.core.resources.IncrementalProjectBuilder;
|
||||
import org.eclipse.core.resources.ResourcesPlugin;
|
||||
@@ -40,17 +37,14 @@ import org.eclipse.core.runtime.Platform;
|
||||
import org.eclipse.core.runtime.Status;
|
||||
import org.eclipse.core.runtime.SubProgressMonitor;
|
||||
import org.eclipse.core.runtime.jobs.Job;
|
||||
import org.eclipse.emf.codegen.CodeGenPlugin;
|
||||
import org.eclipse.emf.codegen.jet.JETEmitter;
|
||||
import org.eclipse.emf.codegen.jet.JETException;
|
||||
import org.eclipse.emf.common.CommonPlugin;
|
||||
import org.eclipse.emf.common.util.URI;
|
||||
import org.eclipse.jdt.core.JavaCore;
|
||||
import org.eclipse.jface.dialogs.MessageDialog;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
import org.talend.commons.CommonsPlugin;
|
||||
import org.talend.commons.exception.BusinessException;
|
||||
import org.talend.commons.ui.runtime.CommonUIPlugin;
|
||||
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
|
||||
import org.talend.commons.utils.StringUtils;
|
||||
import org.talend.commons.utils.io.IOUtils;
|
||||
@@ -111,8 +105,6 @@ public final class CodeGeneratorEmittersPoolFactory {
|
||||
private static IStatus status = null;
|
||||
|
||||
private static DelegateProgressMonitor delegateMonitor = new DelegateProgressMonitor();
|
||||
|
||||
public static final String JET_PROJECT = ".JETEmitters"; //$NON-NLS-1$
|
||||
|
||||
/***/
|
||||
private static class JobRunnable extends Thread {
|
||||
@@ -122,7 +114,6 @@ public final class CodeGeneratorEmittersPoolFactory {
|
||||
initializeStart = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
status = doRun();
|
||||
}
|
||||
@@ -134,19 +125,17 @@ public final class CodeGeneratorEmittersPoolFactory {
|
||||
TimeMeasure.measureActive = CommonsPlugin.isDebugMode();
|
||||
|
||||
TimeMeasure.begin("initialize Jet Emitters");
|
||||
ComponentsFactoryProvider.saveComponentVisibilityStatus();
|
||||
|
||||
jetFilesCompileFail.clear();
|
||||
|
||||
IProgressMonitor monitorWrap = null;
|
||||
boolean headless = CommonUIPlugin.isFullyHeadless();
|
||||
if (!headless) {
|
||||
if (!CommonsPlugin.isHeadless()) {
|
||||
monitorWrap = new CodeGeneratorProgressMonitor(delegateMonitor);
|
||||
} else {
|
||||
monitorWrap = new NullProgressMonitor();
|
||||
}
|
||||
}
|
||||
ECodeLanguage codeLanguage = LanguageManager.getCurrentLanguage();
|
||||
|
||||
initializeJetEmittersProject(monitorWrap);
|
||||
|
||||
CodeGeneratorInternalTemplatesFactory templatesFactory = CodeGeneratorInternalTemplatesFactoryProvider
|
||||
.getInstance();
|
||||
@@ -154,6 +143,8 @@ public final class CodeGeneratorEmittersPoolFactory {
|
||||
templatesFactory.init();
|
||||
|
||||
IComponentsFactory componentsFactory = ComponentsFactoryProvider.getInstance();
|
||||
// do not call init because it may be already loaded by
|
||||
// ComponentsFactoryProvider.saveComponentVisibilityStatus
|
||||
componentsFactory.getComponents();
|
||||
|
||||
long startTime = System.currentTimeMillis();
|
||||
@@ -183,9 +174,11 @@ public final class CodeGeneratorEmittersPoolFactory {
|
||||
if (components != null) {
|
||||
ECodePart codePart = ECodePart.MAIN;
|
||||
for (IComponent component : new ArrayList<IComponent>(components)) {
|
||||
// if (component.isTechnical() || component.isVisible()) {
|
||||
if (component.getAvailableCodeParts().size() > 0) {
|
||||
initComponent(codeLanguage, jetBeans, codePart, component);
|
||||
}
|
||||
// }
|
||||
monitorBuffer++;
|
||||
if (monitorBuffer % 100 == 0) {
|
||||
monitorWrap.worked(100);
|
||||
@@ -201,7 +194,6 @@ public final class CodeGeneratorEmittersPoolFactory {
|
||||
if (!CommonsPlugin.isHeadless()) {
|
||||
Display.getDefault().asyncExec(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
CorePlugin.getDefault().getDesignerCoreService()
|
||||
.synchronizeDesignerUI(new PropertyChangeEvent(this, ComponentUtilities.NORMAL, null, null));
|
||||
@@ -253,42 +245,6 @@ public final class CodeGeneratorEmittersPoolFactory {
|
||||
CorePlugin.getDefault().getRcpService().activeSwitchProjectAction();
|
||||
return Status.OK_STATUS;
|
||||
}
|
||||
|
||||
private void initializeJetEmittersProject(final IProgressMonitor progressMonitor) throws CoreException {
|
||||
final IWorkspace workspace = ResourcesPlugin.getWorkspace();
|
||||
|
||||
IProject project = workspace.getRoot().getProject(JET_PROJECT);
|
||||
progressMonitor.subTask(CodeGenPlugin.getPlugin().getString("_UI_JETPreparingProject_message", //$NON-NLS-1$
|
||||
new Object[] { project.getName() }));
|
||||
File file = new File(workspace.getRoot().getLocation().append(JET_PROJECT).toPortableString());
|
||||
if (file.exists() && !project.isAccessible()) {
|
||||
// .metadata missing, so need to reimport project to add it in the metadata.
|
||||
progressMonitor.subTask("Reinitilializing project " + project.getName()); //$NON-NLS-1$
|
||||
project.create(new SubProgressMonitor(progressMonitor, 1));
|
||||
progressMonitor.subTask(CodeGenPlugin.getPlugin().getString("_UI_JETCreatingProject_message", //$NON-NLS-1$
|
||||
new Object[] { project.getName() }));
|
||||
} else if (!project.isAccessible()) {
|
||||
// project was deleted manually on the disk. The delete here will remove infos from metadata
|
||||
// then we'll be able to create a new clean project.
|
||||
project.delete(true, progressMonitor);
|
||||
}
|
||||
if (!project.exists()) {
|
||||
progressMonitor.subTask("JET creating project " + project.getName()); //$NON-NLS-1$
|
||||
project.create(new SubProgressMonitor(progressMonitor, 1));
|
||||
progressMonitor.subTask(CodeGenPlugin.getPlugin().getString("_UI_JETCreatingProject_message", //$NON-NLS-1$
|
||||
new Object[] { project.getName() }));
|
||||
}
|
||||
if (!project.isOpen()) {
|
||||
project.open(new SubProgressMonitor(progressMonitor, 5));
|
||||
project.refreshLocal(IResource.DEPTH_INFINITE, new SubProgressMonitor(progressMonitor, 1));
|
||||
}
|
||||
IProjectDescription description = project.getDescription();
|
||||
// only in case it's one old workspace and got no nature defined.
|
||||
if (!ArrayUtils.contains(description.getNatureIds(), JavaCore.NATURE_ID)) {
|
||||
description.setNatureIds(new String[] { JavaCore.NATURE_ID });
|
||||
project.setDescription(description, new SubProgressMonitor(progressMonitor, 1));
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
@@ -506,7 +462,6 @@ public final class CodeGeneratorEmittersPoolFactory {
|
||||
if (!CommonsPlugin.isHeadless()) {
|
||||
Display.getDefault().syncExec(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
MessageDialog.openError(Display.getDefault().getActiveShell(),
|
||||
Messages.getString("CodeGeneratorEmittersPoolFactory.operationCanceled"), //$NON-NLS-1$
|
||||
@@ -751,28 +706,24 @@ public final class CodeGeneratorEmittersPoolFactory {
|
||||
delegates.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beginTask(String name, int totalWork) {
|
||||
for (IProgressMonitor delegate : delegates) {
|
||||
delegate.beginTask(name, totalWork);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void done() {
|
||||
for (IProgressMonitor delegate : delegates) {
|
||||
delegate.done();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void internalWorked(double work) {
|
||||
for (IProgressMonitor delegate : delegates) {
|
||||
delegate.internalWorked(work);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCanceled() {
|
||||
for (IProgressMonitor monitor : delegates) {
|
||||
if (monitor.isCanceled()) {
|
||||
@@ -782,26 +733,22 @@ public final class CodeGeneratorEmittersPoolFactory {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCanceled(boolean cancelled) {
|
||||
this.cancelled = cancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTaskName(String name) {
|
||||
for (IProgressMonitor delegate : delegates) {
|
||||
delegate.setTaskName(name);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void subTask(String name) {
|
||||
for (IProgressMonitor delegate : delegates) {
|
||||
delegate.subTask(name);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void worked(int work) {
|
||||
for (IProgressMonitor delegate : delegates) {
|
||||
delegate.worked(work);
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
Exchange=Training
|
||||
DownloadComponenentsAction.Label=\u4E0B\u8F7D\u9009\u62E9\u7684\u7EC4\u4EF6
|
||||
RefreshComponenentsAction.Label=\u5237\u65B0\u7EC4\u4EF6\u6E05\u5355
|
||||
@@ -1,6 +1,5 @@
|
||||
AvailableExtensionsComposite.ViewDetail.installOperateStatus=Instalar
|
||||
AvailableExtensionsComposite.ViewDetail.WriteReview=Escribir un comentario
|
||||
DownloadedExtensionsComposite.installOperateStatus=Instalar
|
||||
MyExtensionsComposite.ModifyOperateStatus=Modificar
|
||||
MyExtensionsComposite.DeleteOperateStatus=Borrar
|
||||
MyExtensionsComposite.Form.Description=Descripción
|
||||
|
||||
@@ -1,21 +1,17 @@
|
||||
ExchangeView.Exchange=Exchange
|
||||
AvailableExtensionsComposite.ExtensionName=Nom de l'extension
|
||||
AvailableExtensionsComposite.Version=Version
|
||||
AvailableExtensionsComposite.Rating=Note
|
||||
AvailableExtensionsComposite.Author=Auteur
|
||||
AvailableExtensionsComposite.FilterTitle=Filtre
|
||||
AvailableExtensionsComposite.ViewDetail.installOperateStatus=Installer
|
||||
AvailableExtensionsComposite.ViewDetail.WriteReview=Donnez votre avis
|
||||
AvailableExtensionsComposite.ViewDetail.InsertionReviewFailureTip=Veuillez vérifier.
|
||||
DownloadedExtensionsComposite.DownloadedVersion=Version téléchargée
|
||||
DownloadedExtensionsComposite.DownloadDate=Date de téléchargement
|
||||
DownloadedExtensionsComposite.installedOperateStatus=Installé
|
||||
DownloadedExtensionsComposite.updateOperateStatus=UPDATE
|
||||
MyExtensionsComposite.Version=Version
|
||||
DownloadedExtensionsComposite.updateOperateStatus=Mettre à jour
|
||||
MyExtensionsComposite.UploadDate=Date du chargement
|
||||
MyExtensionsComposite.AddNewExtensionTitle=Ajouter une nouvelle extension
|
||||
MyExtensionsComposite.UpLoadNewVersionOperateStatus=Charger une nouvelle version
|
||||
MyExtensionsComposite.UpdateOperateStatus=UPDATE
|
||||
MyExtensionsComposite.ModifyOperateStatus=Modifier
|
||||
MyExtensionsComposite.DeleteOperateStatus=DELETE
|
||||
MyExtensionsComposite.Form.Return=Retourner
|
||||
@@ -23,7 +19,6 @@ MyExtensionsComposite.Form.ExtensionTitle=Titre de l'extension
|
||||
MyExtensionsComposite.Form.InitialVersion=Version initiale
|
||||
MyExtensionsComposite.Form.Compatibility=Compatibilité
|
||||
MyExtensionsComposite.Form.Compatibility.AllVersions=Toutes les versions
|
||||
MyExtensionsComposite.Form.Compatibility.Version=Version
|
||||
MyExtensionsComposite.Form.Compatibility.AllVersionsExcept=Toutes les versions sauf :
|
||||
MyExtensionsComposite.Form.Compatibility.OnlyTheseVersions=Uniquement ces versions :
|
||||
MyExtensionsComposite.Form.Description=Description
|
||||
|
||||
@@ -4,6 +4,5 @@ MyExtensionsComposite.Version=Verzija
|
||||
MyExtensionsComposite.UpdateOperateStatus=A\u017Euriraj
|
||||
MyExtensionsComposite.DeleteOperateStatus=Obri\u0161i
|
||||
MyExtensionsComposite.Form.Compatibility.Version=Verzija
|
||||
MyExtensionsComposite.Form.Description=Opis
|
||||
ImportExchangeDialog.WARNING=Upozorenje
|
||||
ImportExchangeDialog.REFRESH_BUTTON=Osvje\u017Ei
|
||||
|
||||
@@ -2,19 +2,13 @@ AvailableExtensionsComposite.Version=Versione
|
||||
AvailableExtensionsComposite.Author=Autore
|
||||
AvailableExtensionsComposite.FilterTitle=Filtro
|
||||
DownloadedExtensionsComposite.installedOperateStatus=Installato
|
||||
DownloadedExtensionsComposite.updateOperateStatus=Aggiornato
|
||||
MyExtensionsComposite.Version=Versione
|
||||
MyExtensionsComposite.UpdateOperateStatus=Aggiornato
|
||||
MyExtensionsComposite.DeleteOperateStatus=Cancellare
|
||||
MyExtensionsComposite.Form.Compatibility.Version=Versione
|
||||
MyExtensionsComposite.Form.Description=Descrizione
|
||||
MyExtensionsComposite.Form.Upload=Carica
|
||||
MyExtensionsComposite.Form.Upload.Browse=Naviga...
|
||||
ImportExchangeDialog.dialogTitle=Seleziona oggetto da Talend Exchange
|
||||
ImportExchangeDialog.WARNING=Avvertimento
|
||||
ImportExchangeDialog.LATEST_REVISION=Ultima Revisione
|
||||
ImportExchangeDialog.EXTENSION_DESCRIPTION=Descrizione estensione
|
||||
ImportExchangeDialog.JOB_BUTTON=Progetti job
|
||||
ImportExchangeDialog.DOWNLOAD_JOB=Scarica alcuni Job Designs...
|
||||
ImportExchangeDialog.ROUTINES_BUTTON=Routine
|
||||
ImportExchangeDialog.REFRESH_BUTTON=Aggiorna
|
||||
|
||||
@@ -1,13 +1,4 @@
|
||||
AvailableExtensionsComposite.Version=Versie
|
||||
DownloadedExtensionsComposite.updateOperateStatus=Update
|
||||
MyExtensionsComposite.Version=Versie
|
||||
MyExtensionsComposite.UpdateOperateStatus=Update
|
||||
MyExtensionsComposite.ModifyOperateStatus=Wijzigen
|
||||
MyExtensionsComposite.DeleteOperateStatus=Verwijderen
|
||||
MyExtensionsComposite.Form.Compatibility.Version=Versie
|
||||
MyExtensionsComposite.Form.Upload.Browse=Blader...
|
||||
RefreshJob.FindExtensions.Title=Beschikbare extensies zoeken
|
||||
RefreshJob.FindExtensions.Message=Extensies zoeken op Exchange...
|
||||
UploadRevisionJob.Title=Upload Revisie...
|
||||
UploadRevisionJob.Message=Upload Revisie...
|
||||
UploadRevisionAction.InstalledFailure=Upload Revisie gefaald.
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
DownloadedExtensionsComposite.updateOperateStatus=UPDATE
|
||||
MyExtensionsComposite.UpdateOperateStatus=UPDATE
|
||||
MyExtensionsComposite.DeleteOperateStatus=DELETE
|
||||
ImportExchangeDialog.TEMPLATES_BUTTON=SQL \u0161abloni
|
||||
ImportExchangeDialog.REFRESH_BUTTON=Osve\u017Eavanje
|
||||
|
||||
@@ -2,4 +2,3 @@ AvailableExtensionsComposite.Version=Versiyon
|
||||
MyExtensionsComposite.Version=Versiyon
|
||||
MyExtensionsComposite.DeleteOperateStatus=Sil
|
||||
MyExtensionsComposite.Form.Compatibility.Version=Versiyon
|
||||
MyExtensionsComposite.Form.Description=Aç\u0131klama
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
ExchangeView.Exchange=Training
|
||||
AvailableExtensionsComposite.ExtensionName=\u6269\u5C55\u540D
|
||||
AvailableExtensionsComposite.Version=\u7248\u672C
|
||||
AvailableExtensionsComposite.Author=\u4F5C\u8005
|
||||
AvailableExtensionsComposite.FilterTitle=\u8FC7\u6EE4
|
||||
DownloadedExtensionsComposite.ExtensionName=\u6269\u5C55\u540D
|
||||
DownloadedExtensionsComposite.installedOperateStatus=\u5DF2\u88C5\u8F7D
|
||||
DownloadedExtensionsComposite.updateOperateStatus=\u66F4\u65B0
|
||||
MyExtensionsComposite.ExtensionName=\u6269\u5C55\u540D
|
||||
MyExtensionsComposite.Version=\u7248\u672C
|
||||
MyExtensionsComposite.UpdateOperateStatus=\u66F4\u65B0
|
||||
MyExtensionsComposite.DeleteOperateStatus=\u5220\u9664
|
||||
MyExtensionsComposite.Form.Compatibility.Version=\u7248\u672C
|
||||
MyExtensionsComposite.Form.Description=\u5FC5\u8981\u7684
|
||||
MyExtensionsComposite.Form.Upload=\u4E0A\u4F20
|
||||
MyExtensionsComposite.Form.Upload.Browse=\u6D4F\u89C8...
|
||||
DownloadComponenentsAction.DownloadTaskName=\u4ECEURL\u4E0B\u8F7D\u6587\u4EF6
|
||||
ImportExchangeDialog.dialogTitle=\u4ECETalend Exchange\u9009\u62E9\u4E00\u4E2A\u9879\u76EE
|
||||
ImportExchangeDialog.WARNING=\u8B66\u544A
|
||||
ImportExchangeDialog.EXTENSION_NAME=\u6269\u5C55\u540D
|
||||
ImportExchangeDialog.LATEST_REVISION=\u6700\u65B0\u7248\u672C
|
||||
ImportExchangeDialog.JOB_BUTTON=\u4F5C\u4E1A\u8BBE\u8BA1
|
||||
ImportExchangeDialog.DOWNLOAD_JOB=\u4E0B\u8F7D\u4F5C\u4E1A\u8BBE\u8BA1
|
||||
ImportExchangeDialog.ROUTINES_BUTTON=\u5E38\u89C4
|
||||
ImportExchangeDialog.TEMPLATES_PROGRESSBAR=\u4E0B\u8F7DSQL\u6A21\u677F......
|
||||
ImportExchangeDialog.REFRESH_BUTTON=\u5237\u65B0
|
||||
ImportExchangeDialog.OPERATION_CANCELLED=\u64CD\u4F5C\u5DF2\u53D6\u6D88
|
||||
@@ -80,24 +80,6 @@
|
||||
checkedType = "only"
|
||||
filtervalue = document.getElementById(checkedType).value;
|
||||
}
|
||||
|
||||
<!-- validate the createNewExtension text start-->
|
||||
var labelValidate = document.getElementById("extension_label").value;
|
||||
var lastVersionAvailableValidate = document.getElementById("lastVersionAvailable").value;
|
||||
var filename = document.getElementById("filename").value;
|
||||
if(labelValidate==0){
|
||||
alert("Extension Title is empty");
|
||||
}else if(labelValidate=="null"){
|
||||
alert("Extension Title can not be null");
|
||||
}else if(lastVersionAvailableValidate==0){
|
||||
alert("Initial Version is empty");
|
||||
}else if(lastVersionAvailableValidate=="null"){
|
||||
alert("Initial Version can not be null");
|
||||
}else if(filename==0){
|
||||
alert("Please input a vaild File path");
|
||||
}
|
||||
|
||||
<!-- validate the createNewExtension text end-->
|
||||
|
||||
var listVersionCompatibles = "listVersionCompatibles:" + "'" + checkedType + "'";
|
||||
var filter = "filter:" + "'" + filtervalue + "'";
|
||||
@@ -134,15 +116,6 @@
|
||||
checkedType = "only"
|
||||
filtervalue = document.getElementById(checkedType + "_update").value;
|
||||
}
|
||||
|
||||
<!-- validate the updateExtension text start-->
|
||||
var lastVersionAvailable_updateValidate = document.getElementById("lastVersionAvailable_update").value;
|
||||
if(lastVersionAvailable_updateValidate==0){
|
||||
alert("New Version is empty");
|
||||
}else if(lastVersionAvailable_updateValidate=="null"){
|
||||
alert("New Version can not be null");
|
||||
}
|
||||
<!-- validate the updateExtension text end-->
|
||||
|
||||
var listVersionCompatibles = "listVersionCompatibles:" + "'" + checkedType + "'";
|
||||
var filter = "filter:" + "'" + filtervalue + "'";
|
||||
|
||||
@@ -162,14 +162,6 @@ public class AvailableCompositeProvider implements IIntroXHTMLContentProvider {
|
||||
if (fAvailableExtensions != null) {
|
||||
for (int i = 0; i < fAvailableExtensions.size(); i++) {
|
||||
ComponentExtension extension = fAvailableExtensions.get(i);
|
||||
// hide null entries directly
|
||||
if (extension.getLabel().equals("null")) {
|
||||
continue;
|
||||
}
|
||||
// set 0.1 as a default version
|
||||
if (extension.getVersionExtension().equals("") || extension.getVersionExtension().equals("null")) {
|
||||
extension.setVersionExtension("0.1");
|
||||
}
|
||||
Element trExtension = dom.createElement("tr");
|
||||
|
||||
Element tdExtension = dom.createElement("td");
|
||||
|
||||
@@ -165,14 +165,7 @@ public class DownloadExtensionProvider implements IIntroXHTMLContentProvider {
|
||||
while (ite.hasNext()) {
|
||||
count++;
|
||||
ComponentExtension object = (ComponentExtension) ite.next();
|
||||
// hide null entries directly
|
||||
if (object.getLabel().equals("null")) {
|
||||
continue;
|
||||
}
|
||||
// set 0.1 as a default version
|
||||
if (object.getDownloadedVersion().equals("") || object.getDownloadedVersion().equals("null")) {
|
||||
object.setDownloadedVersion("0.1");
|
||||
}
|
||||
|
||||
Element trExtension = dom.createElement("tr");
|
||||
|
||||
Element tdExtension = dom.createElement("td");
|
||||
@@ -196,7 +189,6 @@ public class DownloadExtensionProvider implements IIntroXHTMLContentProvider {
|
||||
style = style + ";background:#F7F7F7";
|
||||
}
|
||||
tdExtension.setAttribute("style", style);
|
||||
// set 0.1 as a default version
|
||||
tdExtension.appendChild(dom.createTextNode(object.getDownloadedVersion()));
|
||||
trExtension.appendChild(tdExtension);
|
||||
|
||||
@@ -242,7 +234,7 @@ public class DownloadExtensionProvider implements IIntroXHTMLContentProvider {
|
||||
String url = "http://org.eclipse.ui.intro/runAction?pluginId=org.talend.designer.components.exchange&"
|
||||
+ "class=org.talend.designer.components.exchange.ui.actions.UpdateAction&"
|
||||
+ "id=org.talend.designer.components.exchange.ui.actions.UpdateAction&"
|
||||
+ AvailableCompositeProvider.NUMBER + "=" + count;
|
||||
+ AvailableCompositeProvider.NUMBER + count;
|
||||
;
|
||||
hyperlink.setAttribute("href", url);
|
||||
Text view = dom.createTextNode(Messages
|
||||
|
||||
@@ -527,7 +527,7 @@ public class ExchangeWebService {
|
||||
tokenMessage.put("versionCompatibles", listVersionCompatibles);
|
||||
tokenMessage.put("filename", new Path(filename).lastSegment());
|
||||
tokenMessage.put("content", asHex(fileBytes));
|
||||
tokenMessage.put("description", description.replace(" ", "%20"));
|
||||
tokenMessage.put("description", description);
|
||||
tokenMessage.put("agreement", agreement);
|
||||
JSONObject token = new us.monoid.json.JSONObject();
|
||||
token.put("newRevision", tokenMessage);
|
||||
@@ -576,7 +576,7 @@ public class ExchangeWebService {
|
||||
tokenMessage.put("typeExtension", typeExtension);
|
||||
tokenMessage.put("version", version);
|
||||
tokenMessage.put("listVersionCompatibles", listVersionCompatibles);
|
||||
tokenMessage.put("description", description.replace(" ", "%20"));
|
||||
tokenMessage.put("description", description);
|
||||
tokenMessage.put("agreement", agreement);
|
||||
JSONObject token = new us.monoid.json.JSONObject();
|
||||
token.put("revision", tokenMessage);
|
||||
|
||||
@@ -20,7 +20,7 @@ import org.xml.sax.helpers.DefaultHandler;
|
||||
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2013 Talend Inc. - www.talend.com
|
||||
// Copyright (C) 2006-2012 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2013 Talend Inc. - www.talend.com
|
||||
// Copyright (C) 2006-2012 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2013 Talend Inc. - www.talend.com
|
||||
// Copyright (C) 2006-2012 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2013 Talend Inc. - www.talend.com
|
||||
// Copyright (C) 2006-2012 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2013 Talend Inc. - www.talend.com
|
||||
// Copyright (C) 2006-2012 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2013 Talend Inc. - www.talend.com
|
||||
// Copyright (C) 2006-2012 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
@@ -71,15 +71,15 @@ public class SAXLooper {
|
||||
}
|
||||
|
||||
private void judgeIsSimple() {
|
||||
isSimpleParse = isSimplePath(loopPath);
|
||||
|
||||
for(String path : nodePaths) {
|
||||
if(!isSimpleParse) {
|
||||
if (this.loopPath.indexOf("..") >= 0 || this.loopPath.indexOf("*") >= 0) {
|
||||
this.isSimpleParse = false;
|
||||
}
|
||||
for (int i = 0; i < nodePaths.length; i++) {
|
||||
if (nodePaths[i].indexOf("..") >= 0 || nodePaths[i].indexOf("*") >= 0) {
|
||||
this.isSimpleParse = false;
|
||||
break;
|
||||
}
|
||||
isSimpleParse = isSimplePath(path);
|
||||
}
|
||||
|
||||
if (this.isSimpleParse) {
|
||||
looper = new SimpleSAXLooper(loopPath, nodePaths, asXMLs);
|
||||
} else {
|
||||
@@ -88,61 +88,30 @@ public class SAXLooper {
|
||||
}
|
||||
|
||||
private void judegeMultiIsSimple() {
|
||||
isSimpleParse = isSimplePath(rootPath);
|
||||
|
||||
for(String path : arrOrigLoopPath) {
|
||||
if(!isSimpleParse) {
|
||||
if (this.rootPath.indexOf("..") >= 0 || this.rootPath.indexOf("*") >= 0) {
|
||||
this.isSimpleParse = false;
|
||||
}
|
||||
for (int i = 0; isSimpleParse && i < arrOrigLoopPath.length; i++) {
|
||||
if (arrOrigLoopPath[i].indexOf("..") >= 0 || arrOrigLoopPath[i].indexOf("*") >= 0) {
|
||||
this.isSimpleParse = false;
|
||||
break;
|
||||
}
|
||||
isSimpleParse = isSimplePath(path);
|
||||
}
|
||||
|
||||
for(String[] arrNodePath : arrNodePaths) {
|
||||
for(String path : arrNodePath) {
|
||||
if(!isSimpleParse) {
|
||||
for (int i = 0; isSimpleParse && i < arrNodePaths.length; i++) {
|
||||
for (int j = 0; j < arrNodePaths[i].length; j++) {
|
||||
if (arrNodePaths[i][j].indexOf("..") >= 0 || arrNodePaths[i][j].indexOf("*") >= 0) {
|
||||
this.isSimpleParse = false;
|
||||
break;
|
||||
}
|
||||
isSimpleParse = isSimplePath(path);
|
||||
}
|
||||
if(!isSimpleParse) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
this.isSimpleParse = false;
|
||||
if (this.isSimpleParse) {
|
||||
looper = new SimpleSAXLooper(rootPath, arrOrigLoopPath, arrNodePaths);
|
||||
} else {
|
||||
looper = new ComplexSAXLooper(rootPath, arrOrigLoopPath, arrNodePaths);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* ../../../@attr also can read like a stream(now only consider the case)
|
||||
* @param path
|
||||
* @return
|
||||
*/
|
||||
private boolean isSimplePath(String path) {
|
||||
if(path == null || !path.contains("..") && !path.contains("*")) {
|
||||
return true;
|
||||
}
|
||||
|
||||
boolean isSimplePath = true;
|
||||
|
||||
String[] nodes = path.split("/");
|
||||
|
||||
for(int i = 0;i<nodes.length;i++) {
|
||||
String node = nodes[i];
|
||||
|
||||
if(i < (nodes.length - 1)) {
|
||||
isSimplePath = isSimplePath && "..".equals(node);
|
||||
} else {
|
||||
isSimplePath = isSimplePath && node.startsWith("@");
|
||||
}
|
||||
}
|
||||
|
||||
return isSimplePath;
|
||||
|
||||
}
|
||||
|
||||
private String charset = "UTF-8";
|
||||
|
||||
@@ -187,17 +156,6 @@ public class SAXLooper {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* stop the read action asap
|
||||
*
|
||||
*/
|
||||
public void stopRead() {
|
||||
if(this.isSimpleParse) {
|
||||
SimpleSAXLooper ssl = (SimpleSAXLooper)this.looper;
|
||||
ssl.stopRead();
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String args[]) {
|
||||
|
||||
try {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2013 Talend Inc. - www.talend.com
|
||||
// Copyright (C) 2006-2012 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2013 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.xml.sax.exception;
|
||||
|
||||
public class EnoughDataException extends RuntimeException {
|
||||
|
||||
private static final long serialVersionUID = 3652240965496042451L;
|
||||
|
||||
public EnoughDataException() {
|
||||
super();
|
||||
}
|
||||
|
||||
public EnoughDataException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
|
||||
public EnoughDataException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
public EnoughDataException(Throwable cause) {
|
||||
super(cause);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2013 Talend Inc. - www.talend.com
|
||||
// Copyright (C) 2006-2012 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
|
||||
@@ -1,179 +0,0 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2013 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.xml.sax.simpleparser;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* DOC Administrator class global comment. Detailled comment
|
||||
*/
|
||||
public class DataBufferCache2 {
|
||||
|
||||
// private static DataBufferCache instance = new DataBufferCache();
|
||||
|
||||
private long bufferSize = 5000;
|
||||
|
||||
private boolean isEnd = false;
|
||||
|
||||
private int bufferNum = 10;
|
||||
|
||||
private LinkedList<Buffer> buffers = new LinkedList<Buffer>();
|
||||
|
||||
private Buffer currentReadBuff = null;
|
||||
|
||||
private Buffer currentWriteBuff = null;
|
||||
|
||||
private DataBufferCache2() {
|
||||
}
|
||||
|
||||
public static DataBufferCache2 getInstance() {
|
||||
return new DataBufferCache2();
|
||||
}
|
||||
|
||||
public void setIsEnd() {
|
||||
synchronized (buffers) {
|
||||
try {
|
||||
if (!isEnd && currentWriteBuff != null) {
|
||||
buffers.add(currentWriteBuff);
|
||||
}
|
||||
this.isEnd = true;
|
||||
} finally {
|
||||
this.buffers.notifyAll();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setBufferNum(int num) {
|
||||
if (num <= 0)
|
||||
return;
|
||||
this.bufferNum = num;
|
||||
}
|
||||
|
||||
public void setBufferSize(long size) {
|
||||
if (size <= 0)
|
||||
return;
|
||||
this.bufferSize = size;
|
||||
}
|
||||
|
||||
public boolean hasData() {
|
||||
getCurrReadBuffer();
|
||||
if (currentReadBuff == null) {
|
||||
return false;
|
||||
}
|
||||
return this.currentReadBuff.hasNext();
|
||||
}
|
||||
|
||||
public Map<String,Map<String,String>> readData() {
|
||||
return this.currentReadBuff.Next();
|
||||
}
|
||||
|
||||
private void getCurrReadBuffer() {
|
||||
if (currentReadBuff != null && currentReadBuff.hasNext())
|
||||
return;
|
||||
synchronized (this.buffers) {
|
||||
try {
|
||||
while (!this.isEnd && buffers.size() < 1) {
|
||||
try {
|
||||
buffers.wait();
|
||||
} catch (InterruptedException ex) {
|
||||
System.err.println(ex.getMessage());
|
||||
}
|
||||
}
|
||||
if (buffers.size() > 0) {
|
||||
currentReadBuff = buffers.remove();
|
||||
}
|
||||
} finally {
|
||||
this.buffers.notifyAll();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void writeData(Map<String,Map<String,String>> map) {
|
||||
if (currentWriteBuff == null) {
|
||||
currentWriteBuff = new Buffer();
|
||||
}
|
||||
if (currentWriteBuff.size() < this.bufferSize) {
|
||||
currentWriteBuff.add(map);
|
||||
} else {
|
||||
currentWriteBuff.add(map);
|
||||
synchronized (buffers) {
|
||||
try {
|
||||
while (buffers.size() > bufferNum) {
|
||||
try {
|
||||
buffers.wait();
|
||||
} catch (InterruptedException ex) {
|
||||
System.err.println(ex.getMessage());
|
||||
}
|
||||
}
|
||||
if (currentWriteBuff.size() > 0) {
|
||||
this.buffers.add(currentWriteBuff);
|
||||
}
|
||||
currentWriteBuff = null;
|
||||
} finally {
|
||||
this.buffers.notifyAll();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void notifyErrorOccurred() {
|
||||
setIsEnd();
|
||||
}
|
||||
|
||||
class Buffer {
|
||||
|
||||
private LinkedList<Map<String,Map<String,String>>> buffer = null;
|
||||
|
||||
private boolean isForRead = false; // false for write, true for read
|
||||
|
||||
public Buffer() {
|
||||
buffer = createNewBuffer();
|
||||
}
|
||||
|
||||
public void setIsForRead(boolean isForRead) {
|
||||
this.isForRead = isForRead;
|
||||
}
|
||||
|
||||
public boolean isForRead() {
|
||||
return this.isForRead;
|
||||
}
|
||||
|
||||
public boolean hasNext() {
|
||||
return buffer.size() > 0;
|
||||
}
|
||||
|
||||
public Map<String,Map<String,String>> Next() {
|
||||
return buffer.remove();
|
||||
}
|
||||
|
||||
public void add(Map<String,Map<String,String>> o) {
|
||||
this.buffer.add(o);
|
||||
}
|
||||
|
||||
public int size() {
|
||||
return this.buffer.size();
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
this.buffer.clear();
|
||||
buffer = null;
|
||||
}
|
||||
|
||||
private LinkedList<Map<String,Map<String,String>>> createNewBuffer() {
|
||||
return new LinkedList<Map<String,Map<String,String>>>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,144 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2012 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.xml.sax.simpleparser;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* DOC Administrator class global comment. Detailled comment
|
||||
*/
|
||||
public class DataCache {
|
||||
|
||||
private LinkedList<Map<String, String>> cache = new LinkedList<Map<String, String>>();
|
||||
|
||||
private boolean isReadEnd = false;
|
||||
|
||||
private static DataCache instance = new DataCache();
|
||||
|
||||
private long bufferSize = 10000;
|
||||
|
||||
int startIndex = 0;
|
||||
|
||||
private DataCache() {
|
||||
}
|
||||
|
||||
public static DataCache getInstance() {
|
||||
if (instance == null)
|
||||
instance = new DataCache();
|
||||
return instance;
|
||||
}
|
||||
|
||||
public void setBufferSize(long size) {
|
||||
this.bufferSize = size;
|
||||
}
|
||||
|
||||
public boolean isReadEnd() {
|
||||
return isReadEnd;
|
||||
}
|
||||
|
||||
public boolean hasData() {
|
||||
|
||||
return !(this.isReadEnd && this.cache.size() <= 0);
|
||||
}
|
||||
|
||||
public void setReadEnd(boolean isEnd) {
|
||||
synchronized (this.cache) {
|
||||
this.isReadEnd = isEnd;
|
||||
this.cache.notifyAll();
|
||||
}
|
||||
}
|
||||
|
||||
public Map<String, String> readData() {
|
||||
Map<String, String> result = null;
|
||||
synchronized (this.cache) {
|
||||
if (!isReadEnd && this.cache.size() <= 0) {
|
||||
try {
|
||||
this.cache.wait();
|
||||
} catch (InterruptedException ex) {
|
||||
System.err.println(ex.getMessage());
|
||||
}
|
||||
}
|
||||
if (cache.size() > 0)
|
||||
result = this.cache.remove();
|
||||
this.cache.notifyAll();
|
||||
// System.out.println(result.get("@swid") + "#" + result.get("@login_date") + "#");
|
||||
return result;
|
||||
}
|
||||
|
||||
// if (cache.size() > 0) {
|
||||
// result = cache.remove();
|
||||
// if (this.isWriteWait) {
|
||||
// synchronized (this) {
|
||||
// this.notifyAll();
|
||||
// }
|
||||
// }
|
||||
// return result;
|
||||
// }
|
||||
//
|
||||
// while (!isReadEnd && cache.isEmpty()) {
|
||||
// synchronized (this) {
|
||||
// try {
|
||||
// this.isReadWait = true;
|
||||
// this.wait();
|
||||
// result = cache.remove();
|
||||
// this.isReadWait = false;
|
||||
// this.notifyAll();
|
||||
// return result;
|
||||
// } catch (Exception ex) {
|
||||
// System.err.println(ex.getMessage());
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// return result;
|
||||
}
|
||||
|
||||
public void writeData(Map<String, String> map) {
|
||||
synchronized (this.cache) {
|
||||
if (this.cache.size() >= bufferSize) {
|
||||
try {
|
||||
this.cache.wait();
|
||||
} catch (InterruptedException ex) {
|
||||
System.err.println(ex.getMessage());
|
||||
}
|
||||
}
|
||||
this.cache.add(map);
|
||||
this.cache.notifyAll();
|
||||
}
|
||||
// if (this.cache.size() < this.bufferSize) {
|
||||
// cache.add(map);
|
||||
// if (this.isReadWait) {
|
||||
// synchronized (this) {
|
||||
// this.notifyAll();
|
||||
// }
|
||||
// }
|
||||
// return;
|
||||
// }
|
||||
// while (this.cache.size() >= this.bufferSize) {
|
||||
// synchronized (this) {
|
||||
// try {
|
||||
// this.isReadWait = true;
|
||||
// this.wait();
|
||||
// } catch (Exception ex) {
|
||||
// System.err.println(ex.getMessage());
|
||||
// }
|
||||
// cache.add(map);
|
||||
//
|
||||
// isWriteWait = false;
|
||||
//
|
||||
// this.notifyAll();
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2013 Talend Inc. - www.talend.com
|
||||
// Copyright (C) 2006-2012 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2013 Talend Inc. - www.talend.com
|
||||
// Copyright (C) 2006-2012 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
@@ -17,7 +17,6 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.talend.xml.sax.EscapeEntityHelper;
|
||||
import org.talend.xml.sax.exception.EnoughDataException;
|
||||
import org.talend.xml.sax.simpleparser.model.XMLNode;
|
||||
import org.talend.xml.sax.simpleparser.model.XMLNodes;
|
||||
import org.xml.sax.Attributes;
|
||||
@@ -34,10 +33,6 @@ public class SimpleSAXLoopHandler extends DefaultHandler2 {
|
||||
private String currentPath = "";
|
||||
|
||||
private DataBufferCache bufferCache = null;
|
||||
|
||||
private boolean stop = false;
|
||||
|
||||
private DataBufferCache2 multiCache;
|
||||
|
||||
public SimpleSAXLoopHandler(XMLNodes nodes, DataBufferCache bcache) {
|
||||
super();
|
||||
@@ -45,12 +40,6 @@ public class SimpleSAXLoopHandler extends DefaultHandler2 {
|
||||
this.bufferCache = bcache;
|
||||
}
|
||||
|
||||
public SimpleSAXLoopHandler(XMLNodes nodes, DataBufferCache2 multiCache) {
|
||||
super();
|
||||
this.nodes = nodes;
|
||||
this.multiCache = multiCache;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
@@ -66,11 +55,8 @@ public class SimpleSAXLoopHandler extends DefaultHandler2 {
|
||||
* @see org.xml.sax.helpers.DefaultHandler#endDocument()
|
||||
*/
|
||||
public void endDocument() throws SAXException {
|
||||
if(multiCache!=null) {
|
||||
multiCache.setIsEnd();
|
||||
} else {
|
||||
bufferCache.setIsEnd();
|
||||
}
|
||||
// DataCache.getInstance().setReadEnd(true);
|
||||
bufferCache.setIsEnd();
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -124,18 +110,6 @@ public class SimpleSAXLoopHandler extends DefaultHandler2 {
|
||||
}
|
||||
|
||||
}
|
||||
} else {//process the attribute out of the loop
|
||||
int index = node.nodePath.lastIndexOf("@");
|
||||
if (index > 0) {
|
||||
if (currentPath.equals(node.nodePath.substring(0, index - 1))) {
|
||||
String attribute = attributes.getValue(node.nodePath.substring(index + 1));
|
||||
if (attribute != null) {
|
||||
node.addTextValue(attribute);
|
||||
} else {
|
||||
node.addTextValue("");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -196,18 +170,14 @@ public class SimpleSAXLoopHandler extends DefaultHandler2 {
|
||||
Map<String, String> map = new HashMap<String, String>();
|
||||
for (XMLNode node : nodes.getNodesCollection()) {
|
||||
map.put(node.originPath, node.getTextValue());
|
||||
// ---------------------------------------------
|
||||
|
||||
// System.out.print("" + node.getTextValue() + "#");
|
||||
// ---------------------------------------------
|
||||
}
|
||||
if(multiCache!=null) {
|
||||
HashMap<String, Map<String, String>> row = new HashMap<String, Map<String, String>>(1);
|
||||
row.put(nodes.getOriginalLoopPath(), map);
|
||||
multiCache.writeData(row);
|
||||
} else {
|
||||
bufferCache.writeData(map);
|
||||
}
|
||||
|
||||
if (stop) {
|
||||
throw new EnoughDataException("Get enough data,now stop the xml parse action");
|
||||
}
|
||||
bufferCache.writeData(map);
|
||||
// System.out.println();
|
||||
|
||||
}
|
||||
nodes.resetAll();
|
||||
}
|
||||
@@ -252,12 +222,5 @@ public class SimpleSAXLoopHandler extends DefaultHandler2 {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* stop the read action asap
|
||||
*/
|
||||
public void stopRead() {
|
||||
stop = true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2013 Talend Inc. - www.talend.com
|
||||
// Copyright (C) 2006-2012 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
@@ -13,9 +13,7 @@
|
||||
package org.talend.xml.sax.simpleparser;
|
||||
|
||||
import java.io.Reader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.FutureTask;
|
||||
@@ -23,7 +21,6 @@ import java.util.concurrent.FutureTask;
|
||||
import javax.xml.parsers.SAXParser;
|
||||
import javax.xml.parsers.SAXParserFactory;
|
||||
|
||||
import org.talend.xml.sax.SAXLoopCompositeHandler;
|
||||
import org.talend.xml.sax.commons.ISAXLooper;
|
||||
import org.talend.xml.sax.io.UnicodeReader;
|
||||
import org.talend.xml.sax.simpleparser.model.XMLNode;
|
||||
@@ -38,8 +35,6 @@ public class SimpleSAXLooper implements ISAXLooper,Callable {
|
||||
private XMLNodes nodes = new XMLNodes();
|
||||
|
||||
private DataBufferCache bcache;
|
||||
|
||||
private DataBufferCache2 multiCache;
|
||||
|
||||
private Thread task;
|
||||
|
||||
@@ -47,16 +42,6 @@ public class SimpleSAXLooper implements ISAXLooper,Callable {
|
||||
|
||||
private boolean ignoreDTD = false;
|
||||
|
||||
SimpleSAXLoopHandler hd = null;
|
||||
|
||||
private String[] arrOrigLoopPath;
|
||||
|
||||
private String rootPath;
|
||||
|
||||
private String[] arrLoopPath;
|
||||
|
||||
private List<XMLNodes> nodesList = new ArrayList<XMLNodes>();
|
||||
|
||||
public SimpleSAXLooper(String loopPath, String[] nodePaths, boolean[] asXMLs) {
|
||||
futureTask = new FutureTask(this);
|
||||
task = new Thread(futureTask);
|
||||
@@ -67,53 +52,7 @@ public class SimpleSAXLooper implements ISAXLooper,Callable {
|
||||
}
|
||||
|
||||
public SimpleSAXLooper(String rootPath, String[] arrLoopPath, String[][] arrNodePaths) {
|
||||
futureTask = new FutureTask(this);
|
||||
task = new Thread(futureTask);
|
||||
|
||||
this.arrOrigLoopPath = arrLoopPath;
|
||||
|
||||
String tmpRootPath = rootPath;
|
||||
if (tmpRootPath.endsWith("/")) {
|
||||
tmpRootPath = tmpRootPath.substring(0, tmpRootPath.length() - 1);
|
||||
}
|
||||
|
||||
this.rootPath = tmpRootPath;
|
||||
|
||||
this.arrLoopPath = getLoopPaths(arrLoopPath);
|
||||
|
||||
for(int j = 0;j<arrNodePaths.length;j++) {
|
||||
String[] nodePaths = arrNodePaths[j];
|
||||
XMLNodes ns = new XMLNodes();
|
||||
for (int i = 0; i < nodePaths.length; i++) {
|
||||
ns.addNode(new XMLNode(this.arrOrigLoopPath[j], this.arrLoopPath[j],nodePaths[i], null));
|
||||
}
|
||||
nodesList.add(ns);
|
||||
}
|
||||
|
||||
initLoopEntries();
|
||||
}
|
||||
|
||||
private String[] getLoopPaths(String[] arrLoops) {
|
||||
|
||||
String[] loopPaths = new String[arrLoops.length];
|
||||
|
||||
for (int i = 0; i < arrLoops.length; i++) {
|
||||
String column = arrLoops[i];
|
||||
String resultCol = this.rootPath;
|
||||
String[] splits = column.split("/");
|
||||
for (String tmp : splits) {
|
||||
if (tmp.equals("..")) {
|
||||
resultCol = resultCol.substring(0, resultCol.lastIndexOf("/"));
|
||||
} else if (tmp.equals(".")) {
|
||||
} else if (!("").equals(tmp)) {
|
||||
resultCol += "/" + tmp;
|
||||
}
|
||||
}
|
||||
|
||||
loopPaths[i] = resultCol;
|
||||
}
|
||||
|
||||
return loopPaths;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -135,10 +74,7 @@ public class SimpleSAXLooper implements ISAXLooper,Callable {
|
||||
String resultCol = node.loopPath;
|
||||
String[] splits = column.split("/");
|
||||
for (String tmp : splits) {
|
||||
if (tmp.equals("..")) {
|
||||
resultCol = resultCol.substring(0, resultCol.lastIndexOf("/"));
|
||||
node.setAttrOutOfLoop(true);
|
||||
} else if (tmp.equals(".")) {
|
||||
if (tmp.equals(".")) {
|
||||
node.isDot = true;
|
||||
} else {
|
||||
resultCol += "/" + tmp;
|
||||
@@ -149,30 +85,7 @@ public class SimpleSAXLooper implements ISAXLooper,Callable {
|
||||
}
|
||||
|
||||
private void initLoopEntries() {
|
||||
|
||||
multiCache = DataBufferCache2.getInstance();
|
||||
|
||||
for(XMLNodes ns : nodesList) {
|
||||
|
||||
for (XMLNode node : ns.getNodes().values()) {
|
||||
String column = node.originPath;
|
||||
String resultCol = node.loopPath;
|
||||
String[] splits = column.split("/");
|
||||
for (String tmp : splits) {
|
||||
if (tmp.equals("..")) {
|
||||
resultCol = resultCol.substring(0, resultCol.lastIndexOf("/"));
|
||||
node.setAttrOutOfLoop(true);
|
||||
} else if (tmp.equals(".")) {
|
||||
node.isDot = true;
|
||||
} else {
|
||||
resultCol += "/" + tmp;
|
||||
}
|
||||
}
|
||||
|
||||
node.nodePath = resultCol;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -203,19 +116,7 @@ public class SimpleSAXLooper implements ISAXLooper,Callable {
|
||||
public Object call() throws Exception {
|
||||
Reader reader = null;
|
||||
try {
|
||||
DefaultHandler handler = null;
|
||||
if(nodesList.size() > 0) {
|
||||
SAXLoopCompositeHandler chd = new SAXLoopCompositeHandler();
|
||||
for(int i=0;i<nodesList.size();i++) {
|
||||
XMLNodes ns = nodesList.get(i);
|
||||
chd.register(new SimpleSAXLoopHandler(ns, multiCache));
|
||||
}
|
||||
handler = chd;
|
||||
} else {
|
||||
hd = new SimpleSAXLoopHandler(nodes, bcache);
|
||||
handler = hd;
|
||||
}
|
||||
|
||||
DefaultHandler hd = new SimpleSAXLoopHandler(nodes, bcache);
|
||||
SAXParser saxParser = null;
|
||||
if(!ignoreDTD) { //orginal code
|
||||
saxParser = SAXParserFactory.newInstance().newSAXParser();
|
||||
@@ -224,16 +125,16 @@ public class SimpleSAXLooper implements ISAXLooper,Callable {
|
||||
spf.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
|
||||
saxParser = spf.newSAXParser();
|
||||
}
|
||||
saxParser.setProperty("http://xml.org/sax/properties/lexical-handler", handler);
|
||||
saxParser.setProperty("http://xml.org/sax/properties/lexical-handler", hd);
|
||||
if (fileURL != null) {
|
||||
// routines.system.UnicodeReader.java is used to ignore the BOM of the source file.
|
||||
reader = new UnicodeReader(new java.io.FileInputStream(fileURL),this.charset);
|
||||
org.xml.sax.InputSource inSource = new org.xml.sax.InputSource(reader);
|
||||
saxParser.parse(inSource, handler);
|
||||
saxParser.parse(inSource, hd);
|
||||
} else {
|
||||
reader = new UnicodeReader(is,this.charset);
|
||||
org.xml.sax.InputSource inSource = new org.xml.sax.InputSource(reader);
|
||||
saxParser.parse(inSource, handler);
|
||||
saxParser.parse(inSource, hd);
|
||||
}
|
||||
} finally {
|
||||
try {
|
||||
@@ -241,13 +142,7 @@ public class SimpleSAXLooper implements ISAXLooper,Callable {
|
||||
reader.close();
|
||||
}
|
||||
} finally {
|
||||
if(multiCache!=null) {
|
||||
multiCache.notifyErrorOccurred();
|
||||
}
|
||||
if(bcache!=null) {
|
||||
bcache.notifyErrorOccurred();
|
||||
}
|
||||
|
||||
bcache.notifyErrorOccurred();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
@@ -307,7 +202,8 @@ public class SimpleSAXLooper implements ISAXLooper,Callable {
|
||||
* @see org.talend.xml.sax.commons.ISAXLooper#multiIterator()
|
||||
*/
|
||||
public Iterator<Map<String, Map<String, String>>> multiIterator() {
|
||||
return new SimpleSAXMultiLoopIterator(multiCache);
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
public void setIgnoreDTD(boolean ignoreDTD) {
|
||||
@@ -316,10 +212,4 @@ public class SimpleSAXLooper implements ISAXLooper,Callable {
|
||||
|
||||
}
|
||||
|
||||
public void stopRead() {
|
||||
if(hd != null) {
|
||||
hd.stopRead();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
package org.talend.xml.sax.simpleparser;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
public class SimpleSAXMultiLoopIterator implements Iterator<Map<String, Map<String, String>>> {
|
||||
|
||||
private DataBufferCache2 cache;
|
||||
|
||||
public SimpleSAXMultiLoopIterator(DataBufferCache2 bcache) {
|
||||
this.cache = bcache;
|
||||
}
|
||||
|
||||
public boolean hasNext() {
|
||||
return cache.hasData();
|
||||
}
|
||||
|
||||
public Map<String,Map<String, String>> next() {
|
||||
return cache.readData();
|
||||
}
|
||||
|
||||
public void remove() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2013 Talend Inc. - www.talend.com
|
||||
// Copyright (C) 2006-2012 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
@@ -23,8 +23,6 @@ public class XMLNode {
|
||||
|
||||
public boolean outputText = false;
|
||||
|
||||
public String originLoopPath;
|
||||
|
||||
public String loopPath;
|
||||
|
||||
public String nodePath;
|
||||
@@ -34,14 +32,6 @@ public class XMLNode {
|
||||
public boolean isAsXML = false;
|
||||
|
||||
public boolean isDot = false;
|
||||
|
||||
private boolean isAttrOutOfLoop = false;
|
||||
|
||||
private String attrValueOutOfLoop = "";
|
||||
|
||||
public void setAttrOutOfLoop(boolean isAttrOutOfLoop) {
|
||||
this.isAttrOutOfLoop = isAttrOutOfLoop;
|
||||
}
|
||||
|
||||
private StringBuffer value = new StringBuffer();
|
||||
private boolean isNullValue = true;
|
||||
@@ -61,18 +51,8 @@ public class XMLNode {
|
||||
public XMLNode(String loopPath, String originPath, String nodePath) {
|
||||
this(loopPath, originPath, nodePath, false, false);
|
||||
}
|
||||
|
||||
public XMLNode(String originLoopPath,String loopPath, String originPath, String nodePath) {
|
||||
this(loopPath, originPath, nodePath, false, false);
|
||||
this.originLoopPath = originLoopPath;
|
||||
}
|
||||
|
||||
public void addTextValue(String appendValue) {
|
||||
if(isAttrOutOfLoop) {
|
||||
attrValueOutOfLoop = appendValue;
|
||||
return;
|
||||
}
|
||||
|
||||
isNullValue = false;
|
||||
|
||||
if (appendValue != null) {
|
||||
@@ -81,19 +61,11 @@ public class XMLNode {
|
||||
}
|
||||
|
||||
public String getTextValue() {
|
||||
if(isAttrOutOfLoop) {
|
||||
return attrValueOutOfLoop;
|
||||
}
|
||||
|
||||
if(isNullValue) return null;
|
||||
return value.toString();
|
||||
}
|
||||
|
||||
public void resetValue() {
|
||||
if(isAttrOutOfLoop) {
|
||||
return;
|
||||
}
|
||||
|
||||
isNullValue = true;
|
||||
value.setLength(0);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2013 Talend Inc. - www.talend.com
|
||||
// Copyright (C) 2006-2012 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
@@ -24,9 +24,7 @@ public class XMLNodes {
|
||||
private Map<String, XMLNode> nodes = new HashMap<String, XMLNode>();
|
||||
|
||||
private String loopPath = null;
|
||||
|
||||
private String originLoopPath = null;
|
||||
|
||||
|
||||
public void addNode(XMLNode node) {
|
||||
if (node != null) {
|
||||
nodes.put(node.originPath, node);
|
||||
@@ -74,22 +72,4 @@ public class XMLNodes {
|
||||
return nodes.size();
|
||||
}
|
||||
|
||||
/**
|
||||
* DOC talend2 Comment method "getOriginalLoopPath".
|
||||
* @return
|
||||
*/
|
||||
public String getOriginalLoopPath() {
|
||||
if (this.originLoopPath != null)
|
||||
return this.originLoopPath;
|
||||
|
||||
for (XMLNode node : nodes.values()) {
|
||||
if (node.originLoopPath != null) {
|
||||
this.originLoopPath = node.originLoopPath;
|
||||
return node.originLoopPath;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2013 Talend Inc. - www.talend.com
|
||||
// Copyright (C) 2006-2012 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
@@ -142,17 +142,22 @@ public class FileCopy {
|
||||
if (position + MAP_SIZE >= size) {
|
||||
buf = in.map(FileChannel.MapMode.READ_ONLY, position, size - position);
|
||||
out.write(buf);
|
||||
//For But TDI-26493, here must clean first, or it can't delete
|
||||
clean(buf);
|
||||
if (delSrc) {
|
||||
// here must clean first, or it can't delete
|
||||
clean(buf);
|
||||
}
|
||||
break;
|
||||
} else {
|
||||
buf = in.map(FileChannel.MapMode.READ_ONLY, position, MAP_SIZE);
|
||||
out.write(buf);
|
||||
// here must clean first, or it can't delete
|
||||
clean(buf);
|
||||
if (delSrc) {
|
||||
// here must clean first, or it can't delete
|
||||
clean(buf);
|
||||
}
|
||||
position += MAP_SIZE;
|
||||
}
|
||||
}
|
||||
|
||||
in.close();
|
||||
out.close();
|
||||
|
||||
|
||||
@@ -1,55 +1,32 @@
|
||||
package org.talend.mdm.bulkload.client;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.Reader;
|
||||
import java.net.URL;
|
||||
import java.util.List;
|
||||
|
||||
public class BulkloadClient {
|
||||
|
||||
private String url;
|
||||
|
||||
private String username;
|
||||
|
||||
private String password;
|
||||
|
||||
private String universe;
|
||||
|
||||
private String cluster;
|
||||
|
||||
private String concept;
|
||||
|
||||
private String dataModel;
|
||||
|
||||
private BulkloadOptions options = new BulkloadOptions();
|
||||
|
||||
private static final AtomicInteger startedBulkloadCount = new AtomicInteger(0);
|
||||
|
||||
public BulkloadClient(String url, String username, String password, String universe, String cluster, String concept, String dataModel) {
|
||||
String url;
|
||||
String username;
|
||||
String password;
|
||||
String universe;
|
||||
String cluster;
|
||||
String concept;
|
||||
String datamodel;
|
||||
BulkloadOptions options=new BulkloadOptions();
|
||||
|
||||
public BulkloadClient(String url, String username,String password,String universe,String cluster,String concept,String datamodel) {
|
||||
this.url=url;
|
||||
this.username=username;
|
||||
this.password=password;
|
||||
this.universe=universe;
|
||||
this.cluster=cluster;
|
||||
this.concept=concept;
|
||||
this.dataModel = dataModel;
|
||||
this.datamodel=datamodel;
|
||||
}
|
||||
|
||||
public void startThreadCount(){
|
||||
// Kept for compatibility with tMDMBulkload.
|
||||
}
|
||||
|
||||
public void waitForEndOfQueue() {
|
||||
try {
|
||||
synchronized (startedBulkloadCount) {
|
||||
while (startedBulkloadCount.get() > 0) {
|
||||
System.out.println(startedBulkloadCount.get() + " remaining.");
|
||||
startedBulkloadCount.wait();
|
||||
}
|
||||
}
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
@@ -99,11 +76,11 @@ public class BulkloadClient {
|
||||
}
|
||||
|
||||
public String getDatamodel() {
|
||||
return dataModel;
|
||||
return datamodel;
|
||||
}
|
||||
|
||||
public void setDatamodel(String dataModel) {
|
||||
this.dataModel = dataModel;
|
||||
public void setDatamodel(String datamodel) {
|
||||
this.datamodel = datamodel;
|
||||
}
|
||||
|
||||
public BulkloadOptions getOptions() {
|
||||
@@ -113,75 +90,93 @@ public class BulkloadClient {
|
||||
public void setOptions(BulkloadOptions options) {
|
||||
this.options = options;
|
||||
}
|
||||
|
||||
/**
|
||||
* load from a huge xml string
|
||||
* @param xmlString A full xml document.
|
||||
* @throws Exception Thrown in case of bulk load error.
|
||||
*/
|
||||
public void load(String xmlString) throws Exception {
|
||||
load(new ByteArrayInputStream(xmlString.getBytes("UTF-8")));
|
||||
public void load(List<String > items) {
|
||||
doLoad(items);
|
||||
}
|
||||
/**
|
||||
* load from a huge xml string
|
||||
* @param xmlString
|
||||
*/
|
||||
public void load(String xmlString)throws Exception {
|
||||
List<String > items=BulkloadClientUtil.getItemXmls(xmlString);
|
||||
doLoad(items);
|
||||
}
|
||||
|
||||
private void doLoad(List<String> items) {
|
||||
if(items.size()>options.getArraySize()) {
|
||||
int loop=items.size()/options.getArraySize();
|
||||
int left=items.size()-options.getArraySize()*loop;
|
||||
for(int i=0; i<loop; i++) {
|
||||
List<String> subItems=items.subList(i*options.getArraySize(), (i+1)*options.getArraySize());
|
||||
try {
|
||||
BulkloadClientUtil.bulkload(url, cluster, concept, datamodel, options.isValidate(), options.isSmartpk(), subItems, username, password,universe);
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
if(left>0) {
|
||||
List<String> subItems=items.subList(loop*options.getArraySize(), loop*options.getArraySize()+left);
|
||||
try {
|
||||
BulkloadClientUtil.bulkload(url, cluster, concept, datamodel, options.isValidate(), options.isSmartpk(), subItems, username, password,universe);
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}else {
|
||||
try {
|
||||
BulkloadClientUtil.bulkload(url, cluster, concept, datamodel, options.isValidate(), options.isSmartpk(), items, username, password,universe);
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* load from File
|
||||
* @param inputXmlFile
|
||||
*/
|
||||
public void load(Reader inputXmlFile) {
|
||||
BufferedReader reader=null;
|
||||
try {
|
||||
reader=new BufferedReader(inputXmlFile);
|
||||
StringBuffer sb=new StringBuffer();
|
||||
String line=reader.readLine();
|
||||
while(line!=null) {
|
||||
sb=sb.append(line);
|
||||
line=reader.readLine();
|
||||
}
|
||||
List<String > items=BulkloadClientUtil.getItemXmls(sb.toString());
|
||||
doLoad(items);
|
||||
}catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
}finally {
|
||||
if(reader!=null)
|
||||
try {
|
||||
reader.close();
|
||||
} catch (IOException e) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
//test
|
||||
//FileReader reader=new FileReader(file)
|
||||
URL url=BulkloadClient.class.getResource("test.xml");
|
||||
try {
|
||||
BufferedInputStream in=((BufferedInputStream)url.getContent());
|
||||
byte[] buf=new byte[in.available()];
|
||||
in.read(buf);
|
||||
String xml=new String(buf);
|
||||
BulkloadClient client=new BulkloadClient("http://localhost:8080/datamanager/loadServlet","admin","talend",null,"Order","Country","Order");
|
||||
client.setOptions(new BulkloadOptions());
|
||||
client.load(xml);
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Loads XML documents in MDM using an InputStream. All documents should follow each other.
|
||||
* For instance this InputStream can be used with this method.
|
||||
* </p>
|
||||
*
|
||||
* <code>
|
||||
* InputStream is = new ByteArrayInputStream("<doc></doc><doc></doc><doc></doc>".getBytes());
|
||||
* </code>
|
||||
*
|
||||
* <p>
|
||||
* This method blocks until all documents in <code>xmlDocuments</code> are read. For non blocking use cases
|
||||
* see {@link #load()}.
|
||||
* </p>
|
||||
*
|
||||
* @param xmlDocuments A stream that contains several XML documents.
|
||||
* @throws Exception Thrown in case of bulk load error
|
||||
*/
|
||||
public void load(InputStream xmlDocuments) throws Exception {
|
||||
BulkloadClientUtil.bulkload(url,
|
||||
cluster,
|
||||
concept,
|
||||
dataModel,
|
||||
options.isValidate(),
|
||||
options.isSmartpk(),
|
||||
xmlDocuments,
|
||||
username,
|
||||
password,
|
||||
universe);
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Loads XML documents in MDM using an InputStream created for the load. This method creates a {@link Thread} that
|
||||
* wait for {@link InputStreamMerger#push(java.io.InputStream)} to get called.
|
||||
* </p>
|
||||
*
|
||||
* <code>
|
||||
* BulkloadClient client = ...<br/>
|
||||
* InputStreamMerger is = client.load();<br/>
|
||||
* for(...) {<br/>
|
||||
* is.push(new ByteArrayInputStream("...".getBytes());<br/>
|
||||
* }
|
||||
* </code>
|
||||
*
|
||||
* @throws Exception Thrown in case of communication error
|
||||
* @see InputStreamMerger
|
||||
* @return A {@link InputStreamMerger} that allow asynchronous push to bulkload client.
|
||||
*/
|
||||
public InputStreamMerger load() throws Exception {
|
||||
return BulkloadClientUtil.bulkload(url,
|
||||
cluster,
|
||||
concept,
|
||||
dataModel,
|
||||
options.isValidate(),
|
||||
options.isSmartpk(),
|
||||
username,
|
||||
password,
|
||||
universe,
|
||||
startedBulkloadCount);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,131 +1,189 @@
|
||||
package org.talend.mdm.bulkload.client;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.io.IOException;
|
||||
import java.io.StringReader;
|
||||
import java.io.StringWriter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerException;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
import javax.xml.transform.dom.DOMSource;
|
||||
import javax.xml.transform.stream.StreamResult;
|
||||
|
||||
import org.apache.commons.httpclient.HostConfiguration;
|
||||
import org.apache.commons.httpclient.HttpClient;
|
||||
import org.apache.commons.httpclient.HttpException;
|
||||
import org.apache.commons.httpclient.NameValuePair;
|
||||
import org.apache.commons.httpclient.URI;
|
||||
import org.apache.commons.httpclient.UsernamePasswordCredentials;
|
||||
import org.apache.commons.httpclient.auth.AuthScope;
|
||||
import org.apache.commons.httpclient.cookie.CookiePolicy;
|
||||
import org.apache.commons.httpclient.methods.InputStreamRequestEntity;
|
||||
import org.apache.commons.httpclient.methods.PutMethod;
|
||||
import org.apache.commons.httpclient.methods.PostMethod;
|
||||
import org.apache.commons.httpclient.params.HttpClientParams;
|
||||
import org.apache.commons.httpclient.params.HttpMethodParams;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.Node;
|
||||
import org.xml.sax.InputSource;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
/**
|
||||
* Bulkload amount items client
|
||||
* @author achen
|
||||
*
|
||||
*/
|
||||
public class BulkloadClientUtil {
|
||||
|
||||
public static void bulkload(String url, String cluster, String concept, String datamodel, boolean validate, boolean smartpk, InputStream itemdata,
|
||||
String username, String password, String universe) throws Exception {
|
||||
HostConfiguration config = new HostConfiguration();
|
||||
URI uri = new URI(url, false, "UTF-8"); //$NON-NLS-1$
|
||||
config.setHost(uri);
|
||||
/**
|
||||
* @param args
|
||||
*/
|
||||
public static void main(String[] args)throws Exception {
|
||||
if((!args[0].startsWith("http://") && args.length>0) && (args.length != 9 || args.length!=7 || args.length!=6)) {
|
||||
usage();
|
||||
return;
|
||||
}
|
||||
String url= args[0];
|
||||
String username=args[1];
|
||||
String password=args[2];
|
||||
String cluster= args[3];
|
||||
String concept= args[4];
|
||||
String datamodel= args[5];
|
||||
boolean validate= false;
|
||||
boolean smartpk= false;
|
||||
List<String> itemdata= new ArrayList<String>();
|
||||
if(args.length==9) {
|
||||
validate= Boolean.valueOf(args[6]);
|
||||
smartpk= Boolean.valueOf(args[7]);
|
||||
itemdata=getItemXmls(args[8]);
|
||||
}
|
||||
if(args.length==7) {
|
||||
itemdata=getItemXmls(args[6]);
|
||||
}
|
||||
if(args.length==6) {//get itemdata from System.in
|
||||
byte[] buf=new byte[System.in.available()];
|
||||
System.in.read(buf);
|
||||
itemdata=getItemXmls(new String(buf));
|
||||
}
|
||||
try {
|
||||
bulkload(url,cluster, concept,datamodel, validate, smartpk, itemdata,username,password,null);
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
public static List<String> getItemXmls(String itemdata)throws Exception {
|
||||
Element root=parse(itemdata).getDocumentElement();
|
||||
List<String> items=new ArrayList<String>();
|
||||
for(int i=0; i<root.getChildNodes().getLength(); i++) {
|
||||
Node node=root.getChildNodes().item(i);
|
||||
if(node.getNodeType() == Node.ELEMENT_NODE) {
|
||||
items.add(nodeToString(node, true));
|
||||
}
|
||||
}
|
||||
return items;
|
||||
}
|
||||
|
||||
private static String nodeToString(Node n, boolean omitXMLDeclaration) throws TransformerException{
|
||||
StringWriter sw = new StringWriter();
|
||||
Transformer transformer = TransformerFactory.newInstance().newTransformer();
|
||||
if (omitXMLDeclaration)
|
||||
transformer.setOutputProperty("omit-xml-declaration","yes");
|
||||
else
|
||||
transformer.setOutputProperty("omit-xml-declaration","no");
|
||||
transformer.setOutputProperty("indent","yes");
|
||||
transformer.transform(
|
||||
new DOMSource(n),
|
||||
new StreamResult(sw)
|
||||
);
|
||||
if (sw==null) return null;
|
||||
return sw.toString().replaceAll("\r\n", "\n");
|
||||
}
|
||||
|
||||
private static Document parse(String xmlString) throws ParserConfigurationException,IOException, SAXException{
|
||||
//parse
|
||||
Document d=null;
|
||||
|
||||
NameValuePair[] parameters = {new NameValuePair("cluster", cluster), //$NON-NLS-1$
|
||||
new NameValuePair("concept", concept), //$NON-NLS-1$
|
||||
new NameValuePair("datamodel", datamodel), //$NON-NLS-1$
|
||||
new NameValuePair("validate", String.valueOf(validate)), //$NON-NLS-1$
|
||||
new NameValuePair("action", "load"), //$NON-NLS-1$ //$NON-NLS-2$
|
||||
new NameValuePair("smartpk", String.valueOf(smartpk))}; //$NON-NLS-1$
|
||||
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
|
||||
//Schema validation based on schemaURL
|
||||
factory.setNamespaceAware(true);
|
||||
factory.setAttribute(
|
||||
"http://java.sun.com/xml/jaxp/properties/schemaLanguage",
|
||||
"http://www.w3.org/2001/XMLSchema");
|
||||
DocumentBuilder builder;
|
||||
builder = factory.newDocumentBuilder();
|
||||
|
||||
HttpClient client = new HttpClient();
|
||||
String user = universe == null || universe.trim().length() == 0 ? username : universe + "/" + username; //$NON-NLS-1$
|
||||
client.getState().setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(user, password));
|
||||
HttpClientParams clientParams = client.getParams();
|
||||
clientParams.setAuthenticationPreemptive(true);
|
||||
clientParams.setCookiePolicy(CookiePolicy.IGNORE_COOKIES);
|
||||
d = builder.parse(new InputSource(new StringReader(xmlString)));
|
||||
|
||||
PutMethod putMethod = new PutMethod();
|
||||
// This setPath call is *really* important (if not set, request will be sent to the JBoss root '/')
|
||||
putMethod.setPath(url);
|
||||
String responseBody;
|
||||
try {
|
||||
// Configuration
|
||||
putMethod.setRequestHeader("Content-Type", "text/xml; charset=utf8"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
putMethod.setQueryString(parameters);
|
||||
putMethod.setContentChunked(true);
|
||||
// Set the content of the PUT request
|
||||
putMethod.setRequestEntity(new InputStreamRequestEntity(itemdata));
|
||||
return d;
|
||||
}
|
||||
private static void usage() {
|
||||
String usage="Usage:\n"+
|
||||
"\t java -jar bulkloadclient.jar <url> <username> <password> <datacontainer> <concept> <datamodel> [validate] [smartpk] [itemdata] \n"+
|
||||
"\t example1: java -jar bulkloadclient.jar http://localhost:8080/datamanager/loadServlet admin talend Order Country Order <itemdata><Country><isoCode>zh</isoCode><label>china</label><Continent>Asia</Continent></Country></itemdata>"+
|
||||
"\t example2(on linux): cat myfile.xml|java -jar bulkloadclient.jar http://localhost:8080/datamanager/loadServlet admin talend Order Country Order";
|
||||
|
||||
System.out.println(usage);
|
||||
}
|
||||
|
||||
|
||||
public static boolean bulkload(String URL, String cluster,String concept,String datamodel, boolean validate, boolean smartpk, List<String> itemdata,
|
||||
String username, String password,String universe) throws Exception {
|
||||
HttpClient client = new HttpClient();
|
||||
HttpClientParams params = new HttpClientParams();
|
||||
// params.setSoTimeout(1000);
|
||||
// params.setConnectionManagerTimeout(200);
|
||||
client.setParams(params);
|
||||
String user=universe==null||universe.trim().length()==0?username:universe+"/"+username;
|
||||
client.getState().setCredentials(AuthScope.ANY,
|
||||
new UsernamePasswordCredentials(user, password));
|
||||
|
||||
client.executeMethod(config, putMethod);
|
||||
responseBody = putMethod.getResponseBodyAsString();
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
} finally {
|
||||
putMethod.releaseConnection();
|
||||
}
|
||||
URI uri = new URI(URL, false, "utf-8");
|
||||
HostConfiguration config = new HostConfiguration();
|
||||
config.setHost(uri);
|
||||
|
||||
int statusCode = putMethod.getStatusCode();
|
||||
if (statusCode >= 400) {
|
||||
throw new BulkloadException(responseBody);
|
||||
}
|
||||
}
|
||||
PostMethod postMethod = new PostMethod(URL);
|
||||
HttpMethodParams reqParams = postMethod.getParams();
|
||||
reqParams.setContentCharset("UTF-8");
|
||||
List<NameValuePair> list=new ArrayList<NameValuePair>();
|
||||
NameValuePair[] data = { new NameValuePair("cluster", cluster),
|
||||
new NameValuePair("concept", concept),
|
||||
new NameValuePair("datamodel", datamodel),
|
||||
new NameValuePair("validate", String.valueOf(validate)),
|
||||
new NameValuePair("smartpk", String.valueOf(smartpk))};
|
||||
list.addAll(Arrays.asList(data));
|
||||
for(int i=0; i<itemdata.size(); i++) {
|
||||
list.add(new NameValuePair("itemdata"+i, itemdata.get(i)));
|
||||
}
|
||||
postMethod.setRequestBody((NameValuePair[])list.toArray(new NameValuePair[list.size()]));
|
||||
// post method
|
||||
int statusCode = 0;
|
||||
try {
|
||||
statusCode = client.executeMethod(config,postMethod);
|
||||
} catch (HttpException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
public static InputStreamMerger bulkload(String url, String cluster, String concept, String dataModel, boolean validate, boolean smartPK, String username, String password, String universe, AtomicInteger startedBulkloadCount) {
|
||||
InputStreamMerger merger = new InputStreamMerger();
|
||||
if (statusCode >= 400)
|
||||
return false;
|
||||
String str = "";
|
||||
try {
|
||||
str = postMethod.getResponseBodyAsString();
|
||||
} catch (IOException e) {
|
||||
|
||||
Runnable loadRunnable = new AsyncLoadRunnable(url, cluster, concept, dataModel, validate, smartPK, merger, username, password, universe, startedBulkloadCount);
|
||||
Thread loadThread = new Thread(loadRunnable);
|
||||
loadThread.start();
|
||||
}
|
||||
System.out.println(str);
|
||||
|
||||
return merger;
|
||||
}
|
||||
postMethod.releaseConnection();
|
||||
return true;
|
||||
}
|
||||
|
||||
private static class AsyncLoadRunnable implements Runnable {
|
||||
|
||||
private final String url;
|
||||
|
||||
private final String cluster;
|
||||
|
||||
private final String concept;
|
||||
|
||||
private final String dataModel;
|
||||
|
||||
private final boolean validate;
|
||||
|
||||
private final boolean smartPK;
|
||||
|
||||
private final InputStreamMerger inputStream;
|
||||
|
||||
private final String userName;
|
||||
|
||||
private final String password;
|
||||
|
||||
private final String universe;
|
||||
|
||||
private final AtomicInteger startedBulkloadCount;
|
||||
|
||||
public AsyncLoadRunnable(String url, String cluster, String concept, String dataModel, boolean validate, boolean smartPK, InputStreamMerger inputStream, String userName, String password, String universe, AtomicInteger startedBulkloadCount) {
|
||||
this.url = url;
|
||||
this.cluster = cluster;
|
||||
this.concept = concept;
|
||||
this.dataModel = dataModel;
|
||||
this.validate = validate;
|
||||
this.smartPK = smartPK;
|
||||
this.inputStream = inputStream;
|
||||
this.userName = userName;
|
||||
this.password = password;
|
||||
this.universe = universe;
|
||||
this.startedBulkloadCount = startedBulkloadCount;
|
||||
}
|
||||
|
||||
public void run() {
|
||||
try {
|
||||
startedBulkloadCount.incrementAndGet();
|
||||
bulkload(url, cluster, concept, dataModel, validate, smartPK, inputStream, userName, password, universe);
|
||||
} catch (Throwable e) {
|
||||
inputStream.reportFailure(e);
|
||||
} finally {
|
||||
startedBulkloadCount.decrementAndGet();
|
||||
synchronized (startedBulkloadCount) {
|
||||
startedBulkloadCount.notifyAll();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2006-2012 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.mdm.bulkload.client;
|
||||
|
||||
import java.io.PrintStream;
|
||||
import java.io.PrintWriter;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class BulkloadException extends RuntimeException {
|
||||
|
||||
private static final String SERVER_EXCEPTION_SEPARATOR = "== SERVER EXCEPTION ==";
|
||||
|
||||
private static final String LINE_SEPARATOR = System.getProperty("line.separator"); //$NON-NLS-1$
|
||||
|
||||
private final String serverException;
|
||||
|
||||
public BulkloadException(String serverException) {
|
||||
super("An exception happened during bulk load on MDM server.");
|
||||
this.serverException = serverException;
|
||||
}
|
||||
|
||||
public String getServerException() {
|
||||
return serverException;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void printStackTrace(PrintStream s) {
|
||||
super.printStackTrace(s);
|
||||
s.append(LINE_SEPARATOR);
|
||||
s.append(SERVER_EXCEPTION_SEPARATOR);
|
||||
s.append(LINE_SEPARATOR);
|
||||
s.append(serverException);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void printStackTrace(PrintWriter s) {
|
||||
super.printStackTrace(s);
|
||||
s.println(SERVER_EXCEPTION_SEPARATOR);
|
||||
s.println(serverException);
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user