Compare commits
283 Commits
release/5.
...
release/5.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aec9ebb198 | ||
|
|
47723aa25d | ||
|
|
a5b7d15181 | ||
|
|
d81aa7b53a | ||
|
|
3fbe0c6115 | ||
|
|
92bdbc8bae | ||
|
|
fea02836db | ||
|
|
21abd7a0d5 | ||
|
|
19a2b0cdc6 | ||
|
|
eb8c3283b1 | ||
|
|
46ecf8ddd2 | ||
|
|
a75b149e0e | ||
|
|
ef1802eb01 | ||
|
|
9981367d33 | ||
|
|
6b376666df | ||
|
|
150d71d635 | ||
|
|
cd611f48b2 | ||
|
|
32568fface | ||
|
|
00b998f8e8 | ||
|
|
15bb3e9d9d | ||
|
|
a453a05d85 | ||
|
|
6dbe1a51e5 | ||
|
|
40499ac4dc | ||
|
|
96fd75bea7 | ||
|
|
35bc1b0259 | ||
|
|
59a67ffc31 | ||
|
|
f0b7bca93f | ||
|
|
22b0610477 | ||
|
|
d2893bd870 | ||
|
|
9676d9da04 | ||
|
|
69745e8e72 | ||
|
|
fd2963778c | ||
|
|
63fa9e505e | ||
|
|
a853e0dc11 | ||
|
|
5be0d0fbec | ||
|
|
a76412a3db | ||
|
|
5a62ea448e | ||
|
|
be5c0cfecd | ||
|
|
e3c1a2f802 | ||
|
|
dd97ab49d7 | ||
|
|
5500604d2e | ||
|
|
400294def4 | ||
|
|
f0f9ba38e6 | ||
|
|
eec72ec9ca | ||
|
|
b63d18484a | ||
|
|
e2968d2b7e | ||
|
|
eae351da33 | ||
|
|
d666d1f2c3 | ||
|
|
f4ade04b08 | ||
|
|
d450bf1d97 | ||
|
|
75f7e6c0ad | ||
|
|
faaec3e65f | ||
|
|
216d19b48b | ||
|
|
c1e820922f | ||
|
|
d4f8286818 | ||
|
|
93b15ecf15 | ||
|
|
caf43e3801 | ||
|
|
27f7f40ab1 | ||
|
|
419c64b14b | ||
|
|
9ccf8b6493 | ||
|
|
ef28f73882 | ||
|
|
c20091bd4a | ||
|
|
6de7d7e9c2 | ||
|
|
c3b1e053a6 | ||
|
|
ed068cd126 | ||
|
|
149630ba41 | ||
|
|
8aa5dbd16b | ||
|
|
4110050560 | ||
|
|
84d85418d6 | ||
|
|
06709d277d | ||
|
|
5b8fcd0e45 | ||
|
|
4b822ea7c2 | ||
|
|
dfe89e4e95 | ||
|
|
6b3047e2a0 | ||
|
|
3926f4f146 | ||
|
|
18cd1cfab0 | ||
|
|
3a73e4e2f9 | ||
|
|
ebb738ee0a | ||
|
|
5ca96fd27f | ||
|
|
1520b4f121 | ||
|
|
fe7f2bdc29 | ||
|
|
2e88c8285e | ||
|
|
068cf8e7e6 | ||
|
|
416ee00cc9 | ||
|
|
1593679275 | ||
|
|
0f0be526df | ||
|
|
1b8340da17 | ||
|
|
254a52d59f | ||
|
|
a7eccf1e1f | ||
|
|
3f3e44374a | ||
|
|
b9096f5fe0 | ||
|
|
a45070b0c3 | ||
|
|
1b02e17613 | ||
|
|
6b726b50d2 | ||
|
|
f4ac0d4857 | ||
|
|
745831e0e7 | ||
|
|
fc7393661e | ||
|
|
2bd7511afb | ||
|
|
0409932d3c | ||
|
|
29db0cd433 | ||
|
|
086156c891 | ||
|
|
d9f6016c6d | ||
|
|
935b8db6c1 | ||
|
|
73a7dbfb1f | ||
|
|
32496fa721 | ||
|
|
20cee8bcfa | ||
|
|
04f23d2bc7 | ||
|
|
09148f5699 | ||
|
|
dc2ca051cc | ||
|
|
406eb1fc84 | ||
|
|
2a024b8c08 | ||
|
|
926628b41f | ||
|
|
0e62d4efae | ||
|
|
6624c1b43b | ||
|
|
614bb9a29b | ||
|
|
61dcc0f926 | ||
|
|
56bc84c818 | ||
|
|
049e11d6b3 | ||
|
|
bcf02a2dcb | ||
|
|
756f1cdc00 | ||
|
|
7b86fe22f8 | ||
|
|
c0192c70ad | ||
|
|
204f1e3f10 | ||
|
|
bdaa5a8a9a | ||
|
|
2f87fd8bde | ||
|
|
ca223cf400 | ||
|
|
e7d7cdfd82 | ||
|
|
80a8d0236f | ||
|
|
d4847d7cc4 | ||
|
|
1d99f4026b | ||
|
|
af074bd1b8 | ||
|
|
c410f6a1ac | ||
|
|
f2e65773e1 | ||
|
|
bb558620ce | ||
|
|
d74c2fd614 | ||
|
|
b7029e3a49 | ||
|
|
7709e796bc | ||
|
|
c9332f24c7 | ||
|
|
408e65b479 | ||
|
|
870d7a703e | ||
|
|
1027c61038 | ||
|
|
c7139da44d | ||
|
|
6e37d555b4 | ||
|
|
03db0cc44a | ||
|
|
b90feb1852 | ||
|
|
4e457b3a2e | ||
|
|
cc3290cf24 | ||
|
|
ca7d5bf7f6 | ||
|
|
62f56ec52f | ||
|
|
13e9758ac4 | ||
|
|
8f936edf11 | ||
|
|
96470a5afa | ||
|
|
da6f72eeee | ||
|
|
358a7e31ac | ||
|
|
f840f42400 | ||
|
|
883b0bf0c6 | ||
|
|
49bf906cbf | ||
|
|
725512cacb | ||
|
|
e1839e0f75 | ||
|
|
cdb9fc90e6 | ||
|
|
63156e3c09 | ||
|
|
e8eff74ba5 | ||
|
|
5c900f52e9 | ||
|
|
240619de76 | ||
|
|
adbfe9c4ee | ||
|
|
3a4d78e91b | ||
|
|
823b6568bd | ||
|
|
1e85729fbf | ||
|
|
c91fa16eb6 | ||
|
|
97a44b6588 | ||
|
|
e62b4efe82 | ||
|
|
c49e762284 | ||
|
|
ae26f91cb4 | ||
|
|
d79627b91a | ||
|
|
16785bcbdf | ||
|
|
2a7f25b21b | ||
|
|
6cbfb89baf | ||
|
|
5662149cd8 | ||
|
|
3454cc9825 | ||
|
|
42a1bb3ba9 | ||
|
|
1a4d5e661f | ||
|
|
f2244dfa4a | ||
|
|
44be0ff815 | ||
|
|
2ce9b595bf | ||
|
|
018fc97902 | ||
|
|
c0e0e96de8 | ||
|
|
3d44705fca | ||
|
|
544bdcaf48 | ||
|
|
013e24ac52 | ||
|
|
aeabc70849 | ||
|
|
ab6813f33d | ||
|
|
c92efbacc7 | ||
|
|
302ddbd1ec | ||
|
|
d9bed00121 | ||
|
|
e712d37d84 | ||
|
|
dbfadacf76 | ||
|
|
2d066ea156 | ||
|
|
d39bff5bc0 | ||
|
|
8abb5cbf3d | ||
|
|
4ee1cf2ec5 | ||
|
|
93c665fee7 | ||
|
|
cf60a22c6e | ||
|
|
5c3b6b759e | ||
|
|
3b6968fa19 | ||
|
|
64fb001951 | ||
|
|
00bbc4519c | ||
|
|
ececb4224a | ||
|
|
c5a039c248 | ||
|
|
3a6581bc06 | ||
|
|
0a56c24be5 | ||
|
|
ef81b0454e | ||
|
|
7fa48af6e2 | ||
|
|
8118262e17 | ||
|
|
cc0a180a49 | ||
|
|
8ea39cd048 | ||
|
|
386f9b5bff | ||
|
|
fc384740f5 | ||
|
|
4c4a61b604 | ||
|
|
d8e030126e | ||
|
|
77877ed3e8 | ||
|
|
67e241dccf | ||
|
|
eaa30e76c9 | ||
|
|
39d77ba9f0 | ||
|
|
1c1dcf2f9d | ||
|
|
8db1040ac9 | ||
|
|
2d8ddec13a | ||
|
|
64a5a3ad3e | ||
|
|
9577e398bf | ||
|
|
5fc4fa8af2 | ||
|
|
9247379002 | ||
|
|
d1ee1bd21e | ||
|
|
b0ff60c80d | ||
|
|
78e35d661b | ||
|
|
5b7e247309 | ||
|
|
472cd19f00 | ||
|
|
8804b08bb7 | ||
|
|
0d71b088c6 | ||
|
|
3e709e8067 | ||
|
|
94473e29e1 | ||
|
|
a61d1567a4 | ||
|
|
0e82cc9a05 | ||
|
|
9b17639100 | ||
|
|
fc15539c5a | ||
|
|
d2094d3c2d | ||
|
|
610f01ab0b | ||
|
|
56ea6dc57c | ||
|
|
524530db5b | ||
|
|
90239f5c86 | ||
|
|
492771a027 | ||
|
|
2699013af4 | ||
|
|
452fc97a99 | ||
|
|
787f8b0937 | ||
|
|
633bf34bd1 | ||
|
|
8bd45968c8 | ||
|
|
ad73e1c55f | ||
|
|
fd8f8d9275 | ||
|
|
663d8d5cc4 | ||
|
|
26205ffcb9 | ||
|
|
e41fc713ac | ||
|
|
c613c4e70c | ||
|
|
5e1a1089fa | ||
|
|
96b1bb8dd7 | ||
|
|
87862875b1 | ||
|
|
8a399bd3bd | ||
|
|
1c601b666d | ||
|
|
13582c3529 | ||
|
|
6e7f416c28 | ||
|
|
48db08d91c | ||
|
|
fe2142be2b | ||
|
|
58cbd1a788 | ||
|
|
d9a9492704 | ||
|
|
ea006a97f7 | ||
|
|
b230a01deb | ||
|
|
baea7f17f4 | ||
|
|
1c884aab4d | ||
|
|
444fd96a13 | ||
|
|
fe57b3e3bf | ||
|
|
a569ad1e20 | ||
|
|
ffa9a8b5c5 | ||
|
|
784667da89 | ||
|
|
1b48313eb6 | ||
|
|
f2fbef89b1 | ||
|
|
6a5939950f |
@@ -740,7 +740,7 @@
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
unpack="true"/>
|
||||
|
||||
<plugin
|
||||
id="org.eclipse.jet.core"
|
||||
|
||||
@@ -2,6 +2,7 @@ PushToPaletteActionProvider.Error2=Fout
|
||||
PushToPaletteActionProvider.Error=Fout
|
||||
NewActionProvider.New=Nieuw
|
||||
NewActionProvider.NewComponent=Nieuw Component
|
||||
AbstractXMLConfigPage.Delete=Verwijderen
|
||||
CreateComponentWizard.NewComponent=Nieuw Component
|
||||
WizardComponentFolderPage.Name=Naam
|
||||
AbstractXMLConfigPage.New=Nieuw
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
PushToPaletteActionProvider.Error2=Gre\u0161ka
|
||||
PushToPaletteActionProvider.Error=Gre\u0161ka
|
||||
AbstractXMLConfigPage.Delete=DELETE
|
||||
|
||||
@@ -557,5 +557,16 @@
|
||||
level="20"
|
||||
name="ReadDiagramAction"/>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.core.expressions.definitions">
|
||||
<definition
|
||||
id="isActiveEditorOfBusinessModelEditor">
|
||||
<not>
|
||||
<instanceof
|
||||
value="org.talend.designer.business.model.business.diagram.part.BusinessDiagramEditor">
|
||||
</instanceof>
|
||||
</not>
|
||||
</definition>
|
||||
</extension>
|
||||
|
||||
</plugin>
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
if(param != null && !"__UNIQUE_NAME__".equals(param.getValue())){
|
||||
cid = (String)param.getValue()+"_"+cid;
|
||||
}
|
||||
String endpointVar = "endpoint" + cid;
|
||||
String endpointVar = "endpoint_" + node.getUniqueName();
|
||||
String uriRef = "uriMap.get(\"" + cid + "\")";
|
||||
%>
|
||||
// CXF endpoint for <%=cid%>
|
||||
|
||||
@@ -32,9 +32,19 @@ INode node = (INode) codeGenArgument.getArgument();
|
||||
List< ? extends IConnection> connsIf = node.getIncomingConnections();
|
||||
if(connsIf.size()>0) {
|
||||
if(connsIf.get(0).getLineStyle()==EConnectionType.ROUTE_WHEN) {
|
||||
INode sourceNode = connsIf.get(0).getSource();
|
||||
String languageType = connsIf.get(0).getRouteConnectionType();
|
||||
String condition = connsIf.get(0).getCondition();
|
||||
String expression = "none".equals(languageType)?condition:languageType+"("+condition+")";
|
||||
if("cIntercept".equals(sourceNode.getComponent().getName())){
|
||||
%>
|
||||
.when().<%=connsIf.get(0).getRouteConnectionType()%>(<%=connsIf.get(0).getCondition()%>)
|
||||
.when(<%=expression%>)
|
||||
<%
|
||||
}else{
|
||||
%>
|
||||
.when().<%=expression%>
|
||||
<%
|
||||
}
|
||||
} else if(connsIf.get(0).getLineStyle()==EConnectionType.ROUTE_OTHER) {
|
||||
%>
|
||||
.otherwise()
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -99,8 +99,8 @@ import java.util.Comparator;
|
||||
String talendJobInterfaces = "TalendJob";
|
||||
|
||||
boolean talendMdmJob = !process.getNodesOfType("tMDMTriggerInput").isEmpty() || !process.getNodesOfType("tMDMTriggerOutput").isEmpty();
|
||||
boolean talendEsbJob = !process.getNodesOfType("tESBProviderRequest").isEmpty() || !process.getNodesOfType("tESBConsumer").isEmpty();
|
||||
boolean talendEsbJobFactory = !process.getNodesOfType("tESBProviderRequest").isEmpty();
|
||||
boolean talendEsbJob = !process.getNodesOfType("tESBProviderRequest").isEmpty() || !process.getNodesOfType("tESBConsumer").isEmpty() || !process.getNodesOfType("tRouteInput").isEmpty();
|
||||
boolean talendEsbJobFactory = !process.getNodesOfType("tESBProviderRequest").isEmpty() || !process.getNodesOfType("tRouteInput").isEmpty();
|
||||
|
||||
if (talendMdmJob) {
|
||||
talendJobInterfaces += ", TalendMDMJob"; // Talend MDM job
|
||||
@@ -126,6 +126,8 @@ public class <%=process.getName()%> implements <%=talendJobInterfaces%> {
|
||||
}
|
||||
talendESBJob.setDataSources(dataSources);
|
||||
}
|
||||
// fix for TESB-7714
|
||||
talendESBJob.setEndpointRegistry(registry);
|
||||
return talendESBJob;
|
||||
}
|
||||
<% } %>
|
||||
|
||||
@@ -69,7 +69,7 @@ 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.BrandingChecker;
|
||||
import org.talend.core.utils.TalendCacheUtils;
|
||||
import org.talend.designer.codegen.CodeGeneratorActivator;
|
||||
import org.talend.designer.codegen.i18n.Messages;
|
||||
import org.talend.designer.core.ITisLocalProviderService;
|
||||
@@ -159,7 +159,7 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
Project currentProject = ProjectManager.getInstance().getCurrentProject();
|
||||
if (currentProject != null && currentProject.getEmfProject() != null) {
|
||||
|
||||
List<ComponentSetting> components = (List<ComponentSetting>) currentProject.getEmfProject().getComponentsSettings();
|
||||
List<ComponentSetting> components = currentProject.getEmfProject().getComponentsSettings();
|
||||
return components;
|
||||
}
|
||||
return Collections.emptyList();
|
||||
@@ -231,8 +231,7 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
ProjectManager manager = ProjectManager.getInstance();
|
||||
List<Project> referencedProjects = manager.getReferencedProjects();
|
||||
for (Project curProject : referencedProjects) {
|
||||
List<ComponentSetting> componentsSettings = (List<ComponentSetting>) curProject.getEmfProject()
|
||||
.getComponentsSettings();
|
||||
List<ComponentSetting> componentsSettings = curProject.getEmfProject().getComponentsSettings();
|
||||
for (ComponentSetting setting : componentsSettings) {
|
||||
if (setting.isHidden() && setting.getName().equals(settingInMain.getName())
|
||||
&& setting.getFamily().equals(settingInMain.getFamily())) {
|
||||
@@ -262,7 +261,7 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
skeletonList = new ArrayList<String>();
|
||||
String installLocation = new Path(Platform.getConfigurationLocation().getURL().getPath()).toFile().getAbsolutePath();
|
||||
componentToProviderMap = new HashMap<IComponent, AbstractComponentsProvider>();
|
||||
boolean isNeedClean = cleanComponentCache();
|
||||
boolean isNeedClean = TalendCacheUtils.cleanComponentCache();
|
||||
isCreated = hasComponentFile(installLocation) && !isNeedClean;
|
||||
if (isReset) {
|
||||
isCreated = false;
|
||||
@@ -348,6 +347,7 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
|
||||
FileFilter fileFilter = new FileFilter() {
|
||||
|
||||
@Override
|
||||
public boolean accept(final File file) {
|
||||
return file.isDirectory() && file.getName().charAt(0) != '.'
|
||||
&& !file.getName().equals(IComponentsFactory.EXTERNAL_COMPONENTS_INNER_FOLDER)
|
||||
@@ -482,11 +482,6 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
return file.exists();
|
||||
}
|
||||
|
||||
private boolean cleanComponentCache() {
|
||||
return ArrayUtils.contains(Platform.getApplicationArgs(), "--clean_component_cache")
|
||||
|| ArrayUtils.contains(Platform.getApplicationArgs(), "-clean") || BrandingChecker.isBrandingChanged();
|
||||
}
|
||||
|
||||
private void loadComponentsFromComponentsProviderExtension() {
|
||||
ComponentsProviderManager componentsProviderManager = ComponentsProviderManager.getInstance();
|
||||
for (AbstractComponentsProvider componentsProvider : componentsProviderManager.getProviders()) {
|
||||
@@ -517,6 +512,7 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadUserComponentsFromComponentsProviderExtension() {
|
||||
ComponentsProviderManager.getInstance().getProviders();
|
||||
ComponentsProviderManager componentsProviderManager = ComponentsProviderManager.getInstance();
|
||||
@@ -587,6 +583,7 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
|
||||
FileFilter fileFilter = new FileFilter() {
|
||||
|
||||
@Override
|
||||
public boolean accept(final File file) {
|
||||
return file.isDirectory() && file.getName().charAt(0) != '.'
|
||||
&& !file.getName().equals(IComponentsFactory.EXTERNAL_COMPONENTS_INNER_FOLDER)
|
||||
@@ -607,6 +604,7 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
|
||||
FileFilter skeletonFilter = new FileFilter() {
|
||||
|
||||
@Override
|
||||
public boolean accept(final File file) {
|
||||
String fileName = file.getName();
|
||||
return file.isFile() && fileName.charAt(0) != '.'
|
||||
@@ -913,6 +911,7 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
component.setImageRegistry(componentsImageRegistry);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int size() {
|
||||
if (componentList == null) {
|
||||
init(false);
|
||||
@@ -920,6 +919,7 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
return componentList.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IComponent get(String name) {
|
||||
if (componentList == null) {
|
||||
init(false);
|
||||
@@ -933,6 +933,7 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initializeComponents(IProgressMonitor monitor) {
|
||||
this.monitor = monitor;
|
||||
if (componentList == null) {
|
||||
@@ -942,6 +943,7 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
this.subMonitor = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initializeComponents(IProgressMonitor monitor, boolean duringLogon) {
|
||||
this.monitor = monitor;
|
||||
if (componentList == null) {
|
||||
@@ -956,6 +958,7 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
*
|
||||
* @see org.talend.core.model.components.IComponentsFactory#getComponents()
|
||||
*/
|
||||
@Override
|
||||
public Set<IComponent> getComponents() {
|
||||
if (componentList == null) {
|
||||
init(false);
|
||||
@@ -963,6 +966,7 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
return componentList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IComponent> getCustomComponents() {
|
||||
if (customComponentList == null) {
|
||||
init(false);
|
||||
@@ -975,6 +979,7 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
*
|
||||
* @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(
|
||||
@@ -992,6 +997,7 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
*
|
||||
* @see org.talend.core.model.components.IComponentsFactory#getSkeletons()
|
||||
*/
|
||||
@Override
|
||||
public List<String> getSkeletons() {
|
||||
if (skeletonList == null) {
|
||||
init(false);
|
||||
@@ -999,6 +1005,7 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
return skeletonList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset() {
|
||||
componentsImageRegistry.clear();
|
||||
componentList = null;
|
||||
@@ -1008,6 +1015,7 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resetCache() {
|
||||
componentsImageRegistry.clear();
|
||||
componentList = null;
|
||||
@@ -1026,6 +1034,7 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
* @see org.talend.core.model.components.IComponentsFactory#getFamilyTranslation(IComponent component,
|
||||
* java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public String getFamilyTranslation(Object component, String text) {
|
||||
String translated = Messages.getString(text);
|
||||
|
||||
@@ -1056,6 +1065,7 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
*
|
||||
* @see org.talend.core.model.components.IComponentsFactory#getAllComponentsCanBeProvided()
|
||||
*/
|
||||
@Override
|
||||
public Map<String, String> getAllComponentsCanBeProvided() {
|
||||
List source = new ArrayList();
|
||||
if (allComponents == null) {
|
||||
@@ -1080,6 +1090,7 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
|
||||
FileFilter fileFilter = new FileFilter() {
|
||||
|
||||
@Override
|
||||
public boolean accept(final File file) {
|
||||
return file.isDirectory() && file.getName().charAt(0) != '.'
|
||||
&& !file.getName().equals(IComponentsFactory.EXTERNAL_COMPONENTS_INNER_FOLDER);
|
||||
@@ -1138,14 +1149,17 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
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;
|
||||
}
|
||||
@@ -1197,10 +1211,12 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
*
|
||||
* @see org.talend.core.model.components.IComponentsFactory#resetSpecificComponents()
|
||||
*/
|
||||
@Override
|
||||
public void resetSpecificComponents() {
|
||||
loadComponentsFromExtensions();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, File> getComponentsProvidersFolder() {
|
||||
Map<String, File> list = new HashMap<String, File>();
|
||||
|
||||
@@ -1217,6 +1233,7 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, ImageDescriptor> getComponentsImageRegistry() {
|
||||
return componentsImageRegistry;
|
||||
}
|
||||
|
||||
@@ -80,20 +80,14 @@ public class XsdValidationCacheManager {
|
||||
|
||||
public boolean needCheck(java.io.File file, long currentCRC) {
|
||||
String path = file.getAbsolutePath();
|
||||
if (forceXSDAlreadyChecked) {
|
||||
alreadyCheckedXsd.put(path, currentCRC);
|
||||
return false;
|
||||
} else {
|
||||
Long lastCheckedCRC = alreadyCheckedXsd.get(path);
|
||||
Long lastCheckedCRC = alreadyCheckedXsd.get(path);
|
||||
|
||||
if (lastCheckedCRC == null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
boolean isChanged = currentCRC != lastCheckedCRC;
|
||||
|
||||
return isChanged;
|
||||
if (lastCheckedCRC == null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
boolean isChanged = currentCRC != lastCheckedCRC;
|
||||
return isChanged;
|
||||
}
|
||||
|
||||
public void setChecked(File file, long currentCRC) {
|
||||
|
||||
@@ -14,6 +14,7 @@ package org.talend.designer.codegen.config;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.DataInputStream;
|
||||
import java.io.File;
|
||||
import java.io.InputStream;
|
||||
import java.lang.reflect.Method;
|
||||
@@ -27,7 +28,6 @@ import java.util.StringTokenizer;
|
||||
|
||||
import org.apache.commons.lang.ArrayUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.eclipse.core.resources.IContainer;
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.resources.IFolder;
|
||||
import org.eclipse.core.resources.IMarker;
|
||||
@@ -52,12 +52,10 @@ import org.eclipse.emf.common.util.Monitor;
|
||||
import org.eclipse.jdt.core.IClasspathEntry;
|
||||
import org.eclipse.jdt.core.IJavaModel;
|
||||
import org.eclipse.jdt.core.IJavaProject;
|
||||
import org.eclipse.jdt.core.IPackageFragmentRoot;
|
||||
import org.eclipse.jdt.core.JavaCore;
|
||||
import org.eclipse.jdt.core.JavaModelException;
|
||||
import org.talend.commons.debug.TalendDebugHandler;
|
||||
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
|
||||
import org.talend.core.model.components.ComponentCompilations;
|
||||
import org.talend.designer.codegen.i18n.Messages;
|
||||
|
||||
/**
|
||||
@@ -300,93 +298,107 @@ public class TalendJetEmitter extends JETEmitter {
|
||||
|
||||
progressMonitor.subTask(CodeGenPlugin.getPlugin().getString("_UI_JETOpeningJavaProject_message", //$NON-NLS-1$
|
||||
new Object[] { project.getName() }));
|
||||
// javaProject.open(new SubProgressMonitor(progressMonitor, 1));
|
||||
|
||||
IPackageFragmentRoot[] packageFragmentRoots = javaProject.getPackageFragmentRoots();
|
||||
IPackageFragmentRoot sourcePackageFragmentRoot = null;
|
||||
for (int j = 0; j < packageFragmentRoots.length; ++j) {
|
||||
IPackageFragmentRoot packageFragmentRoot = packageFragmentRoots[j];
|
||||
if (packageFragmentRoot.getKind() == IPackageFragmentRoot.K_SOURCE) {
|
||||
sourcePackageFragmentRoot = packageFragmentRoot;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
String packageName = jetCompiler.getSkeleton().getPackageName();
|
||||
StringTokenizer stringTokenizer = new StringTokenizer(packageName, "."); //$NON-NLS-1$
|
||||
IProgressMonitor subProgressMonitor = new SubProgressMonitor(progressMonitor, 1);
|
||||
subProgressMonitor.beginTask("", stringTokenizer.countTokens() + 4); //$NON-NLS-1$
|
||||
subProgressMonitor.subTask(CodeGenPlugin.getPlugin().getString("_UI_CreateTargetFile_message")); //$NON-NLS-1$
|
||||
IContainer sourceContainer = (IContainer) sourcePackageFragmentRoot.getCorrespondingResource();
|
||||
IFolder sourceContainer = project.getFolder("src");
|
||||
|
||||
while (stringTokenizer.hasMoreElements()) {
|
||||
String folderName = stringTokenizer.nextToken();
|
||||
sourceContainer = sourceContainer.getFolder(new Path(folderName));
|
||||
if (!sourceContainer.exists()) {
|
||||
try {
|
||||
((IFolder) sourceContainer).create(true, true, new SubProgressMonitor(subProgressMonitor, 1));
|
||||
sourceContainer.create(true, true, new SubProgressMonitor(subProgressMonitor, 1));
|
||||
} catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
boolean needRebuild = true;
|
||||
IFile targetFile = sourceContainer.getFile(new Path(jetCompiler.getSkeleton().getClassName() + ".java")); //$NON-NLS-1$
|
||||
if (!targetFile.exists()) {
|
||||
subProgressMonitor.subTask(CodeGenPlugin.getPlugin().getString("_UI_JETCreating_message", //$NON-NLS-1$
|
||||
new Object[] { targetFile.getFullPath() }));
|
||||
targetFile.create(contents, true, new SubProgressMonitor(subProgressMonitor, 1));
|
||||
} else {
|
||||
subProgressMonitor.subTask(CodeGenPlugin.getPlugin().getString("_UI_JETUpdating_message", //$NON-NLS-1$
|
||||
new Object[] { targetFile.getFullPath() }));
|
||||
targetFile.setContents(contents, true, true, new SubProgressMonitor(subProgressMonitor, 1));
|
||||
}
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
|
||||
subProgressMonitor.subTask(CodeGenPlugin.getPlugin().getString("_UI_JETBuilding_message", //$NON-NLS-1$
|
||||
new Object[] { project.getName() }));
|
||||
DataInputStream dis = new DataInputStream(targetFile.getContents());
|
||||
int len = 0;
|
||||
byte[] buf = new byte[1024];
|
||||
while (((len = dis.read(buf))) != -1) {
|
||||
baos.write(buf, 0, len);
|
||||
}
|
||||
dis.close();
|
||||
|
||||
if (!ComponentCompilations.getMarkers()) {
|
||||
project.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, new SubProgressMonitor(subProgressMonitor, 1));
|
||||
}
|
||||
|
||||
IMarker[] markers = targetFile.findMarkers(IMarker.PROBLEM, true, IResource.DEPTH_INFINITE);
|
||||
boolean errors = false;
|
||||
for (int i = 0; i < markers.length; ++i) {
|
||||
IMarker marker = markers[i];
|
||||
if (marker.getAttribute(IMarker.SEVERITY, IMarker.SEVERITY_INFO) == IMarker.SEVERITY_ERROR) {
|
||||
errors = true;
|
||||
subProgressMonitor.subTask(marker.getAttribute(IMarker.MESSAGE) + " : " //$NON-NLS-1$
|
||||
+ (CodeGenPlugin.getPlugin().getString("jet.mark.file.line", new Object[] { //$NON-NLS-1$
|
||||
targetFile.getLocation(), marker.getAttribute(IMarker.LINE_NUMBER) })));
|
||||
log.error(jetEmitter.templateURI.substring(jetEmitter.templateURI.lastIndexOf("/") + 1) //$NON-NLS-1$
|
||||
+ Messages.getString(
|
||||
"TalendJetEmitter.compileFail", //$NON-NLS-1$
|
||||
marker.getAttribute(IMarker.MESSAGE),
|
||||
(CodeGenPlugin.getPlugin().getString("jet.mark.file.line", new Object[] { //$NON-NLS-1$
|
||||
targetFile.getLocation(), marker.getAttribute(IMarker.LINE_NUMBER) }))));
|
||||
String currentContent = baos.toString();
|
||||
String newContent = outputStream.toString();
|
||||
// since the build is done on linux, if use windows, it will use different rules for \r + \n
|
||||
// so compare without \r, at least to see if original string is the same
|
||||
// if yes, consider all is ok, no need to replace the content and recompile
|
||||
currentContent = currentContent.replace("\r", ""); //$NON-NLS-1$//$NON-NLS-2$
|
||||
newContent = newContent.replace("\r", ""); //$NON-NLS-1$//$NON-NLS-2$
|
||||
if (!newContent.equals(currentContent)) {
|
||||
subProgressMonitor.subTask(CodeGenPlugin.getPlugin().getString("_UI_JETUpdating_message", //$NON-NLS-1$
|
||||
new Object[] { targetFile.getFullPath() }));
|
||||
targetFile.setContents(contents, true, true, new SubProgressMonitor(subProgressMonitor, 1));
|
||||
} else {
|
||||
needRebuild = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!errors) {
|
||||
subProgressMonitor.subTask(CodeGenPlugin.getPlugin().getString("_UI_JETLoadingClass_message", //$NON-NLS-1$
|
||||
new Object[] { jetCompiler.getSkeleton().getClassName() + ".class" })); //$NON-NLS-1$
|
||||
// if jetEmitter.getMethod() == null, means the class file doesn't exist anymore
|
||||
// it should be impossible to have only the class file deleted and the .java never modified, but still
|
||||
// handle this case.
|
||||
if (needRebuild || jetEmitter.getMethod() == null) {
|
||||
subProgressMonitor.subTask(CodeGenPlugin.getPlugin().getString("_UI_JETBuilding_message", //$NON-NLS-1$
|
||||
new Object[] { project.getName() }));
|
||||
|
||||
// Construct a proper URL for relative lookup.
|
||||
//
|
||||
URL url = new File(project.getLocation() + "/" + javaProject.getOutputLocation().removeFirstSegments(1) + "/") //$NON-NLS-1$ //$NON-NLS-2$
|
||||
.toURL();
|
||||
URLClassLoader theClassLoader = new URLClassLoader(new URL[] { url }, jetEmitter.classLoader);
|
||||
Class theClass = theClassLoader.loadClass((packageName.length() == 0 ? "" : packageName + ".") //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ jetCompiler.getSkeleton().getClassName());
|
||||
String methodName = jetCompiler.getSkeleton().getMethodName();
|
||||
Method[] methods = theClass.getDeclaredMethods();
|
||||
for (int i = 0; i < methods.length; ++i) {
|
||||
if (methods[i].getName().equals(methodName)) {
|
||||
jetEmitter.setMethod(methods[i]);
|
||||
break;
|
||||
project.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, new SubProgressMonitor(subProgressMonitor, 1));
|
||||
|
||||
IMarker[] markers = targetFile.findMarkers(IMarker.PROBLEM, true, IResource.DEPTH_INFINITE);
|
||||
boolean errors = false;
|
||||
for (int i = 0; i < markers.length; ++i) {
|
||||
IMarker marker = markers[i];
|
||||
if (marker.getAttribute(IMarker.SEVERITY, IMarker.SEVERITY_INFO) == IMarker.SEVERITY_ERROR) {
|
||||
errors = true;
|
||||
subProgressMonitor.subTask(marker.getAttribute(IMarker.MESSAGE) + " : " //$NON-NLS-1$
|
||||
+ (CodeGenPlugin.getPlugin().getString("jet.mark.file.line", new Object[] { //$NON-NLS-1$
|
||||
targetFile.getLocation(), marker.getAttribute(IMarker.LINE_NUMBER) })));
|
||||
log.error(jetEmitter.templateURI.substring(jetEmitter.templateURI.lastIndexOf("/") + 1) //$NON-NLS-1$
|
||||
+ Messages.getString(
|
||||
"TalendJetEmitter.compileFail", //$NON-NLS-1$
|
||||
marker.getAttribute(IMarker.MESSAGE),
|
||||
(CodeGenPlugin.getPlugin().getString("jet.mark.file.line", new Object[] { //$NON-NLS-1$
|
||||
targetFile.getLocation(), marker.getAttribute(IMarker.LINE_NUMBER) }))));
|
||||
}
|
||||
}
|
||||
|
||||
if (!errors) {
|
||||
subProgressMonitor.subTask(CodeGenPlugin.getPlugin().getString("_UI_JETLoadingClass_message", //$NON-NLS-1$
|
||||
new Object[] { jetCompiler.getSkeleton().getClassName() + ".class" })); //$NON-NLS-1$
|
||||
|
||||
// Construct a proper URL for relative lookup.
|
||||
//
|
||||
URL url = new File(project.getLocation()
|
||||
+ "/" + javaProject.getOutputLocation().removeFirstSegments(1) + "/") //$NON-NLS-1$ //$NON-NLS-2$
|
||||
.toURL();
|
||||
URLClassLoader theClassLoader = new URLClassLoader(new URL[] { url }, jetEmitter.classLoader);
|
||||
Class theClass = theClassLoader.loadClass((packageName.length() == 0 ? "" : packageName + ".") //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ jetCompiler.getSkeleton().getClassName());
|
||||
String methodName = jetCompiler.getSkeleton().getMethodName();
|
||||
Method[] methods = theClass.getDeclaredMethods();
|
||||
for (int i = 0; i < methods.length; ++i) {
|
||||
if (methods[i].getName().equals(methodName)) {
|
||||
jetEmitter.setMethod(methods[i]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
subProgressMonitor.done();
|
||||
} catch (CoreException exception) {
|
||||
TalendDebugHandler.debug(exception);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
ExchangeView.Exchange=Exchange
|
||||
AvailableExtensionsComposite.ExtensionName=Nom de l'extension
|
||||
AvailableExtensionsComposite.Version=Version
|
||||
AvailableExtensionsComposite.Rating=Note
|
||||
AvailableExtensionsComposite.Author=Auteur
|
||||
AvailableExtensionsComposite.ViewDetail.installOperateStatus=Installer
|
||||
AvailableExtensionsComposite.ViewDetail.WriteReview=Donnez votre avis
|
||||
@@ -9,6 +10,7 @@ DownloadedExtensionsComposite.DownloadedVersion=Version t
|
||||
DownloadedExtensionsComposite.DownloadDate=Date de téléchargement
|
||||
DownloadedExtensionsComposite.installedOperateStatus=Installé
|
||||
DownloadedExtensionsComposite.updateOperateStatus=Mettre à jour
|
||||
MyExtensionsComposite.Version=Version
|
||||
MyExtensionsComposite.UploadDate=Date du chargement
|
||||
MyExtensionsComposite.AddNewExtensionTitle=Ajouter une nouvelle extension
|
||||
MyExtensionsComposite.UpLoadNewVersionOperateStatus=Charger une nouvelle version
|
||||
@@ -19,6 +21,7 @@ MyExtensionsComposite.Form.ExtensionTitle=Titre de l'extension
|
||||
MyExtensionsComposite.Form.InitialVersion=Version initiale
|
||||
MyExtensionsComposite.Form.Compatibility=Compatibilité
|
||||
MyExtensionsComposite.Form.Compatibility.AllVersions=Toutes les versions
|
||||
MyExtensionsComposite.Form.Compatibility.Version=Version
|
||||
MyExtensionsComposite.Form.Compatibility.AllVersionsExcept=Toutes les versions sauf :
|
||||
MyExtensionsComposite.Form.Compatibility.OnlyTheseVersions=Uniquement ces versions :
|
||||
MyExtensionsComposite.Form.Description=Description
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
DownloadedExtensionsComposite.updateOperateStatus=Update
|
||||
MyExtensionsComposite.UpdateOperateStatus=Update
|
||||
MyExtensionsComposite.ModifyOperateStatus=Wijzigen
|
||||
MyExtensionsComposite.DeleteOperateStatus=Verwijderen
|
||||
MyExtensionsComposite.Form.Upload.Browse=Blader...
|
||||
RefreshJob.FindExtensions.Title=Beschikbare extensies zoeken
|
||||
RefreshJob.FindExtensions.Message=Extensies zoeken op Exchange...
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
DownloadedExtensionsComposite.updateOperateStatus=UPDATE
|
||||
MyExtensionsComposite.UpdateOperateStatus=UPDATE
|
||||
MyExtensionsComposite.DeleteOperateStatus=DELETE
|
||||
ImportExchangeDialog.TEMPLATES_BUTTON=SQL \u0161abloni
|
||||
ImportExchangeDialog.REFRESH_BUTTON=Osve\u017Eavanje
|
||||
|
||||
@@ -1,32 +1,55 @@
|
||||
package org.talend.mdm.bulkload.client;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.Reader;
|
||||
import java.net.URL;
|
||||
import java.util.List;
|
||||
import java.io.*;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
public class BulkloadClient {
|
||||
String url;
|
||||
String username;
|
||||
String password;
|
||||
String universe;
|
||||
String cluster;
|
||||
String concept;
|
||||
String datamodel;
|
||||
BulkloadOptions options=new BulkloadOptions();
|
||||
|
||||
public BulkloadClient(String url, String username,String password,String universe,String cluster,String concept,String datamodel) {
|
||||
|
||||
private String url;
|
||||
|
||||
private String username;
|
||||
|
||||
private String password;
|
||||
|
||||
private String universe;
|
||||
|
||||
private String cluster;
|
||||
|
||||
private String concept;
|
||||
|
||||
private String dataModel;
|
||||
|
||||
private BulkloadOptions options = new BulkloadOptions();
|
||||
|
||||
private static final AtomicInteger startedBulkloadCount = new AtomicInteger(0);
|
||||
|
||||
public BulkloadClient(String url, String username, String password, String universe, String cluster, String concept, String dataModel) {
|
||||
this.url=url;
|
||||
this.username=username;
|
||||
this.password=password;
|
||||
this.universe=universe;
|
||||
this.cluster=cluster;
|
||||
this.concept=concept;
|
||||
this.datamodel=datamodel;
|
||||
this.dataModel = dataModel;
|
||||
}
|
||||
|
||||
public void startThreadCount(){
|
||||
// Kept for compatibility with tMDMBulkload.
|
||||
}
|
||||
|
||||
public void waitForEndOfQueue() {
|
||||
try {
|
||||
synchronized (startedBulkloadCount) {
|
||||
while (startedBulkloadCount.get() > 0) {
|
||||
System.out.println(startedBulkloadCount.get() + " remaining.");
|
||||
startedBulkloadCount.wait();
|
||||
}
|
||||
}
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
@@ -76,11 +99,11 @@ public class BulkloadClient {
|
||||
}
|
||||
|
||||
public String getDatamodel() {
|
||||
return datamodel;
|
||||
return dataModel;
|
||||
}
|
||||
|
||||
public void setDatamodel(String datamodel) {
|
||||
this.datamodel = datamodel;
|
||||
public void setDatamodel(String dataModel) {
|
||||
this.dataModel = dataModel;
|
||||
}
|
||||
|
||||
public BulkloadOptions getOptions() {
|
||||
@@ -90,93 +113,75 @@ public class BulkloadClient {
|
||||
public void setOptions(BulkloadOptions options) {
|
||||
this.options = options;
|
||||
}
|
||||
public void load(List<String > items) {
|
||||
doLoad(items);
|
||||
}
|
||||
/**
|
||||
|
||||
/**
|
||||
* load from a huge xml string
|
||||
* @param xmlString
|
||||
* @param xmlString A full xml document.
|
||||
* @throws Exception Thrown in case of bulk load error.
|
||||
*/
|
||||
public void load(String xmlString)throws Exception {
|
||||
List<String > items=BulkloadClientUtil.getItemXmls(xmlString);
|
||||
doLoad(items);
|
||||
}
|
||||
|
||||
private void doLoad(List<String> items) {
|
||||
if(items.size()>options.getArraySize()) {
|
||||
int loop=items.size()/options.getArraySize();
|
||||
int left=items.size()-options.getArraySize()*loop;
|
||||
for(int i=0; i<loop; i++) {
|
||||
List<String> subItems=items.subList(i*options.getArraySize(), (i+1)*options.getArraySize());
|
||||
try {
|
||||
BulkloadClientUtil.bulkload(url, cluster, concept, datamodel, options.isValidate(), options.isSmartpk(), subItems, username, password,universe);
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
if(left>0) {
|
||||
List<String> subItems=items.subList(loop*options.getArraySize(), loop*options.getArraySize()+left);
|
||||
try {
|
||||
BulkloadClientUtil.bulkload(url, cluster, concept, datamodel, options.isValidate(), options.isSmartpk(), subItems, username, password,universe);
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}else {
|
||||
try {
|
||||
BulkloadClientUtil.bulkload(url, cluster, concept, datamodel, options.isValidate(), options.isSmartpk(), items, username, password,universe);
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* load from File
|
||||
* @param inputXmlFile
|
||||
*/
|
||||
public void load(Reader inputXmlFile) {
|
||||
BufferedReader reader=null;
|
||||
try {
|
||||
reader=new BufferedReader(inputXmlFile);
|
||||
StringBuffer sb=new StringBuffer();
|
||||
String line=reader.readLine();
|
||||
while(line!=null) {
|
||||
sb=sb.append(line);
|
||||
line=reader.readLine();
|
||||
}
|
||||
List<String > items=BulkloadClientUtil.getItemXmls(sb.toString());
|
||||
doLoad(items);
|
||||
}catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
}finally {
|
||||
if(reader!=null)
|
||||
try {
|
||||
reader.close();
|
||||
} catch (IOException e) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
//test
|
||||
//FileReader reader=new FileReader(file)
|
||||
URL url=BulkloadClient.class.getResource("test.xml");
|
||||
try {
|
||||
BufferedInputStream in=((BufferedInputStream)url.getContent());
|
||||
byte[] buf=new byte[in.available()];
|
||||
in.read(buf);
|
||||
String xml=new String(buf);
|
||||
BulkloadClient client=new BulkloadClient("http://localhost:8080/datamanager/loadServlet","admin","talend",null,"Order","Country","Order");
|
||||
client.setOptions(new BulkloadOptions());
|
||||
client.load(xml);
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
public void load(String xmlString) throws Exception {
|
||||
load(new ByteArrayInputStream(xmlString.getBytes("UTF-8")));
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Loads XML documents in MDM using an InputStream. All documents should follow each other.
|
||||
* For instance this InputStream can be used with this method.
|
||||
* </p>
|
||||
*
|
||||
* <code>
|
||||
* InputStream is = new ByteArrayInputStream("<doc></doc><doc></doc><doc></doc>".getBytes());
|
||||
* </code>
|
||||
*
|
||||
* <p>
|
||||
* This method blocks until all documents in <code>xmlDocuments</code> are read. For non blocking use cases
|
||||
* see {@link #load()}.
|
||||
* </p>
|
||||
*
|
||||
* @param xmlDocuments A stream that contains several XML documents.
|
||||
* @throws Exception Thrown in case of bulk load error
|
||||
*/
|
||||
public void load(InputStream xmlDocuments) throws Exception {
|
||||
BulkloadClientUtil.bulkload(url,
|
||||
cluster,
|
||||
concept,
|
||||
dataModel,
|
||||
options.isValidate(),
|
||||
options.isSmartpk(),
|
||||
xmlDocuments,
|
||||
username,
|
||||
password,
|
||||
universe);
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Loads XML documents in MDM using an InputStream created for the load. This method creates a {@link Thread} that
|
||||
* wait for {@link InputStreamMerger#push(java.io.InputStream)} to get called.
|
||||
* </p>
|
||||
*
|
||||
* <code>
|
||||
* BulkloadClient client = ...<br/>
|
||||
* InputStreamMerger is = client.load();<br/>
|
||||
* for(...) {<br/>
|
||||
* is.push(new ByteArrayInputStream("...".getBytes());<br/>
|
||||
* }
|
||||
* </code>
|
||||
*
|
||||
* @throws Exception Thrown in case of communication error
|
||||
* @see InputStreamMerger
|
||||
* @return A {@link InputStreamMerger} that allow asynchronous push to bulkload client.
|
||||
*/
|
||||
public InputStreamMerger load() throws Exception {
|
||||
return BulkloadClientUtil.bulkload(url,
|
||||
cluster,
|
||||
concept,
|
||||
dataModel,
|
||||
options.isValidate(),
|
||||
options.isSmartpk(),
|
||||
username,
|
||||
password,
|
||||
universe,
|
||||
startedBulkloadCount);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,189 +1,131 @@
|
||||
package org.talend.mdm.bulkload.client;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.StringReader;
|
||||
import java.io.StringWriter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerException;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
import javax.xml.transform.dom.DOMSource;
|
||||
import javax.xml.transform.stream.StreamResult;
|
||||
import java.io.InputStream;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import org.apache.commons.httpclient.HostConfiguration;
|
||||
import org.apache.commons.httpclient.HttpClient;
|
||||
import org.apache.commons.httpclient.HttpException;
|
||||
import org.apache.commons.httpclient.NameValuePair;
|
||||
import org.apache.commons.httpclient.URI;
|
||||
import org.apache.commons.httpclient.UsernamePasswordCredentials;
|
||||
import org.apache.commons.httpclient.auth.AuthScope;
|
||||
import org.apache.commons.httpclient.methods.PostMethod;
|
||||
import org.apache.commons.httpclient.cookie.CookiePolicy;
|
||||
import org.apache.commons.httpclient.methods.InputStreamRequestEntity;
|
||||
import org.apache.commons.httpclient.methods.PutMethod;
|
||||
import org.apache.commons.httpclient.params.HttpClientParams;
|
||||
import org.apache.commons.httpclient.params.HttpMethodParams;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.Node;
|
||||
import org.xml.sax.InputSource;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
/**
|
||||
* Bulkload amount items client
|
||||
* @author achen
|
||||
*
|
||||
*/
|
||||
public class BulkloadClientUtil {
|
||||
|
||||
/**
|
||||
* @param args
|
||||
*/
|
||||
public static void main(String[] args)throws Exception {
|
||||
if((!args[0].startsWith("http://") && args.length>0) && (args.length != 9 || args.length!=7 || args.length!=6)) {
|
||||
usage();
|
||||
return;
|
||||
}
|
||||
String url= args[0];
|
||||
String username=args[1];
|
||||
String password=args[2];
|
||||
String cluster= args[3];
|
||||
String concept= args[4];
|
||||
String datamodel= args[5];
|
||||
boolean validate= false;
|
||||
boolean smartpk= false;
|
||||
List<String> itemdata= new ArrayList<String>();
|
||||
if(args.length==9) {
|
||||
validate= Boolean.valueOf(args[6]);
|
||||
smartpk= Boolean.valueOf(args[7]);
|
||||
itemdata=getItemXmls(args[8]);
|
||||
}
|
||||
if(args.length==7) {
|
||||
itemdata=getItemXmls(args[6]);
|
||||
}
|
||||
if(args.length==6) {//get itemdata from System.in
|
||||
byte[] buf=new byte[System.in.available()];
|
||||
System.in.read(buf);
|
||||
itemdata=getItemXmls(new String(buf));
|
||||
}
|
||||
try {
|
||||
bulkload(url,cluster, concept,datamodel, validate, smartpk, itemdata,username,password,null);
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
public static List<String> getItemXmls(String itemdata)throws Exception {
|
||||
Element root=parse(itemdata).getDocumentElement();
|
||||
List<String> items=new ArrayList<String>();
|
||||
for(int i=0; i<root.getChildNodes().getLength(); i++) {
|
||||
Node node=root.getChildNodes().item(i);
|
||||
if(node.getNodeType() == Node.ELEMENT_NODE) {
|
||||
items.add(nodeToString(node, true));
|
||||
}
|
||||
}
|
||||
return items;
|
||||
}
|
||||
|
||||
private static String nodeToString(Node n, boolean omitXMLDeclaration) throws TransformerException{
|
||||
StringWriter sw = new StringWriter();
|
||||
Transformer transformer = TransformerFactory.newInstance().newTransformer();
|
||||
if (omitXMLDeclaration)
|
||||
transformer.setOutputProperty("omit-xml-declaration","yes");
|
||||
else
|
||||
transformer.setOutputProperty("omit-xml-declaration","no");
|
||||
transformer.setOutputProperty("indent","yes");
|
||||
transformer.transform(
|
||||
new DOMSource(n),
|
||||
new StreamResult(sw)
|
||||
);
|
||||
if (sw==null) return null;
|
||||
return sw.toString().replaceAll("\r\n", "\n");
|
||||
}
|
||||
|
||||
private static Document parse(String xmlString) throws ParserConfigurationException,IOException, SAXException{
|
||||
//parse
|
||||
Document d=null;
|
||||
public static void bulkload(String url, String cluster, String concept, String datamodel, boolean validate, boolean smartpk, InputStream itemdata,
|
||||
String username, String password, String universe) throws Exception {
|
||||
HostConfiguration config = new HostConfiguration();
|
||||
URI uri = new URI(url, false, "UTF-8"); //$NON-NLS-1$
|
||||
config.setHost(uri);
|
||||
|
||||
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
|
||||
//Schema validation based on schemaURL
|
||||
factory.setNamespaceAware(true);
|
||||
factory.setAttribute(
|
||||
"http://java.sun.com/xml/jaxp/properties/schemaLanguage",
|
||||
"http://www.w3.org/2001/XMLSchema");
|
||||
DocumentBuilder builder;
|
||||
builder = factory.newDocumentBuilder();
|
||||
NameValuePair[] parameters = {new NameValuePair("cluster", cluster), //$NON-NLS-1$
|
||||
new NameValuePair("concept", concept), //$NON-NLS-1$
|
||||
new NameValuePair("datamodel", datamodel), //$NON-NLS-1$
|
||||
new NameValuePair("validate", String.valueOf(validate)), //$NON-NLS-1$
|
||||
new NameValuePair("action", "load"), //$NON-NLS-1$ //$NON-NLS-2$
|
||||
new NameValuePair("smartpk", String.valueOf(smartpk))}; //$NON-NLS-1$
|
||||
|
||||
d = builder.parse(new InputSource(new StringReader(xmlString)));
|
||||
HttpClient client = new HttpClient();
|
||||
String user = universe == null || universe.trim().length() == 0 ? username : universe + "/" + username; //$NON-NLS-1$
|
||||
client.getState().setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(user, password));
|
||||
HttpClientParams clientParams = client.getParams();
|
||||
clientParams.setAuthenticationPreemptive(true);
|
||||
clientParams.setCookiePolicy(CookiePolicy.IGNORE_COOKIES);
|
||||
|
||||
return d;
|
||||
}
|
||||
private static void usage() {
|
||||
String usage="Usage:\n"+
|
||||
"\t java -jar bulkloadclient.jar <url> <username> <password> <datacontainer> <concept> <datamodel> [validate] [smartpk] [itemdata] \n"+
|
||||
"\t example1: java -jar bulkloadclient.jar http://localhost:8080/datamanager/loadServlet admin talend Order Country Order <itemdata><Country><isoCode>zh</isoCode><label>china</label><Continent>Asia</Continent></Country></itemdata>"+
|
||||
"\t example2(on linux): cat myfile.xml|java -jar bulkloadclient.jar http://localhost:8080/datamanager/loadServlet admin talend Order Country Order";
|
||||
|
||||
System.out.println(usage);
|
||||
}
|
||||
|
||||
|
||||
public static boolean bulkload(String URL, String cluster,String concept,String datamodel, boolean validate, boolean smartpk, List<String> itemdata,
|
||||
String username, String password,String universe) throws Exception {
|
||||
HttpClient client = new HttpClient();
|
||||
HttpClientParams params = new HttpClientParams();
|
||||
// params.setSoTimeout(1000);
|
||||
// params.setConnectionManagerTimeout(200);
|
||||
client.setParams(params);
|
||||
String user=universe==null||universe.trim().length()==0?username:universe+"/"+username;
|
||||
client.getState().setCredentials(AuthScope.ANY,
|
||||
new UsernamePasswordCredentials(user, password));
|
||||
PutMethod putMethod = new PutMethod();
|
||||
// This setPath call is *really* important (if not set, request will be sent to the JBoss root '/')
|
||||
putMethod.setPath(url);
|
||||
String responseBody;
|
||||
try {
|
||||
// Configuration
|
||||
putMethod.setRequestHeader("Content-Type", "text/xml; charset=utf8"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
putMethod.setQueryString(parameters);
|
||||
putMethod.setContentChunked(true);
|
||||
// Set the content of the PUT request
|
||||
putMethod.setRequestEntity(new InputStreamRequestEntity(itemdata));
|
||||
|
||||
URI uri = new URI(URL, false, "utf-8");
|
||||
HostConfiguration config = new HostConfiguration();
|
||||
config.setHost(uri);
|
||||
client.executeMethod(config, putMethod);
|
||||
responseBody = putMethod.getResponseBodyAsString();
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
} finally {
|
||||
putMethod.releaseConnection();
|
||||
}
|
||||
|
||||
PostMethod postMethod = new PostMethod(URL);
|
||||
HttpMethodParams reqParams = postMethod.getParams();
|
||||
reqParams.setContentCharset("UTF-8");
|
||||
List<NameValuePair> list=new ArrayList<NameValuePair>();
|
||||
NameValuePair[] data = { new NameValuePair("cluster", cluster),
|
||||
new NameValuePair("concept", concept),
|
||||
new NameValuePair("datamodel", datamodel),
|
||||
new NameValuePair("validate", String.valueOf(validate)),
|
||||
new NameValuePair("smartpk", String.valueOf(smartpk))};
|
||||
list.addAll(Arrays.asList(data));
|
||||
for(int i=0; i<itemdata.size(); i++) {
|
||||
list.add(new NameValuePair("itemdata"+i, itemdata.get(i)));
|
||||
}
|
||||
postMethod.setRequestBody((NameValuePair[])list.toArray(new NameValuePair[list.size()]));
|
||||
// post method
|
||||
int statusCode = 0;
|
||||
try {
|
||||
statusCode = client.executeMethod(config,postMethod);
|
||||
} catch (HttpException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
int statusCode = putMethod.getStatusCode();
|
||||
if (statusCode >= 400) {
|
||||
throw new BulkloadException(responseBody);
|
||||
}
|
||||
}
|
||||
|
||||
if (statusCode >= 400)
|
||||
return false;
|
||||
String str = "";
|
||||
try {
|
||||
str = postMethod.getResponseBodyAsString();
|
||||
} catch (IOException e) {
|
||||
public static InputStreamMerger bulkload(String url, String cluster, String concept, String dataModel, boolean validate, boolean smartPK, String username, String password, String universe, AtomicInteger startedBulkloadCount) {
|
||||
InputStreamMerger merger = new InputStreamMerger();
|
||||
|
||||
}
|
||||
System.out.println(str);
|
||||
Runnable loadRunnable = new AsyncLoadRunnable(url, cluster, concept, dataModel, validate, smartPK, merger, username, password, universe, startedBulkloadCount);
|
||||
Thread loadThread = new Thread(loadRunnable);
|
||||
loadThread.start();
|
||||
|
||||
postMethod.releaseConnection();
|
||||
return true;
|
||||
}
|
||||
return merger;
|
||||
}
|
||||
|
||||
private static class AsyncLoadRunnable implements Runnable {
|
||||
|
||||
private final String url;
|
||||
|
||||
private final String cluster;
|
||||
|
||||
private final String concept;
|
||||
|
||||
private final String dataModel;
|
||||
|
||||
private final boolean validate;
|
||||
|
||||
private final boolean smartPK;
|
||||
|
||||
private final InputStreamMerger inputStream;
|
||||
|
||||
private final String userName;
|
||||
|
||||
private final String password;
|
||||
|
||||
private final String universe;
|
||||
|
||||
private final AtomicInteger startedBulkloadCount;
|
||||
|
||||
public AsyncLoadRunnable(String url, String cluster, String concept, String dataModel, boolean validate, boolean smartPK, InputStreamMerger inputStream, String userName, String password, String universe, AtomicInteger startedBulkloadCount) {
|
||||
this.url = url;
|
||||
this.cluster = cluster;
|
||||
this.concept = concept;
|
||||
this.dataModel = dataModel;
|
||||
this.validate = validate;
|
||||
this.smartPK = smartPK;
|
||||
this.inputStream = inputStream;
|
||||
this.userName = userName;
|
||||
this.password = password;
|
||||
this.universe = universe;
|
||||
this.startedBulkloadCount = startedBulkloadCount;
|
||||
}
|
||||
|
||||
public void run() {
|
||||
try {
|
||||
startedBulkloadCount.incrementAndGet();
|
||||
bulkload(url, cluster, concept, dataModel, validate, smartPK, inputStream, userName, password, universe);
|
||||
} catch (Throwable e) {
|
||||
inputStream.reportFailure(e);
|
||||
} finally {
|
||||
startedBulkloadCount.decrementAndGet();
|
||||
synchronized (startedBulkloadCount) {
|
||||
startedBulkloadCount.notifyAll();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Copyright (C) 2006-2012 Talend Inc. - www.talend.com
|
||||
*
|
||||
* This source code is available under agreement available at
|
||||
* %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
*
|
||||
* You should have received a copy of the agreement
|
||||
* along with this program; if not, write to Talend SA
|
||||
* 9 rue Pages 92150 Suresnes, France
|
||||
*/
|
||||
|
||||
package org.talend.mdm.bulkload.client;
|
||||
|
||||
import java.io.PrintStream;
|
||||
import java.io.PrintWriter;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class BulkloadException extends RuntimeException {
|
||||
|
||||
private static final String SERVER_EXCEPTION_SEPARATOR = "== SERVER EXCEPTION ==";
|
||||
|
||||
private static final String LINE_SEPARATOR = System.getProperty("line.separator"); //$NON-NLS-1$
|
||||
|
||||
private final String serverException;
|
||||
|
||||
public BulkloadException(String serverException) {
|
||||
super("An exception happened during bulk load on MDM server.");
|
||||
this.serverException = serverException;
|
||||
}
|
||||
|
||||
public String getServerException() {
|
||||
return serverException;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void printStackTrace(PrintStream s) {
|
||||
super.printStackTrace(s);
|
||||
s.append(LINE_SEPARATOR);
|
||||
s.append(SERVER_EXCEPTION_SEPARATOR);
|
||||
s.append(LINE_SEPARATOR);
|
||||
s.append(serverException);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void printStackTrace(PrintWriter s) {
|
||||
super.printStackTrace(s);
|
||||
s.println(SERVER_EXCEPTION_SEPARATOR);
|
||||
s.println(serverException);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,191 @@
|
||||
/*
|
||||
* Copyright (C) 2006-2012 Talend Inc. - www.talend.com
|
||||
*
|
||||
* This source code is available under agreement available at
|
||||
* %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
*
|
||||
* You should have received a copy of the agreement
|
||||
* along with this program; if not, write to Talend SA
|
||||
* 9 rue Pages 92150 Suresnes, France
|
||||
*/
|
||||
|
||||
package org.talend.mdm.bulkload.client;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.Queue;
|
||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class InputStreamMerger extends InputStream {
|
||||
|
||||
private static final Logger log = Logger.getLogger(InputStreamMerger.class.getName());
|
||||
|
||||
private final Queue<InputStream> inputStreamBuffer = new ConcurrentLinkedQueue<InputStream>();
|
||||
|
||||
private final Object readLock = new Object();
|
||||
|
||||
private final Object exhaustLock = new Object();
|
||||
|
||||
private boolean isClosed;
|
||||
|
||||
private InputStream currentStream;
|
||||
|
||||
private boolean hasFinishedRead;
|
||||
|
||||
private Throwable lastFailure;
|
||||
|
||||
public void push(InputStream inputStream) throws IOException {
|
||||
if (inputStream == null) {
|
||||
throw new IllegalArgumentException("Input stream can not be null.");
|
||||
}
|
||||
if (isClosed) {
|
||||
throw new IOException("Stream is closed");
|
||||
}
|
||||
inputStreamBuffer.add(inputStream);
|
||||
debug("Added a new input stream (buffer now has " + inputStreamBuffer.size() + " streams)");
|
||||
}
|
||||
|
||||
public void reportFailure(Throwable e) {
|
||||
debug("Exception occurred in consumer thread: " + e.getMessage());
|
||||
lastFailure = e;
|
||||
synchronized (exhaustLock) {
|
||||
exhaustLock.notifyAll();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int available() throws IOException {
|
||||
return 4096;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean markSupported() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* <p> Read block the current thread until data is pushed to this stream (using {@link #push(java.io.InputStream)}
|
||||
* or if {@link #close()} is called. </p>
|
||||
*
|
||||
* @return the next byte of data, or <code>-1</code> if the end of the stream is reached <b>or</b> if stream is
|
||||
* closed.
|
||||
* @throws IOException
|
||||
* @see java.io.InputStream#read()
|
||||
*/
|
||||
@Override
|
||||
public int read() throws IOException {
|
||||
int read = -1;
|
||||
if (currentStream != null) {
|
||||
read = currentStream.read();
|
||||
} else {
|
||||
moveToNextInputStream();
|
||||
if (currentStream != null) {
|
||||
read = currentStream.read();
|
||||
}
|
||||
}
|
||||
if (read < 0) {
|
||||
moveToNextInputStream();
|
||||
if (currentStream != null) {
|
||||
read = currentStream.read();
|
||||
}
|
||||
}
|
||||
if (read < 0) {
|
||||
synchronized (exhaustLock) {
|
||||
debug("Notify exhaust lock");
|
||||
exhaustLock.notifyAll();
|
||||
}
|
||||
}
|
||||
// Throw any exception that might have occurred during last record processing.
|
||||
throwLastFailure();
|
||||
return read;
|
||||
}
|
||||
|
||||
private void throwLastFailure() throws IOException {
|
||||
if (lastFailure != null) {
|
||||
debug("Report last failure exception to producer.");
|
||||
throw new IOException("An exception occurred while processing last record.", lastFailure);
|
||||
}
|
||||
}
|
||||
|
||||
private void moveToNextInputStream() throws IOException {
|
||||
// Throw any exception that might have occurred during previous records
|
||||
throwLastFailure();
|
||||
// Check the isClosed flag in case we've got waken up by a close()
|
||||
while (inputStreamBuffer.isEmpty() && !isClosed) {
|
||||
synchronized (readLock) {
|
||||
try {
|
||||
debug("Wait for more input...");
|
||||
readLock.wait();
|
||||
debug("Wait for more input done.");
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!inputStreamBuffer.isEmpty()) {
|
||||
if (currentStream != null) {
|
||||
currentStream.close();
|
||||
}
|
||||
currentStream = inputStreamBuffer.poll();
|
||||
} else {
|
||||
currentStream = null;
|
||||
hasFinishedRead = true;
|
||||
}
|
||||
debug("Remaining buffers : " + inputStreamBuffer.size());
|
||||
}
|
||||
|
||||
/**
|
||||
* <p> Close this stream and perform some checks: <ul> <li>Mark this stream as closed (no more calls to {@link
|
||||
* #push(java.io.InputStream)} are allowed)</li> <li>Closes any remaining stream pushed to this stream</li> </ul>
|
||||
* </p> <p> Calling this method wakes up any thread blocked on {@link #read()} </p> <p> Wait till all streams pushed
|
||||
* to this stream (and stored in <code>inputStreamBuffer</code>) are processed by a reader. </p> <p> When this
|
||||
* method exits, the buffer is empty and the last stream in buffer is fully read (i.e. until read() returns -1).
|
||||
* </p>
|
||||
*
|
||||
* @throws IOException In case at least one stream in buffer hasn't been read.
|
||||
* @see java.io.InputStream#close()
|
||||
*/
|
||||
@Override
|
||||
public void close() throws IOException {
|
||||
super.close();
|
||||
isClosed = true;
|
||||
synchronized (readLock) {
|
||||
readLock.notifyAll();
|
||||
}
|
||||
debug("Input stream buffer size: " + +inputStreamBuffer.size());
|
||||
debug("Has finished read: " + hasFinishedRead);
|
||||
debug("Stop condition: " + (!inputStreamBuffer.isEmpty() && !hasFinishedRead));
|
||||
while (!inputStreamBuffer.isEmpty() && !hasFinishedRead) {
|
||||
try {
|
||||
debug("Waiting for exhaust... (" + inputStreamBuffer.size() + " remaining)");
|
||||
synchronized (exhaustLock) {
|
||||
exhaustLock.wait();
|
||||
}
|
||||
// In case we got woken up due to a failure
|
||||
throwLastFailure();
|
||||
debug("Waiting for exhaust done.");
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
// In case failure happened on very last read.
|
||||
throwLastFailure();
|
||||
debug("Close completed.");
|
||||
}
|
||||
|
||||
private static void debug(String message) {
|
||||
Level debugLevel = Level.FINEST;
|
||||
if (log.isLoggable(debugLevel)) {
|
||||
log.log(debugLevel, "[" + Thread.currentThread() + "] " + message);
|
||||
}
|
||||
}
|
||||
|
||||
public Throwable getLastReportedFailure() {
|
||||
return lastFailure;
|
||||
}
|
||||
}
|
||||
@@ -15,8 +15,8 @@
|
||||
<pathelement location="${component.plugin.home}/tFileInputXML/dom4j-1.6.1.jar" />
|
||||
<pathelement location="${component.plugin.home}/tMicrosoftCrmInput/geronimo-stax-api_1.0_spec-1.0.jar" />
|
||||
<pathelement location="${component.plugin.home}/tFileInputExcel/log4j-1.2.15.jar" />
|
||||
<pathelement location="${component.plugin.home}/tFileInputExcel/poi-3.8-20120326.jar" />
|
||||
<pathelement location="${component.plugin.home}/tFileInputExcel/poi-ooxml-3.8-20120326.jar" />
|
||||
<pathelement location="${component.plugin.home}/tFileInputExcel/poi-3.8-20120913_modified_talend.jar" />
|
||||
<pathelement location="${component.plugin.home}/tFileInputExcel/poi-ooxml-3.8-20121127_modified_talend.jar" />
|
||||
<pathelement location="${component.plugin.home}/tFileInputExcel/poi-ooxml-schemas-3.8-20120326.jar" />
|
||||
<pathelement location="${component.plugin.home}/tFileInputExcel/poi-scratchpad-3.8-20120326.jar" />
|
||||
<pathelement location="${component.plugin.home}/tMicrosoftCrmInput/xmlbeans-2.3.0.jar" />
|
||||
|
||||
@@ -27,30 +27,41 @@ public class DefaultTalendSheetContentsHandler implements TalendXSSFSheetXMLHand
|
||||
|
||||
private boolean stop = false;
|
||||
|
||||
private int currentColumnIndex = -1;
|
||||
|
||||
private int lastColumnIndex = -1;
|
||||
|
||||
public DefaultTalendSheetContentsHandler(DataBufferCache cache) {
|
||||
this.cache = cache;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startRow(int rowNum) {
|
||||
row = new ArrayList<String>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endRow() {
|
||||
cache.writeData(row);
|
||||
row = null;
|
||||
|
||||
// when each row end ,reset lastColumnIndex
|
||||
lastColumnIndex = -1;
|
||||
if (stop) {
|
||||
throw new EnoughDataException("Get enough data,now stop the xml parse action");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cell(String cellReference, String formattedValue) {
|
||||
checkHasNullValue(cellReference);
|
||||
row.add(formattedValue);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void headerFooter(String text, boolean isHeader, String tagName) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endSheet() {
|
||||
|
||||
}
|
||||
@@ -59,4 +70,40 @@ public class DefaultTalendSheetContentsHandler implements TalendXSSFSheetXMLHand
|
||||
this.stop = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* when currentCellReferecnce is "A1" ,and next currentCellReferecnce is "C1",we need add a null value for "B1"
|
||||
*/
|
||||
private void checkHasNullValue(String cellReference) {
|
||||
currentColumnIndex = getIndexOfColumn(cellReference);
|
||||
// Might be the empty string.
|
||||
for (int i = lastColumnIndex; i < currentColumnIndex - 1; i++) {
|
||||
row.add(null);
|
||||
}
|
||||
// Update column
|
||||
if (currentColumnIndex > -1) {
|
||||
lastColumnIndex = currentColumnIndex;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* get index of column,like "AB12" return 27
|
||||
*/
|
||||
private int getIndexOfColumn(String cellReference) {
|
||||
int columnIndex = -1;
|
||||
// get First Digit index ,like cellReferecnce is "AA13" ,firstDigitIndex return 2
|
||||
int firstDigitIndex = -1;
|
||||
for (int c = 0; c < cellReference.length(); ++c) {
|
||||
if (Character.isDigit(cellReference.charAt(c))) {
|
||||
firstDigitIndex = c;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// get String part for cellReference,like "AB2" ,return "AB"
|
||||
String cellStringPart = cellReference.substring(0, firstDigitIndex);
|
||||
for (int i = 0; i < cellStringPart.length(); ++i) {
|
||||
int c = cellStringPart.charAt(i);
|
||||
columnIndex = (columnIndex + 1) * 26 + c - 'A';
|
||||
}
|
||||
return columnIndex;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1412,8 +1412,7 @@ public class MktowsApiSoapBindingStub extends org.apache.axis.client.Stub implem
|
||||
public void addMarketoAuthenticatioNHeader(org.apache.axis.client.Call _call) throws Exception {
|
||||
// Request timestamp: a timestamp string in W3C WSDL date format
|
||||
|
||||
DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm");
|
||||
String requestTimestamp = df.format(Calendar.getInstance().getTime());
|
||||
String requestTimestamp = formatAsW3C(Calendar.getInstance().getTime());
|
||||
// System.out.println(requestTimestamp);
|
||||
|
||||
String stringToEncrypt = requestTimestamp + clientAccessID;
|
||||
@@ -1435,6 +1434,13 @@ public class MktowsApiSoapBindingStub extends org.apache.axis.client.Stub implem
|
||||
// System.out.println(authenticationHeader.getAsString());
|
||||
_call.addHeader(authenticationHeader);
|
||||
}
|
||||
|
||||
public String formatAsW3C(java.util.Date dt) {
|
||||
DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
|
||||
String text = df.format(dt);
|
||||
String w3cValue = text.substring(0, 22) + ":" + text.substring(22);
|
||||
return w3cValue;
|
||||
}
|
||||
|
||||
public com.marketo.www.mktows.SuccessGetLeadActivity getLeadActivity(com.marketo.www.mktows.ParamsGetLeadActivity paramsGetLeadActivity) throws java.rmi.RemoteException {
|
||||
if (super.cachedEndpoint == null) {
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<pathelement location="${component.plugin.home}/tMicrosoftCrmInput/geronimo-stax-api_1.0_spec-1.0.jar" />
|
||||
<pathelement location="${component.plugin.home}/tFileInputExcel/log4j-1.2.15.jar" />
|
||||
<pathelement location="${component.plugin.home}/tFileInputExcel/poi-3.8-20120913_modified_talend.jar" />
|
||||
<pathelement location="${component.plugin.home}/tFileInputExcel/poi-ooxml-3.8-20120326.jar" />
|
||||
<pathelement location="${component.plugin.home}/tFileInputExcel/poi-ooxml-3.8-20121127_modified_talend.jar" />
|
||||
<pathelement location="${component.plugin.home}/tFileInputExcel/poi-ooxml-schemas-3.8-20120326.jar" />
|
||||
<pathelement location="${component.plugin.home}/tFileInputExcel/poi-scratchpad-3.8-20120326.jar" />
|
||||
<pathelement location="${component.plugin.home}/tMicrosoftCrmInput/xmlbeans-2.3.0.jar" />
|
||||
|
||||
@@ -3,6 +3,8 @@ package org.talend.designer.components.hashfile.common;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.Iterator;
|
||||
import org.talend.designer.components.hashfile.memory.AdvancedMemoryHashFile;
|
||||
|
||||
public class MapHashFile {
|
||||
@@ -39,4 +41,29 @@ public class MapHashFile {
|
||||
public Map<String, String> getKeyMap() {
|
||||
return keyMap;
|
||||
}
|
||||
public void clearCache(String key){
|
||||
clearChildCache(getRootCache(key));
|
||||
}
|
||||
public void clearChildCache(String root){
|
||||
Set<String> set = keyMap.keySet();
|
||||
synchronized(keyMap) {
|
||||
Iterator<String> it = set.iterator();
|
||||
while(it.hasNext()){
|
||||
String key = it.next();
|
||||
if(keyMap.get(key).equals(root)){
|
||||
this.resourceMap.remove(key);
|
||||
clearChildCache(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
this.resourceMap.remove(root);
|
||||
}
|
||||
|
||||
public String getRootCache(String cache){
|
||||
String root;
|
||||
while((root = keyMap.get(cache))!=null){
|
||||
cache=root;
|
||||
}
|
||||
return cache;
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,7 @@
|
||||
// ============================================================================
|
||||
package org.talend.designer.components.hashfile.memory;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
@@ -34,9 +35,9 @@ public class AdvancedMemoryHashFile<V> {
|
||||
public AdvancedMemoryHashFile(MATCHING_MODE matchingMode) {
|
||||
this.matchingMode = matchingMode;
|
||||
if (matchingMode == MATCHING_MODE.KEEP_ALL) {
|
||||
allList = new ArrayList<V>();
|
||||
allList = Collections.synchronizedList(new ArrayList<V>());
|
||||
} else if (matchingMode == MATCHING_MODE.KEEP_FIRST) {
|
||||
firstHash = new HashMap<V, V>();
|
||||
firstHash = Collections.synchronizedMap(new HashMap<V, V>());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ bin.excludes = components/tBonitaDeploy/,\
|
||||
components/tMSSqlInput/jtds-1.2.5.jar,\
|
||||
components/tMicrosoftMQInput/msmq.jar,\
|
||||
components/tMysqlInput/mysql-connector-java-3.1.14-bin.jar,\
|
||||
components/tAmazonMysqlInput/mysql-connector-java-5.1.0-bin.jar,\
|
||||
components/tAmazonMysqlInput/mysql-connector-java-5.1.22-bin.jar,\
|
||||
components/tAmazonMysqlInput/mysql-connector-java-5.1.0-bin.jar,\
|
||||
components/tGreenplumGPLoad/namedpipe_jni.dll,\
|
||||
components/tNamedPipeOutput/namedpipe_jni.dll,\
|
||||
|
||||
@@ -1,2 +1,4 @@
|
||||
PASS.NAME=Wachtwoord
|
||||
USER.NAME=Gebruikersnaam
|
||||
DB_VERSION.ITEM.V5R2_V5R4=V5R2 to V5R4
|
||||
DB_VERSION.ITEM.V5R3_V6R1=V5R3 to V6R1
|
||||
|
||||
@@ -7,9 +7,7 @@ imports="
|
||||
org.talend.designer.codegen.config.CodeGeneratorArgument
|
||||
org.talend.core.model.process.IConnection
|
||||
org.talend.core.model.process.IConnectionCategory
|
||||
org.talend.core.model.metadata.builder.database.ExtractMetaDataUtils
|
||||
org.talend.core.model.metadata.types.JavaTypesManager
|
||||
org.talend.core.model.metadata.types.JavaType
|
||||
java.util.List
|
||||
java.util.Map"
|
||||
%>
|
||||
|
||||
@@ -1,2 +1,4 @@
|
||||
PASS.NAME=Wachtwoord
|
||||
USER.NAME=Gebruikersnaam
|
||||
DB_VERSION.ITEM.V5R2_V5R4=V5R2 to V5R4
|
||||
DB_VERSION.ITEM.V5R3_V6R1=V5R3 to V6R1
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<%@ jet
|
||||
imports="
|
||||
org.talend.core.model.process.INode
|
||||
org.talend.core.model.process.ElementParameterParser
|
||||
org.talend.designer.codegen.config.CodeGeneratorArgument
|
||||
"
|
||||
%>
|
||||
|
||||
@@ -4,9 +4,6 @@ imports="
|
||||
org.talend.core.model.process.INode
|
||||
org.talend.core.model.process.ElementParameterParser
|
||||
org.talend.core.model.metadata.IMetadataTable
|
||||
org.talend.core.model.metadata.IMetadataColumn
|
||||
org.talend.core.model.metadata.types.JavaTypesManager
|
||||
org.talend.core.model.metadata.types.JavaType
|
||||
org.talend.core.model.metadata.MappingTypeRetriever
|
||||
org.talend.core.model.metadata.MetadataTalendType
|
||||
org.talend.core.model.process.IConnection
|
||||
@@ -14,7 +11,6 @@ imports="
|
||||
java.util.ArrayList
|
||||
java.util.Map
|
||||
java.util.HashMap
|
||||
java.util.LinkedList
|
||||
"
|
||||
skeleton="../templates/db_output_bulk.skeleton"
|
||||
%>
|
||||
|
||||
@@ -4,10 +4,8 @@ imports="
|
||||
org.talend.core.model.process.INode
|
||||
org.talend.core.model.process.ElementParameterParser
|
||||
org.talend.core.model.process.IConnection
|
||||
org.talend.core.model.metadata.IMetadataColumn
|
||||
org.talend.core.model.metadata.IMetadataTable
|
||||
org.talend.core.model.metadata.types.JavaTypesManager
|
||||
org.talend.core.model.metadata.types.JavaType
|
||||
org.talend.core.model.metadata.MappingTypeRetriever
|
||||
org.talend.core.model.metadata.MetadataTalendType
|
||||
org.talend.core.model.process.IConnectionCategory
|
||||
@@ -15,7 +13,6 @@ imports="
|
||||
java.util.ArrayList
|
||||
java.util.Map
|
||||
java.util.HashMap
|
||||
java.util.LinkedList
|
||||
"
|
||||
skeleton="../templates/db_output_bulk.skeleton"
|
||||
%>
|
||||
|
||||
@@ -24,7 +24,7 @@ DATA_ACTION.ITEM.INSERT_OR_UPDATE=Insert ou update
|
||||
DATA_ACTION.ITEM.UPDATE=UPDATE
|
||||
DATA_ACTION.ITEM.UPDATE_OR_INSERT=Update ou insert
|
||||
DATA_ACTION.NAME=Action sur les données
|
||||
DIE_ON_ERROR.NAME=Terminer en cas d'erreur
|
||||
DIE_ON_ERROR.NAME=Arrêter en cas d'erreur
|
||||
ENCODING.NAME=Encodage
|
||||
FIELD_OPTIONS.ITEM.DELETE_KEY=Clé pour suppression
|
||||
FIELD_OPTIONS.ITEM.INSERTABLE=Insérable
|
||||
|
||||
@@ -6,5 +6,9 @@ ADD_COLS.ITEM.OPERATOR.ITEM.IS=IS
|
||||
ADD_COLS.ITEM.OPERATOR.ITEM.LESS_THAN=Kleiner dan
|
||||
ADD_COLS.ITEM.OPERATOR.ITEM.NOT_EQUAL=<>
|
||||
COMMIT_EVERY.NAME=Commit iedere
|
||||
DATA_ACTION.ITEM.DELETE=Verwijderen
|
||||
DATA_ACTION.ITEM.UPDATE=Update
|
||||
PASS.NAME=Wachtwoord
|
||||
USER.NAME=Gebruikersnaam
|
||||
DB_VERSION.ITEM.V5R2_V5R4=V5R2 to V5R4
|
||||
DB_VERSION.ITEM.V5R3_V6R1=V5R3 to V6R1
|
||||
|
||||
@@ -6,6 +6,5 @@ ADD_COLS.ITEM.OPERATOR.ITEM.LESS_THAN=Manje od
|
||||
ADD_COLS.ITEM.OPERATOR.ITEM.NOT_EQUAL=<>
|
||||
ADD_COLS.ITEM.REFCOL=Referentna kolona
|
||||
ADD_COLS.ITEM.SQL=SQL izraz
|
||||
DATA_ACTION.ITEM.DELETE=DELETE
|
||||
DATA_ACTION.ITEM.INSERT=INSERT
|
||||
DATA_ACTION.ITEM.UPDATE=UPDATE
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
COMMIT_EVERY.NAME=Commiter toutes les
|
||||
DBD-DB2.INFO=Requis
|
||||
DIE_ON_ERROR.NAME=Terminer en cas d'erreur
|
||||
DIE_ON_ERROR.NAME=Arrêter en cas d'erreur
|
||||
ENCODING.NAME=Encodage
|
||||
HELP=org.talend.help.tAS400Row
|
||||
HOST.NAME=Hôte
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
COMMIT_EVERY.NAME=Commit iedere
|
||||
PASS.NAME=Wachtwoord
|
||||
USER.NAME=Gebruikersnaam
|
||||
DB_VERSION.ITEM.V5R2_V5R4=V5R2 to V5R4
|
||||
DB_VERSION.ITEM.V5R3_V6R1=V5R3 to V6R1
|
||||
|
||||
@@ -4,7 +4,6 @@ imports="
|
||||
org.talend.core.model.process.ElementParameterParser
|
||||
org.talend.designer.codegen.config.CodeGeneratorArgument
|
||||
org.talend.core.model.metadata.IMetadataTable
|
||||
org.talend.core.model.metadata.IMetadataColumn
|
||||
org.talend.core.model.metadata.MetadataTalendType
|
||||
org.talend.core.model.metadata.MappingTypeRetriever
|
||||
java.util.List
|
||||
|
||||
@@ -1,2 +1,4 @@
|
||||
PASS.NAME=Wachtwoord
|
||||
USER.NAME=Gebruikersnaam
|
||||
DB_VERSION.ITEM.Access_2003=Access 2003
|
||||
DB_VERSION.ITEM.Access_2007=Access 2007
|
||||
|
||||
@@ -1,2 +1,4 @@
|
||||
PASS.NAME=Wachtwoord
|
||||
USER.NAME=Gebruikersnaam
|
||||
DB_VERSION.ITEM.Access_2003=Access 2003
|
||||
DB_VERSION.ITEM.Access_2007=Access 2007
|
||||
|
||||
@@ -7,9 +7,7 @@ imports="
|
||||
org.talend.designer.codegen.config.CodeGeneratorArgument
|
||||
org.talend.core.model.process.IConnection
|
||||
org.talend.core.model.process.IConnectionCategory
|
||||
org.talend.core.model.metadata.builder.database.ExtractMetaDataUtils
|
||||
org.talend.core.model.metadata.types.JavaTypesManager
|
||||
org.talend.core.model.metadata.types.JavaType
|
||||
java.util.List
|
||||
java.util.Map
|
||||
"
|
||||
|
||||
@@ -1 +1,3 @@
|
||||
PASS.NAME=Wachtwoord
|
||||
DB_VERSION.ITEM.Access_2003=Access 2003
|
||||
DB_VERSION.ITEM.Access_2007=Access 2007
|
||||
|
||||
@@ -3,16 +3,12 @@ imports="org.talend.designer.codegen.config.CodeGeneratorArgument
|
||||
org.talend.core.model.process.INode
|
||||
org.talend.core.model.process.ElementParameterParser
|
||||
org.talend.core.model.metadata.IMetadataTable
|
||||
org.talend.core.model.metadata.IMetadataColumn
|
||||
org.talend.core.model.metadata.types.JavaTypesManager
|
||||
org.talend.core.model.metadata.types.JavaType
|
||||
org.talend.core.model.metadata.MappingTypeRetriever
|
||||
org.talend.core.model.metadata.MetadataTalendType
|
||||
java.util.List
|
||||
java.util.ArrayList
|
||||
java.util.Map
|
||||
java.util.HashMap
|
||||
java.util.LinkedList"
|
||||
java.util.HashMap"
|
||||
skeleton="../templates/db_output_bulk.skeleton"
|
||||
%>
|
||||
|
||||
|
||||
@@ -4,10 +4,8 @@ imports="
|
||||
org.talend.core.model.process.INode
|
||||
org.talend.core.model.process.ElementParameterParser
|
||||
org.talend.core.model.process.IConnection
|
||||
org.talend.core.model.metadata.IMetadataColumn
|
||||
org.talend.core.model.metadata.IMetadataTable
|
||||
org.talend.core.model.metadata.types.JavaTypesManager
|
||||
org.talend.core.model.metadata.types.JavaType
|
||||
org.talend.core.model.metadata.MappingTypeRetriever
|
||||
org.talend.core.model.metadata.MetadataTalendType
|
||||
org.talend.core.model.process.IConnectionCategory
|
||||
@@ -15,7 +13,6 @@ imports="
|
||||
java.util.ArrayList
|
||||
java.util.Map
|
||||
java.util.HashMap
|
||||
java.util.LinkedList
|
||||
"
|
||||
skeleton="../templates/db_output_bulk.skeleton"
|
||||
%>
|
||||
|
||||
@@ -15,7 +15,7 @@ DATA_ACTION.ITEM.INSERT_OR_UPDATE=Insert ou update
|
||||
DATA_ACTION.ITEM.UPDATE=UPDATE
|
||||
DATA_ACTION.ITEM.UPDATE_OR_INSERT=Update ou insert
|
||||
DATA_ACTION.NAME=Action sur les données
|
||||
DIE_ON_ERROR.NAME=Terminer en cas d'erreur
|
||||
DIE_ON_ERROR.NAME=Arrêter en cas d'erreur
|
||||
ENCODING.NAME=Encodage
|
||||
HELP=org.talend.help.tAccessOutput
|
||||
LONG_NAME=Insère ou met à jour des lignes dans une table Access.
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
ADD_COLS.ITEM.NAME=Naam
|
||||
COMMIT_EVERY.NAME=Commit iedere
|
||||
DATA_ACTION.ITEM.DELETE=Verwijderen
|
||||
DATA_ACTION.ITEM.UPDATE=Update
|
||||
PASS.NAME=Wachtwoord
|
||||
ADD_COLS.ITEM.OPERATOR.ITEM.NOT_EQUAL=<>
|
||||
ADD_COLS.ITEM.OPERATOR.ITEM.LESS_THAN=Kleiner dan
|
||||
@@ -7,3 +9,5 @@ ADD_COLS.ITEM.OPERATOR.ITEM.LESS_EQUAL_THAN=Kleiner dan
|
||||
ADD_COLS.ITEM.OPERATOR.ITEM.GREAT_THAN=Groter dan of gelijk aan
|
||||
ADD_COLS.ITEM.OPERATOR.ITEM.GREAT_EQUAL_THAN=Groter dan of gelijk aan
|
||||
ADD_COLS.ITEM.OPERATOR.ITEM.IS=IS
|
||||
DB_VERSION.ITEM.Access_2003=Access 2003
|
||||
DB_VERSION.ITEM.Access_2007=Access 2007
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
ADD_COLS.ITEM.REFCOL=Referentna kolona
|
||||
ADD_COLS.ITEM.SQL=SQL izraz
|
||||
DATA_ACTION.ITEM.DELETE=DELETE
|
||||
DATA_ACTION.ITEM.INSERT=INSERT
|
||||
DATA_ACTION.ITEM.UPDATE=UPDATE
|
||||
ADD_COLS.ITEM.OPERATOR.ITEM.NOT_EQUAL=<>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
APPEND.NAME=Ecrire après
|
||||
ENCODING.NAME=Encodage
|
||||
FILENAME.NAME=Nom de fichier
|
||||
HELP=org.talend.help.tAccessOutputBulk
|
||||
INCLUDEHEADER.NAME=Inclure l'en-tête
|
||||
LONG_NAME=Ecrit un fichier préparé pour chargement de masse Access
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
APPEND.NAME=Ecrire après
|
||||
DBNAME.NAME=Nom de la base de données
|
||||
DB_SCHEMA.NAME=Schéma
|
||||
FILENAME.NAME=Nom de fichier
|
||||
HELP=org.talend.help.tAccessOutputBulkExec
|
||||
INCLUDEHEADER.NAME=Inclure l'en-tête
|
||||
LONG_NAME=Construit un fichier de masse au format Access, et demande à la base de données de charger ce fichier
|
||||
@@ -31,3 +32,4 @@ CREATE.NAME=Cr
|
||||
PROPERTIES.NAME=Paramètres JDBC supplémentaires
|
||||
USE_EXISTING_CONNECTION.NAME=Utiliser une connexion existante
|
||||
USE_FIELDS_ENCLOSURE.NAME=Utiliser l'entourage du texte
|
||||
FIELDS_ENCLOSURE.NAME=Entourage du champ
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
APPEND.NAME=Toevoegen
|
||||
PASS.NAME=Wachtwoord
|
||||
USER.NAME=Gebruikersnaam
|
||||
DB_VERSION.ITEM.Access_2003=Access 2003
|
||||
DB_VERSION.ITEM.Access_2007=Access 2007
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
COMMIT_EVERY.NAME=Commiter toutes les
|
||||
TABLE.NAME=Nom de la table
|
||||
DIE_ON_ERROR.NAME=Terminer en cas d'erreur
|
||||
DIE_ON_ERROR.NAME=Arrêter en cas d'erreur
|
||||
ENCODING.NAME=Encodage
|
||||
HELP=org.talend.help.tAccessRow
|
||||
LONG_NAME=Exécute une requête SQL à chaque itération de flux Talend
|
||||
|
||||
@@ -1,2 +1,4 @@
|
||||
COMMIT_EVERY.NAME=Commit iedere
|
||||
PASS.NAME=Wachtwoord
|
||||
DB_VERSION.ITEM.Access_2003=Access 2003
|
||||
DB_VERSION.ITEM.Access_2007=Access 2007
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
<%@ jet
|
||||
imports="
|
||||
org.talend.core.model.process.INode
|
||||
org.talend.core.model.process.ElementParameterParser
|
||||
org.talend.core.model.metadata.IMetadataTable
|
||||
org.talend.designer.codegen.config.CodeGeneratorArgument
|
||||
java.util.List
|
||||
"
|
||||
%>
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<%@ jet
|
||||
imports="
|
||||
org.talend.core.model.process.INode
|
||||
org.talend.core.model.process.ElementParameterParser
|
||||
org.talend.designer.codegen.config.CodeGeneratorArgument
|
||||
"
|
||||
%>
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
LOCATION_TYPE_CODE2.NAME=Land code 2 letters
|
||||
LOCATION_TYPE_CODE3.NAME=Land code 3 letters
|
||||
LOCATION_TYPE_CODE.NAME=Land code
|
||||
@@ -0,0 +1,583 @@
|
||||
<%@ jet
|
||||
imports="
|
||||
org.talend.core.model.process.INode
|
||||
org.talend.core.model.process.ElementParameterParser
|
||||
org.talend.designer.codegen.config.CodeGeneratorArgument
|
||||
org.talend.core.model.metadata.IMetadataTable
|
||||
java.util.List
|
||||
java.util.Map
|
||||
org.talend.core.model.process.IConnection
|
||||
org.talend.core.model.process.IConnectionCategory
|
||||
org.talend.core.model.metadata.IMetadataColumn
|
||||
java.util.ArrayList
|
||||
java.util.LinkedList
|
||||
org.talend.core.model.metadata.types.JavaTypesManager
|
||||
org.talend.core.model.metadata.types.JavaType
|
||||
org.talend.core.model.utils.NodeUtil
|
||||
"
|
||||
%>
|
||||
<%
|
||||
//XMLTool
|
||||
class XMLTool{
|
||||
public boolean advancedSeparator = false;
|
||||
public String thousandsSeparator = null;
|
||||
public String decimalSeparator =null;
|
||||
public String connName = null;
|
||||
public String cid = null;
|
||||
|
||||
public void getValue(XMLNode node){
|
||||
%>
|
||||
valueMap_<%=cid%>.get("<%=node.relatedColumn.getLabel()%>")
|
||||
<%
|
||||
}
|
||||
|
||||
public void getValue(IMetadataColumn column){
|
||||
JavaType javaType = JavaTypesManager.getJavaTypeFromId(column.getTalendType());
|
||||
String defaultValue=column.getDefault();
|
||||
boolean isNotSetDefault = false;
|
||||
if(defaultValue!=null){
|
||||
isNotSetDefault = defaultValue.length()==0;
|
||||
}else{
|
||||
isNotSetDefault=true;
|
||||
}
|
||||
%>
|
||||
(
|
||||
<%
|
||||
if(column.isNullable()){
|
||||
%>
|
||||
<%=connName%>.<%=column.getLabel()%> != null?
|
||||
<%
|
||||
}
|
||||
|
||||
if(advancedSeparator && JavaTypesManager.isNumberType(javaType, column.isNullable())) {
|
||||
if(javaType == JavaTypesManager.BIGDECIMAL) {
|
||||
%>
|
||||
FormatterUtils.format_Number(String.valueOf(<%=column.getPrecision() == null? connName + "." + column.getLabel() : connName + "." + column.getLabel() + ".setScale(" + column.getPrecision() + ", java.math.RoundingMode.HALF_UP)" %>), <%= thousandsSeparator%>,<%=decimalSeparator %>)
|
||||
<%
|
||||
} else {
|
||||
%>
|
||||
FormatterUtils.format_Number(String.valueOf(<%=connName%>.<%=column.getLabel()%>), <%= thousandsSeparator %>,<%=decimalSeparator %>)
|
||||
<%
|
||||
}
|
||||
} else if(JavaTypesManager.isJavaPrimitiveType( column.getTalendType(), column.isNullable())){
|
||||
%>
|
||||
String.valueOf(<%=connName%>.<%=column.getLabel()%>)
|
||||
<%
|
||||
}else if(javaType == JavaTypesManager.DATE){
|
||||
if( column.getPattern() != null && column.getPattern().trim().length() != 0 ){
|
||||
%>
|
||||
FormatterUtils.format_Date(<%=connName%>.<%=column.getLabel()%>,<%=column.getPattern()%>)
|
||||
<%
|
||||
}else{
|
||||
%>
|
||||
<%=connName%>.<%=column.getLabel()%>
|
||||
<%
|
||||
}
|
||||
}else if (javaType == JavaTypesManager.BIGDECIMAL) {
|
||||
%>
|
||||
String.valueOf(<%=column.getPrecision() == null? connName + "." + column.getLabel() : connName + "." + column.getLabel() + ".setScale(" + column.getPrecision() + ", java.math.RoundingMode.HALF_UP)" %>)
|
||||
<%
|
||||
}else{
|
||||
%>
|
||||
<%=connName%>.<%=column.getLabel()%>.toString()
|
||||
<%
|
||||
}
|
||||
if(column.isNullable()){
|
||||
%>:<%
|
||||
if(isNotSetDefault == false){
|
||||
%><%=column.getDefault()%><%
|
||||
}else{
|
||||
%>null<%
|
||||
}
|
||||
}
|
||||
%>
|
||||
)
|
||||
<%
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------- *** Dom4j generation mode start *** ------------------- //
|
||||
class GenerateToolByDom4j{
|
||||
String cid = null;
|
||||
boolean allowEmpty = false;
|
||||
boolean bAddEmptyAttr = false, bAddUnmappedAttr = false;
|
||||
boolean outputAsXSD = false;
|
||||
XMLTool tool = null;
|
||||
boolean isAppend = false;
|
||||
public void generateCode(XMLNode node, String currEleName, String parentName){
|
||||
if(("ELEMENT").equals(node.type)){
|
||||
createElement(currEleName,node,parentName);
|
||||
setText(currEleName,node);
|
||||
for(XMLNode ns:node.namespaces){
|
||||
addNameSpace(currEleName,ns);
|
||||
}
|
||||
for(XMLNode attri:node.attributes){
|
||||
addAttribute(currEleName,attri);
|
||||
}
|
||||
if(node.name.indexOf(":")>0){
|
||||
%>
|
||||
<%=currEleName%>_<%=cid%>.setName("<%=node.name%>");
|
||||
<%
|
||||
}
|
||||
int index = 0;
|
||||
for(XMLNode child:node.elements){
|
||||
if(0==(child.special & 1)){
|
||||
generateCode(child,currEleName+"_"+index++,currEleName);
|
||||
}
|
||||
}
|
||||
if(node.relatedColumn != null && (node.special & 2)==0 && (node.special & 1)==0){
|
||||
if(isAppend && !outputAsXSD && !allowEmpty){
|
||||
%>
|
||||
if (<%=currEleName%>_<%=cid%>.content().size() == 0
|
||||
&& <%=currEleName%>_<%=cid%>.attributes().size() == 0
|
||||
&& <%=currEleName%>_<%=cid%>.declaredNamespaces().size() == 0) {
|
||||
<%=parentName%>_<%=cid%>.remove(<%=currEleName%>_<%=cid%>);
|
||||
}
|
||||
|
||||
<%
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
private void createElement(String currEleName, XMLNode node, String parentName){
|
||||
int index = node.name.indexOf(":");
|
||||
if(5==(node.special & 5)){
|
||||
int currPos = node.getCurrGroupPos();
|
||||
if(index>0 && node.parent!=null){
|
||||
%>
|
||||
org.dom4j.Element <%=currEleName%>_<%=cid%>;
|
||||
if (<%=parentName%>_<%=cid%>.getNamespaceForPrefix("<%=node.name.substring(0,index)%>") == null) {
|
||||
<%=currEleName%>_<%=cid%> = org.dom4j.DocumentHelper.createElement("<%=node.name.substring(index+1)%>");
|
||||
} else {
|
||||
<%=currEleName%>_<%=cid%> = org.dom4j.DocumentHelper.createElement("<%=node.name%>");
|
||||
}
|
||||
<%
|
||||
}else{
|
||||
%>
|
||||
org.dom4j.Element <%=currEleName%>_<%=cid%> = org.dom4j.DocumentHelper.createElement("<%=node.name%>");
|
||||
<%
|
||||
}
|
||||
if(isAppend){
|
||||
%>
|
||||
int app_size_<%=cid %>=<%=parentName%>_<%=cid%>.elements("<%=node.name%>").size();
|
||||
if(app_size_<%=cid %> > 0){
|
||||
orders_<%=cid %>[<%=currPos %>] =1+ <%=parentName%>_<%=cid%>.elements().indexOf(<%=parentName%>_<%=cid%>.elements("<%=node.name%>").get(app_size_<%=cid %>-1));
|
||||
}else{
|
||||
<%
|
||||
if(currPos==0){
|
||||
%>
|
||||
orders_<%=cid %>[<%=currPos %>] = <%=parentName%>_<%=cid%>.elements().size();
|
||||
<%
|
||||
}else{
|
||||
%>
|
||||
orders_<%=cid %>[<%=currPos %>] = <%=node.getNodeInsertIndex() %>;
|
||||
if(orders_<%=cid %>[<%=currPos %>] == 0 && <%=parentName%>_<%=cid%>.elements().size() != 0 && !bl_<%=cid%>) {
|
||||
orders_<%=cid %>[<%=currPos %>] = <%=parentName%>_<%=cid%>.elements().size();
|
||||
}
|
||||
<%
|
||||
}
|
||||
%>
|
||||
}
|
||||
<%=parentName%>_<%=cid%>.elements().add(orders_<%=cid %>[<%=currPos %>],<%=currEleName%>_<%=cid%>);
|
||||
<%
|
||||
}else{
|
||||
%>
|
||||
if(orders_<%=cid %>[<%=currPos %>]==0){
|
||||
orders_<%=cid %>[<%=currPos %>] = <%=node.getNodeInsertIndex() %>;
|
||||
}
|
||||
if(<%=currPos +1 %> < orders_<%=cid %>.length){
|
||||
orders_<%=cid %>[<%=currPos +1 %>] = 0;
|
||||
}
|
||||
<%=parentName%>_<%=cid%>.elements().add(orders_<%=cid %>[<%=currPos %>]++,<%=currEleName%>_<%=cid%>);
|
||||
<%
|
||||
}
|
||||
}else{
|
||||
if(index>0 && node.parent!=null){
|
||||
%>
|
||||
org.dom4j.Element <%=currEleName%>_<%=cid%>;
|
||||
if (<%=parentName%>_<%=cid%>.getNamespaceForPrefix("<%=node.name.substring(0,index)%>") == null) {
|
||||
<%=currEleName%>_<%=cid%> = <%=parentName%>_<%=cid%>.addElement("<%=node.name.substring(index+1)%>");
|
||||
} else {
|
||||
<%=currEleName%>_<%=cid%> = <%=parentName%>_<%=cid%>.addElement("<%=node.name%>");
|
||||
}
|
||||
<%
|
||||
}else{
|
||||
%>
|
||||
org.dom4j.Element <%=currEleName%>_<%=cid%> = <%=parentName%>_<%=cid%>.addElement("<%=node.name%>");
|
||||
<%
|
||||
}
|
||||
}
|
||||
if(0!=(node.special & 2)){
|
||||
%>
|
||||
subTreeRootParent_<%=cid%> = <%=currEleName%>_<%=cid%>;
|
||||
<%
|
||||
}
|
||||
}
|
||||
private void setText(String currEleName, XMLNode node){
|
||||
if(node.relatedColumn!=null){
|
||||
JavaType javaType = JavaTypesManager.getJavaTypeFromId(node.relatedColumn.getTalendType());
|
||||
if(javaType == JavaTypesManager.OBJECT){
|
||||
%>
|
||||
if(<%tool.getValue(node); %>!=null){
|
||||
nestXMLTool_<%=cid%> .parseAndAdd(<%=currEleName%>_<%=cid%>,<%tool.getValue(node);%>);
|
||||
}
|
||||
<%
|
||||
if(outputAsXSD){
|
||||
%>
|
||||
else{
|
||||
nestXMLTool_<%=cid%> .parseAndAdd(<%=currEleName%>_<%=cid%>,"");
|
||||
<%=currEleName%>_<%=cid%>.addAttribute("xsi:nil","true");
|
||||
}
|
||||
<%
|
||||
}
|
||||
}else{
|
||||
if("id_Document".equals(node.relatedColumn.getTalendType())) {
|
||||
%>
|
||||
if(<%tool.getValue(node); %>!=null){
|
||||
nestXMLTool_<%=cid%> .setText(<%=currEleName%>_<%=cid%>, ParserUtils.parseTo_Document(<%tool.getValue(node);%>).getDocument().getRootElement().asXML());
|
||||
}
|
||||
<%
|
||||
} else {
|
||||
%>
|
||||
if(<%tool.getValue(node); %>!=null){
|
||||
nestXMLTool_<%=cid%> .setText(<%=currEleName%>_<%=cid%>,<%tool.getValue(node);%>);
|
||||
}
|
||||
<%
|
||||
}
|
||||
if(outputAsXSD){
|
||||
%>
|
||||
else{
|
||||
<%=currEleName%>_<%=cid%>.setText("");
|
||||
<%=currEleName%>_<%=cid%>.addAttribute("xsi:nil","true");
|
||||
}
|
||||
<%
|
||||
}
|
||||
}
|
||||
}else if(node.defaultValue != null && !("").equals(node.defaultValue) ){
|
||||
%>
|
||||
nestXMLTool_<%=cid %>.parseAndAdd(<%=currEleName %>_<%=cid %>,"<%=node.defaultValue %>");
|
||||
|
||||
<%
|
||||
}
|
||||
}
|
||||
private void addAttribute(String currEleName, XMLNode node){
|
||||
if (node.relatedColumn != null){
|
||||
%>
|
||||
if (<%tool.getValue(node);%> != null){
|
||||
<%=currEleName%>_<%=cid%>.addAttribute("<%=node.path%>", <%tool.getValue(node);%>);
|
||||
} <% if (bAddEmptyAttr) { %> else {
|
||||
<%=currEleName%>_<%=cid%>.addAttribute("<%=node.path%>", "");
|
||||
}
|
||||
<%}
|
||||
} else {
|
||||
if (node.defaultValue != null && !("").equals(node.defaultValue) ){
|
||||
%>
|
||||
<%=currEleName%>_<%=cid%>.addAttribute("<%=node.path%>", "<%=node.defaultValue %>");
|
||||
<%
|
||||
} else if (bAddUnmappedAttr){
|
||||
%>
|
||||
<%=currEleName%>_<%=cid%>.addAttribute("<%=node.path%>", "");
|
||||
<%
|
||||
}
|
||||
}
|
||||
}
|
||||
private void addNameSpace(String currEleName, XMLNode node){
|
||||
if(node.relatedColumn!=null){
|
||||
%>
|
||||
if(<%tool.getValue(node);%>!=null){
|
||||
<%=currEleName%>_<%=cid%>.addNamespace("<%=node.path%>",TalendString.replaceSpecialCharForXML(<%tool.getValue(node);%>));
|
||||
<%
|
||||
if(node.path ==null || node.path.length()==0){
|
||||
%>
|
||||
<%=currEleName%>_<%=cid%>.setQName(org.dom4j.DocumentHelper.createQName(<%=currEleName%>_<%=cid%>.getName(),
|
||||
org.dom4j.DocumentHelper.createNamespace("",TalendString.replaceSpecialCharForXML(<%tool.getValue(node);%>))));
|
||||
<%
|
||||
}
|
||||
%>
|
||||
}
|
||||
<%
|
||||
}else if(node.defaultValue != null && !("").equals(node.defaultValue) ){
|
||||
%>
|
||||
<%=currEleName %>_<%=cid %>.addNamespace("<%=node.path %>",TalendString.replaceSpecialCharForXML("<%=node.defaultValue %>"));
|
||||
<%
|
||||
if(node.path ==null || node.path.length()==0){
|
||||
%>
|
||||
<%=currEleName %>_<%=cid %>.setQName(org.dom4j.DocumentHelper.createQName(<%=currEleName %>_<%=cid %>.getName(),
|
||||
org.dom4j.DocumentHelper.createNamespace("",TalendString.replaceSpecialCharForXML("<%=node.defaultValue %>"))));
|
||||
<%
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//----------** add by wliu dom4j to genenrate get function for node **-------//
|
||||
class GenerateExprCmpByDom4j{
|
||||
// String cid = null;
|
||||
XMLTool tool = null;
|
||||
XMLNode groupNode = null;
|
||||
boolean needEmptyNode = true;
|
||||
public void generateCode(XMLNode node, String parentName){
|
||||
String tmpPath = node.path.replaceFirst(groupNode.path,"");
|
||||
String[] arrNames = tmpPath.split("/");
|
||||
if(node==groupNode){
|
||||
%>true
|
||||
<%
|
||||
}
|
||||
|
||||
if(node.relatedColumn != null){
|
||||
%> && (<%
|
||||
if(!needEmptyNode){
|
||||
%>(<%tool.getValue(node); %>==null && <%generateCmnExpr(arrNames, parentName); %> == null) || (true &&
|
||||
<% }%>
|
||||
<%generateCmnExpr(arrNames, parentName); %>!=null
|
||||
&& <%generateCmnExpr(arrNames, parentName); %>.getText()!=null
|
||||
&& <%generateCmnExpr(arrNames, parentName); %>.getText().equals(<%tool.getValue(node); %>)
|
||||
<%if(!needEmptyNode){%>)<%}%>
|
||||
)
|
||||
<%
|
||||
}
|
||||
|
||||
//first generate the attribute comparision
|
||||
if(node.attributes!=null){
|
||||
for(XMLNode attri:node.attributes){
|
||||
if(attri.relatedColumn !=null){
|
||||
%> && (<%
|
||||
if(!needEmptyNode){
|
||||
%>(<%tool.getValue(attri); %>==null && <%generateCmnExpr(arrNames, parentName); %>.attribute("<%=attri.name %>") == null) || (true &&
|
||||
<% }%>
|
||||
<%generateCmnExpr(arrNames, parentName); %>.attribute("<%=attri.name %>")!=null
|
||||
&& <%generateCmnExpr(arrNames, parentName); %>.attribute("<%=attri.name %>").getText()!=null
|
||||
&& <%generateCmnExpr(arrNames, parentName); %>.attribute("<%=attri.name %>").getText().equals(<%tool.getValue(attri); %>)
|
||||
<%
|
||||
if(!needEmptyNode){%>)<%}
|
||||
%>)<%
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(node.elements!=null){
|
||||
for(XMLNode child:node.elements){
|
||||
if(!child.isMainNode()){
|
||||
generateCode(child,parentName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void generateCmnExpr(String[] arrNames, String parentName){
|
||||
%>
|
||||
<%=parentName %>
|
||||
<%
|
||||
for(int i=1;arrNames != null && i<arrNames.length; i++){
|
||||
%>.element(<%=parentName%>.getQName("<%=arrNames[i]%>"))
|
||||
<%
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------- *** Dom4j generation mode end *** ------------------- //
|
||||
|
||||
// ------------------- *** Null generation mode start *** ------------------- //
|
||||
class GenerateToolByNull{
|
||||
String cid = null;
|
||||
boolean allowEmpty = false;
|
||||
boolean bAddEmptyAttr = false, bAddUnmappedAttr = false;
|
||||
boolean outputAsXSD = false;
|
||||
XMLTool tool = null;
|
||||
|
||||
boolean isCompact = false;
|
||||
|
||||
public void generateCode(XMLNode node, String emptySpace){
|
||||
if(("ELEMENT").equals(node.type)){
|
||||
startElement(node,emptySpace);
|
||||
setText(node);
|
||||
XMLNode mainChild = null;
|
||||
for(XMLNode child:node.elements){
|
||||
if(child.isMainNode()){ //loop dosen't have a main child node
|
||||
mainChild = child;
|
||||
break;
|
||||
}
|
||||
}
|
||||
for(XMLNode child:node.elements){
|
||||
if(mainChild!=null && mainChild.order<=child.order){ //loop dosen't have a main child node
|
||||
if(1==(node.special & 1)){ // group
|
||||
%>
|
||||
// buffer the start tabs to group buffer
|
||||
groupBuffer_<%=cid%>[<%=node.getCurrGroupPos()%>] = buf_<%=cid%>.toString();
|
||||
buf_<%=cid%> = new StringBuffer();
|
||||
<%
|
||||
}else{// root
|
||||
int num = node.path.split("/").length-2;
|
||||
if(!outputAsXSD && !allowEmpty){
|
||||
%>
|
||||
startTabs_<%=cid%>[<%=num%>] = buf_<%=cid%>.toString();
|
||||
buf_<%=cid%> = new StringBuffer();
|
||||
<%
|
||||
}else{
|
||||
%>
|
||||
out_<%=cid%>.write(buf_<%=cid%>.toString());
|
||||
buf_<%=cid%> = new StringBuffer();
|
||||
<%
|
||||
}
|
||||
}
|
||||
mainChild = null;
|
||||
}
|
||||
if(!child.isMainNode()){ //make the main node output last
|
||||
if(!outputAsXSD && !allowEmpty
|
||||
&& (child.relatedColumn != null || child.childrenColumnList.size()>0
|
||||
|| child.hasDefaultValue == true ) ){
|
||||
%>
|
||||
if( false
|
||||
<%
|
||||
for(IMetadataColumn column : child.childrenColumnList){
|
||||
%> || valueMap_<%=cid%>.get("<%=column.getLabel()%>") != null<%
|
||||
}
|
||||
if(child.hasDefaultValue == true){%> || true
|
||||
<%}%>
|
||||
){
|
||||
<%
|
||||
if(isCompact==false)
|
||||
generateCode(child,emptySpace+" ");
|
||||
else
|
||||
generateCode(child,emptySpace);
|
||||
%>
|
||||
}
|
||||
<%
|
||||
}else{
|
||||
if(isCompact==false)
|
||||
generateCode(child,emptySpace+" ");
|
||||
else
|
||||
generateCode(child,emptySpace);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!node.isMainNode()){ // is not main node
|
||||
endElement(node,emptySpace);
|
||||
}
|
||||
}
|
||||
}
|
||||
private void startElement(XMLNode node, String emptySpace){
|
||||
%>
|
||||
buf_<%=cid%>.append("<%=isCompact?"":"\\n"%>");
|
||||
buf_<%=cid%>.append("<%=emptySpace%><<%=node.name%>");
|
||||
<%
|
||||
if(outputAsXSD && node.parent==null){
|
||||
%>
|
||||
buf_<%=cid%>.append(" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"");
|
||||
buf_<%=cid%>.append(" xsi:noNamespaceSchemaLocation= \""+ file_<%=cid%>.substring(file_<%=cid%>.lastIndexOf("/")+1)+".xsd"+"\"");
|
||||
<%
|
||||
}
|
||||
for(XMLNode ns:node.namespaces){
|
||||
addNameSpace(ns);
|
||||
}
|
||||
for(XMLNode attri:node.attributes){
|
||||
addAttribute(attri);
|
||||
}
|
||||
if(outputAsXSD && node.relatedColumn != null){
|
||||
%>
|
||||
if(<%tool.getValue(node); %> == null){
|
||||
buf_<%=cid%>.append(" xsi:nil=\"true\"");
|
||||
}
|
||||
<%
|
||||
}
|
||||
%>
|
||||
buf_<%=cid%>.append(">");
|
||||
<%
|
||||
}
|
||||
|
||||
public void endElement(XMLNode node, String emptySpace){
|
||||
if(node.elements.size()>0){
|
||||
%>
|
||||
buf_<%=cid%>.append("<%=isCompact?"":"\\n"%>");
|
||||
buf_<%=cid%>.append("<%=emptySpace%></<%=node.name%>>");
|
||||
<%
|
||||
}else{
|
||||
%>
|
||||
buf_<%=cid%>.append("</<%=node.name%>>");
|
||||
<%
|
||||
}
|
||||
}
|
||||
private void setText(XMLNode node){
|
||||
if(node.relatedColumn!=null){
|
||||
JavaType javaType = JavaTypesManager.getJavaTypeFromId(node.relatedColumn.getTalendType());
|
||||
if(javaType == JavaTypesManager.OBJECT){
|
||||
%>
|
||||
if(<%tool.getValue(node);%>!=null){
|
||||
if(routines.system.XMLHelper.getInstance().isValid(<%tool.getValue(node);%>)){
|
||||
buf_<%=cid%>.append(<%tool.getValue(node);%>);
|
||||
} else {
|
||||
buf_<%=cid%>.append(TalendString.checkCDATAForXML(<%tool.getValue(node);%>));
|
||||
}
|
||||
}
|
||||
<%
|
||||
}else{
|
||||
%>
|
||||
if(<%tool.getValue(node);%>!=null){
|
||||
buf_<%=cid%>.append(TalendString.checkCDATAForXML(<%tool.getValue(node);%>));
|
||||
}
|
||||
<%
|
||||
}
|
||||
}else if(node.defaultValue !=null && !("").equals(node.defaultValue) ){
|
||||
%>
|
||||
if(routines.system.XMLHelper.getInstance().isValid("<%=node.defaultValue %>")){
|
||||
buf_<%=cid %>.append("<%=node.defaultValue %>");
|
||||
} else {
|
||||
buf_<%=cid %>.append(TalendString.checkCDATAForXML("<%=node.defaultValue %>"));
|
||||
}
|
||||
<%
|
||||
}
|
||||
}
|
||||
private void addAttribute(XMLNode node){
|
||||
if (node.relatedColumn != null){
|
||||
%>
|
||||
if (<%tool.getValue(node); %>!=null){
|
||||
buf_<%=cid%>.append(" <%=node.path%>=\""+TalendString.replaceSpecialCharForXML(<%tool.getValue(node);%>)+"\"");
|
||||
} <% if (bAddEmptyAttr){%> else{
|
||||
buf_<%=cid%>.append(" <%=node.path%>=\"\"");
|
||||
}
|
||||
<%}
|
||||
} else {
|
||||
if (node.defaultValue != null && !("").equals(node.defaultValue)){
|
||||
%>
|
||||
buf_<%=cid%>.append(" <%=node.path%>=\""+TalendString.replaceSpecialCharForXML("<%=node.defaultValue %>")+"\"");
|
||||
<%
|
||||
} else if (bAddUnmappedAttr){
|
||||
%>
|
||||
buf_<%=cid%>.append(" <%=node.path%>=\"\"");
|
||||
<%
|
||||
}
|
||||
}
|
||||
}
|
||||
private void addNameSpace(XMLNode node){
|
||||
if(node.relatedColumn!=null){
|
||||
%>
|
||||
if(<%tool.getValue(node);%>!=null){
|
||||
<%
|
||||
if(node.path ==null || node.path.length()==0){
|
||||
%>
|
||||
buf_<%=cid%>.append(" xmlns=\""+TalendString.replaceSpecialCharForXML(<%tool.getValue(node);%>)+"\"");
|
||||
<%
|
||||
}else{
|
||||
%>
|
||||
buf_<%=cid%>.append(" xmlns:<%=node.path%>=\""+TalendString.replaceSpecialCharForXML(<%tool.getValue(node);%>)+"\"");
|
||||
<%
|
||||
}
|
||||
%>
|
||||
}
|
||||
<%
|
||||
}else if(node.defaultValue !=null && !("").equals(node.defaultValue) ){
|
||||
if(node.path ==null || node.path.length()==0){
|
||||
%>
|
||||
buf_<%=cid%>.append(" xmlns=\""+TalendString.replaceSpecialCharForXML("<%=node.defaultValue %>")+"\"");
|
||||
<%
|
||||
}else{
|
||||
%>
|
||||
buf_<%=cid%>.append(" xmlns:<%=node.path%>=\""+TalendString.replaceSpecialCharForXML("<%=node.defaultValue %>")+"\"");
|
||||
<%
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// ------------------- *** Null generation mode end *** ------------------- //
|
||||
%>
|
||||
@@ -8,7 +8,14 @@
|
||||
java.util.Map
|
||||
org.talend.core.model.process.IConnection
|
||||
org.talend.core.model.process.IConnectionCategory
|
||||
org.talend.core.model.metadata.IMetadataColumn
|
||||
java.util.ArrayList
|
||||
java.util.LinkedList
|
||||
org.talend.core.model.metadata.types.JavaTypesManager
|
||||
org.talend.core.model.metadata.types.JavaType
|
||||
org.talend.core.model.utils.NodeUtil
|
||||
"
|
||||
skeleton="tAdvancedFileOutputXML_java.skeleton"
|
||||
%>
|
||||
<%
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
@@ -18,6 +25,11 @@ String cid_original = cid;
|
||||
cid = cid_original.replace("tAdvancedFileOutputXML","tAFOX");
|
||||
List< ? extends IConnection> conns = node.getIncomingConnections();
|
||||
|
||||
%>
|
||||
|
||||
<%@ include file="tAdvancedFileOutputXML_begin.inc.javajet"%>
|
||||
|
||||
<%
|
||||
if (conns == null || conns.isEmpty()) {
|
||||
return "";
|
||||
} else {
|
||||
@@ -60,7 +72,7 @@ if ((metadatas != null) && (metadatas.size() > 0)) {
|
||||
%>
|
||||
int nb_line_<%=cid%> = 0;
|
||||
|
||||
<%if (isMerge == true) {%>
|
||||
<%if (isMerge) {%>
|
||||
boolean needRoot_<%=cid%> = false;
|
||||
<%} else {%>
|
||||
boolean needRoot_<%=cid%> = true;
|
||||
@@ -85,7 +97,7 @@ if ((metadatas != null) && (metadatas.size() > 0)) {
|
||||
}
|
||||
<%}
|
||||
|
||||
if (isMerge==true) {
|
||||
if (isMerge) {
|
||||
%>
|
||||
if (!createFile<%=cid%>.exists() || (createFile<%=cid %>.isFile() && createFile<%=cid %>.length() < 1)) {
|
||||
needRoot_<%=cid %> = true;
|
||||
@@ -198,7 +210,7 @@ if ((metadatas != null) && (metadatas.size() > 0)) {
|
||||
org.dom4j.Element root4Group_<%=cid%> = null;
|
||||
org.dom4j.Document doc_<%=cid %>=null;
|
||||
|
||||
<%if (!useStream && isMerge == true) {//append mode and the code of file path%>
|
||||
<%if (!useStream && isMerge) {//append mode and the code of file path%>
|
||||
if (needRoot_<%=cid %> == false) {
|
||||
try {
|
||||
org.dom4j.io.SAXReader saxReader_<%=cid %>= new org.dom4j.io.SAXReader();
|
||||
@@ -320,6 +332,345 @@ if ((metadatas != null) && (metadatas.size() > 0)) {
|
||||
}
|
||||
}
|
||||
}
|
||||
if(conns!=null && conns.size()>0){
|
||||
IConnection conn = conns.get(0);
|
||||
if(conn.getLineStyle().hasConnectionCategory(IConnectionCategory.DATA)){
|
||||
|
||||
String allowEmpty = ElementParameterParser.getValue(node, "__CREATE_EMPTY_ELEMENT__");
|
||||
String advancedSeparatorStr = ElementParameterParser.getValue(node, "__ADVANCED_SEPARATOR__");
|
||||
boolean advancedSeparator = (advancedSeparatorStr!=null&&!("").equals(advancedSeparatorStr))?("true").equals(advancedSeparatorStr):false;
|
||||
String thousandsSeparator = ElementParameterParser.getValueWithJavaType(node, "__THOUSANDS_SEPARATOR__", JavaTypesManager.CHARACTER);
|
||||
String decimalSeparator = ElementParameterParser.getValueWithJavaType(node, "__DECIMAL_SEPARATOR__", JavaTypesManager.CHARACTER);
|
||||
String outputAsXSD = ElementParameterParser.getValue(node, "__OUTPUT_AS_XSD__");
|
||||
boolean bAddEmptyAttr = "true".equals(ElementParameterParser.getValue(node, "__ADD_EMPTY_ATTRIBUTE__"));
|
||||
boolean bAddUnmappedAttr = "true".equals(ElementParameterParser.getValue(node, "__ADD_UNMAPPED_ATTRIBUTE__"));
|
||||
int schemaOptNum=100;
|
||||
String schemaOptNumStr=ElementParameterParser.getValue(node, "__SCHEMA_OPT_NUM__");
|
||||
if(schemaOptNumStr!=null && !"".equals(schemaOptNumStr) && !"\"\"".equals(schemaOptNumStr)){
|
||||
schemaOptNum = Integer.parseInt(schemaOptNumStr);
|
||||
}
|
||||
|
||||
// init tool
|
||||
XMLTool tool = new XMLTool();
|
||||
tool.connName = NodeUtil.getPrivateConnClassName(conn);
|
||||
tool.advancedSeparator=advancedSeparator;
|
||||
tool.thousandsSeparator=thousandsSeparator;
|
||||
tool.decimalSeparator=decimalSeparator;
|
||||
tool.cid=cid;
|
||||
|
||||
// change tables to a tree
|
||||
Object[] treeObjs = getTree(rootTable, groupTable, loopTable, metadata.getListColumns());
|
||||
|
||||
if(treeObjs == null || treeObjs.length == 0){
|
||||
return "";
|
||||
}
|
||||
|
||||
List<XMLNode> mainList = (ArrayList<XMLNode>)treeObjs[0];
|
||||
List<XMLNode> groupList = (ArrayList<XMLNode>)treeObjs[1];
|
||||
XMLNode root = mainList.get(0);
|
||||
XMLNode loop = (XMLNode)treeObjs[2];
|
||||
|
||||
if(!("true").equals(allowEmpty)){
|
||||
removeEmptyElement(root);
|
||||
}
|
||||
|
||||
List<List<XMLNode>> groupbyNodeList = new ArrayList<List<XMLNode>>();
|
||||
for(XMLNode group:groupList){
|
||||
groupbyNodeList.add(getGroupByNodeList(group));
|
||||
}
|
||||
if(metadata.getListColumns().size()> schemaOptNum){
|
||||
%>
|
||||
class AdvancedXMLUtil_<%=cid%>{
|
||||
<%
|
||||
int colNum = 0;
|
||||
for(IMetadataColumn column :metadata.getListColumns()){
|
||||
if(colNum%schemaOptNum==0){
|
||||
%>
|
||||
public void putValue_<%=colNum/schemaOptNum%>(<%=tool.connName%>Struct <%=tool.connName%>,java.util.Map<String,String> valueMap_<%=cid%>){
|
||||
<%
|
||||
}
|
||||
%>
|
||||
valueMap_<%=cid%>.put("<%=column.getLabel()%>", <% tool.getValue(column); %>);
|
||||
<%
|
||||
if((colNum+1)%schemaOptNum==0){
|
||||
%>
|
||||
}
|
||||
<%
|
||||
}
|
||||
colNum++;
|
||||
}
|
||||
if(colNum>0&&(colNum%schemaOptNum)>0){
|
||||
%>
|
||||
}
|
||||
<%
|
||||
}
|
||||
if((groupTable.size()>0 && "Dom4j".equals(mode)&&(useStream || !isMerge))||("Null".equals(mode))){
|
||||
for(int groupNum=0;groupNum<groupList.size();groupNum++){
|
||||
XMLNode groupRootNode = groupList.get(groupNum);
|
||||
int nodeNum=0;
|
||||
for(int j=0;j<groupbyNodeList.get(groupNum).size();j++){
|
||||
XMLNode attr = groupbyNodeList.get(groupNum).get(j);
|
||||
if(attr.relatedColumn!=null){
|
||||
if(nodeNum%schemaOptNum==0){
|
||||
%>
|
||||
public boolean getValue_<%=groupNum%>_<%=nodeNum/schemaOptNum%>(java.util.List<java.util.List<String>> groupbyList_<%=cid%>,java.util.Map<String,String> valueMap_<%=cid%>){
|
||||
return false
|
||||
<%
|
||||
}
|
||||
%>
|
||||
|| ( groupbyList_<%=cid%>.get(<%=groupNum%>).get(<%=j%>)!=null
|
||||
? !groupbyList_<%=cid%>.get(<%=groupNum%>).get(<%=j%>).equals(<%tool.getValue(attr);%>)
|
||||
: <%tool.getValue(attr);%>!=null )
|
||||
<%
|
||||
if((nodeNum+1)%schemaOptNum==0){
|
||||
%>
|
||||
;
|
||||
}
|
||||
<%
|
||||
}
|
||||
nodeNum++;
|
||||
}
|
||||
|
||||
}
|
||||
if(nodeNum>0&&(nodeNum%schemaOptNum)>0){
|
||||
%>
|
||||
;
|
||||
}
|
||||
<%
|
||||
}
|
||||
for(int j=0;j<groupbyNodeList.get(groupNum).size();j++){
|
||||
XMLNode attr = groupbyNodeList.get(groupNum).get(j);
|
||||
if(j%schemaOptNum==0){
|
||||
%>
|
||||
public void setValue_<%=groupNum%>_<%=j/schemaOptNum%>(java.util.List<java.util.List<String>> groupbyList_<%=cid%>,java.util.Map<String,String> valueMap_<%=cid%>){
|
||||
<%
|
||||
}
|
||||
%>
|
||||
groupbyList_<%=cid%>.get(<%=groupNum%>).add(<%tool.getValue(attr);%>);
|
||||
<%
|
||||
if((j+1)%schemaOptNum==0){
|
||||
%>
|
||||
}
|
||||
<%
|
||||
}
|
||||
}
|
||||
if(groupbyNodeList.get(groupNum).size()>0&&(groupbyNodeList.get(groupNum).size()%schemaOptNum)>0){
|
||||
%>
|
||||
}
|
||||
<%
|
||||
}
|
||||
}
|
||||
}
|
||||
if(("Dom4j").equals(mode)){
|
||||
//init the generate tool.
|
||||
GenerateToolByDom4j generateToolByDom4j = new GenerateToolByDom4j();
|
||||
if(!useStream && ("true").equals(outputAsXSD)){ // add a new prerequisite:useStream to ignore generating the xsd file
|
||||
generateToolByDom4j.outputAsXSD = true;
|
||||
}
|
||||
if(("true").equals(allowEmpty)){
|
||||
generateToolByDom4j.allowEmpty = true;
|
||||
}
|
||||
generateToolByDom4j.bAddEmptyAttr = bAddEmptyAttr;
|
||||
generateToolByDom4j.bAddUnmappedAttr = bAddUnmappedAttr;
|
||||
generateToolByDom4j.cid = cid;
|
||||
generateToolByDom4j.tool = tool;
|
||||
if( groupTable.size()>0){
|
||||
if((!useStream && isMerge)){
|
||||
generateToolByDom4j.isAppend= true;
|
||||
for( int i=0; i<groupList.size();i++){
|
||||
XMLNode groupNode= groupList.get(i);
|
||||
GenerateExprCmpByDom4j generateExprCmpByDom4j = new GenerateExprCmpByDom4j();
|
||||
generateExprCmpByDom4j.tool = tool;
|
||||
generateExprCmpByDom4j.groupNode = groupNode;
|
||||
generateExprCmpByDom4j.needEmptyNode = ("true").equals(allowEmpty);
|
||||
|
||||
%>
|
||||
public boolean generateCodeDom4j_FindInsertNode<%=i%>(org.dom4j.Element tempElem,java.util.Map<String,String> valueMap_<%=cid%>){
|
||||
return <%generateExprCmpByDom4j.generateCode(groupNode, "tempElem"); %>;
|
||||
}
|
||||
|
||||
public org.dom4j.Element generateCodeDom4j_UnFindInsertNode<%=i%>(NestXMLTool_<%=cid%> nestXMLTool_<%=cid%>,java.util.Map<String,String> valueMap_<%=cid%>,org.dom4j.Element subTreeRootParent_<%=cid%>,int[] orders_<%=cid %>,boolean bl_<%=cid %>){
|
||||
<%
|
||||
generateToolByDom4j.generateCode(groupList.get(i),"group"+i+"_","subTreeRootParent");
|
||||
%>
|
||||
return group<%=i%>__<%=cid%>;
|
||||
}
|
||||
<%
|
||||
|
||||
}
|
||||
}else{
|
||||
for(int i=0;i<groupList.size();i++){
|
||||
XMLNode groupRootNode = groupList.get(i);
|
||||
%>
|
||||
public org.dom4j.Element generateCodeDom4j_group<%=i%>(NestXMLTool_<%=cid%> nestXMLTool_<%=cid%>,java.util.Map<String,String> valueMap_<%=cid%>,org.dom4j.Element subTreeRootParent_<%=cid%>,int[] orders_<%=cid %>){
|
||||
<%
|
||||
generateToolByDom4j.generateCode(groupList.get(i),"group"+i+"_","subTreeRootParent");
|
||||
%>
|
||||
return group<%=i%>__<%=cid%>;
|
||||
}
|
||||
<%
|
||||
}
|
||||
}
|
||||
}
|
||||
if(loopTable!=null && loopTable.size()>0){
|
||||
%>
|
||||
public org.dom4j.Element generateCodeDom4j_Loop(NestXMLTool_<%=cid%> nestXMLTool_<%=cid%>,java.util.Map<String,String> valueMap_<%=cid%>,org.dom4j.Element subTreeRootParent_<%=cid%>,int[] orders_<%=cid %><%if(!useStream && isMerge && groupTable.size()>0){%>,boolean bl_<%=cid %><%}%>){
|
||||
<%
|
||||
generateToolByDom4j.generateCode(loop,"loop","subTreeRootParent");
|
||||
%>
|
||||
return loop_<%=cid%>;
|
||||
}
|
||||
<%
|
||||
}
|
||||
}
|
||||
if("Null".equals(mode)){
|
||||
GenerateToolByNull generateToolByNull = new GenerateToolByNull();
|
||||
if(!useStream && ("true").equals(outputAsXSD)){ // add a new prerequisite:useStream to ignore generating the xsd file
|
||||
generateToolByNull.outputAsXSD = true;
|
||||
}
|
||||
if(("true").equals(allowEmpty)){
|
||||
generateToolByNull.allowEmpty = true;
|
||||
}
|
||||
generateToolByNull.bAddEmptyAttr = bAddEmptyAttr;
|
||||
generateToolByNull.bAddUnmappedAttr = bAddUnmappedAttr;
|
||||
generateToolByNull.cid = cid;
|
||||
generateToolByNull.tool = tool;
|
||||
generateToolByNull.isCompact = isCompact;
|
||||
String rootEmptySpace = "";
|
||||
for(int i=0;i < mainList.size();i++){
|
||||
%>
|
||||
public StringBuffer generateCodeNull_rootEmptySpace<%=i%>(StringBuffer buf_<%=cid%>,java.io.BufferedWriter out_<%=cid%>,String[] startTabs_<%=cid%>,String[] endTabs_<%=cid%>,java.util.Map<String, String> valueMap_<%=cid%>)throws IOException{
|
||||
<%
|
||||
generateToolByNull.generateCode(mainList.get(i),rootEmptySpace);
|
||||
%>
|
||||
return buf_<%=cid%>;
|
||||
}
|
||||
<%
|
||||
if(isCompact==false){//generate pretty file
|
||||
rootEmptySpace+=" ";
|
||||
}
|
||||
if(!generateToolByNull.outputAsXSD && !generateToolByNull.allowEmpty){
|
||||
if(mainList.get(i).relatedColumn != null || mainList.get(i).childrenColumnList.size()>0){
|
||||
int columnNum=0;
|
||||
for(IMetadataColumn column : mainList.get(i).childrenColumnList){
|
||||
if(columnNum%schemaOptNum==0){
|
||||
%>
|
||||
public boolean generateCodeNull_conditMain<%=i%>_<%=columnNum/schemaOptNum%>(java.util.Map<String,String> valueMap_<%=cid%>){
|
||||
return false
|
||||
<%
|
||||
}
|
||||
%>
|
||||
|| valueMap_<%=cid%>.get("<%=column.getLabel()%>") != null
|
||||
<%
|
||||
if((columnNum+1)%schemaOptNum==0){
|
||||
%>
|
||||
;}
|
||||
<%
|
||||
}
|
||||
columnNum++;
|
||||
}
|
||||
if(columnNum>0&&(columnNum%schemaOptNum)>0){
|
||||
%>
|
||||
;}
|
||||
<%
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for(int i=0;i<groupList.size();i++){
|
||||
String emptySpace = "";
|
||||
if(isCompact==false){//generate pretty file
|
||||
for(int len = groupList.get(i).path.split("/").length-1;len>1;len--){
|
||||
emptySpace +=" ";
|
||||
}
|
||||
}
|
||||
%>
|
||||
public StringBuffer generateCodeNull_emptySpace<%=i%>(StringBuffer buf_<%=cid%>,java.util.Map<String, String> valueMap_<%=cid%>,String[] groupBuffer_<%=cid%>){
|
||||
<%
|
||||
generateToolByNull.generateCode(groupList.get(i),emptySpace);
|
||||
%>
|
||||
return buf_<%=cid%>;
|
||||
}
|
||||
<%
|
||||
if(!("true").equals(outputAsXSD) && !("true").equals(allowEmpty)){
|
||||
if((groupList.get(i).relatedColumn != null || groupList.get(i).childrenColumnList.size()>0)){
|
||||
int columnNum=0;
|
||||
for(IMetadataColumn column : groupList.get(i).childrenColumnList){
|
||||
if(columnNum%schemaOptNum==0){
|
||||
%>
|
||||
public boolean generateCodeNull_conditGroup<%=i%>_<%=columnNum/schemaOptNum%>(java.util.Map<String,String> valueMap_<%=cid%>){
|
||||
return false
|
||||
<%
|
||||
}
|
||||
%>
|
||||
|| valueMap_<%=cid%>.get("<%=column.getLabel()%>") != null
|
||||
<%
|
||||
if((columnNum+1)%schemaOptNum==0){
|
||||
%>
|
||||
;}
|
||||
<%
|
||||
}
|
||||
columnNum++;
|
||||
}
|
||||
if(columnNum>0&&(columnNum%schemaOptNum)>0){
|
||||
%>
|
||||
;}
|
||||
<%
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!("true").equals(outputAsXSD) && !("true").equals(allowEmpty)){
|
||||
int columnNum=0;
|
||||
for(IMetadataColumn column : loop.childrenColumnList){
|
||||
if(columnNum%schemaOptNum==0){
|
||||
%>
|
||||
public boolean generateCodeNull_conditLoop_<%=columnNum/schemaOptNum%>(java.util.Map<String,String> valueMap_<%=cid%>){
|
||||
return false
|
||||
<%
|
||||
}
|
||||
%>
|
||||
|| valueMap_<%=cid%>.get("<%=column.getLabel()%>") != null
|
||||
<%
|
||||
if((columnNum+1)%schemaOptNum==0){
|
||||
%>
|
||||
;}
|
||||
<%
|
||||
}
|
||||
columnNum++;
|
||||
}
|
||||
if(columnNum>0&&(columnNum%schemaOptNum)>0){
|
||||
%>
|
||||
;}
|
||||
<%
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
String emptySpace = "";
|
||||
if(isCompact==false){//generate pretty file
|
||||
for(int len =loop.path.split("/").length-1;len>1;len--){
|
||||
emptySpace +=" ";
|
||||
}
|
||||
}
|
||||
%>
|
||||
public void generateCodeNull_loopEmptySpace(StringBuffer buf_<%=cid%>,java.io.BufferedWriter out_<%=cid%>,String[] endTabs_<%=cid%>,java.util.Map<String, String> valueMap_<%=cid%>){
|
||||
<%
|
||||
generateToolByNull.generateCode(loop,emptySpace);
|
||||
generateToolByNull.endElement(loop,emptySpace);
|
||||
%>
|
||||
}
|
||||
<%
|
||||
}
|
||||
%>
|
||||
|
||||
}
|
||||
AdvancedXMLUtil_<%=cid%> advancedXMLUtil_<%=cid%>=new AdvancedXMLUtil_<%=cid%>();
|
||||
<%
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
%>
|
||||
|
||||
@@ -192,6 +192,11 @@
|
||||
<PARAMETER NAME="DELETE_EMPTYFILE" FIELD="CHECK" REQUIRED="true" NUM_ROW="70" NOT_SHOW_IF="USESTREAM=='true'">
|
||||
<DEFAULT>false</DEFAULT>
|
||||
</PARAMETER>
|
||||
|
||||
<PARAMETER NAME="SCHEMA_OPT_NUM" FIELD="TEXT" NUM_ROW="90"
|
||||
REQUIRED="true" SHOW="false">
|
||||
<DEFAULT>100</DEFAULT>
|
||||
</PARAMETER>
|
||||
</ADVANCED_PARAMETERS>
|
||||
|
||||
<CODEGENERATION>
|
||||
|
||||
@@ -13,574 +13,14 @@ imports="
|
||||
org.talend.core.model.process.IConnectionCategory
|
||||
org.talend.core.model.metadata.types.JavaTypesManager
|
||||
org.talend.core.model.metadata.types.JavaType
|
||||
org.talend.core.model.utils.NodeUtil
|
||||
"
|
||||
skeleton="tAdvancedFileOutputXML_java.skeleton"
|
||||
%>
|
||||
<%
|
||||
//XMLTool
|
||||
class XMLTool{
|
||||
public boolean advancedSeparator = false;
|
||||
public String thousandsSeparator = null;
|
||||
public String decimalSeparator =null;
|
||||
public String connName = null;
|
||||
public String cid = null;
|
||||
|
||||
public void getValue(XMLNode node){
|
||||
%>
|
||||
valueMap_<%=cid%>.get("<%=node.relatedColumn.getLabel()%>")
|
||||
<%
|
||||
}
|
||||
|
||||
public void getValue(IMetadataColumn column){
|
||||
JavaType javaType = JavaTypesManager.getJavaTypeFromId(column.getTalendType());
|
||||
String defaultValue=column.getDefault();
|
||||
boolean isNotSetDefault = false;
|
||||
if(defaultValue!=null){
|
||||
isNotSetDefault = defaultValue.length()==0;
|
||||
}else{
|
||||
isNotSetDefault=true;
|
||||
}
|
||||
%>
|
||||
(
|
||||
<%
|
||||
if(column.isNullable()){
|
||||
%>
|
||||
<%=connName%>.<%=column.getLabel()%> != null?
|
||||
<%
|
||||
}
|
||||
|
||||
if(advancedSeparator && JavaTypesManager.isNumberType(javaType, column.isNullable())) {
|
||||
if(javaType == JavaTypesManager.BIGDECIMAL) {
|
||||
%>
|
||||
FormatterUtils.format_Number(String.valueOf(<%=column.getPrecision() == null? connName + "." + column.getLabel() : connName + "." + column.getLabel() + ".setScale(" + column.getPrecision() + ", java.math.RoundingMode.HALF_UP)" %>), <%= thousandsSeparator%>,<%=decimalSeparator %>)
|
||||
<%
|
||||
} else {
|
||||
%>
|
||||
FormatterUtils.format_Number(String.valueOf(<%=connName%>.<%=column.getLabel()%>), <%= thousandsSeparator %>,<%=decimalSeparator %>)
|
||||
<%
|
||||
}
|
||||
} else if(JavaTypesManager.isJavaPrimitiveType( column.getTalendType(), column.isNullable())){
|
||||
%>
|
||||
String.valueOf(<%=connName%>.<%=column.getLabel()%>)
|
||||
<%
|
||||
}else if(javaType == JavaTypesManager.DATE){
|
||||
if( column.getPattern() != null && column.getPattern().trim().length() != 0 ){
|
||||
%>
|
||||
FormatterUtils.format_Date(<%=connName%>.<%=column.getLabel()%>,<%=column.getPattern()%>)
|
||||
<%
|
||||
}else{
|
||||
%>
|
||||
<%=connName%>.<%=column.getLabel()%>
|
||||
<%
|
||||
}
|
||||
}else if (javaType == JavaTypesManager.BIGDECIMAL) {
|
||||
%>
|
||||
String.valueOf(<%=column.getPrecision() == null? connName + "." + column.getLabel() : connName + "." + column.getLabel() + ".setScale(" + column.getPrecision() + ", java.math.RoundingMode.HALF_UP)" %>)
|
||||
<%
|
||||
}else{
|
||||
%>
|
||||
<%=connName%>.<%=column.getLabel()%>.toString()
|
||||
<%
|
||||
}
|
||||
if(column.isNullable()){
|
||||
%>:<%
|
||||
if(isNotSetDefault == false){
|
||||
%><%=column.getDefault()%><%
|
||||
}else{
|
||||
%>null<%
|
||||
}
|
||||
}
|
||||
%>
|
||||
)
|
||||
<%
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------- *** Dom4j generation mode start *** ------------------- //
|
||||
class GenerateToolByDom4j{
|
||||
String cid = null;
|
||||
boolean allowEmpty = false;
|
||||
boolean bAddEmptyAttr = false, bAddUnmappedAttr = false;
|
||||
boolean outputAsXSD = false;
|
||||
XMLTool tool = null;
|
||||
boolean isAppend = false;
|
||||
public void generateCode(XMLNode node, String currEleName, String parentName){
|
||||
if(("ELEMENT").equals(node.type)){
|
||||
createElement(currEleName,node,parentName);
|
||||
setText(currEleName,node);
|
||||
for(XMLNode ns:node.namespaces){
|
||||
addNameSpace(currEleName,ns);
|
||||
}
|
||||
for(XMLNode attri:node.attributes){
|
||||
addAttribute(currEleName,attri);
|
||||
}
|
||||
if(node.name.indexOf(":")>0){
|
||||
%>
|
||||
<%=currEleName%>_<%=cid%>.setName("<%=node.name%>");
|
||||
<%
|
||||
}
|
||||
int index = 0;
|
||||
for(XMLNode child:node.elements){
|
||||
if(0==(child.special & 1)){
|
||||
generateCode(child,currEleName+"_"+index++,currEleName);
|
||||
}
|
||||
}
|
||||
if(node.relatedColumn != null && (node.special & 2)==0 && (node.special & 1)==0){
|
||||
if(isAppend && !outputAsXSD && !allowEmpty){
|
||||
%>
|
||||
if (<%=currEleName%>_<%=cid%>.content().size() == 0
|
||||
&& <%=currEleName%>_<%=cid%>.attributes().size() == 0
|
||||
&& <%=currEleName%>_<%=cid%>.declaredNamespaces().size() == 0) {
|
||||
<%=parentName%>_<%=cid%>.remove(<%=currEleName%>_<%=cid%>);
|
||||
}
|
||||
|
||||
<%
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
private void createElement(String currEleName, XMLNode node, String parentName){
|
||||
int index = node.name.indexOf(":");
|
||||
if(5==(node.special & 5)){
|
||||
int currPos = node.getCurrGroupPos();
|
||||
if(index>0 && node.parent!=null){
|
||||
%>
|
||||
org.dom4j.Element <%=currEleName%>_<%=cid%>;
|
||||
if (<%=parentName%>_<%=cid%>.getNamespaceForPrefix("<%=node.name.substring(0,index)%>") == null) {
|
||||
<%=currEleName%>_<%=cid%> = org.dom4j.DocumentHelper.createElement("<%=node.name.substring(index+1)%>");
|
||||
} else {
|
||||
<%=currEleName%>_<%=cid%> = org.dom4j.DocumentHelper.createElement("<%=node.name%>");
|
||||
}
|
||||
<%
|
||||
}else{
|
||||
%>
|
||||
org.dom4j.Element <%=currEleName%>_<%=cid%> = org.dom4j.DocumentHelper.createElement("<%=node.name%>");
|
||||
<%
|
||||
}
|
||||
if(isAppend){
|
||||
%>
|
||||
int app_size_<%=cid %>=<%=parentName%>_<%=cid%>.elements("<%=node.name%>").size();
|
||||
if(app_size_<%=cid %> > 0){
|
||||
orders_<%=cid %>[<%=currPos %>] =1+ <%=parentName%>_<%=cid%>.elements().indexOf(<%=parentName%>_<%=cid%>.elements("<%=node.name%>").get(app_size_<%=cid %>-1));
|
||||
}else{
|
||||
<%
|
||||
if(currPos==0){
|
||||
%>
|
||||
orders_<%=cid %>[<%=currPos %>] = <%=parentName%>_<%=cid%>.elements().size();
|
||||
<%
|
||||
}else{
|
||||
%>
|
||||
orders_<%=cid %>[<%=currPos %>] = <%=node.getNodeInsertIndex() %>;
|
||||
if(orders_<%=cid %>[<%=currPos %>] == 0 && <%=parentName%>_<%=cid%>.elements().size() != 0 && !bl_<%=cid%>) {
|
||||
orders_<%=cid %>[<%=currPos %>] = <%=parentName%>_<%=cid%>.elements().size();
|
||||
}
|
||||
<%
|
||||
}
|
||||
%>
|
||||
}
|
||||
<%=parentName%>_<%=cid%>.elements().add(orders_<%=cid %>[<%=currPos %>],<%=currEleName%>_<%=cid%>);
|
||||
<%
|
||||
}else{
|
||||
%>
|
||||
if(orders_<%=cid %>[<%=currPos %>]==0){
|
||||
orders_<%=cid %>[<%=currPos %>] = <%=node.getNodeInsertIndex() %>;
|
||||
}
|
||||
if(<%=currPos +1 %> < orders_<%=cid %>.length){
|
||||
orders_<%=cid %>[<%=currPos +1 %>] = 0;
|
||||
}
|
||||
<%=parentName%>_<%=cid%>.elements().add(orders_<%=cid %>[<%=currPos %>]++,<%=currEleName%>_<%=cid%>);
|
||||
<%
|
||||
}
|
||||
}else{
|
||||
if(index>0 && node.parent!=null){
|
||||
%>
|
||||
org.dom4j.Element <%=currEleName%>_<%=cid%>;
|
||||
if (<%=parentName%>_<%=cid%>.getNamespaceForPrefix("<%=node.name.substring(0,index)%>") == null) {
|
||||
<%=currEleName%>_<%=cid%> = <%=parentName%>_<%=cid%>.addElement("<%=node.name.substring(index+1)%>");
|
||||
} else {
|
||||
<%=currEleName%>_<%=cid%> = <%=parentName%>_<%=cid%>.addElement("<%=node.name%>");
|
||||
}
|
||||
<%
|
||||
}else{
|
||||
%>
|
||||
org.dom4j.Element <%=currEleName%>_<%=cid%> = <%=parentName%>_<%=cid%>.addElement("<%=node.name%>");
|
||||
<%
|
||||
}
|
||||
}
|
||||
if(0!=(node.special & 2)){
|
||||
%>
|
||||
subTreeRootParent_<%=cid%> = <%=currEleName%>_<%=cid%>;
|
||||
<%
|
||||
}
|
||||
}
|
||||
private void setText(String currEleName, XMLNode node){
|
||||
if(node.relatedColumn!=null){
|
||||
JavaType javaType = JavaTypesManager.getJavaTypeFromId(node.relatedColumn.getTalendType());
|
||||
if(javaType == JavaTypesManager.OBJECT){
|
||||
%>
|
||||
if(<%tool.getValue(node); %>!=null){
|
||||
nestXMLTool_<%=cid%> .parseAndAdd(<%=currEleName%>_<%=cid%>,<%tool.getValue(node);%>);
|
||||
}
|
||||
<%
|
||||
if(outputAsXSD){
|
||||
%>
|
||||
else{
|
||||
nestXMLTool_<%=cid%> .parseAndAdd(<%=currEleName%>_<%=cid%>,"");
|
||||
<%=currEleName%>_<%=cid%>.addAttribute("xsi:nil","true");
|
||||
}
|
||||
<%
|
||||
}
|
||||
}else{
|
||||
if("id_Document".equals(node.relatedColumn.getTalendType())) {
|
||||
%>
|
||||
if(<%tool.getValue(node); %>!=null){
|
||||
nestXMLTool_<%=cid%> .setText(<%=currEleName%>_<%=cid%>, ParserUtils.parseTo_Document(<%tool.getValue(node);%>).getDocument().getRootElement().asXML());
|
||||
}
|
||||
<%
|
||||
} else {
|
||||
%>
|
||||
if(<%tool.getValue(node); %>!=null){
|
||||
nestXMLTool_<%=cid%> .setText(<%=currEleName%>_<%=cid%>,<%tool.getValue(node);%>);
|
||||
}
|
||||
<%
|
||||
}
|
||||
if(outputAsXSD){
|
||||
%>
|
||||
else{
|
||||
<%=currEleName%>_<%=cid%>.setText("");
|
||||
<%=currEleName%>_<%=cid%>.addAttribute("xsi:nil","true");
|
||||
}
|
||||
<%
|
||||
}
|
||||
}
|
||||
}else if(node.defaultValue != null && !("").equals(node.defaultValue) ){
|
||||
%>
|
||||
nestXMLTool_<%=cid %>.parseAndAdd(<%=currEleName %>_<%=cid %>,"<%=node.defaultValue %>");
|
||||
<%@ include file="tAdvancedFileOutputXML_begin.inc.javajet"%>
|
||||
|
||||
<%
|
||||
}
|
||||
}
|
||||
private void addAttribute(String currEleName, XMLNode node){
|
||||
if (node.relatedColumn != null){
|
||||
%>
|
||||
if (<%tool.getValue(node);%> != null){
|
||||
<%=currEleName%>_<%=cid%>.addAttribute("<%=node.path%>", <%tool.getValue(node);%>);
|
||||
} <% if (bAddEmptyAttr) { %> else {
|
||||
<%=currEleName%>_<%=cid%>.addAttribute("<%=node.path%>", "");
|
||||
}
|
||||
<%}
|
||||
} else {
|
||||
if (node.defaultValue != null && !("").equals(node.defaultValue) ){
|
||||
%>
|
||||
<%=currEleName%>_<%=cid%>.addAttribute("<%=node.path%>", "<%=node.defaultValue %>");
|
||||
<%
|
||||
} else if (bAddUnmappedAttr){
|
||||
%>
|
||||
<%=currEleName%>_<%=cid%>.addAttribute("<%=node.path%>", "");
|
||||
<%
|
||||
}
|
||||
}
|
||||
}
|
||||
private void addNameSpace(String currEleName, XMLNode node){
|
||||
if(node.relatedColumn!=null){
|
||||
%>
|
||||
if(<%tool.getValue(node);%>!=null){
|
||||
<%=currEleName%>_<%=cid%>.addNamespace("<%=node.path%>",TalendString.replaceSpecialCharForXML(<%tool.getValue(node);%>));
|
||||
<%
|
||||
if(node.path ==null || node.path.length()==0){
|
||||
%>
|
||||
<%=currEleName%>_<%=cid%>.setQName(org.dom4j.DocumentHelper.createQName(<%=currEleName%>_<%=cid%>.getName(),
|
||||
org.dom4j.DocumentHelper.createNamespace("",TalendString.replaceSpecialCharForXML(<%tool.getValue(node);%>))));
|
||||
<%
|
||||
}
|
||||
%>
|
||||
}
|
||||
<%
|
||||
}else if(node.defaultValue != null && !("").equals(node.defaultValue) ){
|
||||
%>
|
||||
<%=currEleName %>_<%=cid %>.addNamespace("<%=node.path %>",TalendString.replaceSpecialCharForXML("<%=node.defaultValue %>"));
|
||||
<%
|
||||
if(node.path ==null || node.path.length()==0){
|
||||
%>
|
||||
<%=currEleName %>_<%=cid %>.setQName(org.dom4j.DocumentHelper.createQName(<%=currEleName %>_<%=cid %>.getName(),
|
||||
org.dom4j.DocumentHelper.createNamespace("",TalendString.replaceSpecialCharForXML("<%=node.defaultValue %>"))));
|
||||
<%
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//----------** add by wliu dom4j to genenrate get function for node **-------//
|
||||
class GenerateExprCmpByDom4j{
|
||||
// String cid = null;
|
||||
XMLTool tool = null;
|
||||
XMLNode groupNode = null;
|
||||
boolean needEmptyNode = true;
|
||||
public void generateCode(XMLNode node, String parentName){
|
||||
String tmpPath = node.path.replaceFirst(groupNode.path,"");
|
||||
String[] arrNames = tmpPath.split("/");
|
||||
if(node==groupNode){
|
||||
%>true
|
||||
<%
|
||||
}
|
||||
|
||||
if(node.relatedColumn != null){
|
||||
%> && (<%
|
||||
if(!needEmptyNode){
|
||||
%>(<%tool.getValue(node); %>==null && <%generateCmnExpr(arrNames, parentName); %> == null) || (true &&
|
||||
<% }%>
|
||||
<%generateCmnExpr(arrNames, parentName); %>!=null
|
||||
&& <%generateCmnExpr(arrNames, parentName); %>.getText()!=null
|
||||
&& <%generateCmnExpr(arrNames, parentName); %>.getText().equals(<%tool.getValue(node); %>)
|
||||
<%if(!needEmptyNode){%>)<%}%>
|
||||
)
|
||||
<%
|
||||
}
|
||||
|
||||
//first generate the attribute comparision
|
||||
if(node.attributes!=null){
|
||||
for(XMLNode attri:node.attributes){
|
||||
if(attri.relatedColumn !=null){
|
||||
%> && (<%
|
||||
if(!needEmptyNode){
|
||||
%>(<%tool.getValue(attri); %>==null && <%generateCmnExpr(arrNames, parentName); %>.attribute("<%=attri.name %>") == null) || (true &&
|
||||
<% }%>
|
||||
<%generateCmnExpr(arrNames, parentName); %>.attribute("<%=attri.name %>")!=null
|
||||
&& <%generateCmnExpr(arrNames, parentName); %>.attribute("<%=attri.name %>").getText()!=null
|
||||
&& <%generateCmnExpr(arrNames, parentName); %>.attribute("<%=attri.name %>").getText().equals(<%tool.getValue(attri); %>)
|
||||
<%
|
||||
if(!needEmptyNode){%>)<%}
|
||||
%>)<%
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(node.elements!=null){
|
||||
for(XMLNode child:node.elements){
|
||||
if(!child.isMainNode()){
|
||||
generateCode(child,parentName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void generateCmnExpr(String[] arrNames, String parentName){
|
||||
%>
|
||||
<%=parentName %>
|
||||
<%
|
||||
for(int i=1;arrNames != null && i<arrNames.length; i++){
|
||||
%>.element(<%=parentName%>.getQName("<%=arrNames[i]%>"))
|
||||
<%
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------- *** Dom4j generation mode end *** ------------------- //
|
||||
|
||||
// ------------------- *** Null generation mode start *** ------------------- //
|
||||
class GenerateToolByNull{
|
||||
String cid = null;
|
||||
boolean allowEmpty = false;
|
||||
boolean bAddEmptyAttr = false, bAddUnmappedAttr = false;
|
||||
boolean outputAsXSD = false;
|
||||
XMLTool tool = null;
|
||||
|
||||
boolean isCompact = false;
|
||||
|
||||
public void generateCode(XMLNode node, String emptySpace){
|
||||
if(("ELEMENT").equals(node.type)){
|
||||
startElement(node,emptySpace);
|
||||
setText(node);
|
||||
XMLNode mainChild = null;
|
||||
for(XMLNode child:node.elements){
|
||||
if(child.isMainNode()){ //loop dosen't have a main child node
|
||||
mainChild = child;
|
||||
break;
|
||||
}
|
||||
}
|
||||
for(XMLNode child:node.elements){
|
||||
if(mainChild!=null && mainChild.order<=child.order){ //loop dosen't have a main child node
|
||||
if(1==(node.special & 1)){ // group
|
||||
%>
|
||||
// buffer the start tabs to group buffer
|
||||
groupBuffer_<%=cid%>[<%=node.getCurrGroupPos()%>] = buf_<%=cid%>.toString();
|
||||
buf_<%=cid%> = new StringBuffer();
|
||||
<%
|
||||
}else{// root
|
||||
int num = node.path.split("/").length-2;
|
||||
if(!outputAsXSD && !allowEmpty){
|
||||
%>
|
||||
startTabs_<%=cid%>[<%=num%>] = buf_<%=cid%>.toString();
|
||||
buf_<%=cid%> = new StringBuffer();
|
||||
<%
|
||||
}else{
|
||||
%>
|
||||
out_<%=cid%>.write(buf_<%=cid%>.toString());
|
||||
buf_<%=cid%> = new StringBuffer();
|
||||
<%
|
||||
}
|
||||
}
|
||||
mainChild = null;
|
||||
}
|
||||
if(!child.isMainNode()){ //make the main node output last
|
||||
if(!outputAsXSD && !allowEmpty
|
||||
&& (child.relatedColumn != null || child.childrenColumnList.size()>0
|
||||
|| child.hasDefaultValue == true ) ){
|
||||
%>
|
||||
if( false
|
||||
<%
|
||||
for(IMetadataColumn column : child.childrenColumnList){
|
||||
%> || valueMap_<%=cid%>.get("<%=column.getLabel()%>") != null<%
|
||||
}
|
||||
if(child.hasDefaultValue == true){%> || true
|
||||
<%}%>
|
||||
){
|
||||
<%
|
||||
if(isCompact==false)
|
||||
generateCode(child,emptySpace+" ");
|
||||
else
|
||||
generateCode(child,emptySpace);
|
||||
%>
|
||||
}
|
||||
<%
|
||||
}else{
|
||||
if(isCompact==false)
|
||||
generateCode(child,emptySpace+" ");
|
||||
else
|
||||
generateCode(child,emptySpace);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!node.isMainNode()){ // is not main node
|
||||
endElement(node,emptySpace);
|
||||
}
|
||||
}
|
||||
}
|
||||
private void startElement(XMLNode node, String emptySpace){
|
||||
%>
|
||||
buf_<%=cid%>.append("<%=isCompact?"":"\\n"%>");
|
||||
buf_<%=cid%>.append("<%=emptySpace%><<%=node.name%>");
|
||||
<%
|
||||
if(outputAsXSD && node.parent==null){
|
||||
%>
|
||||
buf_<%=cid%>.append(" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"");
|
||||
buf_<%=cid%>.append(" xsi:noNamespaceSchemaLocation= \""+ file_<%=cid%>.substring(file_<%=cid%>.lastIndexOf("/")+1)+".xsd"+"\"");
|
||||
<%
|
||||
}
|
||||
for(XMLNode ns:node.namespaces){
|
||||
addNameSpace(ns);
|
||||
}
|
||||
for(XMLNode attri:node.attributes){
|
||||
addAttribute(attri);
|
||||
}
|
||||
if(outputAsXSD && node.relatedColumn != null){
|
||||
%>
|
||||
if(<%tool.getValue(node); %> == null){
|
||||
buf_<%=cid%>.append(" xsi:nil=\"true\"");
|
||||
}
|
||||
<%
|
||||
}
|
||||
%>
|
||||
buf_<%=cid%>.append(">");
|
||||
<%
|
||||
}
|
||||
|
||||
public void endElement(XMLNode node, String emptySpace){
|
||||
if(node.elements.size()>0){
|
||||
%>
|
||||
buf_<%=cid%>.append("<%=isCompact?"":"\\n"%>");
|
||||
buf_<%=cid%>.append("<%=emptySpace%></<%=node.name%>>");
|
||||
<%
|
||||
}else{
|
||||
%>
|
||||
buf_<%=cid%>.append("</<%=node.name%>>");
|
||||
<%
|
||||
}
|
||||
}
|
||||
private void setText(XMLNode node){
|
||||
if(node.relatedColumn!=null){
|
||||
JavaType javaType = JavaTypesManager.getJavaTypeFromId(node.relatedColumn.getTalendType());
|
||||
if(javaType == JavaTypesManager.OBJECT){
|
||||
%>
|
||||
if(<%tool.getValue(node);%>!=null){
|
||||
if(routines.system.XMLHelper.getInstance().isValid(<%tool.getValue(node);%>)){
|
||||
buf_<%=cid%>.append(<%tool.getValue(node);%>);
|
||||
} else {
|
||||
buf_<%=cid%>.append(TalendString.checkCDATAForXML(<%tool.getValue(node);%>));
|
||||
}
|
||||
}
|
||||
<%
|
||||
}else{
|
||||
%>
|
||||
if(<%tool.getValue(node);%>!=null){
|
||||
buf_<%=cid%>.append(TalendString.checkCDATAForXML(<%tool.getValue(node);%>));
|
||||
}
|
||||
<%
|
||||
}
|
||||
}else if(node.defaultValue !=null && !("").equals(node.defaultValue) ){
|
||||
%>
|
||||
if(routines.system.XMLHelper.getInstance().isValid("<%=node.defaultValue %>")){
|
||||
buf_<%=cid %>.append("<%=node.defaultValue %>");
|
||||
} else {
|
||||
buf_<%=cid %>.append(TalendString.checkCDATAForXML("<%=node.defaultValue %>"));
|
||||
}
|
||||
<%
|
||||
}
|
||||
}
|
||||
private void addAttribute(XMLNode node){
|
||||
if (node.relatedColumn != null){
|
||||
%>
|
||||
if (<%tool.getValue(node); %>!=null){
|
||||
buf_<%=cid%>.append(" <%=node.path%>=\""+TalendString.replaceSpecialCharForXML(<%tool.getValue(node);%>)+"\"");
|
||||
} <% if (bAddEmptyAttr){%> else{
|
||||
buf_<%=cid%>.append(" <%=node.path%>=\"\"");
|
||||
}
|
||||
<%}
|
||||
} else {
|
||||
if (node.defaultValue != null && !("").equals(node.defaultValue)){
|
||||
%>
|
||||
buf_<%=cid%>.append(" <%=node.path%>=\""+TalendString.replaceSpecialCharForXML("<%=node.defaultValue %>")+"\"");
|
||||
<%
|
||||
} else if (bAddUnmappedAttr){
|
||||
%>
|
||||
buf_<%=cid%>.append(" <%=node.path%>=\"\"");
|
||||
<%
|
||||
}
|
||||
}
|
||||
}
|
||||
private void addNameSpace(XMLNode node){
|
||||
if(node.relatedColumn!=null){
|
||||
%>
|
||||
if(<%tool.getValue(node);%>!=null){
|
||||
<%
|
||||
if(node.path ==null || node.path.length()==0){
|
||||
%>
|
||||
buf_<%=cid%>.append(" xmlns=\""+TalendString.replaceSpecialCharForXML(<%tool.getValue(node);%>)+"\"");
|
||||
<%
|
||||
}else{
|
||||
%>
|
||||
buf_<%=cid%>.append(" xmlns:<%=node.path%>=\""+TalendString.replaceSpecialCharForXML(<%tool.getValue(node);%>)+"\"");
|
||||
<%
|
||||
}
|
||||
%>
|
||||
}
|
||||
<%
|
||||
}else if(node.defaultValue !=null && !("").equals(node.defaultValue) ){
|
||||
if(node.path ==null || node.path.length()==0){
|
||||
%>
|
||||
buf_<%=cid%>.append(" xmlns=\""+TalendString.replaceSpecialCharForXML("<%=node.defaultValue %>")+"\"");
|
||||
<%
|
||||
}else{
|
||||
%>
|
||||
buf_<%=cid%>.append(" xmlns:<%=node.path%>=\""+TalendString.replaceSpecialCharForXML("<%=node.defaultValue %>")+"\"");
|
||||
<%
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// ------------------- *** Null generation mode end *** ------------------- //
|
||||
|
||||
// ------------------- *** Common code start *** ------------------- //
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode)codeGenArgument.getArgument();
|
||||
@@ -628,10 +68,30 @@ if ((metadatas!=null)&&(metadatas.size()>0)) {
|
||||
boolean useStream = ("true").equals(ElementParameterParser.getValue(node,"__USESTREAM__"));
|
||||
String outStream = ElementParameterParser.getValue(node,"__STREAMNAME__");
|
||||
//*******************add for feature:8873 end ****************
|
||||
|
||||
boolean needFileValid = ("true").equals(ElementParameterParser.getValue(node, "__FILE_VALID__"));
|
||||
|
||||
boolean needDTDValid = ("true").equals(ElementParameterParser.getValue(node, "__DTD_VALID__"));
|
||||
String dtdRootName = ElementParameterParser.getValue(node, "__DTD_NAME__");
|
||||
String dtdFileName = ElementParameterParser.getValue(node, "__DTD_SYSTEMID__");
|
||||
|
||||
boolean needXSLValid = ("true").equals(ElementParameterParser.getValue(node, "__XSL_VALID__"));
|
||||
String xslType = ElementParameterParser.getValue(node, "__XSL_TYPE__");
|
||||
String xslHref = ElementParameterParser.getValue(node, "__XSL_HREF__");
|
||||
|
||||
int schemaOptNum=100;
|
||||
boolean isOptimizeCode=false;
|
||||
String schemaOptNumStr=ElementParameterParser.getValue(node, "__SCHEMA_OPT_NUM__");
|
||||
if(schemaOptNumStr!=null && !"".equals(schemaOptNumStr) && !"\"\"".equals(schemaOptNumStr)){
|
||||
schemaOptNum = Integer.parseInt(schemaOptNumStr);
|
||||
}
|
||||
if(metadata.getListColumns().size()> schemaOptNum){
|
||||
isOptimizeCode=true;
|
||||
}
|
||||
|
||||
// init tool
|
||||
XMLTool tool = new XMLTool();
|
||||
tool.connName = conn.getName();
|
||||
tool.connName = NodeUtil.getPrivateConnClassName(conn);
|
||||
tool.advancedSeparator=advancedSeparator;
|
||||
tool.thousandsSeparator=thousandsSeparator;
|
||||
tool.decimalSeparator=decimalSeparator;
|
||||
@@ -661,10 +121,20 @@ if ((metadatas!=null)&&(metadatas.size()>0)) {
|
||||
nb_line_<%=cid%>++;
|
||||
valueMap_<%=cid%>.clear();
|
||||
<%
|
||||
int colNum=0;
|
||||
for(IMetadataColumn column :metadata.getListColumns()){
|
||||
if(isOptimizeCode){
|
||||
if(colNum%schemaOptNum==0){
|
||||
%>
|
||||
advancedXMLUtil_<%=cid%>.putValue_<%=colNum/schemaOptNum%>(<%=tool.connName%>,valueMap_<%=cid%>);
|
||||
<%
|
||||
}
|
||||
}else{
|
||||
%>
|
||||
valueMap_<%=cid%>.put("<%=column.getLabel()%>", <% tool.getValue(column); %>);
|
||||
<%
|
||||
}
|
||||
colNum++;
|
||||
}
|
||||
// ------------------- *** Common code end *** ------------------- //
|
||||
|
||||
@@ -696,7 +166,7 @@ if(("Dom4j").equals(mode)){
|
||||
}
|
||||
<%
|
||||
generateToolByDom4j.generateCode(root,"root","doc");
|
||||
if(isMerge==false || useStream){ // add a prerequisite useStream to ignore the append mode
|
||||
if(!isMerge || useStream){ // add a prerequisite useStream to ignore the append mode
|
||||
%>
|
||||
root4Group_<%=cid%> = subTreeRootParent_<%=cid%>;
|
||||
}else{
|
||||
@@ -711,7 +181,7 @@ if(("Dom4j").equals(mode)){
|
||||
}
|
||||
|
||||
if(groupTable.size()>0){ //init the generate tool.
|
||||
if(!useStream && isMerge==true){//merge into the file and add a prerequisite:useStream to ignore the append mode
|
||||
if(!useStream && isMerge){//merge into the file and add a prerequisite:useStream to ignore the append mode
|
||||
generateToolByDom4j.isAppend= true;
|
||||
String firstGroupPath = groupList.get(0).path;
|
||||
%>
|
||||
@@ -749,7 +219,17 @@ if(groupTable.size()>0){ //init the generate tool.
|
||||
for(j=0;j<listNodes.size();j++){
|
||||
org.dom4j.Element tempElem =listNodes.get(j);
|
||||
if(("<%=groupNode.path%>").equals(tempElem.getPath()!=null ? tempElem.getPath().replace("*[name()='","").replace("']", "") : "")){
|
||||
<%
|
||||
if(isOptimizeCode){
|
||||
%>
|
||||
if(advancedXMLUtil_<%=cid%>.generateCodeDom4j_FindInsertNode<%=i%>(tempElem,valueMap_<%=cid%>)){
|
||||
<%
|
||||
}else{
|
||||
%>
|
||||
if(<%generateExprCmpByDom4j.generateCode(groupNode, "tempElem"); %>){
|
||||
<%
|
||||
}
|
||||
%>
|
||||
subTreeRootParent_<%=cid %> = tempElem;
|
||||
break;
|
||||
}
|
||||
@@ -763,8 +243,19 @@ if(groupTable.size()>0){ //init the generate tool.
|
||||
}
|
||||
}
|
||||
if(bl_<%=cid %>==true){
|
||||
<%
|
||||
generateToolByDom4j.generateCode(groupList.get(i),"group"+i+"_","subTreeRootParent");
|
||||
<%
|
||||
if(isOptimizeCode){
|
||||
%>
|
||||
org.dom4j.Element group<%=i%>__<%=cid%> = advancedXMLUtil_<%=cid%>.generateCodeDom4j_UnFindInsertNode<%=i%>(nestXMLTool_<%=cid%>,valueMap_<%=cid%>,subTreeRootParent_<%=cid%>,orders_<%=cid %>,bl_<%=cid %>);
|
||||
<%
|
||||
if(("ELEMENT").equals(groupList.get(i).type) && (0!=(groupList.get(i).special & 2))){
|
||||
%>
|
||||
subTreeRootParent_<%=cid%>=group<%=i%>__<%=cid%>;
|
||||
<%
|
||||
}
|
||||
}else{
|
||||
generateToolByDom4j.generateCode(groupList.get(i),"group"+i+"_","subTreeRootParent");
|
||||
}
|
||||
%>
|
||||
}
|
||||
<%
|
||||
@@ -775,23 +266,44 @@ if(groupTable.size()>0){ //init the generate tool.
|
||||
<%
|
||||
for(int i=0;i<groupList.size();i++){
|
||||
XMLNode groupRootNode = groupList.get(i);
|
||||
int nodeNum=0;
|
||||
%>
|
||||
if(isNewElememt_<%=cid %> || groupbyList_<%=cid%>.size()<=<%=i%> || groupbyList_<%=cid%>.get(<%=i%>)==null
|
||||
<%
|
||||
for(int j=0;j<groupbyNodeList.get(i).size();j++){
|
||||
XMLNode attr = groupbyNodeList.get(i).get(j);
|
||||
if(attr.relatedColumn!=null){
|
||||
if(isOptimizeCode){
|
||||
if(nodeNum%schemaOptNum==0){
|
||||
%>
|
||||
|| advancedXMLUtil_<%=cid%>.getValue_<%=i%>_<%=nodeNum/schemaOptNum%>(groupbyList_<%=cid%>,valueMap_<%=cid%>)
|
||||
<%
|
||||
}
|
||||
nodeNum++;
|
||||
}else{
|
||||
%>
|
||||
|| ( groupbyList_<%=cid%>.get(<%=i%>).get(<%=j%>)!=null
|
||||
? !groupbyList_<%=cid%>.get(<%=i%>).get(<%=j%>).equals(<%tool.getValue(attr);%>)
|
||||
: <%tool.getValue(attr);%>!=null )
|
||||
<%
|
||||
}
|
||||
}
|
||||
}
|
||||
%>
|
||||
){
|
||||
<%
|
||||
generateToolByDom4j.generateCode(groupList.get(i),"group"+i+"_","subTreeRootParent");
|
||||
if(isOptimizeCode){
|
||||
%>
|
||||
org.dom4j.Element group<%=i%>__<%=cid%>=advancedXMLUtil_<%=cid%>.generateCodeDom4j_group<%=i%>(nestXMLTool_<%=cid%>,valueMap_<%=cid%>,subTreeRootParent_<%=cid%>,orders_<%=cid%>);
|
||||
<%
|
||||
if(("ELEMENT").equals(groupRootNode.type) && (0!=(groupRootNode.special & 2))){
|
||||
%>
|
||||
subTreeRootParent_<%=cid%>=group<%=i%>__<%=cid%>;
|
||||
<%
|
||||
}
|
||||
}else{
|
||||
generateToolByDom4j.generateCode(groupList.get(i),"group"+i+"_","subTreeRootParent");
|
||||
}
|
||||
%>
|
||||
if(groupbyList_<%=cid%>.size()<=<%=i%>){
|
||||
groupbyList_<%=cid%>.add(new java.util.ArrayList<String>());
|
||||
@@ -801,9 +313,17 @@ if(groupTable.size()>0){ //init the generate tool.
|
||||
<%
|
||||
for(int j=0;j<groupbyNodeList.get(i).size();j++){
|
||||
XMLNode attr = groupbyNodeList.get(i).get(j);
|
||||
if(isOptimizeCode){
|
||||
if(j%schemaOptNum==0){
|
||||
%>
|
||||
advancedXMLUtil_<%=cid%>.setValue_<%=i%>_<%=j/schemaOptNum%>(groupbyList_<%=cid%>,valueMap_<%=cid%>);
|
||||
<%
|
||||
}
|
||||
}else{
|
||||
%>
|
||||
groupbyList_<%=cid%>.get(<%=i%>).add(<%tool.getValue(attr);%>);
|
||||
<%
|
||||
}
|
||||
}
|
||||
%>
|
||||
isNewElememt_<%=cid %>=true;
|
||||
@@ -826,7 +346,18 @@ if(groupTable.size()>0){ //init the generate tool.
|
||||
// build loop xml tree
|
||||
<%
|
||||
if(loopTable!=null && loopTable.size()>0){
|
||||
generateToolByDom4j.generateCode(loop,"loop","subTreeRootParent");
|
||||
if(isOptimizeCode){
|
||||
%>
|
||||
org.dom4j.Element loop_<%=cid%>=advancedXMLUtil_<%=cid%>.generateCodeDom4j_Loop(nestXMLTool_<%=cid%>,valueMap_<%=cid%>,subTreeRootParent_<%=cid%>,orders_<%=cid%><%if(!useStream && isMerge && groupTable.size()>0){%>, bl_<%=cid %><%}%>);
|
||||
<%
|
||||
if(("ELEMENT").equals(loop.type) && (0!=(loop.special & 2))){
|
||||
%>
|
||||
subTreeRootParent_<%=cid%>=loop_<%=cid%>;
|
||||
<%
|
||||
}
|
||||
}else{
|
||||
generateToolByDom4j.generateCode(loop,"loop","subTreeRootParent");
|
||||
}
|
||||
}
|
||||
//file split
|
||||
if(!useStream && ("true").equals(split)){ //add a prerequisite:useStream to ignore the append mode
|
||||
@@ -860,6 +391,19 @@ if(groupTable.size()>0){ //init the generate tool.
|
||||
output_<%=cid%>.write(doc_<%=cid%>);
|
||||
output_<%=cid%>.close();
|
||||
doc_<%=cid%> = org.dom4j.DocumentHelper.createDocument();
|
||||
<%
|
||||
if (!isMerge && needFileValid) {
|
||||
if(needDTDValid) {
|
||||
%>
|
||||
doc_<%=cid %>.addDocType(<%=dtdRootName %>, null, <%=dtdFileName %>);
|
||||
<%
|
||||
} else if(needXSLValid) {
|
||||
%>
|
||||
doc_<%=cid %>.addProcessingInstruction("xml-stylesheet", inMap_<%=cid %>);
|
||||
<%
|
||||
}
|
||||
}
|
||||
%>
|
||||
groupElementList_<%=cid%>.clear();
|
||||
}
|
||||
<%
|
||||
@@ -894,7 +438,13 @@ else if(("Null").equals(mode)){
|
||||
<%
|
||||
String rootEmptySpace = "";
|
||||
for(int i=0;i < mainList.size();i++){
|
||||
generateToolByNull.generateCode(mainList.get(i),rootEmptySpace);
|
||||
if(isOptimizeCode){
|
||||
%>
|
||||
buf_<%=cid%>=advancedXMLUtil_<%=cid%>.generateCodeNull_rootEmptySpace<%=i%>(buf_<%=cid%>,out_<%=cid%>,startTabs_<%=cid%>,endTabs_<%=cid%>,valueMap_<%=cid%>);
|
||||
<%
|
||||
}else{
|
||||
generateToolByNull.generateCode(mainList.get(i),rootEmptySpace);
|
||||
}
|
||||
if(isCompact==false){//generate pretty file
|
||||
rootEmptySpace+=" ";
|
||||
}
|
||||
@@ -904,8 +454,18 @@ else if(("Null").equals(mode)){
|
||||
%>
|
||||
if( false
|
||||
<%
|
||||
int columnNum=0;
|
||||
for(IMetadataColumn column : mainList.get(i).childrenColumnList){
|
||||
if(isOptimizeCode){
|
||||
if(columnNum%schemaOptNum==0){
|
||||
%>
|
||||
|| advancedXMLUtil_<%=cid%>.generateCodeNull_conditMain<%=i%>_<%=columnNum/schemaOptNum%>(valueMap_<%=cid%>)
|
||||
<%
|
||||
}
|
||||
columnNum++;
|
||||
}else{
|
||||
%> || valueMap_<%=cid%>.get("<%=column.getLabel()%>") != null<%
|
||||
}
|
||||
}
|
||||
%>
|
||||
){
|
||||
@@ -936,6 +496,7 @@ else if(("Null").equals(mode)){
|
||||
}
|
||||
for(int i=0;i<groupList.size();i++){
|
||||
XMLNode groupRootNode = groupList.get(i);
|
||||
int nodeNum=0;
|
||||
%>
|
||||
|
||||
// need a new group element <%=groupRootNode.name%> or not
|
||||
@@ -944,11 +505,20 @@ else if(("Null").equals(mode)){
|
||||
for(int j=0;j<groupbyNodeList.get(i).size();j++){
|
||||
XMLNode attr = groupbyNodeList.get(i).get(j);
|
||||
if(attr.relatedColumn!=null){
|
||||
if(isOptimizeCode){
|
||||
if(nodeNum%schemaOptNum==0){
|
||||
%>
|
||||
|| advancedXMLUtil_<%=cid%>.getValue_<%=i%>_<%=nodeNum/schemaOptNum%>(groupbyList_<%=cid%>,valueMap_<%=cid%>)
|
||||
<%
|
||||
}
|
||||
nodeNum++;
|
||||
}else{
|
||||
%>
|
||||
|| ( groupbyList_<%=cid%>.get(<%=i%>).get(<%=j%>)!=null
|
||||
? !groupbyList_<%=cid%>.get(<%=i%>).get(<%=j%>).equals(<%tool.getValue(attr);%>)
|
||||
: <%tool.getValue(attr);%>!=null )
|
||||
<%
|
||||
}
|
||||
}
|
||||
}
|
||||
%>
|
||||
@@ -967,9 +537,17 @@ else if(("Null").equals(mode)){
|
||||
<%
|
||||
for(int j=0;j<groupbyNodeList.get(i).size();j++){
|
||||
XMLNode attr = groupbyNodeList.get(i).get(j);
|
||||
if(isOptimizeCode){
|
||||
if(j%schemaOptNum==0){
|
||||
%>
|
||||
advancedXMLUtil_<%=cid%>.setValue_<%=i%>_<%=j/schemaOptNum%>(groupbyList_<%=cid%>,valueMap_<%=cid%>);
|
||||
<%
|
||||
}
|
||||
}else{
|
||||
%>
|
||||
groupbyList_<%=cid%>.get(<%=i%>).add(<%tool.getValue(attr);%>);
|
||||
<%
|
||||
}
|
||||
}
|
||||
%>
|
||||
isNewElememt_<%=cid %>=true;
|
||||
@@ -984,16 +562,30 @@ else if(("Null").equals(mode)){
|
||||
emptySpace +=" ";
|
||||
}
|
||||
}
|
||||
|
||||
generateToolByNull.generateCode(groupList.get(i),emptySpace);
|
||||
|
||||
if(isOptimizeCode){
|
||||
%>
|
||||
buf_<%=cid%>=advancedXMLUtil_<%=cid%>.generateCodeNull_emptySpace<%=i%>(buf_<%=cid%>,valueMap_<%=cid%>,groupBuffer_<%=cid%>);
|
||||
<%
|
||||
}else{
|
||||
generateToolByNull.generateCode(groupList.get(i),emptySpace);
|
||||
}
|
||||
if(!("true").equals(outputAsXSD) && !("true").equals(allowEmpty)){
|
||||
if((groupList.get(i).relatedColumn != null || groupList.get(i).childrenColumnList.size()>0)){
|
||||
%>
|
||||
if( false
|
||||
<%
|
||||
int columnNum=0;
|
||||
for(IMetadataColumn column : groupList.get(i).childrenColumnList){
|
||||
%> || valueMap_<%=cid%>.get("<%=column.getLabel()%>") != null<%
|
||||
if(isOptimizeCode){
|
||||
if(columnNum%schemaOptNum==0){
|
||||
%>
|
||||
|| advancedXMLUtil_<%=cid%>.generateCodeNull_conditGroup<%=i%>_<%=columnNum/schemaOptNum%>(valueMap_<%=cid%>)
|
||||
<%
|
||||
}
|
||||
columnNum++;
|
||||
}else{
|
||||
%> || valueMap_<%=cid%>.get("<%=column.getLabel()%>") != null<%
|
||||
}
|
||||
}
|
||||
%>
|
||||
){
|
||||
@@ -1112,16 +704,32 @@ else if(("Null").equals(mode)){
|
||||
%>
|
||||
if( false
|
||||
<%
|
||||
int columnNum=0;
|
||||
for(IMetadataColumn column : loop.childrenColumnList){
|
||||
%> || valueMap_<%=cid%>.get("<%=column.getLabel()%>") != null<%
|
||||
if(isOptimizeCode){
|
||||
if(columnNum%schemaOptNum==0){
|
||||
%>
|
||||
|| advancedXMLUtil_<%=cid%>.generateCodeNull_conditLoop_<%=columnNum/schemaOptNum%>(valueMap_<%=cid%>)
|
||||
<%
|
||||
}
|
||||
columnNum++;
|
||||
}else{
|
||||
%> || valueMap_<%=cid%>.get("<%=column.getLabel()%>") != null<%
|
||||
}
|
||||
}
|
||||
if(loop.hasDefaultValue == true){%> || true
|
||||
<%}%>
|
||||
){
|
||||
<%
|
||||
}
|
||||
generateToolByNull.generateCode(loop,emptySpace);
|
||||
generateToolByNull.endElement(loop,emptySpace);
|
||||
if(isOptimizeCode){
|
||||
%>
|
||||
advancedXMLUtil_<%=cid%>.generateCodeNull_loopEmptySpace(buf_<%=cid%>,out_<%=cid%>,endTabs_<%=cid%>,valueMap_<%=cid%>);
|
||||
<%
|
||||
}else{
|
||||
generateToolByNull.generateCode(loop,emptySpace);
|
||||
generateToolByNull.endElement(loop,emptySpace);
|
||||
}
|
||||
%>
|
||||
// output all buffer
|
||||
for (int i_<%=cid%> = 0; i_<%=cid%> < startTabs_<%=cid%>.length; i_<%=cid%>++) {
|
||||
@@ -1203,6 +811,22 @@ else if(("Null").equals(mode)){
|
||||
out_<%=cid%> = new java.io.BufferedWriter(new java.io.OutputStreamWriter(new java.io.FileOutputStream(file_<%=cid%> + currentFileCount_<%=cid %> + suffix_<%=cid %>), <%=encoding%>));
|
||||
out_<%=cid%>.write("<?xml version=\"1.0\" encoding=\""+<%=encoding%>+"\"?>");
|
||||
out_<%=cid%>.newLine();
|
||||
|
||||
<%
|
||||
if (needFileValid) {
|
||||
if (needDTDValid) {
|
||||
%>
|
||||
out_<%=cid%>.write("<!DOCTYPE "+<%=dtdRootName %>+" SYSTEM \"" + <%=dtdFileName %> + "\">");
|
||||
out_<%=cid%>.newLine();
|
||||
<%
|
||||
} else if (needXSLValid) {
|
||||
%>
|
||||
out_<%=cid%>.write("<?xml-stylesheet type=\""+<%=xslType %>+"\" href=\""+<%=xslHref%>+"\">");
|
||||
out_<%=cid%>.newLine();
|
||||
<%
|
||||
}
|
||||
}
|
||||
%>
|
||||
}
|
||||
<%
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@ MAPPING.NAME=
|
||||
MERGE.NAME=Append the source xml file
|
||||
NB_LINE.NAME=Number of line
|
||||
NOT_TRIM_TEXT.NAME=
|
||||
SCHEMA_OPT_NUM.NAME=Min column number of optimize code
|
||||
OUTPUT_AS_XSD.NAME=Create associated XSD file
|
||||
PRETTY_COMPACT.NAME=Generate compact file
|
||||
ROOT.ITEM.ATTRIBUTE=Attribute
|
||||
|
||||
@@ -5,6 +5,7 @@ DECIMAL_SEPARATOR.NAME=S
|
||||
DELETE_EMPTYFILE.NAME=Ne pas générer de fichier vide
|
||||
ENCODING.NAME=Encodage
|
||||
FIELD_TAG.NAME=Étiquette du champ
|
||||
FILENAME.NAME=Nom de fichier
|
||||
GENERATION_MODE.ITEM.DOM4J=Lent et consommateur de mémoire (Dom4J)
|
||||
GENERATION_MODE.ITEM.NULL=Rapide avec peu de consommation de mémoire
|
||||
GENERATION_MODE.NAME=Mode de génération
|
||||
@@ -40,7 +41,7 @@ VALIDATORMODE.NAME=Mode de validation
|
||||
FILE_VALID.NAME=Inclure les DTD ou XSL
|
||||
DTD_VALID.NAME=DTD
|
||||
DTD_NAME.NAME=Elément racine
|
||||
DTD_SYSTEMID.NAME=Nom du fichier
|
||||
DTD_SYSTEMID.NAME=Nom de fichier
|
||||
XSL_VALID.NAME=XSL
|
||||
XSL_TYPE.NAME=Type
|
||||
XSL_HREF.NAME=Href
|
||||
|
||||
Binary file not shown.
@@ -6,15 +6,10 @@
|
||||
org.talend.core.model.process.ElementParameterParser
|
||||
java.util.List
|
||||
java.util.ArrayList
|
||||
org.talend.core.model.metadata.IMetadataTable
|
||||
org.talend.core.model.metadata.IMetadataColumn
|
||||
org.talend.core.model.process.IHashableInputConnections
|
||||
org.talend.core.model.process.IHashConfiguration
|
||||
org.talend.core.model.process.IHashableColumn
|
||||
org.talend.core.model.process.IMatchingMode
|
||||
java.util.HashSet
|
||||
java.util.Set
|
||||
org.talend.core.model.process.EConnectionType
|
||||
org.talend.core.model.process.IDataConnection
|
||||
"
|
||||
%>
|
||||
@@ -22,6 +17,7 @@
|
||||
<%
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode)codeGenArgument.getArgument();
|
||||
String cid = node.getUniqueName();
|
||||
|
||||
|
||||
List<IConnection> connections = (List<IConnection>) node.getIncomingConnections();
|
||||
@@ -80,11 +76,23 @@
|
||||
}
|
||||
|
||||
boolean isAllRows = "ALL_ROWS".equals(matchingModeStr);
|
||||
|
||||
boolean includeParallelComps = false;
|
||||
List<? extends INode> listPartitions= node.getProcess().getNodesOfType("tPartitioner");
|
||||
if (listPartitions!=null && listPartitions.size() > 0 ) {
|
||||
includeParallelComps = true;
|
||||
}
|
||||
%>
|
||||
org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE matchingModeEnum_<%=connectionName%> =
|
||||
org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE.<%= matchingModeStr %>;
|
||||
|
||||
|
||||
<%if (includeParallelComps && !(hashConfiguration != null && hashConfiguration.isPersistent() || bSortOnDisk)) {%>
|
||||
synchronized(this) {
|
||||
try {
|
||||
if (globalMap.get("tHash_Lookup_<%=connectionName%>") == null) {
|
||||
|
||||
<%
|
||||
}
|
||||
if (hashConfiguration != null && hashConfiguration.isPersistent() || bSortOnDisk) {
|
||||
%>
|
||||
org.talend.designer.components.lookup.persistent.Persistent<%= isAllRows ? "" : "Sorted" %>LookupManager<<%=connectionName%>Struct> tHash_Lookup_<%=connectionName%> =
|
||||
@@ -102,13 +110,23 @@
|
||||
tHash_Lookup_<%=connectionName%>.initPut();
|
||||
|
||||
globalMap.put("tHash_Lookup_<%=connectionName%>", tHash_Lookup_<%=connectionName%>);
|
||||
|
||||
<%
|
||||
} else {
|
||||
if (includeParallelComps) {
|
||||
%>
|
||||
org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<<%=connectionName%>Struct> tHash_Lookup_<%=connectionName%> =
|
||||
org.talend.designer.components.lookup.memory.AdvancedMemoryLookup.
|
||||
|
||||
org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<<%=connectionName%>Struct> tHash_Lookup_<%=connectionName%> =
|
||||
org.talend.designer.components.lookup.memory.ConcurrentAdvancedMemoryLookup.
|
||||
<<%=connectionName%>Struct>getLookup(matchingModeEnum_<%=connectionName%>);
|
||||
<%
|
||||
} else {
|
||||
%>
|
||||
org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<<%=connectionName%>Struct> tHash_Lookup_<%=connectionName%> =org.talend.designer.components.lookup.memory.AdvancedMemoryLookup.
|
||||
<<%=connectionName%>Struct>getLookup(matchingModeEnum_<%=connectionName%>);
|
||||
|
||||
<%
|
||||
}
|
||||
%>
|
||||
globalMap.put("tHash_Lookup_<%=connectionName%>", tHash_Lookup_<%=connectionName%>);
|
||||
|
||||
<%
|
||||
@@ -124,4 +142,4 @@
|
||||
}
|
||||
|
||||
%>
|
||||
|
||||
|
||||
|
||||
@@ -3,29 +3,86 @@
|
||||
org.talend.core.model.process.INode
|
||||
org.talend.core.model.process.IConnection
|
||||
org.talend.designer.codegen.config.CodeGeneratorArgument
|
||||
org.talend.core.model.process.ElementParameterParser
|
||||
java.util.List
|
||||
org.talend.core.model.metadata.IMetadataTable
|
||||
org.talend.core.model.metadata.IMetadataColumn
|
||||
|
||||
org.talend.core.model.process.IHashableInputConnections
|
||||
org.talend.core.model.process.IHashConfiguration
|
||||
org.talend.core.model.process.IDataConnection
|
||||
"
|
||||
%>
|
||||
|
||||
<%
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode)codeGenArgument.getArgument();
|
||||
|
||||
List<IConnection> connections = (List<IConnection>) node.getIncomingConnections();
|
||||
String cid = node.getUniqueName();
|
||||
List<IConnection> connections = (List<IConnection>) node.getIncomingConnections();
|
||||
|
||||
if (connections != null && connections.size() > 0) {
|
||||
for (IConnection connection : connections) {
|
||||
String connectionName = connection.getName();
|
||||
|
||||
IMetadataTable metadataTable = connection.getMetadataTable();
|
||||
INode validTarget = ((IDataConnection) connection).getLinkNodeForHash();
|
||||
boolean memoryStorage = true;
|
||||
if(validTarget != null) {
|
||||
IHashConfiguration hashConfiguration = null;
|
||||
boolean bSortOnDisk = "true".equals(ElementParameterParser.getValue(node, "__SORT_ON_DISK__"));
|
||||
|
||||
if (validTarget instanceof IHashableInputConnections){
|
||||
IHashableInputConnections target = (IHashableInputConnections) validTarget;
|
||||
hashConfiguration = target.getHashConfiguration(connection.getName());
|
||||
}
|
||||
memoryStorage = !(hashConfiguration != null && hashConfiguration.isPersistent() || bSortOnDisk);
|
||||
}
|
||||
|
||||
boolean includeParallelComps = false;
|
||||
List<? extends INode> listPartitions= node.getProcess().getNodesOfType("tPartitioner");
|
||||
if (listPartitions!=null && listPartitions.size() > 0 ) {
|
||||
includeParallelComps = true;
|
||||
}
|
||||
%>
|
||||
tHash_Lookup_<%=connectionName%>.endPut();
|
||||
<%
|
||||
}
|
||||
if (includeParallelComps && memoryStorage) {
|
||||
%>
|
||||
java.util.List<java.util.concurrent.ConcurrentHashMap<String,Object>> mapsList_<%=cid%> =
|
||||
(java.util.List<java.util.concurrent.ConcurrentHashMap<String,Object>>)globalMap.get("THREAD_MAPS_"+jobName);
|
||||
if (mapsList_<%=cid%> != null) {
|
||||
|
||||
|
||||
for (java.util.concurrent.ConcurrentHashMap<String,Object> map : mapsList_<%=cid%>) {
|
||||
org.talend.designer.components.lookup.memory.ConcurrentAdvancedMemoryLookup
|
||||
<<%=connectionName%>Struct> tmp = (org.talend.designer.components.lookup.memory.ConcurrentAdvancedMemoryLookup
|
||||
<<%=connectionName%>Struct>)tHash_Lookup_<%=connectionName%>;
|
||||
if (globalMap != map) {
|
||||
|
||||
|
||||
//map.put("MAP_POPULATED_<%=connectionName%>",Boolean.TRUE);
|
||||
|
||||
map.put("tHash_Lookup_<%=connectionName%>",new org.talend.designer.components.lookup.memory.ConcurrentAdvancedMemoryLookup
|
||||
<<%=connectionName%>Struct>(tmp));
|
||||
while (map.get("tHash_Lookup_<%=connectionName%>") == null) {
|
||||
Thread.sleep(1);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
globalMap.put("THREADS_HAVE_ERROR",ex);
|
||||
throw ex;
|
||||
} catch (Error er) {
|
||||
globalMap.put("THREADS_HAVE_ERROR",er);
|
||||
throw er;
|
||||
}
|
||||
|
||||
}//end synchronized
|
||||
|
||||
|
||||
<%
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
%>
|
||||
|
||||
@@ -12,9 +12,6 @@
|
||||
org.talend.core.model.process.IHashConfiguration
|
||||
org.talend.core.model.process.IHashableColumn
|
||||
org.talend.core.model.process.IMatchingMode
|
||||
java.util.HashSet
|
||||
java.util.Set
|
||||
org.talend.core.model.process.EConnectionType
|
||||
org.talend.core.model.process.IDataConnection
|
||||
"
|
||||
%>
|
||||
|
||||
@@ -14,13 +14,10 @@
|
||||
org.talend.core.model.process.IMatchingMode
|
||||
java.util.List
|
||||
java.util.ArrayList
|
||||
java.util.HashSet
|
||||
java.util.Set
|
||||
java.util.Map
|
||||
java.util.HashMap
|
||||
java.util.Comparator
|
||||
java.util.Collections
|
||||
org.talend.core.model.process.EConnectionType
|
||||
org.talend.core.model.process.IDataConnection
|
||||
org.talend.designer.xmlmap.XmlMapComponent
|
||||
org.eclipse.emf.common.util.EList
|
||||
|
||||
@@ -5,8 +5,6 @@
|
||||
org.talend.designer.codegen.config.CodeGeneratorArgument
|
||||
java.util.List
|
||||
org.talend.core.model.metadata.IMetadataTable
|
||||
org.talend.core.model.metadata.IMetadataColumn
|
||||
|
||||
"
|
||||
%>
|
||||
|
||||
|
||||
@@ -12,13 +12,10 @@
|
||||
org.talend.core.model.process.IMatchingMode
|
||||
java.util.List
|
||||
java.util.ArrayList
|
||||
java.util.HashSet
|
||||
java.util.Set
|
||||
java.util.Map
|
||||
java.util.HashMap
|
||||
java.util.Comparator
|
||||
java.util.Collections
|
||||
org.talend.core.model.process.EConnectionType
|
||||
org.talend.core.model.process.IDataConnection
|
||||
org.talend.designer.xmlmap.XmlMapComponent
|
||||
org.eclipse.emf.common.util.EList
|
||||
|
||||
@@ -2,3 +2,4 @@ LONG_NAME=Remplit une m
|
||||
HELP=org.talend.help.tAdvancedHash
|
||||
RUN_IF.MENU=Run if
|
||||
RUN_IF.LINK=If
|
||||
NB_LINE.NAME=Nombre de lignes
|
||||
|
||||
@@ -1,17 +1,8 @@
|
||||
<%@ jet
|
||||
imports="
|
||||
org.talend.core.model.process.INode
|
||||
org.talend.core.model.metadata.IMetadataTable
|
||||
org.talend.core.model.metadata.IMetadataColumn
|
||||
org.talend.core.model.process.IConnection
|
||||
org.talend.core.model.process.IConnectionCategory
|
||||
org.talend.core.model.process.ElementParameterParser
|
||||
org.talend.designer.codegen.config.CodeGeneratorArgument
|
||||
org.talend.core.model.metadata.types.JavaTypesManager
|
||||
org.talend.core.model.metadata.types.JavaType
|
||||
java.util.List
|
||||
java.util.Map
|
||||
java.util.HashMap
|
||||
"
|
||||
%>
|
||||
|
||||
|
||||
@@ -1,24 +1,4 @@
|
||||
<%@ jet
|
||||
imports="
|
||||
org.talend.core.model.process.INode
|
||||
org.talend.core.model.metadata.IMetadataTable
|
||||
org.talend.core.model.metadata.IMetadataColumn
|
||||
org.talend.core.model.process.IConnection
|
||||
org.talend.core.model.process.IConnectionCategory
|
||||
org.talend.core.model.process.ElementParameterParser
|
||||
org.talend.designer.codegen.config.CodeGeneratorArgument
|
||||
java.util.List
|
||||
java.util.Map
|
||||
org.talend.core.model.metadata.types.JavaTypesManager
|
||||
org.talend.core.model.metadata.types.JavaType
|
||||
"
|
||||
imports=""
|
||||
%>
|
||||
|
||||
<%
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode)codeGenArgument.getArgument();
|
||||
String cid = node.getUniqueName();
|
||||
|
||||
%>
|
||||
|
||||
} // G_AggR_600
|
||||
|
||||
@@ -11,7 +11,6 @@ imports="
|
||||
java.util.Map
|
||||
org.talend.core.model.metadata.types.JavaTypesManager
|
||||
org.talend.core.model.metadata.types.JavaType
|
||||
org.talend.core.model.process.INode
|
||||
"
|
||||
%>
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ imports="
|
||||
org.talend.core.model.metadata.IMetadataTable
|
||||
org.talend.core.model.metadata.IMetadataColumn
|
||||
org.talend.core.model.process.IConnection
|
||||
org.talend.core.model.process.IConnectionCategory
|
||||
org.talend.core.model.process.ElementParameterParser
|
||||
org.talend.designer.codegen.config.CodeGeneratorArgument
|
||||
org.talend.core.model.metadata.types.JavaTypesManager
|
||||
@@ -12,7 +11,6 @@ imports="
|
||||
java.util.List
|
||||
java.util.ArrayList
|
||||
java.util.Map
|
||||
java.util.HashMap
|
||||
"
|
||||
%>
|
||||
|
||||
|
||||
@@ -1,16 +1,9 @@
|
||||
<%@ jet
|
||||
imports="
|
||||
org.talend.core.model.process.INode
|
||||
org.talend.core.model.metadata.IMetadataTable
|
||||
org.talend.core.model.metadata.IMetadataColumn
|
||||
org.talend.core.model.process.IConnection
|
||||
org.talend.core.model.process.IConnectionCategory
|
||||
org.talend.core.model.process.ElementParameterParser
|
||||
org.talend.designer.codegen.config.CodeGeneratorArgument
|
||||
java.util.List
|
||||
java.util.Map
|
||||
org.talend.core.model.metadata.types.JavaTypesManager
|
||||
org.talend.core.model.metadata.types.JavaType
|
||||
"
|
||||
%>
|
||||
|
||||
|
||||
@@ -2,15 +2,8 @@
|
||||
imports="
|
||||
org.talend.core.model.process.INode
|
||||
org.talend.core.model.metadata.IMetadataTable
|
||||
org.talend.core.model.metadata.IMetadataColumn
|
||||
org.talend.designer.codegen.config.CodeGeneratorArgument
|
||||
org.talend.core.model.process.ElementParameterParser
|
||||
org.talend.core.model.process.IConnection
|
||||
org.talend.core.model.process.IConnectionCategory
|
||||
org.talend.designer.codegen.config.CodeGeneratorArgument
|
||||
java.util.ArrayList
|
||||
java.util.HashMap
|
||||
java.util.LinkedList
|
||||
java.util.List
|
||||
java.util.Map
|
||||
"
|
||||
|
||||
@@ -4,14 +4,7 @@ imports="
|
||||
org.talend.designer.codegen.config.CodeGeneratorArgument
|
||||
org.talend.core.model.process.ElementParameterParser
|
||||
java.util.List
|
||||
java.util.ArrayList
|
||||
java.util.LinkedList
|
||||
java.util.Map
|
||||
java.util.HashMap
|
||||
org.talend.core.model.metadata.IMetadataTable
|
||||
org.talend.core.model.metadata.IMetadataColumn
|
||||
org.talend.core.model.metadata.types.JavaTypesManager
|
||||
org.talend.core.model.metadata.types.JavaType
|
||||
"
|
||||
%>
|
||||
|
||||
|
||||
@@ -6,14 +6,8 @@ imports="
|
||||
org.talend.designer.codegen.config.CodeGeneratorArgument
|
||||
org.talend.core.model.process.ElementParameterParser
|
||||
java.util.List
|
||||
java.util.ArrayList
|
||||
java.util.LinkedList
|
||||
java.util.Map
|
||||
java.util.HashMap
|
||||
org.talend.core.model.process.IConnection
|
||||
org.talend.core.model.process.IConnectionCategory
|
||||
org.talend.core.model.metadata.types.JavaTypesManager
|
||||
org.talend.core.model.metadata.types.JavaType
|
||||
"
|
||||
%>
|
||||
|
||||
|
||||
@@ -22,7 +22,6 @@ ENCODING.NAME=Encodage
|
||||
HELP=org.talend.help.tAmazonMysqlCommit
|
||||
HOST.NAME=Hôte
|
||||
LONG_NAME=Commite toutes les transactions n'ayant pas encore été commitées dans une connexion MySQL Amazon RDS sélectionnée
|
||||
NB_LINE.NAME=Nombre de lignes
|
||||
NULL_CHAR.NAME=Caractère Null
|
||||
PASS.NAME=Mot de passe
|
||||
PORT.NAME=Port
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
ADD_COLS.ITEM.NAME=Naam
|
||||
COMMIT_EVERY.NAME=Commit iedere
|
||||
DATA_ACTION.ITEM.DELETE=Verwijderen
|
||||
DATA_ACTION.ITEM.UPDATE=Update
|
||||
PASS.NAME=Wachtwoord
|
||||
USER.NAME=Gebruikersnaam
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
ADD_COLS.ITEM.REFCOL=Referentna kolona
|
||||
ADD_COLS.ITEM.SQL=SQL izraz
|
||||
DATA_ACTION.ITEM.DELETE=DELETE
|
||||
DATA_ACTION.ITEM.INSERT=INSERT
|
||||
DATA_ACTION.ITEM.UPDATE=UPDATE
|
||||
SQL_SYNTAX.NAME=SQL sintaksa
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
REPOSITORY_VALUE="DB_VERSION"
|
||||
READONLY="true">
|
||||
<ITEMS DEFAULT="MYSQL_5">
|
||||
<ITEM NAME="MYSQL_5" VALUE="mysql-connector-java-5.1.0-bin.jar" />
|
||||
<ITEM NAME="MYSQL_5" VALUE="MYSQL_5" />
|
||||
</ITEMS>
|
||||
</PARAMETER>
|
||||
|
||||
@@ -160,7 +160,7 @@
|
||||
|
||||
<CODEGENERATION>
|
||||
<IMPORTS>
|
||||
<IMPORT NAME="Driver-MysqlConnector" MODULE="mysql-connector-java-5.1.0-bin.jar" REQUIRED="false" />
|
||||
<IMPORT NAME="Driver-MysqlConnector" MODULE="mysql-connector-java-5.1.22-bin.jar" REQUIRED_IF="DB_VERSION == 'MYSQL_5'" />
|
||||
</IMPORTS>
|
||||
</CODEGENERATION>
|
||||
<RETURNS/>
|
||||
|
||||
@@ -6,7 +6,6 @@ ENCODING.NAME=Encodage
|
||||
HELP=org.talend.help.tAmazonMysqlConnection
|
||||
HOST.NAME=Hôte
|
||||
LONG_NAME=Crée une connexion à une base de données MySQL Amazon RDS
|
||||
NB_LINE.NAME=Nombre de lignes
|
||||
NULL_CHAR.NAME=Caractère Null
|
||||
PASS.NAME=Mot de passe
|
||||
PORT.NAME=Port
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
PASS.NAME=Wachtwoord
|
||||
USER.NAME=Gebruikersnaam
|
||||
DB_VERSION.ITEM.MYSQL_5=Mysql 5
|
||||
|
||||
Binary file not shown.
@@ -7,9 +7,7 @@ imports="
|
||||
org.talend.designer.codegen.config.CodeGeneratorArgument
|
||||
org.talend.core.model.process.IConnection
|
||||
org.talend.core.model.process.IConnectionCategory
|
||||
org.talend.core.model.metadata.builder.database.ExtractMetaDataUtils
|
||||
org.talend.core.model.metadata.types.JavaTypesManager
|
||||
org.talend.core.model.metadata.types.JavaType
|
||||
java.util.List
|
||||
java.util.Map
|
||||
"
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
</HEADER>
|
||||
|
||||
<FAMILIES>
|
||||
<FAMILY>Databases/AmazonRDS/MySQL</FAMILY>
|
||||
<FAMILY>Cloud/AmazonRDS/MySQL</FAMILY>
|
||||
</FAMILIES>
|
||||
|
||||
@@ -50,7 +51,7 @@
|
||||
READONLY="true"
|
||||
SHOW_IF="USE_EXISTING_CONNECTION == 'false'">
|
||||
<ITEMS DEFAULT="MYSQL_5">
|
||||
<ITEM NAME="MYSQL_5" VALUE="mysql-connector-java-5.1.0-bin.jar" />
|
||||
<ITEM NAME="MYSQL_5" VALUE="MYSQL_5" />
|
||||
</ITEMS>
|
||||
</PARAMETER>
|
||||
|
||||
@@ -237,7 +238,7 @@
|
||||
|
||||
<CODEGENERATION>
|
||||
<IMPORTS>
|
||||
<IMPORT NAME="Driver-Mysql5" MODULE="mysql-connector-java-5.1.0-bin.jar" REQUIRED="false" />
|
||||
<IMPORT NAME="Driver-Mysql5" MODULE="mysql-connector-java-5.1.22-bin.jar" REQUIRED_IF="(DB_VERSION == 'MYSQL_5') AND (USE_EXISTING_CONNECTION == 'false')" />
|
||||
</IMPORTS>
|
||||
</CODEGENERATION>
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@ ENCODING.NAME=Encodage
|
||||
HELP=org.talend.help.tAmazonMysqlInput
|
||||
HOST.NAME=Hôte
|
||||
LONG_NAME=Lit une table MySQL Amazon RDS et extrait des champs à partir d'une requête SQL
|
||||
NB_LINE.NAME=Nombre de lignes
|
||||
NULL_CHAR.NAME=Caractère Null
|
||||
PASS.NAME=Mot de passe
|
||||
PORT.NAME=Port
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
PASS.NAME=Wachtwoord
|
||||
USER.NAME=Gebruikersnaam
|
||||
DB_VERSION.ITEM.MYSQL_5=Mysql 5
|
||||
|
||||
@@ -4,9 +4,7 @@ imports="
|
||||
org.talend.core.model.process.INode
|
||||
org.talend.core.model.process.ElementParameterParser
|
||||
org.talend.core.model.metadata.IMetadataTable
|
||||
org.talend.core.model.metadata.IMetadataColumn
|
||||
org.talend.core.model.metadata.types.JavaTypesManager
|
||||
org.talend.core.model.metadata.types.JavaType
|
||||
org.talend.core.model.metadata.MappingTypeRetriever
|
||||
org.talend.core.model.metadata.MetadataTalendType
|
||||
org.talend.core.model.process.IProcess
|
||||
@@ -15,7 +13,6 @@ imports="
|
||||
java.util.ArrayList
|
||||
java.util.Map
|
||||
java.util.HashMap
|
||||
java.util.LinkedList
|
||||
"
|
||||
skeleton="../templates/db_output_bulk.skeleton"
|
||||
%>
|
||||
@@ -208,7 +205,7 @@ if(!useExistingConnection) {
|
||||
}
|
||||
%>
|
||||
<%
|
||||
if (useBatchSize && "mysql-connector-java-5.1.0-bin.jar".equals(dbVersion) && !extendedInsert) {
|
||||
if (useBatchSize && "MYSQL_5".equals(dbVersion) && !extendedInsert) {
|
||||
if(!("").equals(batchSize)&&!("0").equals(batchSize)) {
|
||||
%>
|
||||
int batchSize_<%=cid%> = <%=batchSize%>;
|
||||
@@ -332,7 +329,7 @@ if(columnList != null && columnList.size() > 0) {
|
||||
|
||||
<%
|
||||
} else {//extended-insert mode(begin)
|
||||
if ("mysql-connector-java-3.1.14-bin.jar".equals(dbVersion)) {
|
||||
if ("MYSQL_4".equals(dbVersion)) {
|
||||
%>
|
||||
class BufferLine_<%=cid%> {
|
||||
<%
|
||||
@@ -403,7 +400,7 @@ if(columnList != null && columnList.size() > 0) {
|
||||
String insertColValue<%=cid%> = "<%=insertValueStmt.toString()%>";
|
||||
int rowCount<%=cid%> = 0;
|
||||
<%
|
||||
} else if ("mysql-connector-java-5.1.0-bin.jar".equals(dbVersion)) {
|
||||
} else if ("MYSQL_5".equals(dbVersion)) {
|
||||
%>
|
||||
String insert_<%=cid%> = "INSERT INTO `" + <%=table%> + "` (<%=insertColName.toString()%>) VALUES (<%=insertValueStmt.toString()%>)";
|
||||
<%
|
||||
@@ -478,7 +475,7 @@ if(columnList != null && columnList.size() > 0) {
|
||||
}
|
||||
}
|
||||
if(isDynamic) {
|
||||
if ("mysql-connector-java-3.1.14-bin.jar".equals(dbVersion) && extendedInsert) {
|
||||
if ("MYSQL_4".equals(dbVersion) && extendedInsert) {
|
||||
%>
|
||||
|
||||
class BufferLine_<%=cid%> {
|
||||
|
||||
@@ -4,11 +4,8 @@ imports="
|
||||
org.talend.core.model.process.INode
|
||||
org.talend.core.model.process.ElementParameterParser
|
||||
org.talend.core.model.process.IConnection
|
||||
org.talend.core.model.metadata.IMetadataColumn
|
||||
org.talend.core.model.metadata.IMetadataTable
|
||||
org.talend.core.model.metadata.types.JavaTypesManager
|
||||
org.talend.core.model.metadata.types.JavaType
|
||||
org.talend.core.model.process.IConnectionCategory
|
||||
org.talend.core.model.metadata.MappingTypeRetriever
|
||||
org.talend.core.model.metadata.MetadataTalendType
|
||||
org.talend.core.model.process.IProcess
|
||||
@@ -104,7 +101,7 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
|
||||
if(extendedInsert){
|
||||
|
||||
if ("mysql-connector-java-3.1.14-bin.jar".equals(dbVersion)) {
|
||||
if ("MYSQL_4".equals(dbVersion)) {
|
||||
class ExtendInsertOperation{
|
||||
public String generateType(String typeToGenerate){
|
||||
if(("byte[]").equals(typeToGenerate)){
|
||||
@@ -340,7 +337,7 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
insertedCount_<%=cid%> = insertedCount_<%=cid%> + pstmt_<%=cid %>.executeUpdate();
|
||||
}
|
||||
<%
|
||||
} else if ("mysql-connector-java-5.1.0-bin.jar".equals(dbVersion)) {
|
||||
} else if ("MYSQL_5".equals(dbVersion)) {
|
||||
//////////batch execute by batch size///////
|
||||
if(!("").equals(numPerInsert ) && !("0").equals(numPerInsert )) {
|
||||
%>
|
||||
@@ -423,7 +420,7 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
<%
|
||||
} else {
|
||||
%>
|
||||
<%if ((rejectConnName==null && "mysql-connector-java-5.1.0-bin.jar".equals(dbVersion) && useBatchSize) && ( ("INSERT").equals(dataAction) ||("UPDATE").equals(dataAction) || ("DELETE").equals(dataAction))) {
|
||||
<%if ((rejectConnName==null && "MYSQL_5".equals(dbVersion) && useBatchSize) && ( ("INSERT").equals(dataAction) ||("UPDATE").equals(dataAction) || ("DELETE").equals(dataAction))) {
|
||||
%>
|
||||
try {
|
||||
int countSum_<%=cid%> = 0;
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
</HEADER>
|
||||
|
||||
<FAMILIES>
|
||||
<FAMILY>Databases/AmazonRDS/MySQL</FAMILY>
|
||||
<FAMILY>Cloud/AmazonRDS/MySQL</FAMILY>
|
||||
</FAMILIES>
|
||||
|
||||
@@ -54,7 +55,7 @@
|
||||
READONLY="true"
|
||||
SHOW_IF="USE_EXISTING_CONNECTION == 'false'">
|
||||
<ITEMS DEFAULT="MYSQL_5">
|
||||
<ITEM NAME="MYSQL_5" VALUE="mysql-connector-java-5.1.0-bin.jar" />
|
||||
<ITEM NAME="MYSQL_5" VALUE="MYSQL_5" />
|
||||
</ITEMS>
|
||||
</PARAMETER>
|
||||
|
||||
@@ -419,7 +420,7 @@
|
||||
|
||||
<CODEGENERATION>
|
||||
<IMPORTS>
|
||||
<IMPORT NAME="Driver-Mysql5" MODULE="mysql-connector-java-5.1.0-bin.jar" REQUIRED="false" />
|
||||
<IMPORT NAME="Driver-Mysql5" MODULE="mysql-connector-java-5.1.22-bin.jar" REQUIRED_IF="(DB_VERSION == 'MYSQL_5') AND (USE_EXISTING_CONNECTION == 'false')" />
|
||||
</IMPORTS>
|
||||
</CODEGENERATION>
|
||||
|
||||
|
||||
@@ -4,10 +4,8 @@ imports="
|
||||
org.talend.core.model.process.INode
|
||||
org.talend.core.model.process.ElementParameterParser
|
||||
org.talend.core.model.process.IConnection
|
||||
org.talend.core.model.metadata.IMetadataColumn
|
||||
org.talend.core.model.metadata.IMetadataTable
|
||||
org.talend.core.model.metadata.types.JavaTypesManager
|
||||
org.talend.core.model.metadata.types.JavaType
|
||||
org.talend.core.model.process.IConnectionCategory
|
||||
org.talend.core.model.metadata.MappingTypeRetriever
|
||||
org.talend.core.model.metadata.MetadataTalendType
|
||||
@@ -16,7 +14,6 @@ imports="
|
||||
java.util.ArrayList
|
||||
java.util.Map
|
||||
java.util.HashMap
|
||||
java.util.LinkedList
|
||||
"
|
||||
skeleton="../templates/db_output_bulk.skeleton"
|
||||
%>
|
||||
@@ -233,7 +230,7 @@ if(columnList != null && columnList.size() > 0) {
|
||||
|
||||
<%
|
||||
} else {//extended-insert mode(begin)
|
||||
if ("mysql-connector-java-3.1.14-bin.jar".equals(dbVersion)) {
|
||||
if ("MYSQL_4".equals(dbVersion)) {
|
||||
%>
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -300,7 +297,7 @@ if(columnList != null && columnList.size() > 0) {
|
||||
int rowCount<%=cid%> = 0;
|
||||
<%
|
||||
}
|
||||
} else if ("mysql-connector-java-5.1.0-bin.jar".equals(dbVersion)) {
|
||||
} else if ("MYSQL_5".equals(dbVersion)) {
|
||||
List< ? extends IConnection> conns_dynamic = node.getIncomingConnections();
|
||||
if(conns_dynamic!=null && conns_dynamic.size()>0){
|
||||
IConnection conn = conns_dynamic.get(0);
|
||||
@@ -626,7 +623,7 @@ if(columnList != null && columnList.size() > 0) {
|
||||
<%
|
||||
}
|
||||
}
|
||||
if ("mysql-connector-java-5.1.0-bin.jar".equals(dbVersion)) {
|
||||
if ("MYSQL_5".equals(dbVersion)) {
|
||||
if (extendedInsert || useBatchSize) {
|
||||
if((!("").equals(numPerInsert)&&!("0").equals(numPerInsert))
|
||||
||(!("").equals(batchSize)&&!("0").equals(batchSize))) {
|
||||
@@ -647,7 +644,7 @@ if(columnList != null && columnList.size() > 0) {
|
||||
<%
|
||||
if(("INSERT").equals(dataAction)) {
|
||||
if(extendedInsert) {//extended-insert mode(begin)
|
||||
if ("mysql-connector-java-3.1.14-bin.jar".equals(dbVersion)) {
|
||||
if ("MYSQL_4".equals(dbVersion)) {
|
||||
ExtendInsertOperation eiOperation = new ExtendInsertOperation();
|
||||
int insertableCount = 0;
|
||||
for(Column column : colStruct) {
|
||||
@@ -726,7 +723,7 @@ if(columnList != null && columnList.size() > 0) {
|
||||
counter<%=cid%>=1;
|
||||
}
|
||||
<%
|
||||
} else if ("mysql-connector-java-5.1.0-bin.jar".equals(dbVersion)) {
|
||||
} else if ("MYSQL_5".equals(dbVersion)) {
|
||||
int counter = 1;
|
||||
for(Column column : colStruct) {
|
||||
if(column.isInsertable()) {
|
||||
@@ -936,7 +933,7 @@ if(columnList != null && columnList.size() > 0) {
|
||||
}
|
||||
%>
|
||||
|
||||
<%if (rejectConnName == null && useBatchSize && "mysql-connector-java-5.1.0-bin.jar".equals(dbVersion)) { // whether use batch
|
||||
<%if (rejectConnName == null && useBatchSize && "MYSQL_5".equals(dbVersion)) { // whether use batch
|
||||
%>
|
||||
pstmt_<%=cid %>.addBatch();
|
||||
nb_line_<%=cid%>++;
|
||||
@@ -1374,7 +1371,7 @@ if(columnList != null && columnList.size() > 0) {
|
||||
<%
|
||||
}
|
||||
%>
|
||||
<%if (rejectConnName == null && useBatchSize && "mysql-connector-java-5.1.0-bin.jar".equals(dbVersion)) { // whether use batch
|
||||
<%if (rejectConnName == null && useBatchSize && "MYSQL_5".equals(dbVersion)) { // whether use batch
|
||||
%>
|
||||
pstmt_<%=cid %>.addBatch();
|
||||
nb_line_<%=cid%>++;
|
||||
@@ -1644,7 +1641,7 @@ if(columnList != null && columnList.size() > 0) {
|
||||
<%
|
||||
}
|
||||
//////////batch execute by batch size///////
|
||||
if (extendedInsert && "mysql-connector-java-5.1.0-bin.jar".equals(dbVersion) && ("INSERT").equals(dataAction)) {
|
||||
if (extendedInsert && "MYSQL_5".equals(dbVersion) && ("INSERT").equals(dataAction)) {
|
||||
if(!("").equals(numPerInsert ) && !("0").equals(numPerInsert )) {
|
||||
%>
|
||||
if ( batchSize_<%=cid%> <= batchSizeCounter_<%=cid%>) {
|
||||
@@ -1691,7 +1688,7 @@ if(columnList != null && columnList.size() > 0) {
|
||||
}
|
||||
|
||||
}
|
||||
if (useBatchSize && "mysql-connector-java-5.1.0-bin.jar".equals(dbVersion) &&(rejectConnName==null)) {
|
||||
if (useBatchSize && "MYSQL_5".equals(dbVersion) &&(rejectConnName==null)) {
|
||||
if(!("").equals(batchSize) && !("0").equals(batchSize)) {
|
||||
%>
|
||||
if ( batchSize_<%=cid%> <= batchSizeCounter_<%=cid%>) {
|
||||
@@ -1751,7 +1748,7 @@ if(columnList != null && columnList.size() > 0) {
|
||||
|
||||
if(commitEvery_<%=cid%> <= commitCounter_<%=cid%>) {
|
||||
|
||||
<%if ((rejectConnName==null && useBatchSize && "mysql-connector-java-5.1.0-bin.jar".equals(dbVersion)) && (("INSERT").equals(dataAction) || ("UPDATE").equals(dataAction) || ("DELETE").equals(dataAction)) ) {
|
||||
<%if ((rejectConnName==null && useBatchSize && "MYSQL_5".equals(dbVersion)) && (("INSERT").equals(dataAction) || ("UPDATE").equals(dataAction) || ("DELETE").equals(dataAction)) ) {
|
||||
%>
|
||||
try {
|
||||
int countSum_<%=cid%> = 0;
|
||||
|
||||
@@ -35,13 +35,12 @@ DBD-ODBC.INFO=Requis pour les connexions de type ODBC
|
||||
DBD-Oracle.INFO=Requis pour Oracle
|
||||
DBD-Pg.INFO=Requis pour PostgreSQL
|
||||
DBD-mysql.INFO=Requis pour MySQL
|
||||
DIE_ON_ERROR.NAME=Terminer en cas d'erreur
|
||||
DIE_ON_ERROR.NAME=Arrêter en cas d'erreur
|
||||
ENCODING.NAME=Encodage
|
||||
EXTENDINSERT.NAME=Insertions étendues
|
||||
HELP=org.talend.help.tAmazonMysqlOutput
|
||||
HOST.NAME=Hôte
|
||||
LONG_NAME=Insère ou met à jour des lignes dans une table MySQL Amazon RDS
|
||||
NB_LINE.NAME=Nombre de lignes
|
||||
NULL_CHAR.NAME=Caractère Null
|
||||
PASS.NAME=Mot de passe
|
||||
PORT.NAME=Port
|
||||
|
||||
@@ -2,5 +2,11 @@ ADD_COLS.ITEM.NAME=Naam
|
||||
ADD_COLS.ITEM.OPERATOR.ITEM.NOT_EQUAL=<>
|
||||
ADD_COLS.ITEM.OPERATOR.ITEM.IS=IS
|
||||
COMMIT_EVERY.NAME=Commit iedere
|
||||
DATA_ACTION.ITEM.DELETE=Verwijderen
|
||||
DATA_ACTION.ITEM.UPDATE=Update
|
||||
PASS.NAME=Wachtwoord
|
||||
USER.NAME=Gebruikersnaam
|
||||
HINT_OPTIONS.ITEM.SQL_STMT.ITEM.UPDATE=Update
|
||||
HINT_OPTIONS.ITEM.SQL_STMT.ITEM.DELETE=Verwijderen
|
||||
DB_VERSION.ITEM.MYSQL_4=Mysql 4
|
||||
DB_VERSION.ITEM.MYSQL_5=Mysql 5
|
||||
|
||||
@@ -5,7 +5,6 @@ ADD_COLS.ITEM.OPERATOR.ITEM.NOT_EQUAL=<>
|
||||
ADD_COLS.ITEM.OPERATOR.ITEM.LESS_THAN=<
|
||||
ADD_COLS.ITEM.OPERATOR.ITEM.GREAT_THAN=>
|
||||
ADD_COLS.ITEM.OPERATOR.ITEM.GREAT_EQUAL_THAN=>=
|
||||
DATA_ACTION.ITEM.DELETE=DELETE
|
||||
DATA_ACTION.ITEM.INSERT=INSERT
|
||||
DATA_ACTION.ITEM.UPDATE=UPDATE
|
||||
SQL_SYNTAX.NAME=SQL sintaksa
|
||||
@@ -15,6 +14,5 @@ TYPE.ITEM.PGSQL=Postgre SQL
|
||||
HINT_OPTIONS.ITEM.SQL_STMT=SQL STMT*
|
||||
HINT_OPTIONS.ITEM.SQL_STMT.ITEM.INSERT=INSERT
|
||||
HINT_OPTIONS.ITEM.SQL_STMT.ITEM.UPDATE=UPDATE
|
||||
HINT_OPTIONS.ITEM.SQL_STMT.ITEM.DELETE=DELETE
|
||||
DB_VERSION.ITEM.MYSQL_4=Mysql 4
|
||||
DB_VERSION.ITEM.MYSQL_5=Mysql 5
|
||||
|
||||
@@ -22,7 +22,6 @@ ENCODING.NAME=Encodage
|
||||
HELP=org.talend.help.tAmazonMysqlRollback
|
||||
HOST.NAME=Hôte
|
||||
LONG_NAME=Annule toutes les transactions n'ayant pas encore été commitées dans une connexion MySQL Amazon RDS sélectionnée
|
||||
NB_LINE.NAME=Nombre de lignes
|
||||
NULL_CHAR.NAME=Caractère Null
|
||||
PASS.NAME=Mot de passe
|
||||
PORT.NAME=Port
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
ADD_COLS.ITEM.NAME=Naam
|
||||
COMMIT_EVERY.NAME=Commit iedere
|
||||
DATA_ACTION.ITEM.DELETE=Verwijderen
|
||||
DATA_ACTION.ITEM.UPDATE=Update
|
||||
PASS.NAME=Wachtwoord
|
||||
USER.NAME=Gebruikersnaam
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
ADD_COLS.ITEM.REFCOL=Referentna kolona
|
||||
ADD_COLS.ITEM.SQL=SQL izraz
|
||||
DATA_ACTION.ITEM.DELETE=DELETE
|
||||
DATA_ACTION.ITEM.INSERT=INSERT
|
||||
DATA_ACTION.ITEM.UPDATE=UPDATE
|
||||
SQL_SYNTAX.NAME=SQL sintaksa
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
READONLY="true"
|
||||
SHOW_IF="USE_EXISTING_CONNECTION == 'false'">
|
||||
<ITEMS DEFAULT="MYSQL_5">
|
||||
<ITEM NAME="MYSQL_5" VALUE="mysql-connector-java-5.1.0-bin.jar" />
|
||||
<ITEM NAME="MYSQL_5" VALUE="MYSQL_5" />
|
||||
</ITEMS>
|
||||
</PARAMETER>
|
||||
|
||||
@@ -276,7 +276,7 @@
|
||||
|
||||
<CODEGENERATION>
|
||||
<IMPORTS>
|
||||
<IMPORT NAME="Driver-Mysql5" MODULE="mysql-connector-java-5.1.0-bin.jar" REQUIRED="false" />
|
||||
<IMPORT NAME="Driver-Mysql5" MODULE="mysql-connector-java-5.1.22-bin.jar" REQUIRED_IF="(DB_VERSION == 'MYSQL_5') AND (USE_EXISTING_CONNECTION == 'false')" />
|
||||
</IMPORTS>
|
||||
</CODEGENERATION>
|
||||
|
||||
|
||||
@@ -4,12 +4,11 @@ DBD-Oracle.INFO=Requis pour Oracle
|
||||
DBD-Pg.INFO=Requis pour PostgreSQL
|
||||
DBD-mysql.INFO=Requis pour MySQL
|
||||
DBTABLE.NAME=Nom de la table
|
||||
DIE_ON_ERROR.NAME=Terminer en cas d'erreur
|
||||
DIE_ON_ERROR.NAME=Arrêter en cas d'erreur
|
||||
ENCODING.NAME=Encodage
|
||||
HELP=org.talend.help.tAmazonMysqlRow
|
||||
HOST.NAME=Hôte
|
||||
LONG_NAME=Exécute une requête SQL à chaque itération de flux Talend
|
||||
NB_LINE.NAME=Nombre de lignes
|
||||
PASS.NAME=Mot de passe
|
||||
PORT.NAME=Port
|
||||
PREPARED_STATEMENT.NAME=Instruction préparée
|
||||
@@ -45,7 +44,7 @@ SET_PREPAREDSTATEMENT_PARAMETERS.ITEM.PARAMETER_INDEX=Index des param
|
||||
SET_PREPAREDSTATEMENT_PARAMETERS.ITEM.PARAMETER_TYPE=Type de paramètre
|
||||
SET_PREPAREDSTATEMENT_PARAMETERS.ITEM.PARAMETER_TYPE.ITEM.BigDecimal=BigDecimal
|
||||
SET_PREPAREDSTATEMENT_PARAMETERS.ITEM.PARAMETER_TYPE.ITEM.Blob=Blob
|
||||
SET_PREPAREDSTATEMENT_PARAMETERS.ITEM.PARAMETER_TYPE.ITEM.Boolean=Booléen
|
||||
SET_PREPAREDSTATEMENT_PARAMETERS.ITEM.PARAMETER_TYPE.ITEM.Boolean=Boolean
|
||||
SET_PREPAREDSTATEMENT_PARAMETERS.ITEM.PARAMETER_TYPE.ITEM.Byte=Byte
|
||||
SET_PREPAREDSTATEMENT_PARAMETERS.ITEM.PARAMETER_TYPE.ITEM.Bytes=Bytes
|
||||
SET_PREPAREDSTATEMENT_PARAMETERS.ITEM.PARAMETER_TYPE.ITEM.Clob=Clob
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
COMMIT_EVERY.NAME=Commit iedere
|
||||
PASS.NAME=Wachtwoord
|
||||
USER.NAME=Gebruikersnaam
|
||||
DB_VERSION.ITEM.MYSQL_4=Mysql 4
|
||||
DB_VERSION.ITEM.MYSQL_5=Mysql 5
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user