Compare commits
258 Commits
release/5.
...
release/5.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7d5243a3b0 | ||
|
|
a195661bb4 | ||
|
|
45196b3ad1 | ||
|
|
6c9b01c58c | ||
|
|
7b0a310141 | ||
|
|
0181a22fd7 | ||
|
|
7be39642aa | ||
|
|
501c74798d | ||
|
|
7149abbb4c | ||
|
|
4e9d6d37a3 | ||
|
|
5ade3175bd | ||
|
|
b2ef6ae3df | ||
|
|
1d522ca9d1 | ||
|
|
f8d6ef3f0a | ||
|
|
12bd9d58a2 | ||
|
|
11f6a34b6d | ||
|
|
7f8a375ff0 | ||
|
|
5953efad1c | ||
|
|
8e55cf4dd0 | ||
|
|
1319d4e59a | ||
|
|
adaebc6fe8 | ||
|
|
d9e9ac819e | ||
|
|
008a630030 | ||
|
|
3335907b29 | ||
|
|
b13d463179 | ||
|
|
d82e66d498 | ||
|
|
847c948e43 | ||
|
|
25f8a2f3a4 | ||
|
|
de468c004e | ||
|
|
890147ff94 | ||
|
|
38111fee1b | ||
|
|
e400d35e7d | ||
|
|
ce4a5f2134 | ||
|
|
ffb9838a8f | ||
|
|
453204e39e | ||
|
|
75f7650a9f | ||
|
|
075edc1305 | ||
|
|
afa431a23f | ||
|
|
c6250af57f | ||
|
|
50cbb598e2 | ||
|
|
ed5ae04ca4 | ||
|
|
187ea12fc8 | ||
|
|
f254abf1b9 | ||
|
|
ae80c68122 | ||
|
|
0cb3e52f89 | ||
|
|
63bbbd581b | ||
|
|
d03922b4ed | ||
|
|
e90ac46d52 | ||
|
|
245d1d7955 | ||
|
|
d170c6df84 | ||
|
|
834c3c1081 | ||
|
|
ced5a9a5e0 | ||
|
|
c0ff3b5df5 | ||
|
|
1abf647464 | ||
|
|
60914027d4 | ||
|
|
37bf89e3b7 | ||
|
|
5d042939be | ||
|
|
852a52b12e | ||
|
|
78565c1383 | ||
|
|
86af67b25d | ||
|
|
178de3b7c1 | ||
|
|
7f8c9a0151 | ||
|
|
d3156fcb4b | ||
|
|
0dfb66d5c2 | ||
|
|
a4ad97cd23 | ||
|
|
5cb6810f8d | ||
|
|
860f23e1f1 | ||
|
|
247112ff3e | ||
|
|
5591949de0 | ||
|
|
2e10d160d4 | ||
|
|
718e9266b6 | ||
|
|
b863d50849 | ||
|
|
e4f2d7323a | ||
|
|
e077e4f3c9 | ||
|
|
0185b109c7 | ||
|
|
dd7b32ea7e | ||
|
|
202d0aa0b4 | ||
|
|
47150cfc81 | ||
|
|
801975dc14 | ||
|
|
60f1c48569 | ||
|
|
3450e7eeae | ||
|
|
11699ef91e | ||
|
|
662160c212 | ||
|
|
f8659d6b90 | ||
|
|
bb5ef469ba | ||
|
|
1e91f0fc6a | ||
|
|
fd3898c23c | ||
|
|
3f5dae597b | ||
|
|
a71d5f32e7 | ||
|
|
bb79796eea | ||
|
|
ad137e411b | ||
|
|
76322f2f8f | ||
|
|
3897811c57 | ||
|
|
68ae744e02 | ||
|
|
e52c05aca7 | ||
|
|
7e42930e31 | ||
|
|
580c094590 | ||
|
|
cb3e605b05 | ||
|
|
77dea01787 | ||
|
|
41fdb6ca73 | ||
|
|
6fe3fa4fcd | ||
|
|
05271e7d51 | ||
|
|
443f0889d5 | ||
|
|
e9b6d8ec4b | ||
|
|
325f20e58d | ||
|
|
db380cc78d | ||
|
|
2d0f7049f2 | ||
|
|
be4940612e | ||
|
|
2888d969e0 | ||
|
|
9822d9b6aa | ||
|
|
ffeafa1b34 | ||
|
|
1c89f1bd4a | ||
|
|
96794da1f9 | ||
|
|
3fb2de7d8b | ||
|
|
98c16a7aaa | ||
|
|
758fd764d8 | ||
|
|
c70caa068e | ||
|
|
4eb784f7e7 | ||
|
|
81a1725f74 | ||
|
|
b9640a7abb | ||
|
|
18a360b6c8 | ||
|
|
02a40ec26f | ||
|
|
c74703b462 | ||
|
|
1cf6e12f70 | ||
|
|
4e2a33bf40 | ||
|
|
9348d70a01 | ||
|
|
50ad81452a | ||
|
|
172b122cf5 | ||
|
|
52308186b2 | ||
|
|
de75ca4a5b | ||
|
|
0dc2a9326a | ||
|
|
195a02242b | ||
|
|
793f4ed4b8 | ||
|
|
f851d9f5f3 | ||
|
|
6f3742d959 | ||
|
|
fd60f94c4c | ||
|
|
7b5c2ea1a6 | ||
|
|
5e8188396e | ||
|
|
c13b26c3c3 | ||
|
|
ea0d91cd51 | ||
|
|
8dc1139682 | ||
|
|
169aa70e8d | ||
|
|
29efd784f0 | ||
|
|
2acc842c56 | ||
|
|
7cd145a533 | ||
|
|
d28e8737d7 | ||
|
|
d39b081a42 | ||
|
|
05a022ec7b | ||
|
|
66887ab783 | ||
|
|
84a6deb959 | ||
|
|
68603eb76d | ||
|
|
ba4e3314d0 | ||
|
|
0b2bcabe7b | ||
|
|
71806d17eb | ||
|
|
32e7eb154b | ||
|
|
f4103293b4 | ||
|
|
08c3098170 | ||
|
|
80eb31631e | ||
|
|
0c7127bd11 | ||
|
|
742382f39d | ||
|
|
79c08549c7 | ||
|
|
b45cd72e92 | ||
|
|
051d42c720 | ||
|
|
e733526d1c | ||
|
|
c9c1ed48ef | ||
|
|
8320034fca | ||
|
|
5a8b18f423 | ||
|
|
a33e5794a8 | ||
|
|
7a8f3bb7ee | ||
|
|
bdc2b7031a | ||
|
|
747d65f23c | ||
|
|
639d15876e | ||
|
|
feb6ab86bb | ||
|
|
b937a15129 | ||
|
|
1d2ebd52b2 | ||
|
|
c6747a6167 | ||
|
|
2107866231 | ||
|
|
bca22e2c06 | ||
|
|
fa6a2d03d2 | ||
|
|
25c55fe33e | ||
|
|
b639e6b088 | ||
|
|
607c71fbb0 | ||
|
|
a66afae4cb | ||
|
|
79bc1e9169 | ||
|
|
d6283d31cb | ||
|
|
35b19653a8 | ||
|
|
b00c2e236f | ||
|
|
8c226ebfc7 | ||
|
|
073ad6281c | ||
|
|
185edacfb6 | ||
|
|
6ecdb41309 | ||
|
|
2f6ac52437 | ||
|
|
fce85adfe3 | ||
|
|
ab2785a0d7 | ||
|
|
b03b6f45e3 | ||
|
|
44f7c02042 | ||
|
|
489aad7166 | ||
|
|
7faca09d3b | ||
|
|
6a30d6b2a6 | ||
|
|
50c1d9628d | ||
|
|
2620325e80 | ||
|
|
83ceb366f4 | ||
|
|
e20b6636ae | ||
|
|
11d3d668d8 | ||
|
|
4ba3934d01 | ||
|
|
7713c8519b | ||
|
|
72a9674ad8 | ||
|
|
17a2efa165 | ||
|
|
026e714a07 | ||
|
|
42f686658f | ||
|
|
429b9d8f18 | ||
|
|
63870324e7 | ||
|
|
8bcd4fcf56 | ||
|
|
f7bef5e104 | ||
|
|
665bbffdb8 | ||
|
|
4ae8c08015 | ||
|
|
0de32fd558 | ||
|
|
01047d4ef3 | ||
|
|
14be53832c | ||
|
|
0eddbc6988 | ||
|
|
a24c72f1cb | ||
|
|
45cb0f3a56 | ||
|
|
272ffc0e33 | ||
|
|
926cc3ee7d | ||
|
|
655d247e41 | ||
|
|
304a82b943 | ||
|
|
b5356f9603 | ||
|
|
d9af1946a9 | ||
|
|
3d2e0f2a58 | ||
|
|
980faa8da4 | ||
|
|
25f3da00a4 | ||
|
|
810f582f9c | ||
|
|
7ff64ce7ea | ||
|
|
0ad4f4e599 | ||
|
|
03a619b51a | ||
|
|
365947f70b | ||
|
|
ac72f63570 | ||
|
|
bee90f6719 | ||
|
|
16d544a51a | ||
|
|
7652d3ee71 | ||
|
|
7eb24c4b8e | ||
|
|
40f27eac56 | ||
|
|
40c25c071f | ||
|
|
7f9895b33f | ||
|
|
965dbe0d91 | ||
|
|
8d93489f4f | ||
|
|
27c731bd7d | ||
|
|
38c8a1eb01 | ||
|
|
4bb11d3d55 | ||
|
|
0d3512fd58 | ||
|
|
89de8cfe95 | ||
|
|
975c1c5e57 | ||
|
|
449f2893d8 | ||
|
|
5be9aa761c | ||
|
|
c3de914df6 | ||
|
|
85188fc5b4 | ||
|
|
d238cc0376 | ||
|
|
d44441b7ef |
@@ -46,7 +46,6 @@ 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=Erreur
|
||||
PushToPaletteActionProvider.Error2=ERROR
|
||||
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=Erreur
|
||||
PushToPaletteActionProvider.Error=ERROR
|
||||
ComponentProjectManager.InternalErrorMsg=Erreur interne \: {(0)}
|
||||
AbstractXMLConfigPage.IntValue=Entier
|
||||
ImportComponentDialog.ImportCanceled=Import des composants annulé
|
||||
|
||||
@@ -19,16 +19,21 @@ 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
|
||||
|
||||
@@ -85,3 +85,4 @@ 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
|
||||
|
||||
@@ -124,6 +124,7 @@ 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$
|
||||
@@ -183,6 +184,7 @@ 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 {
|
||||
@@ -222,15 +224,17 @@ 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 = (IClasspathEntry[]) cpEntries.toArray(new IClasspathEntry[cpEntries.size()]);
|
||||
if (monitor != null)
|
||||
entries = 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);
|
||||
@@ -260,7 +264,6 @@ 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,11 +12,15 @@
|
||||
// ============================================================================
|
||||
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;
|
||||
@@ -27,8 +31,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.
|
||||
@@ -50,6 +54,7 @@ public class ComponentProjectPreferencePage extends FieldEditorPreferencePage im
|
||||
*
|
||||
* @see org.eclipse.jface.preference.PreferencePage#performApply()
|
||||
*/
|
||||
@Override
|
||||
protected void performApply() {
|
||||
super.performApply();
|
||||
}
|
||||
@@ -59,29 +64,47 @@ 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();
|
||||
@@ -92,6 +115,7 @@ public class ComponentProjectPreferencePage extends FieldEditorPreferencePage im
|
||||
*
|
||||
* @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
|
||||
*/
|
||||
@Override
|
||||
public void init(IWorkbench workbench) {
|
||||
}
|
||||
|
||||
@@ -100,6 +124,7 @@ 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();
|
||||
|
||||
@@ -26,16 +26,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 AbstractExternalNode {
|
||||
public abstract class AbstractMapComponent extends MapperExternalNode {
|
||||
|
||||
/**
|
||||
* DOC amaumont AbstractMapComponent constructor comment.
|
||||
@@ -49,6 +49,7 @@ public abstract class AbstractMapComponent extends AbstractExternalNode {
|
||||
*
|
||||
* @see org.talend.core.model.process.IExternalNode#initialize()
|
||||
*/
|
||||
@Override
|
||||
public void initialize() {
|
||||
initElementParameters();
|
||||
}
|
||||
@@ -78,7 +79,7 @@ public abstract class AbstractMapComponent extends AbstractExternalNode {
|
||||
|
||||
protected boolean hasDataIntoExpression(Pattern pattern, PatternMatcher matcher, String expression) {
|
||||
if (expression != null) {
|
||||
if (matcher.contains(expression, pattern)) {
|
||||
if (matcher.matches(expression, pattern)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -90,6 +91,7 @@ public abstract class AbstractMapComponent extends AbstractExternalNode {
|
||||
*
|
||||
* @see org.talend.core.model.process.INode#useData(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public boolean useData(String name) {
|
||||
if (super.useData(name)) {
|
||||
return true;
|
||||
@@ -106,17 +108,18 @@ public abstract class AbstractMapComponent extends AbstractExternalNode {
|
||||
*
|
||||
* @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);
|
||||
|
||||
hasOrRenameData(oldName, newName, true);
|
||||
|
||||
}
|
||||
|
||||
|
||||
private static Map<String, Pattern> patternsCache = new HashMap<String, Pattern>();
|
||||
|
||||
protected final Pattern getRenamePattern(String oldName) {
|
||||
if (patternsCache.containsKey(oldName)) {
|
||||
if (patternsCache.containsKey(oldName)) {
|
||||
return patternsCache.get(oldName);
|
||||
}
|
||||
PatternCompiler compiler = new Perl5Compiler();
|
||||
@@ -130,7 +133,7 @@ public abstract class AbstractMapComponent extends AbstractExternalNode {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static Map<String, Perl5Substitution> substitutionsCache = new HashMap<String, Perl5Substitution>();
|
||||
|
||||
protected final Perl5Substitution getRenameSubstitution(String newName) {
|
||||
|
||||
@@ -14,5 +14,4 @@ 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,4 +10,5 @@ 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,3 +1,4 @@
|
||||
AlfrescoModelDialog.modelTable.title=Ba\u015Fl\u0131k
|
||||
AlfrescoModelDialog.add=Ekle...
|
||||
AlfrescoModelDialog.type=Tip
|
||||
AlfrescoModelDialog.modelTable.name=Ad\u0131
|
||||
|
||||
@@ -53,3 +53,4 @@ 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,7 +16,6 @@ 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
|
||||
@@ -79,3 +78,4 @@ 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,3 +75,4 @@ 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,3 +79,5 @@ 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,3 +46,4 @@ 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=Erreur
|
||||
BusinessInitDiagramFileAction.Error=ERROR
|
||||
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,3 +79,4 @@ 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,3 +64,4 @@ 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,3 +77,4 @@ 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,3 +79,5 @@ 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,3 +57,4 @@ 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,3 +64,4 @@ 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,3 +73,4 @@ 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,3 +1,4 @@
|
||||
AssignmentPropertySection.Type=Tip
|
||||
AssignmentPropertySection.Name=Ad\u0131
|
||||
BusinessInitDiagramFileAction.Error=Hata
|
||||
BusinessPaletteFactory.InputComment=Yeni giri\u015F olu\u015Ftur
|
||||
|
||||
@@ -78,3 +78,4 @@ BusinessAbstractParser.StringValueDoesNotConvertToByteValue=String\u7C7B\u578B\u
|
||||
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
|
||||
|
||||
@@ -82,6 +82,7 @@ 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;
|
||||
@@ -411,11 +412,12 @@ 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());
|
||||
|
||||
@@ -87,7 +87,7 @@ FAMILY.Misc=Verschiedenes
|
||||
FAMILY.MySQL=MySQL
|
||||
FAMILY.Netezza=Netezza
|
||||
FAMILY.OLAP_Cube=OLAP Würfel
|
||||
FAMILY.Oracle=Dieser Quellcode wurde automatisiert generiert durch {0}
|
||||
FAMILY.Oracle=Oracle
|
||||
FAMILY.Orchestration=Instrumentation
|
||||
FAMILY.Output= Ausgabe
|
||||
FAMILY.ParAccel=Paraccel
|
||||
|
||||
@@ -13,6 +13,7 @@ FAMILY.Access=Access
|
||||
FAMILY.Business=negocio
|
||||
FAMILY.Connections=Conexiones
|
||||
FAMILY.DB2=DB2
|
||||
FAMILY.eXist=Existe
|
||||
FAMILY.File=Fichero
|
||||
FAMILY.FireBird=Firebird
|
||||
FAMILY.Greenplum=Greenplum
|
||||
@@ -33,5 +34,6 @@ 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=Charger des composants...
|
||||
ComponentsFactory.load.components=Chargement 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,3 +25,4 @@ 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\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
|
||||
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
|
||||
prefs.configuration.LINK_STYLE.AUTO=\u81EA\u52D5
|
||||
prefs.configuration.LINK_STYLE.BEZIER_CURVE=\u66F2\u7DDA
|
||||
prefs.configuration.LINK_STYLE.LINE=\u76F4\u7DDA(\u6700\u901F)
|
||||
|
||||
@@ -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.page1"
|
||||
id="org.talend.designer.codegen.components.localprovider.page2"
|
||||
name="%format">
|
||||
</page>
|
||||
</extension>
|
||||
|
||||
@@ -457,17 +457,6 @@ private class TalendException extends java.lang.Exception {
|
||||
}
|
||||
}
|
||||
%>
|
||||
} else {
|
||||
<%
|
||||
if (isRunInMultiThread ) {
|
||||
%>
|
||||
((java.util.Map)threadLocal.get()).put("status", "failure");
|
||||
<%
|
||||
} else {%>
|
||||
status = "failure";
|
||||
<%
|
||||
}
|
||||
%>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -232,7 +232,7 @@ for (INode node : graphicalNodes) {
|
||||
}
|
||||
}
|
||||
String delay = ElementParameterParser.getValue(node, "__DELAY__");
|
||||
if(delay!=null && !delay.trim().equals("") && !"1000".equals(delay)){
|
||||
if(delay!=null && !delay.trim().equals("")){
|
||||
if(sb.length()==0){
|
||||
sb.append("+\"?delay=\"+");
|
||||
sb.append(delay);
|
||||
|
||||
@@ -217,7 +217,7 @@
|
||||
<%
|
||||
}
|
||||
%>
|
||||
throw new java.lang.Error(error);
|
||||
throw error;
|
||||
|
||||
}
|
||||
<%
|
||||
|
||||
@@ -48,7 +48,6 @@ 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;
|
||||
@@ -58,9 +57,8 @@ 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() && xsdValidationCacheManager.needCheck(xmlMainFile, currentCRC)) {
|
||||
if (!CommonsPlugin.isHeadless()) {
|
||||
checkXSD(xmlMainFile);
|
||||
xsdValidationCacheManager.setChecked(xmlMainFile, currentCRC);
|
||||
}
|
||||
} catch (FileNotFoundException e) {
|
||||
ExceptionHandler.process(e);
|
||||
|
||||
@@ -14,33 +14,30 @@ 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;
|
||||
@@ -53,10 +50,14 @@ 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.language.ECodeLanguage;
|
||||
import org.talend.core.context.Context;
|
||||
import org.talend.core.context.RepositoryContext;
|
||||
import org.talend.core.language.LanguageManager;
|
||||
import org.talend.core.model.component_cache.ComponentCachePackage;
|
||||
import org.talend.core.model.component_cache.ComponentInfo;
|
||||
@@ -67,7 +68,6 @@ 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.designer.codegen.CodeGeneratorActivator;
|
||||
@@ -78,14 +78,7 @@ 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.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;
|
||||
import org.talend.repository.model.ComponentsFactoryProvider;
|
||||
|
||||
/**
|
||||
* Component factory that look for each component and load their information. <br/>
|
||||
@@ -107,15 +100,15 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
|
||||
private static HashSet<IComponent> componentList = null;
|
||||
|
||||
private static List<IComponent> customComponentList = null;
|
||||
private static HashSet<IComponent> customComponentList = null;
|
||||
|
||||
private List<IComponent> userComponentList = null;
|
||||
private HashSet<IComponent> userComponentList = null;
|
||||
|
||||
private IProgressMonitor monitor;
|
||||
|
||||
private SubMonitor subMonitor;
|
||||
|
||||
private static Map<String, IComponent> componentsCache = new HashMap<String, IComponent>();
|
||||
private static Map<String, Map<String, IComponent>> componentsCache = new HashMap<String, Map<String, IComponent>>();
|
||||
|
||||
// keep a list of the current provider for the selected component, to have the family translation
|
||||
// only for components that are loaded
|
||||
@@ -123,8 +116,6 @@ 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;
|
||||
@@ -133,117 +124,11 @@ 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 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$
|
||||
private static boolean cleanDone = false;
|
||||
|
||||
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 = 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 = 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) {
|
||||
@@ -257,51 +142,38 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
// TimeMeasure.begin("initComponents");
|
||||
|
||||
componentList = new HashSet<IComponent>();
|
||||
customComponentList = new ArrayList<IComponent>();
|
||||
customComponentList = new HashSet<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 = TalendCacheUtils.cleanComponentCache();
|
||||
boolean isNeedClean = !cleanDone && TalendCacheUtils.isSetCleanComponentCache();
|
||||
cleanDone = true; // only check this parameter one time, or it will reinitialize things all the time...
|
||||
isCreated = hasComponentFile(installLocation) && !isNeedClean;
|
||||
if (isReset) {
|
||||
isCreated = false;
|
||||
}
|
||||
ComponentsCache cache = ComponentManager.getInstance();
|
||||
ComponentsCache cache = ComponentManager.getComponentCache();
|
||||
try {
|
||||
if (isCreated) {
|
||||
ComponentsCache loadCache = loadComponentResource(installLocation);
|
||||
cache.getComponentEntryMap().putAll(loadCache.getComponentEntryMap());
|
||||
// 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());
|
||||
}
|
||||
} 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;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isCreated) {
|
||||
loadComponentsFromComponentsProviderExtension();
|
||||
}
|
||||
loadComponentsFromComponentsProviderExtension();
|
||||
|
||||
// TimeMeasure.step("initComponents", "loadComponentsFromProvider");
|
||||
// 2.Load Component from extension point: component_definition
|
||||
@@ -310,17 +182,11 @@ 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");
|
||||
@@ -328,118 +194,23 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
// TimeMeasure.display = false;
|
||||
// TimeMeasure.displaySteps = false;
|
||||
// TimeMeasure.measureActive = false;
|
||||
}
|
||||
|
||||
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() {
|
||||
|
||||
@Override
|
||||
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
|
||||
}
|
||||
}
|
||||
if (!CommonUIPlugin.isFullyHeadless()) {
|
||||
RepositoryContext repositoryContext = (RepositoryContext) CorePlugin.getContext().getProperty(
|
||||
Context.REPOSITORY_CONTEXT_KEY);
|
||||
if (repositoryContext == 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;
|
||||
Project project = repositoryContext.getProject();
|
||||
if (project == 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;
|
||||
org.talend.core.model.properties.Project emfProject = project.getEmfProject();
|
||||
if (emfProject == null) {
|
||||
return;
|
||||
}
|
||||
// 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);
|
||||
EList list = emfProject.getComponentsSettings();
|
||||
if (list.isEmpty()) {
|
||||
ComponentsFactoryProvider.saveComponentVisibilityStatus();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -489,15 +260,6 @@ 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 {
|
||||
@@ -518,8 +280,8 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
ComponentsProviderManager componentsProviderManager = ComponentsProviderManager.getInstance();
|
||||
AbstractComponentsProvider componentsProvider = componentsProviderManager.loadUserComponentsProvidersFromExtension();
|
||||
// remove old user components
|
||||
if (this.userComponentList != null) {
|
||||
ComponentsCache cache = ComponentManager.getInstance();
|
||||
if (!this.userComponentList.isEmpty()) {
|
||||
ComponentsCache cache = ComponentManager.getComponentCache();
|
||||
for (IComponent component : userComponentList) {
|
||||
if (componentList != null && componentList.contains(component)) {
|
||||
componentList.remove(component);
|
||||
@@ -529,13 +291,12 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
}
|
||||
if (cache.getComponentEntryMap().get(component.getName()) != null) {
|
||||
cache.getComponentEntryMap().remove(component.getName());
|
||||
ComponentManager.setModified(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
loadComponents(componentsProvider);
|
||||
if (!CommonsPlugin.isHeadless()) {
|
||||
ComponentManager.saveResource();
|
||||
}
|
||||
ComponentManager.saveResource();
|
||||
}
|
||||
|
||||
private void removeOldComponentsUserFolder() {
|
||||
@@ -556,16 +317,6 @@ 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())) {
|
||||
@@ -586,8 +337,7 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
@Override
|
||||
public boolean accept(final File file) {
|
||||
return file.isDirectory() && file.getName().charAt(0) != '.'
|
||||
&& !file.getName().equals(IComponentsFactory.EXTERNAL_COMPONENTS_INNER_FOLDER)
|
||||
&& isComponentVisible(file.getName());
|
||||
&& !file.getName().equals(IComponentsFactory.EXTERNAL_COMPONENTS_INNER_FOLDER);
|
||||
}
|
||||
|
||||
};
|
||||
@@ -624,19 +374,14 @@ 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,
|
||||
@@ -654,26 +399,60 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
}
|
||||
|
||||
try {
|
||||
ComponentFileChecker.checkComponentFolder(currentFolder, getCodeLanguageSuffix());
|
||||
File xmlMainFile = new File(currentFolder, ComponentFilesNaming.getInstance().getMainXMLFileName(
|
||||
currentFolder.getName(), getCodeLanguageSuffix()));
|
||||
|
||||
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()));
|
||||
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
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
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());
|
||||
}
|
||||
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();
|
||||
@@ -688,30 +467,38 @@ 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, "");
|
||||
pathName = pathName.replace(applicationPath, ""); //$NON-NLS-1$
|
||||
|
||||
// pathName = /components/mycomponent/mycomponent.xml
|
||||
|
||||
EmfComponent currentComp = new EmfComponent(pathName, bundleName, xmlMainFile.getParentFile().getName(),
|
||||
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.
|
||||
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.
|
||||
|
||||
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())
|
||||
&& !(ArrayUtils.contains(COMPONENTS_ALWAYS_NEEDED, currentComp.getName())
|
||||
|| currentComp.getOriginalFamilyName().contains("Technical") || currentComp.isTechnical())) {
|
||||
if (availableComponents != null && !ArrayUtils.contains(availableComponents, currentComp.getName())
|
||||
&& !(currentComp.getOriginalFamilyName().contains("Technical") || currentComp.isTechnical())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -720,10 +507,8 @@ 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())
|
||||
&& (ArrayUtils.contains(COMPONENTS_ALWAYS_NEEDED, currentComp.getName())
|
||||
|| currentComp.getOriginalFamilyName().contains("Technical") || currentComp.isTechnical())) {
|
||||
if (availableComponents != null && !ArrayUtils.contains(availableComponents, currentComp.getName())
|
||||
&& (currentComp.getOriginalFamilyName().contains("Technical") || currentComp.isTechnical())) {
|
||||
currentComp.setVisible(false);
|
||||
currentComp.setTechnical(true);
|
||||
}
|
||||
@@ -754,9 +539,13 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
}
|
||||
}
|
||||
|
||||
if (CommonsPlugin.isHeadless()) {
|
||||
componentsCache.put(xmlMainFile.getAbsolutePath(), currentComp);
|
||||
// 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>());
|
||||
}
|
||||
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) {
|
||||
@@ -971,25 +760,7 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
if (customComponentList == null) {
|
||||
init(false);
|
||||
}
|
||||
return customComponentList;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.core.model.components.IComponentsFactory#getComponentPath()
|
||||
*/
|
||||
@Override
|
||||
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;
|
||||
return new ArrayList<IComponent>(customComponentList);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1007,22 +778,16 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
|
||||
@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();
|
||||
}
|
||||
@@ -1060,152 +825,6 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
return translated;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.core.model.components.IComponentsFactory#getAllComponentsCanBeProvided()
|
||||
*/
|
||||
@Override
|
||||
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() {
|
||||
|
||||
@Override
|
||||
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() {
|
||||
|
||||
@Override
|
||||
public void error(final SAXParseException exception) throws SAXException {
|
||||
throw exception;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fatalError(final SAXParseException exception) throws SAXException {
|
||||
throw exception;
|
||||
}
|
||||
|
||||
@Override
|
||||
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)
|
||||
*
|
||||
|
||||
@@ -87,6 +87,7 @@ public class ComponentsPreferencePage extends FieldEditorPreferencePage implemen
|
||||
/**
|
||||
* @see org.eclipse.jface.preference.FieldEditor#refreshValidState()
|
||||
*/
|
||||
@Override
|
||||
protected void refreshValidState() {
|
||||
super.refreshValidState();
|
||||
}
|
||||
@@ -95,6 +96,7 @@ 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();
|
||||
@@ -122,6 +124,7 @@ public class ComponentsPreferencePage extends FieldEditorPreferencePage implemen
|
||||
addField(dbTypeField);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void propertyChange(PropertyChangeEvent event) {
|
||||
|
||||
if (event.getSource() == filePathTemp) {
|
||||
@@ -242,6 +245,7 @@ public class ComponentsPreferencePage extends FieldEditorPreferencePage implemen
|
||||
addField(doNotShowJobletAfterDoubleClickCheckBoxField);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createFieldEditors() {
|
||||
final Composite parent = getFieldEditorParent();
|
||||
filePathTemp = new DirectoryFieldEditor(IComponentPreferenceConstant.USER_COMPONENTS_FOLDER,
|
||||
@@ -253,10 +257,11 @@ 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()) {
|
||||
if (!file.exists() && !"".equals(newPath)) {
|
||||
// getPreferenceStore().setValue(IComponentPreferenceConstant.USER_COMPONENTS_FOLDER, "");
|
||||
filePathTemp.showErrorMessage();
|
||||
setValid(false);
|
||||
@@ -287,6 +292,7 @@ public class ComponentsPreferencePage extends FieldEditorPreferencePage implemen
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(IWorkbench workbench) {
|
||||
}
|
||||
|
||||
@@ -299,6 +305,7 @@ 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();
|
||||
@@ -308,6 +315,7 @@ public class ComponentsPreferencePage extends FieldEditorPreferencePage implemen
|
||||
if (display != null) {
|
||||
display.syncExec(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
IComponentsFactory components = ComponentsFactoryProvider.getInstance();
|
||||
|
||||
|
||||
@@ -19,6 +19,9 @@ 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/>
|
||||
@@ -72,7 +75,19 @@ public class CodeGeneratorProgressMonitor extends ProgressMonitorWrapper impleme
|
||||
* @see org.eclipse.core.runtime.IProgressMonitorWithBlocking#clearBlocked()
|
||||
*/
|
||||
public void clearBlocked() {
|
||||
Dialog.getBlockedHandler().clearBlocked();
|
||||
if (CommonUIPlugin.isFullyHeadless()) {
|
||||
return;
|
||||
}
|
||||
final Display disp = DisplayUtils.getDisplay();
|
||||
|
||||
disp.syncExec(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
Dialog.getBlockedHandler().clearBlocked();
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -140,8 +155,20 @@ public class CodeGeneratorProgressMonitor extends ProgressMonitorWrapper impleme
|
||||
*
|
||||
* @see org.eclipse.core.runtime.IProgressMonitorWithBlocking#setBlocked(org.eclipse.core.runtime.IStatus)
|
||||
*/
|
||||
public void setBlocked(IStatus reason) {
|
||||
Dialog.getBlockedHandler().showBlocked(this, reason, taskName);
|
||||
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);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -111,7 +111,7 @@ public class NodesTree {
|
||||
|
||||
for (INode node : nodes) {
|
||||
String componentName = node.getComponent().getName();
|
||||
if ((node.isStart()) && (node.isActivate()) && (!componentName.equals("tPrejob")) //$NON-NLS-1$
|
||||
if ((node.isStart()) && (node.isActivate()) && node.isDesignSubjobStartNode() && !node.isThereLinkWithHash() && (!componentName.equals("tPrejob")) //$NON-NLS-1$
|
||||
&& (!componentName.equals("tPostjob"))) { //$NON-NLS-1$
|
||||
rootNodes.add(node);
|
||||
}
|
||||
|
||||
@@ -182,21 +182,17 @@ 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() }));
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
||||
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));
|
||||
}
|
||||
javaProject = JavaCore.create(project);
|
||||
|
||||
progressMonitor.subTask(CodeGenPlugin.getPlugin().getString("_UI_JETInitializingProject_message", //$NON-NLS-1$
|
||||
|
||||
@@ -24,8 +24,11 @@ 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;
|
||||
@@ -37,14 +40,17 @@ 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;
|
||||
@@ -105,6 +111,8 @@ 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 {
|
||||
@@ -114,6 +122,7 @@ public final class CodeGeneratorEmittersPoolFactory {
|
||||
initializeStart = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
status = doRun();
|
||||
}
|
||||
@@ -125,17 +134,19 @@ public final class CodeGeneratorEmittersPoolFactory {
|
||||
TimeMeasure.measureActive = CommonsPlugin.isDebugMode();
|
||||
|
||||
TimeMeasure.begin("initialize Jet Emitters");
|
||||
ComponentsFactoryProvider.saveComponentVisibilityStatus();
|
||||
|
||||
jetFilesCompileFail.clear();
|
||||
|
||||
IProgressMonitor monitorWrap = null;
|
||||
if (!CommonsPlugin.isHeadless()) {
|
||||
boolean headless = CommonUIPlugin.isFullyHeadless();
|
||||
if (!headless) {
|
||||
monitorWrap = new CodeGeneratorProgressMonitor(delegateMonitor);
|
||||
} else {
|
||||
monitorWrap = new NullProgressMonitor();
|
||||
}
|
||||
}
|
||||
ECodeLanguage codeLanguage = LanguageManager.getCurrentLanguage();
|
||||
|
||||
initializeJetEmittersProject(monitorWrap);
|
||||
|
||||
CodeGeneratorInternalTemplatesFactory templatesFactory = CodeGeneratorInternalTemplatesFactoryProvider
|
||||
.getInstance();
|
||||
@@ -143,8 +154,6 @@ 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();
|
||||
@@ -174,11 +183,9 @@ 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);
|
||||
@@ -194,6 +201,7 @@ 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));
|
||||
@@ -245,6 +253,42 @@ 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));
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
@@ -462,6 +506,7 @@ 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$
|
||||
@@ -706,24 +751,28 @@ 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()) {
|
||||
@@ -733,22 +782,26 @@ 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,2 +1,3 @@
|
||||
Exchange=Training
|
||||
DownloadComponenentsAction.Label=\u4E0B\u8F7D\u9009\u62E9\u7684\u7EC4\u4EF6
|
||||
RefreshComponenentsAction.Label=\u5237\u65B0\u7EC4\u4EF6\u6E05\u5355
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
AvailableExtensionsComposite.ViewDetail.installOperateStatus=Instalar
|
||||
AvailableExtensionsComposite.ViewDetail.WriteReview=Escribir un comentario
|
||||
DownloadedExtensionsComposite.installOperateStatus=Instalar
|
||||
MyExtensionsComposite.ModifyOperateStatus=Modificar
|
||||
MyExtensionsComposite.DeleteOperateStatus=Borrar
|
||||
MyExtensionsComposite.Form.Description=Descripción
|
||||
|
||||
@@ -3,17 +3,19 @@ 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=Mettre à jour
|
||||
DownloadedExtensionsComposite.updateOperateStatus=UPDATE
|
||||
MyExtensionsComposite.Version=Version
|
||||
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
|
||||
|
||||
@@ -4,5 +4,6 @@ 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,13 +2,19 @@ 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
|
||||
|
||||
@@ -2,3 +2,4 @@ AvailableExtensionsComposite.Version=Versiyon
|
||||
MyExtensionsComposite.Version=Versiyon
|
||||
MyExtensionsComposite.DeleteOperateStatus=Sil
|
||||
MyExtensionsComposite.Form.Compatibility.Version=Versiyon
|
||||
MyExtensionsComposite.Form.Description=Aç\u0131klama
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
ExchangeView.Exchange=Training
|
||||
AvailableExtensionsComposite.ExtensionName=\u6269\u5C55\u540D
|
||||
AvailableExtensionsComposite.Version=\u7248\u672C
|
||||
AvailableExtensionsComposite.Author=\u4F5C\u8005
|
||||
@@ -11,6 +12,7 @@ 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
|
||||
|
||||
@@ -80,6 +80,24 @@
|
||||
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 + "'";
|
||||
@@ -116,6 +134,15 @@
|
||||
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,6 +162,14 @@ 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,7 +165,14 @@ 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");
|
||||
@@ -189,6 +196,7 @@ 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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
tokenMessage.put("description", description.replace(" ", "%20"));
|
||||
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);
|
||||
tokenMessage.put("description", description.replace(" ", "%20"));
|
||||
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-2012 Talend Inc. - www.talend.com
|
||||
// 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2012 Talend Inc. - www.talend.com
|
||||
// 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2012 Talend Inc. - www.talend.com
|
||||
// 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2012 Talend Inc. - www.talend.com
|
||||
// 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2012 Talend Inc. - www.talend.com
|
||||
// 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2012 Talend Inc. - www.talend.com
|
||||
// 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
|
||||
@@ -71,15 +71,15 @@ public class SAXLooper {
|
||||
}
|
||||
|
||||
private void judgeIsSimple() {
|
||||
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;
|
||||
isSimpleParse = isSimplePath(loopPath);
|
||||
|
||||
for(String path : nodePaths) {
|
||||
if(!isSimpleParse) {
|
||||
break;
|
||||
}
|
||||
isSimpleParse = isSimplePath(path);
|
||||
}
|
||||
|
||||
if (this.isSimpleParse) {
|
||||
looper = new SimpleSAXLooper(loopPath, nodePaths, asXMLs);
|
||||
} else {
|
||||
@@ -88,30 +88,61 @@ public class SAXLooper {
|
||||
}
|
||||
|
||||
private void judegeMultiIsSimple() {
|
||||
if (this.rootPath.indexOf("..") >= 0 || this.rootPath.indexOf("*") >= 0) {
|
||||
this.isSimpleParse = false;
|
||||
isSimpleParse = isSimplePath(rootPath);
|
||||
|
||||
for(String path : arrOrigLoopPath) {
|
||||
if(!isSimpleParse) {
|
||||
break;
|
||||
}
|
||||
isSimpleParse = isSimplePath(path);
|
||||
}
|
||||
for (int i = 0; isSimpleParse && i < arrOrigLoopPath.length; i++) {
|
||||
if (arrOrigLoopPath[i].indexOf("..") >= 0 || arrOrigLoopPath[i].indexOf("*") >= 0) {
|
||||
this.isSimpleParse = false;
|
||||
|
||||
for(String[] arrNodePath : arrNodePaths) {
|
||||
for(String path : arrNodePath) {
|
||||
if(!isSimpleParse) {
|
||||
break;
|
||||
}
|
||||
isSimpleParse = isSimplePath(path);
|
||||
}
|
||||
if(!isSimpleParse) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
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";
|
||||
|
||||
@@ -156,6 +187,17 @@ 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-2012 Talend Inc. - www.talend.com
|
||||
// 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
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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-2012 Talend Inc. - www.talend.com
|
||||
// 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
|
||||
|
||||
@@ -0,0 +1,179 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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>>>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,144 +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.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-2012 Talend Inc. - www.talend.com
|
||||
// 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2012 Talend Inc. - www.talend.com
|
||||
// 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
|
||||
@@ -17,6 +17,7 @@ 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;
|
||||
@@ -33,6 +34,10 @@ 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();
|
||||
@@ -40,6 +45,12 @@ public class SimpleSAXLoopHandler extends DefaultHandler2 {
|
||||
this.bufferCache = bcache;
|
||||
}
|
||||
|
||||
public SimpleSAXLoopHandler(XMLNodes nodes, DataBufferCache2 multiCache) {
|
||||
super();
|
||||
this.nodes = nodes;
|
||||
this.multiCache = multiCache;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
@@ -55,8 +66,11 @@ public class SimpleSAXLoopHandler extends DefaultHandler2 {
|
||||
* @see org.xml.sax.helpers.DefaultHandler#endDocument()
|
||||
*/
|
||||
public void endDocument() throws SAXException {
|
||||
// DataCache.getInstance().setReadEnd(true);
|
||||
bufferCache.setIsEnd();
|
||||
if(multiCache!=null) {
|
||||
multiCache.setIsEnd();
|
||||
} else {
|
||||
bufferCache.setIsEnd();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -110,6 +124,18 @@ 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("");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -170,14 +196,18 @@ 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() + "#");
|
||||
// ---------------------------------------------
|
||||
}
|
||||
bufferCache.writeData(map);
|
||||
// System.out.println();
|
||||
|
||||
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");
|
||||
}
|
||||
}
|
||||
nodes.resetAll();
|
||||
}
|
||||
@@ -222,5 +252,12 @@ public class SimpleSAXLoopHandler extends DefaultHandler2 {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* stop the read action asap
|
||||
*/
|
||||
public void stopRead() {
|
||||
stop = true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2012 Talend Inc. - www.talend.com
|
||||
// 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
|
||||
@@ -13,7 +13,9 @@
|
||||
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;
|
||||
@@ -21,6 +23,7 @@ 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;
|
||||
@@ -35,6 +38,8 @@ public class SimpleSAXLooper implements ISAXLooper,Callable {
|
||||
private XMLNodes nodes = new XMLNodes();
|
||||
|
||||
private DataBufferCache bcache;
|
||||
|
||||
private DataBufferCache2 multiCache;
|
||||
|
||||
private Thread task;
|
||||
|
||||
@@ -42,6 +47,16 @@ 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);
|
||||
@@ -52,7 +67,53 @@ 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;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -74,7 +135,10 @@ public class SimpleSAXLooper implements ISAXLooper,Callable {
|
||||
String resultCol = node.loopPath;
|
||||
String[] splits = column.split("/");
|
||||
for (String tmp : splits) {
|
||||
if (tmp.equals(".")) {
|
||||
if (tmp.equals("..")) {
|
||||
resultCol = resultCol.substring(0, resultCol.lastIndexOf("/"));
|
||||
node.setAttrOutOfLoop(true);
|
||||
} else if (tmp.equals(".")) {
|
||||
node.isDot = true;
|
||||
} else {
|
||||
resultCol += "/" + tmp;
|
||||
@@ -85,7 +149,30 @@ 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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -116,7 +203,19 @@ public class SimpleSAXLooper implements ISAXLooper,Callable {
|
||||
public Object call() throws Exception {
|
||||
Reader reader = null;
|
||||
try {
|
||||
DefaultHandler hd = new SimpleSAXLoopHandler(nodes, bcache);
|
||||
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;
|
||||
}
|
||||
|
||||
SAXParser saxParser = null;
|
||||
if(!ignoreDTD) { //orginal code
|
||||
saxParser = SAXParserFactory.newInstance().newSAXParser();
|
||||
@@ -125,16 +224,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", hd);
|
||||
saxParser.setProperty("http://xml.org/sax/properties/lexical-handler", handler);
|
||||
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, hd);
|
||||
saxParser.parse(inSource, handler);
|
||||
} else {
|
||||
reader = new UnicodeReader(is,this.charset);
|
||||
org.xml.sax.InputSource inSource = new org.xml.sax.InputSource(reader);
|
||||
saxParser.parse(inSource, hd);
|
||||
saxParser.parse(inSource, handler);
|
||||
}
|
||||
} finally {
|
||||
try {
|
||||
@@ -142,7 +241,13 @@ public class SimpleSAXLooper implements ISAXLooper,Callable {
|
||||
reader.close();
|
||||
}
|
||||
} finally {
|
||||
bcache.notifyErrorOccurred();
|
||||
if(multiCache!=null) {
|
||||
multiCache.notifyErrorOccurred();
|
||||
}
|
||||
if(bcache!=null) {
|
||||
bcache.notifyErrorOccurred();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return null;
|
||||
@@ -202,8 +307,7 @@ public class SimpleSAXLooper implements ISAXLooper,Callable {
|
||||
* @see org.talend.xml.sax.commons.ISAXLooper#multiIterator()
|
||||
*/
|
||||
public Iterator<Map<String, Map<String, String>>> multiIterator() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
return new SimpleSAXMultiLoopIterator(multiCache);
|
||||
}
|
||||
|
||||
public void setIgnoreDTD(boolean ignoreDTD) {
|
||||
@@ -212,4 +316,10 @@ public class SimpleSAXLooper implements ISAXLooper,Callable {
|
||||
|
||||
}
|
||||
|
||||
public void stopRead() {
|
||||
if(hd != null) {
|
||||
hd.stopRead();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
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-2012 Talend Inc. - www.talend.com
|
||||
// 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
|
||||
@@ -23,6 +23,8 @@ public class XMLNode {
|
||||
|
||||
public boolean outputText = false;
|
||||
|
||||
public String originLoopPath;
|
||||
|
||||
public String loopPath;
|
||||
|
||||
public String nodePath;
|
||||
@@ -32,6 +34,14 @@ 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;
|
||||
@@ -51,8 +61,18 @@ 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) {
|
||||
@@ -61,11 +81,19 @@ 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-2012 Talend Inc. - www.talend.com
|
||||
// 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
|
||||
@@ -24,7 +24,9 @@ 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);
|
||||
@@ -72,4 +74,22 @@ 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-2012 Talend Inc. - www.talend.com
|
||||
// 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
|
||||
@@ -142,22 +142,17 @@ public class FileCopy {
|
||||
if (position + MAP_SIZE >= size) {
|
||||
buf = in.map(FileChannel.MapMode.READ_ONLY, position, size - position);
|
||||
out.write(buf);
|
||||
if (delSrc) {
|
||||
// here must clean first, or it can't delete
|
||||
clean(buf);
|
||||
}
|
||||
//For But TDI-26493, 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);
|
||||
if (delSrc) {
|
||||
// here must clean first, or it can't delete
|
||||
clean(buf);
|
||||
}
|
||||
// here must clean first, or it can't delete
|
||||
clean(buf);
|
||||
position += MAP_SIZE;
|
||||
}
|
||||
}
|
||||
|
||||
in.close();
|
||||
out.close();
|
||||
|
||||
|
||||
@@ -22,10 +22,8 @@ import javax.xml.soap.SOAPHeader;
|
||||
import javax.xml.soap.SOAPMessage;
|
||||
import javax.xml.soap.SOAPPart;
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerConfigurationException;
|
||||
import javax.xml.transform.TransformerException;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
import javax.xml.transform.dom.DOMSource;
|
||||
import javax.xml.transform.stream.StreamResult;
|
||||
import javax.xml.transform.stream.StreamSource;
|
||||
|
||||
@@ -33,6 +31,7 @@ import org.jdom.input.DOMBuilder;
|
||||
import org.jdom.output.XMLOutputter;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.Node;
|
||||
|
||||
public class SOAPUtil {
|
||||
|
||||
@@ -170,15 +169,15 @@ public class SOAPUtil {
|
||||
DocumentBuilder builder = factory.newDocumentBuilder();
|
||||
document = builder.newDocument();
|
||||
|
||||
Element element;
|
||||
Node content;
|
||||
Element headerRootElem = document.createElement("Header");
|
||||
|
||||
Iterator childElements = header.getChildElements();
|
||||
org.w3c.dom.Node domNode = null;
|
||||
while (childElements.hasNext()) {
|
||||
domNode = (org.w3c.dom.Node) childElements.next();
|
||||
element = (Element) document.importNode(domNode, true);
|
||||
headerRootElem.appendChild(element);
|
||||
content = (Node) document.importNode(domNode, true);
|
||||
headerRootElem.appendChild(content);
|
||||
}
|
||||
document.appendChild(headerRootElem);
|
||||
return document;
|
||||
|
||||
@@ -88,6 +88,7 @@ public class Client {
|
||||
public Client(String endpoint, String secretKey, String clientAccessID) throws ServiceException, MalformedURLException {
|
||||
// 1. change the endpoint.
|
||||
MktMktowsApiService service = new MktMktowsApiServiceLocator();
|
||||
((MktMktowsApiServiceLocator)service).setMktowsApiSoapPortEndpointAddress(endpoint);
|
||||
URL portAddress = new URL(endpoint);
|
||||
stub = service.getMktowsApiSoapPort(portAddress);
|
||||
// 2.assign secretKey and clientAccessID
|
||||
|
||||
@@ -18,6 +18,7 @@ import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.poi.ss.usermodel.WorkbookFactory;
|
||||
import org.apache.poi.xssf.streaming.SXSSFSheet;
|
||||
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
|
||||
import org.apache.poi.ss.usermodel.FormulaEvaluator;
|
||||
|
||||
public class ExcelTool {
|
||||
|
||||
@@ -220,7 +221,7 @@ public class ExcelTool {
|
||||
}
|
||||
|
||||
private CellStyle getPreCellStyle() {
|
||||
if (isAbsY && keepCellFormat) {
|
||||
if (preSheet!=null && isAbsY && keepCellFormat) {
|
||||
CellStyle preCellStyle =null;
|
||||
if (preCell == null) {
|
||||
preCellStyle = preSheet.getColumnStyle(curCell.getColumnIndex());
|
||||
@@ -258,6 +259,11 @@ public class ExcelTool {
|
||||
curCell.setCellValue(stringValue);
|
||||
curCell.setCellStyle(getNormalCellStyle());
|
||||
}
|
||||
|
||||
public void addCellNullValue() {
|
||||
addCell();
|
||||
curCell.setCellStyle(getNormalCellStyle());
|
||||
}
|
||||
|
||||
public void setColAutoSize(int colNum) {
|
||||
sheet.autoSizeColumn(startX + colNum, true);
|
||||
@@ -280,10 +286,27 @@ public class ExcelTool {
|
||||
}
|
||||
}
|
||||
FileOutputStream fileOutput = new FileOutputStream(fileName);
|
||||
if(appendWorkbook && appendSheet){
|
||||
evaluateFormulaCell();
|
||||
}
|
||||
wb.write(fileOutput);
|
||||
fileOutput.close();
|
||||
}
|
||||
|
||||
public void evaluateFormulaCell(){
|
||||
FormulaEvaluator evaluator = wb.getCreationHelper().createFormulaEvaluator();
|
||||
for(int sheetNum = 0; sheetNum < wb.getNumberOfSheets(); sheetNum++) {
|
||||
sheet = wb.getSheetAt(sheetNum);
|
||||
for(Row r : sheet) {
|
||||
for(Cell c : r) {
|
||||
if(c.getCellType() == Cell.CELL_TYPE_FORMULA) {
|
||||
evaluator.evaluateFormulaCell(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void flushRowInMemory() throws Exception{
|
||||
if (wb instanceof SXSSFWorkbook) {
|
||||
((SXSSFSheet) sheet).flushRows();
|
||||
|
||||
@@ -88,6 +88,9 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
Manager manager = null;
|
||||
if(columnList != null && columnList.size() > 0) {
|
||||
stmtStructure = getManager(dbmsId, cid).createColumnList(columnList, false, null, null);
|
||||
}
|
||||
if((columnList != null && columnList.size() > 0) || "CLEAR".equals(tableAction)){
|
||||
|
||||
%>
|
||||
<%@ include file="../templates/_tableActionForBulk.javajet"%>
|
||||
<%
|
||||
|
||||
@@ -68,7 +68,11 @@
|
||||
</ITEMS>
|
||||
</PARAMETER>
|
||||
|
||||
|
||||
<PARAMETER NAME="TYPE" FIELD="TEXT" NUM_ROW="20" SHOW="false"
|
||||
REPOSITORY_VALUE="TYPE">
|
||||
<DEFAULT>Access</DEFAULT>
|
||||
</PARAMETER>
|
||||
|
||||
<PARAMETER
|
||||
NAME="DBNAME"
|
||||
FIELD="FILE"
|
||||
|
||||
@@ -66,7 +66,11 @@
|
||||
<ITEM NAME="Access_2007" VALUE="Access_2007" />
|
||||
</ITEMS>
|
||||
</PARAMETER>
|
||||
|
||||
|
||||
<PARAMETER NAME="TYPE" FIELD="TEXT" NUM_ROW="20" SHOW="false"
|
||||
REPOSITORY_VALUE="TYPE">
|
||||
<DEFAULT>Access</DEFAULT>
|
||||
</PARAMETER>
|
||||
|
||||
<PARAMETER
|
||||
NAME="DBNAME"
|
||||
@@ -230,6 +234,7 @@
|
||||
|
||||
<TEMPLATE_PARAM SOURCE="self.DB_VERSION" TARGET="tABE.DB_VERSION" />
|
||||
<TEMPLATE_PARAM SOURCE="self.DBNAME" TARGET="tABE.DBNAME" />
|
||||
<TEMPLATE_PARAM SOURCE="self.TYPE" TARGET="tABE.TYPE" />
|
||||
<TEMPLATE_PARAM SOURCE="self.USER" TARGET="tABE.USER" />
|
||||
<TEMPLATE_PARAM SOURCE="self.PASS" TARGET="tABE.PASS" />
|
||||
<TEMPLATE_PARAM SOURCE="self.TABLE_ACTION" TARGET="tABE.TABLE_ACTION" />
|
||||
|
||||
@@ -44,7 +44,11 @@
|
||||
</ITEMS>
|
||||
</PARAMETER>
|
||||
|
||||
|
||||
<PARAMETER NAME="TYPE" FIELD="TEXT" NUM_ROW="20" SHOW="false"
|
||||
REPOSITORY_VALUE="TYPE">
|
||||
<DEFAULT>Access</DEFAULT>
|
||||
</PARAMETER>
|
||||
|
||||
<PARAMETER NAME="DBNAME" FIELD="FILE" NUM_ROW="20"
|
||||
REQUIRED="true" REPOSITORY_VALUE="FILE" SHOW_IF="USE_EXISTING_CONNECTION == 'false'">
|
||||
<DEFAULT>"__COMP_DEFAULT_FILE_DIR__/in.mdb"</DEFAULT>
|
||||
|
||||
@@ -149,7 +149,6 @@ String cid = node.getUniqueName();
|
||||
String cid_original = cid;
|
||||
cid = cid_original.replace("tAdvancedFileOutputXML","tAFOX");
|
||||
|
||||
String filename = ElementParameterParser.getValue(node, "__FILENAME__");
|
||||
boolean isDeleteEmptyFile = ("true").equals(ElementParameterParser.getValue(node, "__DELETE_EMPTYFILE__"));
|
||||
boolean isCompact = ("true").equals(ElementParameterParser.getValue(node, "__PRETTY_COMPACT__"));
|
||||
|
||||
@@ -331,6 +330,6 @@ globalMap.put("<%=cid_original %>_NB_LINE",nb_line_<%=cid %>);
|
||||
|
||||
<%if(!useStream && isDeleteEmptyFile){%>
|
||||
if((nb_line_<%=cid %> == 0) && !alreadyExistsFile_<%=cid%>){
|
||||
new java.io.File(<%=filename %>).delete();
|
||||
createFile<%=cid%>.delete();
|
||||
}
|
||||
<%}%>
|
||||
|
||||
Binary file not shown.
@@ -23,6 +23,7 @@ if ((metadatas!=null)&&(metadatas.size()>0)) {
|
||||
|
||||
%>
|
||||
fr.openwide.talendalfresco.acpxml.TalendAcpXmlWriter talendAcpXmlWriter_<%=cid%> = new fr.openwide.talendalfresco.acpxml.TalendAcpXmlWriter();
|
||||
boolean whetherReject_<%=cid%> = false;
|
||||
<%
|
||||
|
||||
// getting useful parameters
|
||||
@@ -32,11 +33,6 @@ if ((metadatas!=null)&&(metadatas.size()>0)) {
|
||||
|
||||
String restEncodingString = ElementParameterParser.getValue(node, "__REST_ENCODING__");
|
||||
|
||||
String targetLocationBase = ElementParameterParser.getValue(node, "__TARGET_LOCATION_BASE__");
|
||||
boolean mapTargetLocationFromColumn = Boolean.valueOf(ElementParameterParser.getValue(node, "__MAP_TARGET_LOCATION_FROM_COLUMN__"));
|
||||
String targetLocationColumn = ElementParameterParser.getValue(node, "__TARGET_LOCATION_COLUMN__");
|
||||
String documentMode = ElementParameterParser.getValue(node, "__DOCUMENT_MODE__");
|
||||
String containerMode = ElementParameterParser.getValue(node, "__CONTAINER_MODE__");
|
||||
|
||||
List<Map<String, String>> alfrescoNamespaces = (List<Map<String, String>>) ElementParameterParser.getObjectValue(node, "__AVAILABLE_ALFRESCO_NAMESPACES__");
|
||||
String alfrescoType = ElementParameterParser.getValue(node, "__ALFRESCO_TYPE_NAME__");
|
||||
@@ -50,7 +46,6 @@ if ((metadatas!=null)&&(metadatas.size()>0)) {
|
||||
String permissionsTarget = ElementParameterParser.getValue(node, "__PERMISSIONS_TARGET__");
|
||||
boolean permissionOnDocumentAndNotContainer = "Document".equals(permissionsTarget);
|
||||
boolean inheritPermissions = Boolean.valueOf(ElementParameterParser.getValue(node, "__INHERIT_PERMISSIONS__"));
|
||||
List<Map<String, String>> permissionMappings = (List<Map<String,String>>)ElementParameterParser.getObjectValue(node, "__PERMISSIONS__");
|
||||
|
||||
%>
|
||||
talendAcpXmlWriter_<%=cid%>.setRestEncoding(<%=restEncodingString%>);
|
||||
|
||||
@@ -28,12 +28,23 @@ if ((metadatas!=null)&&(metadatas.size()>0)) {
|
||||
String containerMode = ElementParameterParser.getValue(node, "__CONTAINER_MODE__");
|
||||
|
||||
String resultLogFilenameString = ElementParameterParser.getValue(node, "__RESULT_LOG_FILENAME__");
|
||||
String dieOnError = ElementParameterParser.getValue(node, "__DIE_ON_ERROR__");
|
||||
%>
|
||||
|
||||
try {
|
||||
talendAcpXmlWriter_<%=cid%>.close();
|
||||
} catch (fr.openwide.talendalfresco.acpxml.AcpXmlException e) {
|
||||
<%
|
||||
if (("true").equals(dieOnError)) {
|
||||
%>
|
||||
throw new fr.openwide.talendalfresco.rest.client.RestClientException("Error creating XML result", e);
|
||||
<%
|
||||
} else {
|
||||
%>
|
||||
System.err.println("Error creating XML result.");
|
||||
<%
|
||||
}
|
||||
%>
|
||||
}
|
||||
|
||||
String content_<%=cid%> = talendAcpXmlWriter_<%=cid%>.toString();
|
||||
@@ -44,13 +55,37 @@ if ((metadatas!=null)&&(metadatas.size()>0)) {
|
||||
importCmd_<%=cid%>.setContainerMode("<%=containerMode%>");
|
||||
|
||||
// Execute the command.
|
||||
alfrescoRestClient_<%=cid%>.execute(importCmd_<%=cid%>);
|
||||
try {
|
||||
alfrescoRestClient_<%=cid%>.execute(importCmd_<%=cid%>);
|
||||
} catch (fr.openwide.talendalfresco.rest.client.RestClientException e_<%=cid%>) {
|
||||
<%
|
||||
if (("true").equals(dieOnError)) {
|
||||
%>
|
||||
throw new fr.openwide.talendalfresco.rest.client.RestClientException("Error execute import command", e_<%=cid%>);
|
||||
<%
|
||||
} else {
|
||||
%>
|
||||
System.err.println("Error execute import command.");
|
||||
<%
|
||||
}
|
||||
%>
|
||||
}
|
||||
|
||||
// logout
|
||||
try {
|
||||
alfrescoRestClient_<%=cid%>.logout();
|
||||
} catch (fr.openwide.talendalfresco.rest.client.RestClientException e) {
|
||||
<%
|
||||
if (("true").equals(dieOnError)) {
|
||||
%>
|
||||
throw new fr.openwide.talendalfresco.rest.client.RestClientException("Error initing client", e);
|
||||
<%
|
||||
} else {
|
||||
%>
|
||||
System.err.println("Error initing client.");
|
||||
<%
|
||||
}
|
||||
%>
|
||||
}
|
||||
|
||||
// setting global var NB_LINE for further components
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<COMPONENT>
|
||||
<HEADER PLATEFORM="ALL" SERIAL="" VERSION="1.0" STATUS="ALPHA"
|
||||
COMPATIBILITY="ALL" AUTHOR="Open Wide" RELEASE_DATE="20081006A"
|
||||
STARTABLE="false" EXTENSION="org.talend.designer.alfrescooutput">
|
||||
STARTABLE="false" DATA_AUTO_PROPAGATE="false" HAS_CONDITIONAL_OUTPUTS="true" EXTENSION="org.talend.designer.alfrescooutput">
|
||||
<SIGNATURE></SIGNATURE>
|
||||
</HEADER>
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
|
||||
<CONNECTORS>
|
||||
<CONNECTOR CTYPE="FLOW" MAX_INPUT="1" MAX_OUTPUT="1"/>
|
||||
<CONNECTOR NAME="REJECT" CTYPE="FLOW" MAX_INPUT="0" MAX_OUTPUT="1"
|
||||
LINE_STYLE="2" COLOR="FF0000" BASE_SCHEMA="FLOW" />
|
||||
<CONNECTOR NAME="REJECT" NOT_SHOW_IF="(DIE_ON_ERROR == 'true')" CTYPE="FLOW" MAX_INPUT="0" MAX_OUTPUT="1"
|
||||
LINE_STYLE="2" COLOR="FF0000" BASE_SCHEMA="FLOW" />
|
||||
<CONNECTOR CTYPE="ITERATE" MAX_OUTPUT="0" MAX_INPUT="0" />
|
||||
<CONNECTOR CTYPE="SUBJOB_OK" MAX_INPUT="1" />
|
||||
<CONNECTOR CTYPE="SUBJOB_ERROR" MAX_INPUT="1" />
|
||||
@@ -135,6 +135,15 @@
|
||||
REQUIRED="true">
|
||||
<DEFAULT>"__COMP_DEFAULT_FILE_DIR__/out.xml"</DEFAULT>
|
||||
</PARAMETER>
|
||||
|
||||
<PARAMETER
|
||||
NAME="DIE_ON_ERROR"
|
||||
FIELD="CHECK"
|
||||
NUM_ROW="90"
|
||||
>
|
||||
<DEFAULT>false</DEFAULT>
|
||||
</PARAMETER>
|
||||
|
||||
</PARAMETERS>
|
||||
|
||||
<ADVANCED_PARAMETERS>
|
||||
|
||||
@@ -5,6 +5,7 @@ imports="
|
||||
org.talend.core.model.metadata.IMetadataColumn
|
||||
org.talend.designer.codegen.config.CodeGeneratorArgument
|
||||
org.talend.core.model.process.ElementParameterParser
|
||||
org.talend.core.model.process.IConnectionCategory
|
||||
java.util.List
|
||||
java.util.Map
|
||||
org.talend.core.model.process.IConnection
|
||||
@@ -37,6 +38,7 @@ imports="
|
||||
inConn = inConns.get(0);
|
||||
inConnName = inConn.getName();
|
||||
}
|
||||
List<? extends IConnection> outgoingConns = node.getOutgoingSortedConnections();
|
||||
|
||||
// getting reject connection columnList and name
|
||||
IConnection rejectConn = null;
|
||||
@@ -64,9 +66,17 @@ imports="
|
||||
|
||||
List<Map<String, String>> propertyMappings = (List<Map<String,String>>)ElementParameterParser.getObjectValue(node, "__PROPERTY_MAPPING__");
|
||||
List<Map<String, String>> associationMappings = (List<Map<String,String>>)ElementParameterParser.getObjectValue(node, "__ASSOCIATION_MAPPING__");
|
||||
|
||||
%>
|
||||
String dieOnError = ElementParameterParser.getValue(node, "__DIE_ON_ERROR__");
|
||||
for(IConnection conn : outgoingConns) {
|
||||
if (conn.getLineStyle().hasConnectionCategory(IConnectionCategory.DATA)) {
|
||||
%>
|
||||
<%=conn.getName() %> = null;
|
||||
<%
|
||||
}
|
||||
}
|
||||
%>
|
||||
|
||||
whetherReject_<%=cid%> = false;
|
||||
try { // start reject exception handling
|
||||
|
||||
// writing document
|
||||
@@ -171,8 +181,15 @@ imports="
|
||||
nbLine_<%=cid%>++;
|
||||
|
||||
} catch (java.lang.Exception mainEx_<%=cid%>) { // end reject exception handling
|
||||
|
||||
<%
|
||||
<%
|
||||
if (("true").equals(dieOnError)) {
|
||||
%>
|
||||
throw(mainEx_<%=cid%>);
|
||||
<%
|
||||
} else {
|
||||
%>
|
||||
whetherReject_<%=cid%> = true;
|
||||
<%
|
||||
// handling exception as reject connection or std err
|
||||
if(rejectConnName != null && rejectColumns != null && rejectColumns.size() > 0) {
|
||||
%>
|
||||
@@ -194,9 +211,32 @@ imports="
|
||||
System.err.println(mainEx_<%=cid%>.getMessage());
|
||||
<%
|
||||
}
|
||||
}
|
||||
%>
|
||||
|
||||
}
|
||||
<%
|
||||
if(outgoingConns != null && outgoingConns.size() > 0) {
|
||||
%>
|
||||
if(!whetherReject_<%=cid%>) {
|
||||
<%
|
||||
for(IConnection outgoingConn : outgoingConns) {
|
||||
if(rejectConnName == null || (rejectConnName != null && !outgoingConn.getName().equals(rejectConnName))) {
|
||||
if(outgoingConn.getLineStyle().hasConnectionCategory(IConnectionCategory.DATA)) {
|
||||
%>
|
||||
<%=outgoingConn.getName()%> = new <%=outgoingConn.getName()%>Struct();
|
||||
<%
|
||||
for(IMetadataColumn column : columns) {
|
||||
%>
|
||||
<%=outgoingConn.getName()%>.<%=column.getLabel()%> = <%=inConnName%>.<%=column.getLabel()%>;
|
||||
<%
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
%>
|
||||
}
|
||||
<%
|
||||
}
|
||||
}
|
||||
%>
|
||||
@@ -4,6 +4,7 @@ LONG_NAME=Creates documents within an Alfresco server using metadata and content
|
||||
HELP=org.talend.help.tAlfrescoOutput
|
||||
REJECT.LINK=Reject
|
||||
REJECT.MENU=Reject
|
||||
DIE_ON_ERROR.NAME=Die on error
|
||||
ALFRESCO_SERVER_GROUP.NAME=Alfresco Server
|
||||
ALFRESCO_SERVER_URL.NAME=URL
|
||||
ALFRESCO_USER_LOGIN.NAME=Login
|
||||
|
||||
@@ -168,7 +168,7 @@
|
||||
<IMPORTS>
|
||||
<IMPORT NAME="Driver-Oracle11g-1" MODULE="ojdbc5.jar" REQUIRED_IF="(DB_VERSION == 'ORACLE_11') AND (USE_EXISTING_CONNECTION == 'false')" />
|
||||
<IMPORT NAME="Driver-Oracle-XDB" MODULE="xdb.jar" REQUIRED_IF="SCHEMA.DB_TYPE IN ['XMLTYPE']" />
|
||||
<IMPORT NAME="Driver-Oracle-XMLPARSERV2" MODULE="xmlparserv2.jar" REQUIRED_IF="SCHEMA.DB_TYPE IN ['XMLTYPE']" />
|
||||
<IMPORT NAME="Driver-Oracle-XMLPARSERV2" BundleID="" MODULE="xmlparserv2.jar" REQUIRED_IF="SCHEMA.DB_TYPE IN ['XMLTYPE']" />
|
||||
<IMPORT NAME="Driver-Ojdbc6" MODULE="ojdbc6.jar" REQUIRED_IF="(DB_VERSION == 'ORACLE_11-6') AND (USE_EXISTING_CONNECTION == 'false')" />
|
||||
</IMPORTS>
|
||||
</CODEGENERATION>
|
||||
|
||||
@@ -435,7 +435,7 @@
|
||||
<CODEGENERATION>
|
||||
<IMPORTS>
|
||||
<IMPORT NAME="Driver-Oracle-XDB" MODULE="xdb.jar" REQUIRED_IF="SCHEMA.DB_TYPE IN ['XMLTYPE']" />
|
||||
<IMPORT NAME="Driver-Oracle-XMLPARSERV2" MODULE="xmlparserv2.jar" REQUIRED_IF="SCHEMA.DB_TYPE IN ['XMLTYPE']" />
|
||||
<IMPORT NAME="Driver-Oracle-XMLPARSERV2" BundleID="" MODULE="xmlparserv2.jar" REQUIRED_IF="SCHEMA.DB_TYPE IN ['XMLTYPE']" />
|
||||
<IMPORT NAME="Driver-Ojdbc6" MODULE="ojdbc6.jar" REQUIRED_IF="(DB_VERSION == 'ORACLE_11-6') AND (USE_EXISTING_CONNECTION == 'false')" />
|
||||
<IMPORT NAME="Driver-Ojdbc5" MODULE="ojdbc5.jar" REQUIRED_IF="(DB_VERSION == 'ORACLE_11') AND (USE_EXISTING_CONNECTION == 'false')" />
|
||||
</IMPORTS>
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
<CONNECTORS>
|
||||
<CONNECTOR CTYPE="FLOW" MAX_INPUT="1" MIN_INPUT="1" MAX_OUTPUT="1"/>
|
||||
<CONNECTOR NAME="REJECT" CTYPE="FLOW" MAX_INPUT="0"
|
||||
<CONNECTOR NAME="REJECT" NOT_SHOW_IF="(DIEONERROR == 'true')" CTYPE="FLOW" MAX_INPUT="0"
|
||||
MAX_OUTPUT="1" LINE_STYLE="2" COLOR="FF0000" BASE_SCHEMA="FLOW" />
|
||||
<CONNECTOR CTYPE="ITERATE" MAX_OUTPUT="0" MAX_INPUT="0"/>
|
||||
<CONNECTOR CTYPE="SUBJOB_OK" MAX_INPUT="1" />
|
||||
|
||||
@@ -351,6 +351,7 @@ class AccessManager extends Manager {
|
||||
class DB2Manager extends Manager {
|
||||
private String host;
|
||||
private String port;
|
||||
private String userName;
|
||||
private String dbSchema;
|
||||
private boolean useExistingConnection;
|
||||
private String connection;
|
||||
@@ -359,6 +360,7 @@ class DB2Manager extends Manager {
|
||||
this.host = host;
|
||||
this.port = port;
|
||||
this.dbSchema = dbSchema;
|
||||
this.userName = userName;
|
||||
this.useExistingConnection = useExistingConnection;
|
||||
this.connection = connection;
|
||||
}
|
||||
@@ -402,8 +404,10 @@ class DB2Manager extends Manager {
|
||||
javaCode.append(super.retrieveTable());
|
||||
if(useExistingConnection) {
|
||||
javaCode.append("String dbSchema_" + cid + " = (String)globalMap.get(\"tableschema_" + connection + "\");\r\n");
|
||||
javaCode.append("String dbUser_" + cid + " = (String)globalMap.get(\"username_" + connection + "\");\r\n");
|
||||
} else {
|
||||
javaCode.append("String dbSchema_" + cid + " = " + dbSchema + ";\r\n");
|
||||
javaCode.append("String dbUser_" + cid + " = " + userName + ";\r\n");
|
||||
}
|
||||
javaCode.append("if(dbSchema_" + cid + " != null && dbSchema_" + cid + ".trim().length() != 0) {");
|
||||
javaCode.append("tableName_" + cid + " = dbSchema_" + cid + " + \"" + getLProtectedChar() + "." + getRProtectedChar() + "\" + tableName_" + cid + ";\r\n");
|
||||
@@ -1957,6 +1961,48 @@ if(columnList != null && columnList.size() > 0) {
|
||||
whetherExist_<%=cid%> = true;
|
||||
}
|
||||
<%
|
||||
} else if("DB2".equalsIgnoreCase(dbType) ){
|
||||
%>
|
||||
java.sql.DatabaseMetaData dbMetaData_<%=cid%> = conn_<%=cid%>.getMetaData();
|
||||
java.sql.ResultSet rsTable_<%=cid%> = dbMetaData_<%=cid%>.getTables(null, null, null, new String[]{"TABLE"});
|
||||
boolean whetherExist_<%=cid%> = false;
|
||||
while(rsTable_<%=cid%>.next()) {
|
||||
String table_<%=cid%> = rsTable_<%=cid%>.getString("TABLE_NAME");
|
||||
String schema_<%=cid%> = rsTable_<%=cid%>.getString("TABLE_SCHEM");
|
||||
if(table_<%=cid%>.equals<%if(!tableNameCaseSensitive){%>IgnoreCase<%}%>(<%=tableName%>)
|
||||
&& (schema_<%=cid%>.equals<%if(!tableNameCaseSensitive){%>IgnoreCase<%}%>(dbSchema_<%=cid%>) || (dbSchema_<%=cid%>.trim().length() ==0 && dbUser_<%=cid%>.equalsIgnoreCase(schema_<%=cid%>)))) {
|
||||
whetherExist_<%=cid%> = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
rsTable_<%=cid%>.close();
|
||||
<%
|
||||
} else if ("GREENPLUM".equalsIgnoreCase(dbType) || "POSTGRE".equalsIgnoreCase(dbType) || "POSTGREPLUS".equalsIgnoreCase(dbType)) {
|
||||
%>
|
||||
java.sql.DatabaseMetaData dbMetaData_<%=cid%> = conn_<%=cid%>.getMetaData();
|
||||
java.sql.ResultSet rsTable_<%=cid%> = dbMetaData_<%=cid%>.getTables(null, null, null, new String[]{"TABLE"});
|
||||
boolean whetherExist_<%=cid%> = false;
|
||||
String defaultSchema_<%=cid%> = "public";
|
||||
if(dbSchema_<%=cid%> == null || dbSchema_<%=cid%>.trim().length() == 0) {
|
||||
java.sql.Statement stmtSchema_<%=cid%> = conn_<%=cid%>.createStatement();
|
||||
java.sql.ResultSet rsSchema_<%=cid%> = stmtSchema_<%=cid%>.executeQuery("select current_schema() ");
|
||||
while(rsSchema_<%=cid%>.next()){
|
||||
defaultSchema_<%=cid%> = rsSchema_<%=cid%>.getString("current_schema");
|
||||
}
|
||||
rsSchema_<%=cid%>.close();
|
||||
stmtSchema_<%=cid%>.close();
|
||||
}
|
||||
while(rsTable_<%=cid%>.next()) {
|
||||
String table_<%=cid%> = rsTable_<%=cid%>.getString("TABLE_NAME");
|
||||
String schema_<%=cid%> = rsTable_<%=cid%>.getString("TABLE_SCHEM");
|
||||
if(table_<%=cid%>.equals<%if(!tableNameCaseSensitive){%>IgnoreCase<%}%>(<%=tableName%>)
|
||||
&& (schema_<%=cid%>.equals<%if(!tableNameCaseSensitive){%>IgnoreCase<%}%>(dbSchema_<%=cid%>) || ((dbSchema_<%=cid%> ==null || dbSchema_<%=cid%>.trim().length() ==0) && defaultSchema_<%=cid%>.equals<%if(!tableNameCaseSensitive){%>IgnoreCase<%}%>(schema_<%=cid%>)))) {
|
||||
whetherExist_<%=cid%> = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
rsTable_<%=cid%>.close();
|
||||
<%
|
||||
} else {
|
||||
%>
|
||||
java.sql.DatabaseMetaData dbMetaData_<%=cid%> = conn_<%=cid%>.getMetaData();
|
||||
|
||||
@@ -46,10 +46,12 @@ Manager manager = null;
|
||||
if(useExistingConnection) {
|
||||
String connection = ElementParameterParser.getValue(node,"__CONNECTION__");
|
||||
String conn = "conn_" + connection;
|
||||
String schema = "tableschema_" + connection;
|
||||
String schema = "tableschema_" + connection;
|
||||
String username = "username_" + connection;
|
||||
%>
|
||||
java.sql.Connection conn_<%=cid%> = (java.sql.Connection)globalMap.get("<%=conn%>");
|
||||
String schema_<%=cid%> = (String)globalMap.get("<%=schema %>");
|
||||
String dbUser_<%=cid %> = (String)globalMap.get("<%=username%>");
|
||||
<%
|
||||
} else {
|
||||
%>
|
||||
@@ -74,6 +76,9 @@ Manager manager = null;
|
||||
<%
|
||||
if(columnList != null && columnList.size() > 0) {
|
||||
stmtStructure = getManager(dbmsId, cid).createColumnList(columnList, false, null, null);
|
||||
}
|
||||
if((columnList != null && columnList.size() > 0) || "CLEAR".equals(tableAction) || "NONE".equals(tableAction)){
|
||||
|
||||
%>
|
||||
|
||||
<%
|
||||
|
||||
@@ -15,7 +15,6 @@ imports="
|
||||
|
||||
if(!("true").equals(useExistingConn)) {
|
||||
%>
|
||||
conn_<%=cid%>.commit();
|
||||
conn_<%=cid%>.close();
|
||||
<%
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@
|
||||
|
||||
<PARAMETER
|
||||
NAME="TABLE"
|
||||
FIELD="TEXT"
|
||||
FIELD="DBTABLE"
|
||||
NUM_ROW="30"
|
||||
REQUIRED="true"
|
||||
>
|
||||
@@ -144,7 +144,7 @@
|
||||
<PARAMETER
|
||||
NAME="TABLE_ACTION"
|
||||
FIELD="CLOSED_LIST"
|
||||
NUM_ROW="30"
|
||||
NUM_ROW="31"
|
||||
NOT_SHOW_IF="PARALLELIZE == 'true'"
|
||||
>
|
||||
<ITEMS DEFAULT="NONE">
|
||||
@@ -157,7 +157,7 @@
|
||||
</ITEMS>
|
||||
</PARAMETER>
|
||||
|
||||
<PARAMETER NAME="NOTE" FIELD="LABEL" NUM_ROW="30"
|
||||
<PARAMETER NAME="NOTE" FIELD="LABEL" NUM_ROW="31"
|
||||
NOT_SHOW_IF="(TABLE_ACTION == 'NONE') OR (USE_EXISTING_CONNECTION == 'false')"
|
||||
>
|
||||
<DEFAULT>Warning : this component configuration will automatically generate a commit before bulk insert</DEFAULT>
|
||||
|
||||
@@ -117,9 +117,11 @@ if(("true").equals(useExistingConn)) {
|
||||
String connection = ElementParameterParser.getValue(node,"__CONNECTION__");
|
||||
String conn = "conn_" + connection;
|
||||
String tableschema = "tableschema_" + connection;
|
||||
String username = "username_" + connection;
|
||||
%>
|
||||
String dbschema_<%=cid%> = (String)globalMap.get("<%=tableschema%>");
|
||||
java.sql.Connection conn_<%=cid%> = (java.sql.Connection)globalMap.get("<%=conn%>");
|
||||
String dbUser_<%=cid %> = (String)globalMap.get("<%=username%>");
|
||||
<%
|
||||
} else {
|
||||
%>
|
||||
|
||||
@@ -61,6 +61,11 @@
|
||||
REPOSITORY_VALUE="DATABASE:IBM_DB2"
|
||||
SHOW_IF="USE_EXISTING_CONNECTION == 'false'"
|
||||
/>
|
||||
|
||||
<PARAMETER NAME="TYPE" FIELD="TEXT" NUM_ROW="15" SHOW="false"
|
||||
REPOSITORY_VALUE="TYPE">
|
||||
<DEFAULT>IBM DB2</DEFAULT>
|
||||
</PARAMETER>
|
||||
|
||||
<PARAMETER
|
||||
NAME="HOST"
|
||||
|
||||
@@ -21,6 +21,7 @@ INode node = (INode)codeGenArgument.getArgument();
|
||||
String cid = node.getUniqueName();
|
||||
List<IMetadataColumn> columnList = getColumnList(node);
|
||||
if(columnList != null && columnList.size() > 0) {
|
||||
String strFieldName = ""; // temp variable to save name of field
|
||||
boolean debug = ("true").equals(ElementParameterParser.getValue(node, "__DEBUG__"));
|
||||
List<Map<String, String>> sourceKeys = (List<Map<String, String>>)ElementParameterParser.getObjectValue(node, "__SOURCE_KEYS__");
|
||||
boolean isEnableType1 = ("true").equals(ElementParameterParser.getValue(node, "__USE_L1__"));
|
||||
@@ -34,14 +35,17 @@ if(columnList != null && columnList.size() > 0) {
|
||||
type2Attributes = (List<Map<String, String>>)ElementParameterParser.getObjectValue(node, "__L2_FIELDS__");
|
||||
}
|
||||
String endDateFieldType="DATE";
|
||||
boolean isFieldValueIncNull = ("true").equals(ElementParameterParser.getValue(node, "__FIELD_VALUE_INC_NULL__"));
|
||||
String useExistingConnection = ElementParameterParser.getValue(node, "__USE_EXISTING_CONNECTION__");
|
||||
if (("true").equals(useExistingConnection)) {
|
||||
String connection = ElementParameterParser.getValue(node, "__CONNECTION__");
|
||||
String connectionName = "conn_" + connection;
|
||||
String tableschema = "tableschema_" + connection;
|
||||
String username = "username_" + connection;
|
||||
%>
|
||||
java.sql.Connection conn_<%=cid%> = (java.sql.Connection) globalMap.get("<%=connectionName%>");
|
||||
String schema_<%=cid%> = (String)globalMap.get("<%=tableschema%>");
|
||||
String dbUser_<%=cid %> = (String)globalMap.get("<%=username%>");
|
||||
<%
|
||||
} else {
|
||||
String dbname= ElementParameterParser.getValue(node, "__DBNAME__");
|
||||
@@ -107,7 +111,9 @@ if(columnList != null && columnList.size() > 0) {
|
||||
boolean whetherExist_<%=cid%> = false;
|
||||
while(rsTable_<%=cid%>.next()) {
|
||||
String table_<%=cid%> = rsTable_<%=cid%>.getString("TABLE_NAME");
|
||||
if(table_<%=cid%>.equals(<%=tableName%>)) {
|
||||
String qSchema_<%=cid%> = rsTable_<%=cid%>.getString("TABLE_SCHEM");
|
||||
if(table_<%=cid%>.equals(<%=tableName%>)
|
||||
&& (qSchema_<%=cid%>.equals(schema_<%=cid%>) || ((schema_<%=cid%> == null || schema_<%=cid%>.trim().length() ==0) && dbUser_<%=cid%>.equalsIgnoreCase(qSchema_<%=cid%>)))) {
|
||||
whetherExist_<%=cid%> = true;
|
||||
break;
|
||||
}
|
||||
@@ -177,10 +183,14 @@ if(columnList != null && columnList.size() > 0) {
|
||||
}
|
||||
}
|
||||
for(Map<String, String> type1Attribute : type1Attributes) {
|
||||
columnNames.add(StringUtils.getPostgresqlProtectedColumnName(type1Attribute.get("NAME")));
|
||||
setColumns.add(StringUtils.getPostgresqlProtectedColumnName(type1Attribute.get("NAME")));
|
||||
whereClause.add(" d." + StringUtils.getPostgresqlProtectedColumnName(type1Attribute.get("NAME")) +
|
||||
" <> t." + StringUtils.getPostgresqlProtectedColumnName(type1Attribute.get("NAME")));
|
||||
strFieldName = StringUtils.getPostgresqlProtectedColumnName(type1Attribute.get("NAME"));
|
||||
columnNames.add(strFieldName);
|
||||
setColumns.add(strFieldName);
|
||||
if(isFieldValueIncNull){
|
||||
whereClause.add("( d." + strFieldName + " is null AND t." + strFieldName + " is not null )");
|
||||
whereClause.add("( d." + strFieldName + " is not null AND t." + strFieldName + " is null )");
|
||||
}
|
||||
whereClause.add("( d." + strFieldName + " <> t." + strFieldName+")");
|
||||
}
|
||||
selectColumnString = StringUtils.join(columnNames.toArray(), ", t.");
|
||||
columnNameString = StringUtils.join(columnNames.toArray(), ", ");
|
||||
@@ -207,8 +217,12 @@ if(columnList != null && columnList.size() > 0) {
|
||||
if(isEnableType2) {
|
||||
List<String> whereClause = new ArrayList<String>();
|
||||
for (Map<String, String> type2Attribute : type2Attributes) {
|
||||
whereClause.add(" d." + StringUtils.getPostgresqlProtectedColumnName(type2Attribute.get("NAME")) +
|
||||
" <> t." + StringUtils.getPostgresqlProtectedColumnName(type2Attribute.get("NAME")));
|
||||
strFieldName = StringUtils.getPostgresqlProtectedColumnName(type2Attribute.get("NAME"));
|
||||
if(isFieldValueIncNull){
|
||||
whereClause.add("( d." + strFieldName + " is null AND t." + strFieldName + " is not null )");
|
||||
whereClause.add("( d." + strFieldName + " is not null AND t." + strFieldName + " is null )");
|
||||
}
|
||||
whereClause.add("( d." + strFieldName + " <> t." + strFieldName+")");
|
||||
}
|
||||
String whereClauseString = StringUtils.join(whereClause.toArray(), " OR ");
|
||||
for(IMetadataColumn column : columnList) {
|
||||
|
||||
@@ -58,6 +58,11 @@
|
||||
SHOW_IF="USE_EXISTING_CONNECTION == 'true'"
|
||||
DYNAMIC_SETTINGS="true"/>
|
||||
|
||||
<PARAMETER NAME="TYPE" FIELD="TEXT" NUM_ROW="15" SHOW="false"
|
||||
REPOSITORY_VALUE="TYPE">
|
||||
<DEFAULT>IBM DB2</DEFAULT>
|
||||
</PARAMETER>
|
||||
|
||||
<PARAMETER
|
||||
NAME="HOST"
|
||||
FIELD="TEXT"
|
||||
@@ -322,6 +327,14 @@
|
||||
<DEFAULT>"ISO-8859-15"</DEFAULT>
|
||||
</PARAMETER>
|
||||
|
||||
<PARAMETER
|
||||
NAME="FIELD_VALUE_INC_NULL"
|
||||
FIELD="CHECK"
|
||||
NUM_ROW="15"
|
||||
>
|
||||
<DEFAULT>false</DEFAULT>
|
||||
</PARAMETER>
|
||||
|
||||
<PARAMETER
|
||||
NAME="DEBUG"
|
||||
FIELD="CHECK"
|
||||
|
||||
@@ -52,6 +52,7 @@ SK_ROUTINE.NAME=Routine
|
||||
SOURCE_KEYS.NAME=Source keys
|
||||
SOURCE_KEYS.ITEM.NAME=Name
|
||||
SOURCE_KEYS.ITEM.INCOMING_COLUMN=Input flow column
|
||||
FIELD_VALUE_INC_NULL.NAME=Source fields value include Null
|
||||
USE_L1.NAME=Use SCD type 1 fields
|
||||
L1_FIELDS.NAME=SCD type 1 fields
|
||||
L1_FIELDS.ITEM.NAME=Field name
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
<CONNECTORS>
|
||||
<CONNECTOR CTYPE="FLOW" MAX_INPUT="1" MAX_OUTPUT="1"/>
|
||||
<CONNECTOR NAME="REJECT" CTYPE="FLOW" MAX_INPUT="0" MAX_OUTPUT="1" LINE_STYLE="2" COLOR="FF0000" BASE_SCHEMA="FLOW" />
|
||||
<CONNECTOR NAME="REJECT" NOT_SHOW_IF="(DIE_ON_ERROR == 'true')" CTYPE="FLOW" MAX_INPUT="0" MAX_OUTPUT="1" LINE_STYLE="2" COLOR="FF0000" BASE_SCHEMA="FLOW" />
|
||||
<CONNECTOR CTYPE="ITERATE" MAX_OUTPUT="1" MAX_INPUT="1" />
|
||||
<CONNECTOR CTYPE="SUBJOB_OK" MAX_INPUT="1" />
|
||||
<CONNECTOR CTYPE="SUBJOB_ERROR" MAX_INPUT="1" />
|
||||
@@ -87,6 +87,13 @@
|
||||
<PARAMETER NAME="QUERY" FIELD="MEMO_SQL" NUM_ROW="7">
|
||||
<DEFAULT>"select id, name from employee"</DEFAULT>
|
||||
</PARAMETER>
|
||||
<PARAMETER
|
||||
NAME="DIE_ON_ERROR"
|
||||
FIELD="CHECK"
|
||||
NUM_ROW="90"
|
||||
>
|
||||
<DEFAULT>false</DEFAULT>
|
||||
</PARAMETER>
|
||||
</PARAMETERS>
|
||||
|
||||
<ADVANCED_PARAMETERS>
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
globalMap.put("<%=cid %>_DIE_PRIORITY", <%=ElementParameterParser.getValue(node, "__PRIORITY__") %>);
|
||||
System.err.println(<%=ElementParameterParser.getValue(node, "__MESSAGE__") %>);
|
||||
globalMap.put("<%=cid %>_DIE_MESSAGE", <%=ElementParameterParser.getValue(node, "__MESSAGE__") %>);
|
||||
globalMap.put("<%=cid %>_DIE_MESSAGES", <%=ElementParameterParser.getValue(node, "__MESSAGE__") %>);
|
||||
currentComponent = "<%=cid %>";
|
||||
status = "failure";
|
||||
<%
|
||||
|
||||
@@ -74,12 +74,14 @@
|
||||
FIELD="PROPERTY_TYPE"
|
||||
SHOW="true"
|
||||
NUM_ROW="30"
|
||||
REPOSITORY_VALUE="DATABASE:NETEZZA"
|
||||
/>
|
||||
|
||||
<PARAMETER
|
||||
NAME="HOST"
|
||||
FIELD="TEXT"
|
||||
NUM_ROW="40"
|
||||
REPOSITORY_VALUE="SERVER_NAME"
|
||||
SHOW_IF="USE_EXISTING_CONNECTION == 'false'"
|
||||
>
|
||||
<DEFAULT>""</DEFAULT>
|
||||
@@ -89,6 +91,7 @@
|
||||
NAME="PORT"
|
||||
FIELD="TEXT"
|
||||
NUM_ROW="40"
|
||||
REPOSITORY_VALUE="PORT"
|
||||
SHOW_IF="USE_EXISTING_CONNECTION == 'false'"
|
||||
>
|
||||
<DEFAULT>"5480"</DEFAULT>
|
||||
@@ -99,6 +102,7 @@
|
||||
FIELD="TEXT"
|
||||
NUM_ROW="50"
|
||||
REQUIRED="true"
|
||||
REPOSITORY_VALUE="SID"
|
||||
SHOW_IF="USE_EXISTING_CONNECTION == 'false'"
|
||||
>
|
||||
<DEFAULT>""</DEFAULT>
|
||||
@@ -109,6 +113,7 @@
|
||||
FIELD="TEXT"
|
||||
NUM_ROW="60"
|
||||
REQUIRED="true"
|
||||
REPOSITORY_VALUE="USERNAME"
|
||||
SHOW_IF="USE_EXISTING_CONNECTION == 'false'"
|
||||
>
|
||||
<DEFAULT>""</DEFAULT>
|
||||
@@ -119,6 +124,7 @@
|
||||
FIELD="TEXT"
|
||||
NUM_ROW="60"
|
||||
REQUIRED="true"
|
||||
REPOSITORY_VALUE="PASSWORD"
|
||||
SHOW_IF="USE_EXISTING_CONNECTION == 'false'"
|
||||
>
|
||||
<DEFAULT>""</DEFAULT>
|
||||
|
||||
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user