Compare commits
464 Commits
patch/5.3.
...
release/5.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9ced8f0f1b | ||
|
|
c8fc6015a0 | ||
|
|
8d31416607 | ||
|
|
2b4177287a | ||
|
|
1ff6aec7f4 | ||
|
|
6859959d72 | ||
|
|
e93e573c62 | ||
|
|
49e5227bfa | ||
|
|
eb824c8c7e | ||
|
|
5fcfd98d40 | ||
|
|
deb8ee5933 | ||
|
|
132f27bccd | ||
|
|
0f645548c0 | ||
|
|
9ce0220f21 | ||
|
|
9d60e5eda7 | ||
|
|
eac9c051d4 | ||
|
|
10811fb005 | ||
|
|
66652eba42 | ||
|
|
5aba3c7448 | ||
|
|
c15c8ade4a | ||
|
|
51ab43ae42 | ||
|
|
74dade8861 | ||
|
|
fa1e0eedd2 | ||
|
|
8a97c7c478 | ||
|
|
470dc7fb42 | ||
|
|
67310fd7b9 | ||
|
|
d36f450273 | ||
|
|
b2200108fb | ||
|
|
edcf1436f2 | ||
|
|
08cb60840c | ||
|
|
0766c2e48e | ||
|
|
0d4a4d51c9 | ||
|
|
33835fd55b | ||
|
|
7a3c6713c3 | ||
|
|
585c0325dc | ||
|
|
697895bb25 | ||
|
|
03aab14184 | ||
|
|
2624e739f3 | ||
|
|
87d40aa533 | ||
|
|
86e090c2a7 | ||
|
|
07ed52f8c6 | ||
|
|
e1011b3977 | ||
|
|
5b7f06a5ff | ||
|
|
8e76d74b07 | ||
|
|
c9e2d5271c | ||
|
|
41a9369e16 | ||
|
|
b98e8e1891 | ||
|
|
144c01fc84 | ||
|
|
f4dbed6a4f | ||
|
|
968946e2b4 | ||
|
|
b5c00c9f95 | ||
|
|
88e952d92f | ||
|
|
5267310b8d | ||
|
|
91c25a0c8e | ||
|
|
ca952b7ef1 | ||
|
|
346340c1aa | ||
|
|
64390a18f6 | ||
|
|
953e259d22 | ||
|
|
74f74a885e | ||
|
|
59d2f1104b | ||
|
|
b517d2a175 | ||
|
|
acd7ec3ac9 | ||
|
|
1e30a1d3a9 | ||
|
|
d93d1517cf | ||
|
|
2eb636e743 | ||
|
|
2a86020878 | ||
|
|
f3fc1d09e2 | ||
|
|
2169d0875a | ||
|
|
5edf5f0050 | ||
|
|
17c84ef2a6 | ||
|
|
017dc09f93 | ||
|
|
c5bb672e81 | ||
|
|
6c267df2bb | ||
|
|
a9efec19b6 | ||
|
|
f15d0fda5b | ||
|
|
24fe60c2b9 | ||
|
|
78002a88d1 | ||
|
|
36b3b40166 | ||
|
|
d39a56b0ad | ||
|
|
ea13a14f3c | ||
|
|
57c6f0eb39 | ||
|
|
70bbac254d | ||
|
|
dc9bec4610 | ||
|
|
807b51b432 | ||
|
|
6a74487574 | ||
|
|
df5d263bd4 | ||
|
|
5129ea9d45 | ||
|
|
b57e6838e4 | ||
|
|
df50fe44de | ||
|
|
92511c9740 | ||
|
|
ebeed546c9 | ||
|
|
2be2113881 | ||
|
|
e856677491 | ||
|
|
e88ba34567 | ||
|
|
34f0de171b | ||
|
|
8b912a6c59 | ||
|
|
eab8d8b92c | ||
|
|
1f0368991a | ||
|
|
e200339580 | ||
|
|
e903925b16 | ||
|
|
d3ae3d09cb | ||
|
|
1c89078f08 | ||
|
|
3bf0b1817b | ||
|
|
4e9e3aa670 | ||
|
|
59e0d87b38 | ||
|
|
c909491254 | ||
|
|
c4bfaea624 | ||
|
|
92c6617608 | ||
|
|
b204a97dde | ||
|
|
58282559f3 | ||
|
|
82fb5ab048 | ||
|
|
312d5c3b1c | ||
|
|
892b7e0ecf | ||
|
|
7116dc9c3f | ||
|
|
d5d93005c2 | ||
|
|
36f96b3d8e | ||
|
|
b0438b34e3 | ||
|
|
f578e81eef | ||
|
|
26dabc8443 | ||
|
|
679170a50e | ||
|
|
8bf7b20e6d | ||
|
|
1739c1a1bd | ||
|
|
7a467134eb | ||
|
|
bd3d778df7 | ||
|
|
533b9b03ac | ||
|
|
dbfdd0462b | ||
|
|
02701a1167 | ||
|
|
be32e6eac8 | ||
|
|
6e072d36c7 | ||
|
|
8bbf5f6094 | ||
|
|
fd333f8500 | ||
|
|
0650b41b91 | ||
|
|
fe1829206e | ||
|
|
141113a3a8 | ||
|
|
db8bc0107c | ||
|
|
fc9b33624f | ||
|
|
b6e0a76541 | ||
|
|
09df7b6fd0 | ||
|
|
ada539abbb | ||
|
|
d55e8a6b2a | ||
|
|
0ec8a3a3fe | ||
|
|
5975aeeca1 | ||
|
|
7c656c3d14 | ||
|
|
8cda2616dd | ||
|
|
033c1ad0bd | ||
|
|
237a979e55 | ||
|
|
860a89dc39 | ||
|
|
e12d1f1e18 | ||
|
|
4e36c8912a | ||
|
|
4fcf357a28 | ||
|
|
4403b48949 | ||
|
|
4e45b057c3 | ||
|
|
d0bf29028c | ||
|
|
decc82bb41 | ||
|
|
423bcbbbd5 | ||
|
|
5b52f2b5b8 | ||
|
|
396a75fb47 | ||
|
|
c56ae16bc8 | ||
|
|
47679f5613 | ||
|
|
c5a2c24f46 | ||
|
|
df6c9843fd | ||
|
|
594df0be3e | ||
|
|
67f5567932 | ||
|
|
3fb11ab978 | ||
|
|
3050f7151e | ||
|
|
318a87c1da | ||
|
|
429961a447 | ||
|
|
4d999086c2 | ||
|
|
6e2a8359f2 | ||
|
|
987c8b61c9 | ||
|
|
0fd98a1a8b | ||
|
|
a71492b0c6 | ||
|
|
bbd5cb1cf7 | ||
|
|
f11f6956ee | ||
|
|
52ea14785f | ||
|
|
7f490ed6db | ||
|
|
c98de97595 | ||
|
|
cf6c524f57 | ||
|
|
7b9a8b7dc2 | ||
|
|
86508c434d | ||
|
|
68e33016ce | ||
|
|
3a82f17533 | ||
|
|
db752d2fde | ||
|
|
e6a787d069 | ||
|
|
1698c5c243 | ||
|
|
b1df0c6a4a | ||
|
|
ca91c1b27a | ||
|
|
9b0b67efe5 | ||
|
|
47893300f0 | ||
|
|
09db8ad528 | ||
|
|
bce841fa40 | ||
|
|
715c9ecda5 | ||
|
|
ce15c832ba | ||
|
|
1647ea03cd | ||
|
|
2ddc694763 | ||
|
|
24586f133b | ||
|
|
26f44b9774 | ||
|
|
9244cc0d78 | ||
|
|
6bf07a751f | ||
|
|
5bc2db9cf9 | ||
|
|
6577706874 | ||
|
|
0389a1c5e3 | ||
|
|
d954acb226 | ||
|
|
2c3bf8f95a | ||
|
|
ee291dbe94 | ||
|
|
46de87592a | ||
|
|
b469484489 | ||
|
|
78bccc337f | ||
|
|
4573bd3977 | ||
|
|
f59454ad5d | ||
|
|
cacdec7d63 | ||
|
|
49b92e98b4 | ||
|
|
47d5c6e990 | ||
|
|
f670f94782 | ||
|
|
b0e272f8c2 | ||
|
|
7634c2cb19 | ||
|
|
c043eaf013 | ||
|
|
b8994d6634 | ||
|
|
3078a06461 | ||
|
|
70eeb4e43d | ||
|
|
57e14acbd2 | ||
|
|
c89a5685d6 | ||
|
|
3960f4db81 | ||
|
|
3e04b4b039 | ||
|
|
e7b1c0fd28 | ||
|
|
c1e10cd30e | ||
|
|
a9855f04e2 | ||
|
|
3782dff09c | ||
|
|
44bb16adf9 | ||
|
|
0bc3a5e565 | ||
|
|
e800d7ffec | ||
|
|
269cca108f | ||
|
|
1c12ff5b62 | ||
|
|
a547f72182 | ||
|
|
1ea5b0983e | ||
|
|
44ba2561ba | ||
|
|
12620d7fe0 | ||
|
|
9151ed67f9 | ||
|
|
e14330172e | ||
|
|
cfb5fb68d3 | ||
|
|
9dd710db15 | ||
|
|
fe8a80e4ac | ||
|
|
e60352d672 | ||
|
|
a45b731b4e | ||
|
|
ac34e67475 | ||
|
|
9aae893730 | ||
|
|
5ee38547a7 | ||
|
|
b390d784c6 | ||
|
|
73c1ba4e8c | ||
|
|
663ebaeefa | ||
|
|
6fd0387017 | ||
|
|
358cbb908e | ||
|
|
b6bee45229 | ||
|
|
35eca94250 | ||
|
|
b475ad8d0d | ||
|
|
2a5c16a017 | ||
|
|
e67290268d | ||
|
|
fa54706af7 | ||
|
|
8fd6cb2104 | ||
|
|
bf1e5cc409 | ||
|
|
8079a69c24 | ||
|
|
4b059e3c0d | ||
|
|
b1d86bd6f2 | ||
|
|
9302172572 | ||
|
|
12d75e53bf | ||
|
|
2444886d2c | ||
|
|
39fc271ba1 | ||
|
|
0a86d32fee | ||
|
|
b852e655d4 | ||
|
|
1532e0e31c | ||
|
|
93c6aa74d7 | ||
|
|
2b01953149 | ||
|
|
118a623533 | ||
|
|
9da0dfa541 | ||
|
|
c3bab4b5ce | ||
|
|
debcc83d63 | ||
|
|
a8025c581f | ||
|
|
25318c023e | ||
|
|
e1f3063f0b | ||
|
|
62df2525c8 | ||
|
|
9ad54b096d | ||
|
|
17a5e88a24 | ||
|
|
b3992c0a29 | ||
|
|
2249dc0b2b | ||
|
|
feaf3d9cd4 | ||
|
|
0bace3f9e6 | ||
|
|
b080a3f67f | ||
|
|
a1209b7fdd | ||
|
|
fb46c02727 | ||
|
|
0df8a9a7b3 | ||
|
|
6b912c24f4 | ||
|
|
7669771d5a | ||
|
|
b0b4315aab | ||
|
|
b6f53d0120 | ||
|
|
713fef287e | ||
|
|
1fc1307eb6 | ||
|
|
afbf7443ba | ||
|
|
65e0f0c01b | ||
|
|
a6ffa96a30 | ||
|
|
4924d36567 | ||
|
|
4954dc6f72 | ||
|
|
b6083b0c52 | ||
|
|
6e59e06794 | ||
|
|
90f56e7f90 | ||
|
|
f174f3288c | ||
|
|
8ff13b15b5 | ||
|
|
87eaff4d67 | ||
|
|
c50f66561c | ||
|
|
863bffac81 | ||
|
|
01980f3095 | ||
|
|
b5f02580d9 | ||
|
|
6f81556e4a | ||
|
|
7c50c6ced3 | ||
|
|
bd0f383ff0 | ||
|
|
256fcf6f7b | ||
|
|
609bdd5999 | ||
|
|
8d3caaa412 | ||
|
|
1505c35333 | ||
|
|
eb9d978e34 | ||
|
|
897efd043a | ||
|
|
1f8b8c85ca | ||
|
|
18e3747090 | ||
|
|
1afe84de93 | ||
|
|
013eb8d3f0 | ||
|
|
021889afd3 | ||
|
|
3114d40c0c | ||
|
|
507439d785 | ||
|
|
8f5d2c0d49 | ||
|
|
2600486bbe | ||
|
|
6087a46523 | ||
|
|
0712a27213 | ||
|
|
0d172c3035 | ||
|
|
b3e6862bdc | ||
|
|
7a2b256756 | ||
|
|
9f6b9a8a44 | ||
|
|
2a9275f7c5 | ||
|
|
c77598c0ca | ||
|
|
d3b341d6a8 | ||
|
|
0884624c6a | ||
|
|
fe7c17f153 | ||
|
|
7b87a11d3c | ||
|
|
7d7c562971 | ||
|
|
bb8c1d0535 | ||
|
|
6a7e7a9c06 | ||
|
|
f5c517dca2 | ||
|
|
322187f198 | ||
|
|
88710514e5 | ||
|
|
31c12f2ee1 | ||
|
|
8483d35af1 | ||
|
|
ea084a503c | ||
|
|
25b0f0732a | ||
|
|
4c53ed17fb | ||
|
|
b769d705a4 | ||
|
|
a3045feaa5 | ||
|
|
32353b426a | ||
|
|
a72576cb27 | ||
|
|
329a937be1 | ||
|
|
a8b6657b61 | ||
|
|
e51fd38bf2 | ||
|
|
0c436b3d06 | ||
|
|
f9deb2012c | ||
|
|
981a8938cd | ||
|
|
077664e32c | ||
|
|
f1205ea06d | ||
|
|
9af54fff22 | ||
|
|
fe85dc960f | ||
|
|
5a0b2660ec | ||
|
|
8c64a864bb | ||
|
|
8a4947114d | ||
|
|
3821df40b3 | ||
|
|
056d418eaa | ||
|
|
ea713c82a5 | ||
|
|
9f89a4c2a8 | ||
|
|
4ecb191446 | ||
|
|
04dde29d67 | ||
|
|
37cbab1850 | ||
|
|
1706bc437f | ||
|
|
0fadd95dc5 | ||
|
|
1a985ff340 | ||
|
|
09cde10db9 | ||
|
|
6499a3e2bf | ||
|
|
99c447df11 | ||
|
|
73f703603d | ||
|
|
a4b5e57daa | ||
|
|
ead81dd2ca | ||
|
|
a36b3bd574 | ||
|
|
768aeb42c4 | ||
|
|
931d91b98a | ||
|
|
4fb075bb71 | ||
|
|
ae39a55e08 | ||
|
|
0596016727 | ||
|
|
ffd46f920f | ||
|
|
690d742025 | ||
|
|
aebbb564f2 | ||
|
|
d1c55280c3 | ||
|
|
9c22cb11b6 | ||
|
|
98d1b7a904 | ||
|
|
568a262627 | ||
|
|
39ab7686b9 | ||
|
|
876959ae12 | ||
|
|
90275b296d | ||
|
|
bf8934b40a | ||
|
|
e35cdbb279 | ||
|
|
a65b2affb8 | ||
|
|
6fe0f1a7cb | ||
|
|
d5806df81d | ||
|
|
4afeff8adf | ||
|
|
eeb97c2af8 | ||
|
|
513df73b07 | ||
|
|
8ff7087cb7 | ||
|
|
a7efce3a94 | ||
|
|
d92c155434 | ||
|
|
ad409f5a66 | ||
|
|
761ecb4fb5 | ||
|
|
f7cde6d12c | ||
|
|
706fd67f7d | ||
|
|
6bb3a9ef74 | ||
|
|
5fc6bb2996 | ||
|
|
5852506748 | ||
|
|
689edf6476 | ||
|
|
1c0e651025 | ||
|
|
8a1a9b0de0 | ||
|
|
af1da04bdf | ||
|
|
c3e81c3972 | ||
|
|
0875bbedb9 | ||
|
|
bb84837ace | ||
|
|
f3f3eef89f | ||
|
|
ef5ccb82c0 | ||
|
|
ff87fcb956 | ||
|
|
f2438c353d | ||
|
|
f27bfbeaef | ||
|
|
5f16bc105a | ||
|
|
2063762134 | ||
|
|
d7505c16a1 | ||
|
|
3a24558d56 | ||
|
|
c9cc45c3bf | ||
|
|
69bf0965fd | ||
|
|
624dba28ae | ||
|
|
fecd59404c | ||
|
|
18ea0c919d | ||
|
|
a9518edb4d | ||
|
|
599aa47478 | ||
|
|
929f6ea81c | ||
|
|
6d03b5e3b7 | ||
|
|
97fe058c33 | ||
|
|
876e5ae530 | ||
|
|
9309ec77fc | ||
|
|
f949752660 | ||
|
|
5319765903 | ||
|
|
d0f4f5576d | ||
|
|
f3a47d159c | ||
|
|
ecebf55d1a | ||
|
|
1029975b99 | ||
|
|
51d8f6a592 | ||
|
|
3964f425eb | ||
|
|
104c3e489c | ||
|
|
708a076329 | ||
|
|
91cab8553f | ||
|
|
e221a3ac2b | ||
|
|
5de9d7451f | ||
|
|
f5c9bcf84c | ||
|
|
a1eec2a5c0 | ||
|
|
c9fc6c5964 | ||
|
|
99d74db820 |
1
org.talend.componentdesigner.nl/META-INF/eclipse.inf
Normal file
1
org.talend.componentdesigner.nl/META-INF/eclipse.inf
Normal file
@@ -0,0 +1 @@
|
||||
jarprocessor.exclude.children=true
|
||||
1
org.talend.componentdesigner.rcp.nl/META-INF/eclipse.inf
Normal file
1
org.talend.componentdesigner.rcp.nl/META-INF/eclipse.inf
Normal file
@@ -0,0 +1 @@
|
||||
jarprocessor.exclude.children=true
|
||||
1
org.talend.componentdesigner.rcp/META-INF/eclipse.inf
Normal file
1
org.talend.componentdesigner.rcp/META-INF/eclipse.inf
Normal file
@@ -0,0 +1 @@
|
||||
jarprocessor.exclude.children=true
|
||||
1
org.talend.componentdesigner/META-INF/eclipse.inf
Normal file
1
org.talend.componentdesigner/META-INF/eclipse.inf
Normal file
@@ -0,0 +1 @@
|
||||
jarprocessor.exclude.children=true
|
||||
@@ -16,7 +16,7 @@
|
||||
<extension point="org.eclipse.ui.perspectives">
|
||||
<perspective class="org.talend.componentdesigner.ui.Perspective"
|
||||
id="org.talend.componentdesigner.perspective"
|
||||
name="Component's Designer">
|
||||
name="Component Designer">
|
||||
</perspective>
|
||||
</extension>
|
||||
<extension point="org.eclipse.ui.perspectiveExtensions">
|
||||
@@ -99,7 +99,7 @@
|
||||
<contentExtension
|
||||
pattern="org.talend.componentdesigner.resourceContent" />
|
||||
<contentExtension
|
||||
pattern="org.eclipse.ui.navigator.resources.filters.*" />
|
||||
pattern="org.talend.componentdesigner.ui.navigator.resources.filters.*" />
|
||||
</includes>
|
||||
</viewerContentBinding>
|
||||
<viewerActionBinding
|
||||
@@ -267,7 +267,7 @@
|
||||
</filterExpression>
|
||||
</commonFilter> -->
|
||||
<commonFilter
|
||||
id="org.eclipse.ui.navigator.resources.filters.nonComponentProject"
|
||||
id="org.talend.componentdesigner.ui.navigator.resources.filters.nonComponentProject"
|
||||
name="nonComponentProject" description="not the component project"
|
||||
activeByDefault="true">
|
||||
<filterExpression>
|
||||
|
||||
@@ -260,7 +260,6 @@ public final class ComponentProjectManager {
|
||||
addLibClasspathEntries(ces, "org.talend.metadata.managment"); //$NON-NLS-1$
|
||||
addLibClasspathEntries(ces, "org.talend.core"); //$NON-NLS-1$
|
||||
addLibClasspathEntries(ces, "org.talend.designer.codegen"); //$NON-NLS-1$
|
||||
addLibClasspathEntries(ces, "org.talend.commons"); //$NON-NLS-1$
|
||||
return ces;
|
||||
}
|
||||
|
||||
|
||||
@@ -34,6 +34,9 @@ import org.talend.componentdesigner.i18n.internal.Messages;
|
||||
import org.talend.componentdesigner.util.XSDValidator;
|
||||
import org.talend.componentdesigner.util.file.FileCopy;
|
||||
import org.talend.core.CorePlugin;
|
||||
import org.talend.core.model.components.IComponent;
|
||||
import org.talend.core.model.components.IComponentsFactory;
|
||||
import org.talend.repository.model.ComponentsFactoryProvider;
|
||||
|
||||
/**
|
||||
* DOC slanglois class global comment. Detailled comment
|
||||
@@ -49,6 +52,7 @@ public class PushToPaletteActionProvider extends CommonActionProvider {
|
||||
*
|
||||
* @see org.eclipse.ui.navigator.CommonActionProvider#init(org.eclipse.ui.navigator.ICommonActionExtensionSite)
|
||||
*/
|
||||
@Override
|
||||
public void init(ICommonActionExtensionSite anExtensionSite) {
|
||||
|
||||
if (anExtensionSite.getViewSite() instanceof ICommonViewerWorkbenchSite) {
|
||||
@@ -59,6 +63,7 @@ public class PushToPaletteActionProvider extends CommonActionProvider {
|
||||
/**
|
||||
* Adds a submenu to the given menu with the name "New Component".
|
||||
*/
|
||||
@Override
|
||||
public void fillContextMenu(IMenuManager menu) {
|
||||
menu.insertBefore("group.edit", copyProjectAction); //$NON-NLS-1$
|
||||
// Object obj = ((TreeSelection) this.getContext().getSelection()).getFirstElement();// need to get all
|
||||
@@ -86,9 +91,10 @@ public class PushToPaletteActionProvider extends CommonActionProvider {
|
||||
/*
|
||||
* (non-Javadoc) Method declared on IAction.
|
||||
*/
|
||||
@Override
|
||||
public void run() {
|
||||
String path = CorePlugin.getDefault().getComponentsLocalProviderService().getPreferenceStore().getString(
|
||||
"USER_COMPONENTS_FOLDER"); //$NON-NLS-1$
|
||||
String path = CorePlugin.getDefault().getComponentsLocalProviderService().getPreferenceStore()
|
||||
.getString("USER_COMPONENTS_FOLDER"); //$NON-NLS-1$
|
||||
if (path == null || path.length() == 0) {
|
||||
new MessageDialog(
|
||||
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
|
||||
@@ -130,6 +136,15 @@ public class PushToPaletteActionProvider extends CommonActionProvider {
|
||||
}
|
||||
}
|
||||
|
||||
// add for bug TDI-26719, clear image cash from EmfComponent
|
||||
IComponentsFactory components = ComponentsFactoryProvider.getInstance();
|
||||
List<IComponent> comList = components.getCustomComponents();
|
||||
for (IComponent com : comList) {
|
||||
if (com.getImageRegistry() != null) {
|
||||
com.getImageRegistry().clear();
|
||||
}
|
||||
}
|
||||
|
||||
MessageDialog warningMessageDialog = new MessageDialog(
|
||||
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
|
||||
Messages.getString("PushToPaletteActionProvider.Information"), null, Messages.getString("PushToPaletteActionProvider.InformationMSG"), MessageDialog.INFORMATION, //$NON-NLS-1$ //$NON-NLS-2$
|
||||
@@ -147,7 +162,8 @@ public class PushToPaletteActionProvider extends CommonActionProvider {
|
||||
|
||||
MessageDialog warningMessageDialog = new MessageDialog(
|
||||
|
||||
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), Messages.getString("PushToPaletteActionProvider.PushToPaletteActionProvider.result"), null, waringInfo, //$NON-NLS-1$
|
||||
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
|
||||
Messages.getString("PushToPaletteActionProvider.PushToPaletteActionProvider.result"), null, waringInfo, //$NON-NLS-1$
|
||||
MessageDialog.WARNING, new String[] { Messages.getString("PushToPaletteActionProvider.OK3") }, 0); //$NON-NLS-1$
|
||||
|
||||
warningMessageDialog.open();
|
||||
@@ -162,6 +178,7 @@ public class PushToPaletteActionProvider extends CommonActionProvider {
|
||||
// get the correct XML file for components
|
||||
File[] list = componentFolder.listFiles(new FilenameFilter() {
|
||||
|
||||
@Override
|
||||
public boolean accept(File dir, String name) {
|
||||
// _java.xml
|
||||
String javaXmlName = dir.getName() + "_java.xml"; //$NON-NLS-1$
|
||||
|
||||
@@ -12,11 +12,15 @@
|
||||
// ============================================================================
|
||||
package org.talend.componentdesigner.ui.preferencepage;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import org.eclipse.jface.dialogs.MessageDialog;
|
||||
import org.eclipse.jface.preference.DirectoryFieldEditor;
|
||||
import org.eclipse.jface.preference.FieldEditorPreferencePage;
|
||||
import org.eclipse.jface.util.PropertyChangeEvent;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.ModifyEvent;
|
||||
import org.eclipse.swt.events.ModifyListener;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.widgets.Label;
|
||||
import org.eclipse.ui.IWorkbench;
|
||||
@@ -27,8 +31,8 @@ import org.talend.componentdesigner.i18n.internal.Messages;
|
||||
|
||||
/**
|
||||
* This class represents a preference page that is contributed to the Preferences dialog. By subclassing
|
||||
* <samp>FieldEditorPreferencePage</samp>, we can use the field support built into JFace that allows us to create a
|
||||
* page that is small and knows how to save, restore and apply itself.
|
||||
* <samp>FieldEditorPreferencePage</samp>, we can use the field support built into JFace that allows us to create a page
|
||||
* that is small and knows how to save, restore and apply itself.
|
||||
* <p>
|
||||
* This page is used to modify preferences only. They are stored in the preference store that belongs to the main
|
||||
* plug-in class. That way, preferences can be accessed directly via the preference store.
|
||||
@@ -65,23 +69,39 @@ public class ComponentProjectPreferencePage extends FieldEditorPreferencePage im
|
||||
GridData gd = new GridData();
|
||||
gd.horizontalSpan = 3;
|
||||
l.setLayoutData(gd);
|
||||
filePathTemp = new DirectoryFieldEditor(PluginConstant.PROJECT_URL, Messages
|
||||
.getString("ComponentProjectPreferencePage.ComponentProject"), //$NON-NLS-1$
|
||||
filePathTemp = new DirectoryFieldEditor(PluginConstant.PROJECT_URL,
|
||||
Messages.getString("ComponentProjectPreferencePage.ComponentProject"), //$NON-NLS-1$
|
||||
getFieldEditorParent());
|
||||
addField(filePathTemp);
|
||||
// addModifyListener for the filePath text
|
||||
filePathTemp.getTextControl(getFieldEditorParent()).addModifyListener(new ModifyListener() {
|
||||
|
||||
@Override
|
||||
public void modifyText(ModifyEvent e) {
|
||||
String newPath = filePathTemp.getTextControl(getFieldEditorParent()).getText();
|
||||
File file = new File(newPath);
|
||||
if (!file.exists() && !"".equals(newPath)) {
|
||||
filePathTemp.showErrorMessage();
|
||||
setValid(false);
|
||||
} else {
|
||||
setValid(true);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.jface.preference.FieldEditorPreferencePage#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
|
||||
* @see
|
||||
* org.eclipse.jface.preference.FieldEditorPreferencePage#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
|
||||
*/
|
||||
public void propertyChange(PropertyChangeEvent event) {
|
||||
|
||||
super.propertyChange(event);
|
||||
|
||||
MessageDialog warningMessageDialog = new MessageDialog(getFieldEditorParent().getShell(), Messages
|
||||
.getString("ComponentProjectPreferencePage.Warning"), null, //$NON-NLS-1$
|
||||
|
||||
MessageDialog warningMessageDialog = new MessageDialog(getFieldEditorParent().getShell(),
|
||||
Messages.getString("ComponentProjectPreferencePage.Warning"), null, //$NON-NLS-1$
|
||||
Messages.getString("ComponentProjectPreferencePage.WarningMSG"), MessageDialog.WARNING, //$NON-NLS-1$
|
||||
new String[] { Messages.getString("ComponentProjectPreferencePage.ButtonLabel0") }, 0); //$NON-NLS-1$
|
||||
warningMessageDialog.open();
|
||||
|
||||
1
org.talend.designer.abstractmap.nl/META-INF/eclipse.inf
Normal file
1
org.talend.designer.abstractmap.nl/META-INF/eclipse.inf
Normal file
@@ -0,0 +1 @@
|
||||
jarprocessor.exclude.children=true
|
||||
1
org.talend.designer.abstractmap/META-INF/eclipse.inf
Normal file
1
org.talend.designer.abstractmap/META-INF/eclipse.inf
Normal file
@@ -0,0 +1 @@
|
||||
jarprocessor.exclude.children=true
|
||||
@@ -79,7 +79,7 @@ public abstract class AbstractMapComponent extends MapperExternalNode {
|
||||
|
||||
protected boolean hasDataIntoExpression(Pattern pattern, PatternMatcher matcher, String expression) {
|
||||
if (expression != null) {
|
||||
if (matcher.contains(expression, pattern)) {
|
||||
if (matcher.matches(expression, pattern)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,6 +40,10 @@ public class DefaultDropTargetListener implements TransferDropTargetListener {
|
||||
|
||||
private Point lastCursorPosition;
|
||||
|
||||
private long lastDragTime;
|
||||
|
||||
private boolean scrollUp = false;
|
||||
|
||||
public DefaultDropTargetListener(AbstractMapperManager mapperManager) {
|
||||
super();
|
||||
this.mapperManager = mapperManager;
|
||||
@@ -53,12 +57,14 @@ public class DefaultDropTargetListener implements TransferDropTargetListener {
|
||||
return mapperManager.getUiManager();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dragEnter(DropTargetEvent event) {
|
||||
updatePopupPosition(event);
|
||||
// updatePopupPosition(event);
|
||||
setPopupVisible(true);
|
||||
event.detail = mapperManager.getUiManager().getCurrentDragDetail();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dragLeave(DropTargetEvent event) {
|
||||
dragFinished();
|
||||
}
|
||||
@@ -76,6 +82,7 @@ public class DefaultDropTargetListener implements TransferDropTargetListener {
|
||||
draggingInfosPopup.setVisible(visible);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dragOperationChanged(DropTargetEvent event) {
|
||||
updatePopupPosition(event);
|
||||
detectPressedKeys(event);
|
||||
@@ -124,6 +131,7 @@ public class DefaultDropTargetListener implements TransferDropTargetListener {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dragOver(DropTargetEvent event) {
|
||||
// System.out.println(((DropTarget)event.widget).getControl());
|
||||
event.detail = DND.DROP_NONE;
|
||||
@@ -133,20 +141,17 @@ public class DefaultDropTargetListener implements TransferDropTargetListener {
|
||||
}
|
||||
|
||||
private void updatePopupPosition(DropTargetEvent event) {
|
||||
|
||||
Point cursorPosition = new Point(event.x, event.y);
|
||||
if (!cursorPosition.equals(lastCursorPosition)) {
|
||||
AbstractUIManager uiManager = mapperManager.getUiManager();
|
||||
DraggingInfosPopup draggingInfosPopup = uiManager.getDraggingInfosPopup();
|
||||
draggingInfosPopup.setCursorPosition(event.x, event.y);
|
||||
}
|
||||
// System.out.println("updatePopupPosition:" + lastCursorPosition + "-->" + cursorPosition);
|
||||
lastCursorPosition = cursorPosition;
|
||||
}
|
||||
|
||||
private void autoScroll(DropTargetEvent event) {
|
||||
if (lastCursorPosition == null || lastCursorPosition.y == event.y) {
|
||||
return;
|
||||
}
|
||||
Composite currentComposite = null;
|
||||
Object source = event.getSource();
|
||||
if (source instanceof DropTarget) {
|
||||
@@ -163,22 +168,51 @@ public class DefaultDropTargetListener implements TransferDropTargetListener {
|
||||
if (parentScrolledComposite == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
ScrollBar vBar = parentScrolledComposite.getVerticalBar();
|
||||
int increment = event.y - lastCursorPosition.y;
|
||||
if (increment > 0) {
|
||||
increment = increment + 3;
|
||||
} else {
|
||||
increment = increment - 3;
|
||||
}
|
||||
|
||||
Control content = parentScrolledComposite.getContent();
|
||||
if (content != null) {
|
||||
Point location = content.getLocation();
|
||||
int vSelection = vBar.getSelection();
|
||||
int increment = 0;
|
||||
int thumb = vBar.getThumb();
|
||||
if (lastCursorPosition == null || lastCursorPosition.y == event.y) {
|
||||
long currentTimeMillis = System.currentTimeMillis();
|
||||
long time = currentTimeMillis - lastDragTime;
|
||||
|
||||
if (lastDragTime != 0 && time > 100) {
|
||||
Point pointToScrollComposite = parentScrolledComposite.toControl(event.x, event.y);
|
||||
|
||||
// scroll up
|
||||
if (pointToScrollComposite.y < 40) {
|
||||
increment = -20;
|
||||
}
|
||||
// scroll down
|
||||
else if (thumb - pointToScrollComposite.y < 40) {
|
||||
increment = 20;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
increment = event.y - lastCursorPosition.y;
|
||||
if (increment > 0) {
|
||||
increment = increment + 3;
|
||||
} else {
|
||||
increment = increment - 3;
|
||||
}
|
||||
}
|
||||
|
||||
if (vSelection >= 0 && vSelection + increment > 0 && vSelection + increment < vBar.getMaximum()) {
|
||||
vBar.setSelection(vSelection + increment);
|
||||
}
|
||||
content.setLocation(location.x, -vSelection);
|
||||
mapperManager.getUiManager().refreshBackground(true, false);
|
||||
lastDragTime = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
// Event e = new Event();
|
||||
@@ -205,6 +239,7 @@ public class DefaultDropTargetListener implements TransferDropTargetListener {
|
||||
return getParentScrolledComposite(composite.getParent());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drop(DropTargetEvent event) {
|
||||
dragFinished();
|
||||
}
|
||||
@@ -218,6 +253,7 @@ public class DefaultDropTargetListener implements TransferDropTargetListener {
|
||||
return getClass() != DefaultDropTargetListener.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dropAccept(DropTargetEvent event) {
|
||||
|
||||
}
|
||||
@@ -227,6 +263,7 @@ public class DefaultDropTargetListener implements TransferDropTargetListener {
|
||||
*
|
||||
* @see org.eclipse.jface.util.TransferDropTargetListener#getTransfer()
|
||||
*/
|
||||
@Override
|
||||
public Transfer getTransfer() {
|
||||
return TableEntriesTransfer.getInstance();
|
||||
}
|
||||
@@ -236,6 +273,7 @@ public class DefaultDropTargetListener implements TransferDropTargetListener {
|
||||
*
|
||||
* @see org.eclipse.jface.util.TransferDropTargetListener#isEnabled(org.eclipse.swt.dnd.DropTargetEvent)
|
||||
*/
|
||||
@Override
|
||||
public boolean isEnabled(DropTargetEvent event) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
jarprocessor.exclude.children=true
|
||||
1
org.talend.designer.alfrescooutput/META-INF/eclipse.inf
Normal file
1
org.talend.designer.alfrescooutput/META-INF/eclipse.inf
Normal file
@@ -0,0 +1 @@
|
||||
jarprocessor.exclude.children=true
|
||||
@@ -0,0 +1 @@
|
||||
jarprocessor.exclude.children=true
|
||||
@@ -0,0 +1 @@
|
||||
jarprocessor.exclude.children=true
|
||||
@@ -86,8 +86,7 @@ public class CreateDiagramAction extends AContextualAction implements IIntroActi
|
||||
if (nodeType == ERepositoryObjectType.BUSINESS_PROCESS) {
|
||||
enabled = true;
|
||||
}
|
||||
if (repositoryNode.getObject() != null
|
||||
&& repositoryNode.getObject().getProperty().getItem().getState().isDeleted()) {
|
||||
if (repositoryNode.getObject() != null && repositoryNode.getObject().isDeleted()) {
|
||||
enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,6 +82,7 @@ import org.talend.designer.core.ui.views.jobsettings.JobSettingsView;
|
||||
import org.talend.designer.core.ui.views.jobsettings.tabs.AbstractTabComposite;
|
||||
import org.talend.designer.core.utils.EmfPropertyHelper;
|
||||
import org.talend.designer.core.utils.KeyHelper;
|
||||
import org.talend.repository.ProjectManager;
|
||||
import org.talend.repository.model.IRepositoryNode;
|
||||
import org.talend.repository.model.IRepositoryNode.ENodeType;
|
||||
import org.talend.repository.model.IRepositoryNode.EProperties;
|
||||
@@ -411,11 +412,12 @@ public class BusinessAssignmentComposite extends AbstractTabComposite {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ProjectManager.getInstance().isInCurrentMainProject(repositoryNode)) {
|
||||
CorePlugin.getDefault().getDiagramModelService()
|
||||
.addDeleteAssignmentAction(mgr, tableViewer.getSelection());
|
||||
}
|
||||
}
|
||||
CorePlugin.getDefault().getDiagramModelService().addDeleteAssignmentAction(mgr, tableViewer.getSelection());
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
Menu menu = menuMgr.createContextMenu(tableViewer.getControl());
|
||||
|
||||
1
org.talend.designer.codegen.nl/META-INF/eclipse.inf
Normal file
1
org.talend.designer.codegen.nl/META-INF/eclipse.inf
Normal file
@@ -0,0 +1 @@
|
||||
jarprocessor.exclude.children=true
|
||||
1
org.talend.designer.codegen.test/META-INF/eclipse.inf
Normal file
1
org.talend.designer.codegen.test/META-INF/eclipse.inf
Normal file
@@ -0,0 +1 @@
|
||||
jarprocessor.exclude.children=true
|
||||
1
org.talend.designer.codegen/META-INF/eclipse.inf
Normal file
1
org.talend.designer.codegen/META-INF/eclipse.inf
Normal file
@@ -0,0 +1 @@
|
||||
jarprocessor.exclude.children=true
|
||||
@@ -56,7 +56,7 @@
|
||||
<page
|
||||
category="org.talend.designer.codegen.components.localprovider.page1"
|
||||
class="org.talend.designer.components.preference.labelformat.ComponentsFormatPreferencePage"
|
||||
id="org.talend.designer.codegen.components.localprovider.page1"
|
||||
id="org.talend.designer.codegen.components.localprovider.page2"
|
||||
name="%format">
|
||||
</page>
|
||||
</extension>
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
org.talend.core.model.metadata.types.JavaType
|
||||
java.util.Map
|
||||
java.util.List
|
||||
java.util.ArrayList
|
||||
java.util.Set
|
||||
java.util.HashSet
|
||||
"
|
||||
@@ -37,23 +38,44 @@ boolean isRunInMultiThread = codeGenArgument.getIsRunInMultiThread();
|
||||
|
||||
Set<IConnection> connSet = new HashSet<IConnection>();
|
||||
connSet.addAll(node.getIncomingConnections(EConnectionType.FLOW_MAIN));
|
||||
connSet.addAll(node.getIncomingConnections(EConnectionType.FLOW_MERGE));
|
||||
connSet.addAll(node.getOutgoingConnections(EConnectionType.FLOW_MERGE));
|
||||
|
||||
Set<IConnection> iterateConnSet = new HashSet<IConnection>();
|
||||
iterateConnSet.addAll(node.getOutgoingConnections(EConnectionType.ITERATE));
|
||||
|
||||
List<IConnection> allSubProcessConnection = codeGenArgument.getAllMainSubTreeConnections();
|
||||
|
||||
if((codePart.equals(ECodePart.END))&&(stat)&&connSet.size()>0){
|
||||
for(IConnection con:connSet){
|
||||
%>
|
||||
if(execStat){
|
||||
runStat.updateStatOnConnection("<%=con.getUniqueName()%>"
|
||||
+iterateId,2, 0);
|
||||
if((codePart.equals(ECodePart.END))&&(stat)){
|
||||
boolean iterateInVFComp = (node.getVirtualLinkTo() != null && node.getVirtualLinkTo() == EConnectionType.ITERATE);
|
||||
if(iterateInVFComp){
|
||||
List<String> needToEndConnNames = new ArrayList<String>();
|
||||
INode nextNode = node.getOutgoingConnections(EConnectionType.ITERATE).get(0).getTarget();
|
||||
NodeUtil.fillConnectionsForStat(needToEndConnNames, nextNode);
|
||||
%>
|
||||
if(execStat){
|
||||
<%
|
||||
for(String connName : needToEndConnNames){
|
||||
%>
|
||||
runStat.updateStatOnConnection("<%=connName%>"+iterateId,2, 0);
|
||||
<%
|
||||
}
|
||||
%>
|
||||
}
|
||||
<%
|
||||
}
|
||||
if(connSet.size()>0){
|
||||
for(IConnection con:connSet){
|
||||
%>
|
||||
if(execStat){
|
||||
if(resourceMap.get("inIterateVComp") == null || !((Boolean)resourceMap.get("inIterateVComp"))){
|
||||
runStat.updateStatOnConnection("<%=con.getUniqueName()%>"+iterateId,2, 0);
|
||||
}
|
||||
}
|
||||
<%
|
||||
}
|
||||
}
|
||||
}
|
||||
<%
|
||||
}
|
||||
}%>
|
||||
%>
|
||||
|
||||
<%
|
||||
|
||||
@@ -311,6 +333,9 @@ end_Hash.put("<%=node.getUniqueName() %>", System.currentTimeMillis());
|
||||
if (!status.equals("failure")) {
|
||||
status = errorThread_<%=iterateTargetNodeName %>.status;
|
||||
}
|
||||
if(errorThread_<%=iterateTargetNodeName %>.exception!=null){
|
||||
throw errorThread_<%=iterateTargetNodeName %>.exception;
|
||||
}
|
||||
}else{
|
||||
Integer threadErrorCode = mtp_<%=iterateTargetNodeName %>.getTalendThreadResult().getErrorCode();
|
||||
String threadStatus = mtp_<%=iterateTargetNodeName %>.getTalendThreadResult().getStatus();
|
||||
@@ -338,6 +363,9 @@ end_Hash.put("<%=node.getUniqueName() %>", System.currentTimeMillis());
|
||||
if (!localStatus.equals("failure")) {
|
||||
((java.util.Map) threadLocal.get()).put("status", errorThread_<%=iterateTargetNodeName %>.status);
|
||||
}
|
||||
if(errorThread_<%=iterateTargetNodeName %>.exception!=null){
|
||||
throw errorThread_<%=iterateTargetNodeName %>.exception;
|
||||
}
|
||||
}else{
|
||||
Integer threadErrorCode = mtp_<%=iterateTargetNodeName %>.getTalendThreadResult().getErrorCode();
|
||||
String threadStatus = mtp_<%=iterateTargetNodeName %>.getTalendThreadResult().getStatus();
|
||||
|
||||
@@ -8,9 +8,11 @@
|
||||
org.talend.core.model.process.EConnectionType
|
||||
org.talend.core.model.process.ElementParameterParser
|
||||
org.talend.designer.codegen.config.CodeGeneratorArgument
|
||||
org.talend.core.model.utils.NodeUtil
|
||||
org.talend.core.model.process.IConnectionCategory
|
||||
java.util.List
|
||||
java.util.Set
|
||||
java.util.ArrayList
|
||||
java.util.Set
|
||||
java.util.HashSet
|
||||
java.util.Iterator
|
||||
"
|
||||
@@ -33,12 +35,12 @@
|
||||
|
||||
List<IConnection> allSubProcessConnection = codeGenArgument.getAllMainSubTreeConnections();
|
||||
%>
|
||||
|
||||
/**
|
||||
* [<%=node.getUniqueName() %> <%=codePart %> ] start
|
||||
*/
|
||||
|
||||
/**
|
||||
* [<%=node.getUniqueName() %> <%=codePart %> ] start
|
||||
*/
|
||||
|
||||
<%
|
||||
<%
|
||||
//This part in order to feedback with the iterate_subprocess_header.javajet and iterate_subprocess_footer.javajet
|
||||
|
||||
if (codePart.equals(ECodePart.BEGIN)) {
|
||||
@@ -47,139 +49,195 @@
|
||||
for (IConnection iterateConn : iterateConnSet) {
|
||||
parallelIterate = "true".equals(ElementParameterParser.getValue(iterateConn, "__ENABLE_PARALLEL__"));
|
||||
if (parallelIterate) {
|
||||
%>
|
||||
TalendThreadPool mtp_<%=iterateConn.getTarget().getUniqueName() %> = new TalendThreadPool(<%=ElementParameterParser.getValue(iterateConn,"__NUMBER_PARALLEL__") %>);
|
||||
%>
|
||||
TalendThreadPool mtp_<%=iterateConn.getTarget().getUniqueName() %> = new TalendThreadPool(<%=ElementParameterParser.getValue(iterateConn,"__NUMBER_PARALLEL__") %>);
|
||||
|
||||
<%
|
||||
if(!hasParallelIterate){
|
||||
hasParallelIterate = true;
|
||||
%>
|
||||
<%
|
||||
if(!hasParallelIterate){
|
||||
hasParallelIterate = true;
|
||||
%>
|
||||
|
||||
final Object[] lockWrite = new Object[0];
|
||||
int threadIdCounter =0;
|
||||
<%}%>
|
||||
final Object[] lockWrite = new Object[0];
|
||||
int threadIdCounter =0;
|
||||
<%
|
||||
}
|
||||
%>
|
||||
|
||||
<%
|
||||
<%
|
||||
}
|
||||
|
||||
String iterateNodeName = iterateConn.getTarget().getUniqueName();
|
||||
%>
|
||||
%>
|
||||
int NB_ITERATE_<%=iterateNodeName %> = 0; //for statistics
|
||||
<%
|
||||
<%
|
||||
continue;
|
||||
}
|
||||
}
|
||||
%>
|
||||
%>
|
||||
|
||||
<%
|
||||
<%
|
||||
if (codePart.equals(ECodePart.BEGIN)) {
|
||||
%>
|
||||
<% if(trace){ %>
|
||||
globalMap.put("ENABLE_TRACES_CONNECTION_<%=startNodeCid%>",Boolean.FALSE);
|
||||
<% } %>
|
||||
ok_Hash.put("<%=node.getUniqueName() %>", false);
|
||||
start_Hash.put("<%=node.getUniqueName() %>", System.currentTimeMillis());
|
||||
<%
|
||||
%>
|
||||
<%
|
||||
if(trace){
|
||||
%>
|
||||
globalMap.put("ENABLE_TRACES_CONNECTION_<%=startNodeCid%>",Boolean.FALSE);
|
||||
<%
|
||||
}
|
||||
%>
|
||||
ok_Hash.put("<%=node.getUniqueName() %>", false);
|
||||
start_Hash.put("<%=node.getUniqueName() %>", System.currentTimeMillis());
|
||||
<%
|
||||
String statCatcher = ElementParameterParser.getValue(node,"__TSTATCATCHER_STATS__");
|
||||
if ((node.getProcess().getNodesOfType("tStatCatcher").size() > 0) && (statCatcher.equals("true"))) {
|
||||
for (INode statCatcherNode : node.getProcess().getNodesOfType("tStatCatcher")) {
|
||||
%>
|
||||
<%=statCatcherNode.getUniqueName() %>.addMessage("begin","<%=node.getUniqueName() %>");
|
||||
<%=statCatcherNode.getDesignSubjobStartNode().getUniqueName() %>Process(globalMap);
|
||||
<%
|
||||
%>
|
||||
<%=statCatcherNode.getUniqueName() %>.addMessage("begin","<%=node.getUniqueName() %>");
|
||||
<%=statCatcherNode.getDesignSubjobStartNode().getUniqueName() %>Process(globalMap);
|
||||
<%
|
||||
}
|
||||
}
|
||||
}
|
||||
if(codePart.equals(ECodePart.MAIN)) {
|
||||
List<INode> meterCatchers = (List<INode>)node.getProcess().getNodesOfType("tFlowMeterCatcher");
|
||||
if ((node.getProcess().getNodesOfType("tFlowMeter").size() > 0))
|
||||
{
|
||||
for(IConnection temp_conn : node.getIncomingConnections(EConnectionType.FLOW_MAIN))
|
||||
{
|
||||
if ((node.getProcess().getNodesOfType("tFlowMeter").size() > 0)){
|
||||
for(IConnection temp_conn : node.getIncomingConnections(EConnectionType.FLOW_MAIN)){
|
||||
String name_conn = temp_conn.getUniqueName();
|
||||
if(temp_conn.isUseByMetter())
|
||||
{
|
||||
%>
|
||||
<%
|
||||
if (meterCatchers != null) {
|
||||
for (INode meterCatcher : meterCatchers) {
|
||||
%>
|
||||
<%=meterCatcher.getUniqueName() %>.addLineToRow("<%=name_conn%>_count");
|
||||
<%
|
||||
}
|
||||
}
|
||||
%>
|
||||
<%
|
||||
if(temp_conn.isUseByMetter()){
|
||||
%>
|
||||
<%
|
||||
if (meterCatchers != null) {
|
||||
for (INode meterCatcher : meterCatchers) {
|
||||
%>
|
||||
<%=meterCatcher.getUniqueName() %>.addLineToRow("<%=name_conn%>_count");
|
||||
<%
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for(IConnection temp_conn : node.getIncomingConnections(EConnectionType.FLOW_MERGE))
|
||||
{
|
||||
for(IConnection temp_conn : node.getIncomingConnections(EConnectionType.FLOW_MERGE)){
|
||||
String name_conn = temp_conn.getUniqueName();
|
||||
if(name_conn == incomingName && temp_conn.isUseByMetter())
|
||||
{
|
||||
%>
|
||||
<%
|
||||
if (meterCatchers != null) {
|
||||
for (INode meterCatcher : meterCatchers) {
|
||||
%>
|
||||
<%=meterCatcher.getUniqueName() %>.addLineToRow("<%=name_conn%>_count");
|
||||
<%
|
||||
}
|
||||
}
|
||||
%>
|
||||
<%
|
||||
if(name_conn == incomingName && temp_conn.isUseByMetter()){
|
||||
if (meterCatchers != null) {
|
||||
for (INode meterCatcher : meterCatchers) {
|
||||
%>
|
||||
<%=meterCatcher.getUniqueName() %>.addLineToRow("<%=name_conn%>_count");
|
||||
<%
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
%>
|
||||
currentComponent="<%=node.getUniqueName() %>";
|
||||
%>
|
||||
<%
|
||||
if(node.isVirtualGenerateNode()){
|
||||
%>
|
||||
currentVirtualComponent = "<%=NodeUtil.getVirtualUniqueName(node)%>";
|
||||
<%
|
||||
}
|
||||
%>
|
||||
currentComponent="<%=node.getUniqueName() %>";
|
||||
|
||||
<%
|
||||
<%
|
||||
connSet = new HashSet<IConnection>();
|
||||
connSet.addAll(node.getIncomingConnections(EConnectionType.FLOW_MAIN));
|
||||
connSet.addAll(node.getIncomingConnections(EConnectionType.FLOW_MERGE));
|
||||
connSet.addAll(node.getOutgoingConnections(EConnectionType.FLOW_MERGE));
|
||||
|
||||
if ((codePart.equals(ECodePart.BEGIN))&&(stat)&&connSet.size()>0) {
|
||||
for(IConnection con:connSet){
|
||||
%>
|
||||
%>
|
||||
if (execStat) {
|
||||
if(resourceMap.get("inIterateVComp") == null){
|
||||
java.util.concurrent.ConcurrentHashMap<Object, Object> concurrentHashMap_<%=con.getUniqueName() %> = (java.util.concurrent.ConcurrentHashMap) globalMap.get("concurrentHashMap");
|
||||
concurrentHashMap_<%=con.getUniqueName() %>.putIfAbsent("<%=con.getUniqueName() %>" + iterateLoop,new java.util.concurrent.atomic.AtomicInteger(0));
|
||||
java.util.concurrent.atomic.AtomicInteger stats_<%=con.getUniqueName() %> = (java.util.concurrent.atomic.AtomicInteger) concurrentHashMap_<%=con.getUniqueName() %>.get("<%=con.getUniqueName() %>" + iterateLoop);
|
||||
runStat.updateStatOnConnection("<%=con.getUniqueName() %>" + iterateId, stats_<%=con.getUniqueName() %>.incrementAndGet()<=1?0:1, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (execStat) {
|
||||
java.util.concurrent.ConcurrentHashMap<Object, Object> concurrentHashMap_<%=con.getUniqueName() %> = (java.util.concurrent.ConcurrentHashMap) globalMap.get("concurrentHashMap");
|
||||
concurrentHashMap_<%=con.getUniqueName() %>.putIfAbsent("<%=con.getUniqueName() %>" + iterateLoop,new java.util.concurrent.atomic.AtomicInteger(0));
|
||||
java.util.concurrent.atomic.AtomicInteger stats_<%=con.getUniqueName() %> = (java.util.concurrent.atomic.AtomicInteger) concurrentHashMap_<%=con.getUniqueName() %>.get("<%=con.getUniqueName() %>" + iterateLoop);
|
||||
runStat.updateStatOnConnection("<%=con.getUniqueName() %>" + iterateId, stats_<%=con.getUniqueName() %>.incrementAndGet()<=1?0:1, 0);
|
||||
}
|
||||
|
||||
<% }
|
||||
<%
|
||||
}
|
||||
}
|
||||
|
||||
if((codePart.equals(ECodePart.MAIN))&&(stat)&&connSet.size()>0){
|
||||
for(IConnection con:connSet){
|
||||
%>
|
||||
%>
|
||||
|
||||
//<%=con.getUniqueName()%>
|
||||
//<%=(String)codeGenArgument.getIncomingName()%>
|
||||
//<%=con.getUniqueName()%>
|
||||
//<%=(String)codeGenArgument.getIncomingName()%>
|
||||
|
||||
|
||||
<%if (!node.getComponent().useMerge()) {%>
|
||||
if(execStat){
|
||||
runStat.updateStatOnConnection("<%=con.getUniqueName() %>"+iterateId,1, 1);
|
||||
}
|
||||
<%
|
||||
} else if(con.getUniqueName().equals((String)codeGenArgument.getIncomingName())){
|
||||
%>
|
||||
if(execStat){
|
||||
runStat.updateStatOnConnection("<%=con.getUniqueName() %>"+iterateId,1, 1);
|
||||
}
|
||||
<%}%>
|
||||
<%if (!node.getComponent().useMerge()) {%>
|
||||
if(execStat){
|
||||
runStat.updateStatOnConnection("<%=con.getUniqueName() %>"+iterateId,1, 1);
|
||||
}
|
||||
<%
|
||||
} else if(con.getUniqueName().equals((String)codeGenArgument.getIncomingName())){
|
||||
%>
|
||||
if(execStat){
|
||||
runStat.updateStatOnConnection("<%=con.getUniqueName() %>"+iterateId,1, 1);
|
||||
}
|
||||
<%}%>
|
||||
|
||||
<%
|
||||
<%
|
||||
}
|
||||
}
|
||||
%>
|
||||
%>
|
||||
|
||||
<%if(codePart.equals(ECodePart.BEGIN)){ %>
|
||||
int tos_count_<%=node.getUniqueName() %> = 0;
|
||||
<%}%>
|
||||
<%
|
||||
if(codePart.equals(ECodePart.BEGIN)){
|
||||
%>
|
||||
int tos_count_<%=node.getUniqueName() %> = 0;
|
||||
<%
|
||||
}
|
||||
if(stat){
|
||||
boolean iterateInVFComp = (node.getVirtualLinkTo() != null && node.getVirtualLinkTo() == EConnectionType.ITERATE);
|
||||
if(iterateInVFComp){
|
||||
if(codePart.equals(ECodePart.BEGIN)){
|
||||
List<String> needToStartConnNames = new ArrayList<String>();
|
||||
INode nextNode = node.getOutgoingConnections(EConnectionType.ITERATE).get(0).getTarget();
|
||||
NodeUtil.fillConnectionsForStat(needToStartConnNames, nextNode);
|
||||
%>
|
||||
if(execStat){
|
||||
<%
|
||||
for(String connName : needToStartConnNames){
|
||||
%>
|
||||
java.util.concurrent.ConcurrentHashMap<Object, Object> concurrentHashMap_<%=connName%> = (java.util.concurrent.ConcurrentHashMap) globalMap.get("concurrentHashMap");
|
||||
concurrentHashMap_<%=connName%>.putIfAbsent("<%=connName%>" + iterateLoop,new java.util.concurrent.atomic.AtomicInteger(0));
|
||||
java.util.concurrent.atomic.AtomicInteger stats_<%=connName%> = (java.util.concurrent.atomic.AtomicInteger) concurrentHashMap_<%=connName%>.get("<%=connName%>" + iterateLoop);
|
||||
runStat.updateStatOnConnection("<%=connName%>" + iterateId, stats_<%=connName%>.incrementAndGet()<=1?0:1, 0);
|
||||
<%
|
||||
}
|
||||
%>
|
||||
}
|
||||
<%
|
||||
}else if(codePart.equals(ECodePart.MAIN)){
|
||||
%>
|
||||
resourceMap.put("inIterateVComp", true);
|
||||
<%
|
||||
}else if(codePart.equals(ECodePart.END)){
|
||||
%>
|
||||
resourceMap.remove("inIterateVComp");
|
||||
<%
|
||||
}
|
||||
}else{
|
||||
IConnection preIterate = (node.getIncomingConnections(EConnectionType.ITERATE) != null && node.getIncomingConnections(EConnectionType.ITERATE).size() == 1) ? node.getIncomingConnections(EConnectionType.ITERATE).get(0) : null;
|
||||
if(preIterate != null){
|
||||
boolean iterateInVSComp = (preIterate.getSource().getVirtualLinkTo() != null && preIterate.getSource().getVirtualLinkTo() == EConnectionType.ITERATE);
|
||||
if(iterateInVSComp){
|
||||
if(codePart.equals(ECodePart.BEGIN)){
|
||||
%>
|
||||
resourceMap.remove("inIterateVComp");
|
||||
<%
|
||||
}else if(codePart.equals(ECodePart.END)){
|
||||
%>
|
||||
resourceMap.put("inIterateVComp", true);
|
||||
<%
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
%>
|
||||
|
||||
@@ -35,9 +35,10 @@ public class CLASS
|
||||
// toReturn += failure_singleThread;
|
||||
// }
|
||||
|
||||
toReturn += "globalMap.put(\""+rootNode.getUniqueName()+ "_SUBPROCESS_STATE\", -1);\n";
|
||||
|
||||
toReturn += "\ne_" + rootNode.getUniqueName() + ".printStackTrace();\n";
|
||||
|
||||
toReturn += "globalMap.put(\""+rootNode.getUniqueName()+ "_SUBPROCESS_STATE\", -1);\n";
|
||||
|
||||
//List< ? extends IConnection> onSubJobErrorConns = rootNode.getOutgoingConnections(EConnectionType.ON_SUBJOB_ERROR);
|
||||
//if(onSubJobErrorConns!=null){
|
||||
@@ -47,8 +48,8 @@ public class CLASS
|
||||
//}
|
||||
if(isMultiThread){
|
||||
toReturn += "\n}catch (Error e_" + rootNode.getUniqueName() + ") {\n";
|
||||
toReturn += "\ne_" + rootNode.getUniqueName() + ".printStackTrace();\n";
|
||||
toReturn += "globalMap.put(\""+rootNode.getUniqueName()+ "_SUBPROCESS_STATE\", -1);\n";
|
||||
toReturn += "\ne_" + rootNode.getUniqueName() + ".printStackTrace();\n";
|
||||
}
|
||||
toReturn += "\n}";
|
||||
return toReturn;
|
||||
|
||||
@@ -260,23 +260,38 @@ public <%=JavaTypesManager.getTypeToGenerate(ctxParam.getType(),true)%> get<%=Ch
|
||||
private final String projectName = "<%=codeGenArgument.getCurrentProjectName() %>";
|
||||
public Integer errorCode = null;
|
||||
private String currentComponent = "";
|
||||
<%
|
||||
if(!isRunInMultiThread ){
|
||||
%>
|
||||
private final java.util.Map<String, Long> start_Hash = new java.util.HashMap<String, Long>();
|
||||
private final java.util.Map<String, Long> end_Hash = new java.util.HashMap<String, Long>();
|
||||
private final java.util.Map<String, Boolean> ok_Hash = new java.util.HashMap<String, Boolean>();
|
||||
private final java.util.Map<String, Object> globalMap = new java.util.HashMap<String, Object>();
|
||||
public final java.util.List<String[]> globalBuffer = new java.util.ArrayList<String[]>();
|
||||
<%
|
||||
} else {
|
||||
%>
|
||||
private final java.util.Map<String, Long> start_Hash = java.util.Collections.synchronizedMap(new java.util.HashMap<String, Long>());
|
||||
private final java.util.Map<String, Long> end_Hash = java.util.Collections.synchronizedMap(new java.util.HashMap<String, Long>());
|
||||
private final java.util.Map<String, Boolean> ok_Hash = java.util.Collections.synchronizedMap(new java.util.HashMap<String, Boolean>());
|
||||
private final java.util.Map<String, Object> globalMap = java.util.Collections.synchronizedMap(new java.util.HashMap<String, Object>());
|
||||
public final java.util.List<String[]> globalBuffer = java.util.Collections.synchronizedList(new java.util.ArrayList<String[]>());
|
||||
<% } %>
|
||||
<%
|
||||
//tParallelize will wrap globalMap with synchronizedMap
|
||||
if(!isRunInMultiThread){
|
||||
%>
|
||||
private final java.util.Map<String, Object> globalMap = new java.util.HashMap<String, Object>();
|
||||
<%
|
||||
}else{
|
||||
%>
|
||||
private final java.util.Map<String, Object> globalMap = java.util.Collections.synchronizedMap(new java.util.HashMap<String, Object>());
|
||||
<%
|
||||
}
|
||||
boolean exist_tParallelize = false;
|
||||
List<? extends INode> tParallelizeList = process.getNodesOfType("tParallelize");
|
||||
if(tParallelizeList != null && tParallelizeList.size() > 0){
|
||||
exist_tParallelize = true;
|
||||
}
|
||||
if(!isRunInMultiThread && !exist_tParallelize){
|
||||
%>
|
||||
private final java.util.Map<String, Long> start_Hash = new java.util.HashMap<String, Long>();
|
||||
private final java.util.Map<String, Long> end_Hash = new java.util.HashMap<String, Long>();
|
||||
private final java.util.Map<String, Boolean> ok_Hash = new java.util.HashMap<String, Boolean>();
|
||||
public final java.util.List<String[]> globalBuffer = new java.util.ArrayList<String[]>();
|
||||
<%
|
||||
}else{
|
||||
%>
|
||||
private final java.util.Map<String, Long> start_Hash = java.util.Collections.synchronizedMap(new java.util.HashMap<String, Long>());
|
||||
private final java.util.Map<String, Long> end_Hash = java.util.Collections.synchronizedMap(new java.util.HashMap<String, Long>());
|
||||
private final java.util.Map<String, Boolean> ok_Hash = java.util.Collections.synchronizedMap(new java.util.HashMap<String, Boolean>());
|
||||
public final java.util.List<String[]> globalBuffer = java.util.Collections.synchronizedList(new java.util.ArrayList<String[]>());
|
||||
<%
|
||||
}
|
||||
%>
|
||||
|
||||
<%
|
||||
if (stats) {
|
||||
@@ -359,6 +374,11 @@ private class TalendException extends java.lang.Exception {
|
||||
private java.util.Map<String, Object> globalMap = null;
|
||||
private java.lang.Exception e = null;
|
||||
private String currentComponent = null;
|
||||
private String virtualComponentName = null;
|
||||
|
||||
public void setVirtualComponentName (String virtualComponentName){
|
||||
this.virtualComponentName = virtualComponentName;
|
||||
}
|
||||
|
||||
private TalendException(java.lang.Exception e, String errorComponent, final java.util.Map<String, Object> globalMap) {
|
||||
this.currentComponent= errorComponent;
|
||||
@@ -374,10 +394,32 @@ private class TalendException extends java.lang.Exception {
|
||||
return this.currentComponent;
|
||||
}
|
||||
|
||||
<%//For TDI-27789%>
|
||||
public String getExceptionCauseMessage(java.lang.Exception e){
|
||||
Throwable cause = e;
|
||||
String message = null;
|
||||
int i = 10;
|
||||
while (null != cause && 0 < i--) {
|
||||
message = cause.getMessage();
|
||||
if (null == message) {
|
||||
cause = cause.getCause();
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (null == message) {
|
||||
message = e.getClass().getName();
|
||||
}
|
||||
return message;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void printStackTrace() {
|
||||
if (!(e instanceof TalendException || e instanceof TDieException)) {
|
||||
globalMap.put(currentComponent+"_ERROR_MESSAGE",e.getMessage());
|
||||
if(virtualComponentName!=null && currentComponent.indexOf(virtualComponentName+"_")==0){
|
||||
globalMap.put(virtualComponentName+"_ERROR_MESSAGE",getExceptionCauseMessage(e));
|
||||
}
|
||||
globalMap.put(currentComponent+"_ERROR_MESSAGE",getExceptionCauseMessage(e));
|
||||
System.err.println("Exception in component " + currentComponent);
|
||||
}
|
||||
if (!(e instanceof TDieException)) {
|
||||
|
||||
@@ -297,7 +297,7 @@ for (INode node : graphicalNodes) {
|
||||
}
|
||||
}
|
||||
String delay = ElementParameterParser.getValue(node, "__DELAY__");
|
||||
if(delay!=null && !delay.trim().equals("") && !"1000".equals(delay)){
|
||||
if(delay!=null && !delay.trim().equals("")){
|
||||
if(sb.length()==0){
|
||||
sb.append("+\"?delay=\"+");
|
||||
sb.append(delay);
|
||||
|
||||
@@ -12,16 +12,20 @@
|
||||
org.talend.designer.codegen.config.NodesSubTree
|
||||
org.talend.core.model.utils.NodeUtil
|
||||
java.util.List
|
||||
java.util.Set
|
||||
java.util.Set
|
||||
java.util.HashSet
|
||||
java.util.Iterator
|
||||
java.util.Vector
|
||||
"
|
||||
class="IterateSubProcessFooter"
|
||||
skeleton="subprocess_header_java.skeleton"
|
||||
%>
|
||||
<%
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode)codeGenArgument.getArgument();
|
||||
Vector v = (Vector) codeGenArgument.getArgument();
|
||||
INode node = (INode) v.get(0);
|
||||
String finallyPart = v.get(1).toString();
|
||||
|
||||
ECodePart codePart = codeGenArgument.getCodePart();
|
||||
//boolean trace = codeGenArgument.isTrace();
|
||||
boolean stat = codeGenArgument.isStatistics();
|
||||
@@ -51,57 +55,81 @@
|
||||
schemaInstanceDeclaration = "," + schemaInstanceDeclaration.substring(0,schemaInstanceDeclaration.length()-1);
|
||||
}
|
||||
if(stat){
|
||||
%>
|
||||
if(execStat){
|
||||
runStat.updateStatOnConnection("<%=iterateConn.getUniqueName() %>",2,"exec"+iterateId);
|
||||
}
|
||||
<%
|
||||
%>
|
||||
if(execStat){
|
||||
runStat.updateStatOnConnection("<%=iterateConn.getUniqueName() %>",2,"exec"+iterateId);
|
||||
}
|
||||
<%
|
||||
}
|
||||
%>
|
||||
} catch (java.lang.Exception e) {
|
||||
this.status = "failure";
|
||||
Integer localErrorCode = (Integer) (((java.util.Map) threadLocal.get()).get("errorCode"));
|
||||
if (localErrorCode != null) {
|
||||
if (this.errorCode == null || localErrorCode.compareTo(this.errorCode) > 0) {
|
||||
this.errorCode = localErrorCode;
|
||||
}
|
||||
}
|
||||
talendThreadPool.setErrorThread(this);
|
||||
talendThreadPool.stopAllWorkers();
|
||||
|
||||
new TalendException(e, currentComponent, globalMap).printStackTrace();
|
||||
|
||||
}
|
||||
this.isRunning = false;
|
||||
|
||||
Integer localErrorCode = (Integer) (((java.util.Map) threadLocal.get()).get("errorCode"));
|
||||
String localStatus = (String) (((java.util.Map) threadLocal.get()).get("status"));
|
||||
if (localErrorCode != null) {
|
||||
if (this.errorCode == null || localErrorCode.compareTo(this.errorCode) > 0) {
|
||||
this.errorCode = localErrorCode;
|
||||
}
|
||||
}
|
||||
if (!this.status.equals("failure")) {
|
||||
this.status = localStatus;
|
||||
}
|
||||
|
||||
talendThreadPool.getTalendThreadResult().setErrorCode(this.errorCode);
|
||||
talendThreadPool.getTalendThreadResult().setStatus(this.status);
|
||||
}
|
||||
}
|
||||
|
||||
<%=node.getUniqueName() %>Thread bt_<%=node.getUniqueName() %> = new <%=node.getUniqueName() %>Thread(globalMap<%=schemaInstanceDeclaration %>,threadIdCounter++);
|
||||
mtp_<%=node.getUniqueName() %>.execute(bt_<%=node.getUniqueName() %>);
|
||||
%>
|
||||
} catch (java.lang.Exception e) {
|
||||
this.status = "failure";
|
||||
Integer localErrorCode = (Integer) (((java.util.Map) threadLocal.get()).get("errorCode"));
|
||||
if (localErrorCode != null) {
|
||||
if (this.errorCode == null || localErrorCode.compareTo(this.errorCode) > 0) {
|
||||
this.errorCode = localErrorCode;
|
||||
}
|
||||
}
|
||||
|
||||
TalendException te = new TalendException(e, currentComponent, globalMap);
|
||||
<%
|
||||
if(NodeUtil.hasVirtualComponent(subTree.getNodes())){
|
||||
%>
|
||||
te.setVirtualComponentName(currentVirtualComponent);
|
||||
<%
|
||||
}
|
||||
%>
|
||||
this.exception = te;
|
||||
talendThreadPool.setErrorThread(this);
|
||||
talendThreadPool.stopAllWorkers();
|
||||
|
||||
<%
|
||||
} finally {
|
||||
try{
|
||||
<%=finallyPart%>
|
||||
}catch(java.lang.Exception e){
|
||||
//ignore
|
||||
}catch(java.lang.Error error){
|
||||
//ignore
|
||||
}
|
||||
resourceMap = null;
|
||||
}
|
||||
this.isRunning = false;
|
||||
|
||||
Integer localErrorCode = (Integer) (((java.util.Map) threadLocal.get()).get("errorCode"));
|
||||
String localStatus = (String) (((java.util.Map) threadLocal.get()).get("status"));
|
||||
if (localErrorCode != null) {
|
||||
if (this.errorCode == null || localErrorCode.compareTo(this.errorCode) > 0) {
|
||||
this.errorCode = localErrorCode;
|
||||
}
|
||||
}
|
||||
if (!this.status.equals("failure")) {
|
||||
this.status = localStatus;
|
||||
}
|
||||
|
||||
talendThreadPool.getTalendThreadResult().setErrorCode(this.errorCode);
|
||||
talendThreadPool.getTalendThreadResult().setStatus(this.status);
|
||||
}
|
||||
}
|
||||
|
||||
<%=node.getUniqueName() %>Thread bt_<%=node.getUniqueName() %> = new <%=node.getUniqueName() %>Thread(globalMap<%=schemaInstanceDeclaration %>,threadIdCounter++);
|
||||
mtp_<%=node.getUniqueName() %>.execute(bt_<%=node.getUniqueName() %>);
|
||||
|
||||
<%
|
||||
continue;
|
||||
}else {//3
|
||||
if(stat){
|
||||
%>
|
||||
if(execStat){
|
||||
runStat.updateStatOnConnection("<%=iterateConn.getUniqueName() %>", 2, "exec" + NB_ITERATE_<%=iterateNodeName %>);
|
||||
}
|
||||
<%
|
||||
if(node.getDesignSubjobStartNode().getComponent().getName().equals("tCollector")){
|
||||
%>
|
||||
if(execStat){
|
||||
runStat.updateStatOnIterate("<%=iterateConn.getUniqueName() %>", RunStat.END);
|
||||
}
|
||||
<%
|
||||
}else{%>
|
||||
if(execStat){
|
||||
runStat.updateStatOnConnection("<%=iterateConn.getUniqueName() %>", 2, "exec" + NB_ITERATE_<%=iterateNodeName %>);
|
||||
}
|
||||
<%
|
||||
}
|
||||
}
|
||||
}//3
|
||||
}//2
|
||||
|
||||
@@ -50,12 +50,10 @@ params = process.getContextManager().getDefaultContext().getContextParameterList
|
||||
List<IConnection> allSubProcessConnection = codeGenArgument.getAllMainSubTreeConnections();
|
||||
boolean parallelIterate = false;
|
||||
for (IConnection iterateConn : iterateConnSet) { //1
|
||||
|
||||
%>
|
||||
NB_ITERATE_<%=iterateNodeName %>++;
|
||||
iterateLoop++;
|
||||
<%
|
||||
|
||||
<%
|
||||
parallelIterate = "true".equals(ElementParameterParser.getValue(iterateConn, "__ENABLE_PARALLEL__"));
|
||||
if (parallelIterate) {//2
|
||||
if (codePart.equals(ECodePart.BEGIN)) {//3
|
||||
@@ -64,156 +62,176 @@ for (IConnection iterateConn : iterateConnSet) { //1
|
||||
rowList += conn.getUniqueName()+"Struct "+conn.getUniqueName()+",";
|
||||
}
|
||||
rowList = rowList.substring(0, rowList.length()-1);
|
||||
%>
|
||||
class <%=node.getUniqueName() %>Thread extends TalendThread {//implements routines.system.TalendThreadPool.PropertySettable
|
||||
%>
|
||||
class <%=node.getUniqueName() %>Thread extends TalendThread {//implements routines.system.TalendThreadPool.PropertySettable
|
||||
|
||||
class ThreadedMap extends java.util.HashMap<String, Object> {
|
||||
class ThreadedMap extends java.util.HashMap<String, Object> {
|
||||
|
||||
private static final long serialVersionUID = 0L;
|
||||
|
||||
public ThreadedMap(java.util.Map<String, Object> globalMap) {
|
||||
super(globalMap);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object put(String key, Object value) {
|
||||
<%if(!isRunInMultiThread){%>
|
||||
synchronized (<%=process.getName()%>.this.obj) {
|
||||
<%}%>
|
||||
super.put(key, value);
|
||||
return <%=process.getName()%>.this.globalMap.put(key, value);
|
||||
<%if(!isRunInMultiThread){%>
|
||||
}
|
||||
<%}%>
|
||||
}
|
||||
}
|
||||
<% if(isRunJob) {%>
|
||||
private final ContextProperties localContext = new ContextProperties();
|
||||
<% } %>
|
||||
private java.util.Map<String, Object> globalMap = null;
|
||||
boolean isRunning = false;
|
||||
String iterateId = "";
|
||||
int iterateLoop = 0;
|
||||
<%
|
||||
if(!subTree.isMergeSubTree()) {
|
||||
List< ? extends IConnection> rootConns = subTree.getRootNode().getOutgoingConnections();
|
||||
if ((rootConns!=null)&&(rootConns.size()>0)) {
|
||||
%>
|
||||
<%=createPrivateClassInstance(subTree.getRootNode(), rootConns.get(0).getName(), false)%>
|
||||
<%
|
||||
}
|
||||
} else {
|
||||
List<INode> sortedMergeBranchStarts = subTree.getSortedMergeBranchStarts();
|
||||
for (INode startNode : sortedMergeBranchStarts) {
|
||||
List< ? extends IConnection> rootConns = startNode.getOutgoingConnections();
|
||||
if ((rootConns!=null)&&(rootConns.size()>0)) {
|
||||
%>
|
||||
<%=createPrivateClassInstance(startNode, rootConns.get(0).getName(), false)%>
|
||||
<%
|
||||
private static final long serialVersionUID = 0L;
|
||||
|
||||
public ThreadedMap(java.util.Map<String, Object> globalMap) {
|
||||
super(globalMap);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object put(String key, Object value) {
|
||||
<%if(!isRunInMultiThread){%>
|
||||
synchronized (<%=process.getName()%>.this.obj) {
|
||||
<%}%>
|
||||
super.put(key, value);
|
||||
return <%=process.getName()%>.this.globalMap.put(key, value);
|
||||
<%if(!isRunInMultiThread){%>
|
||||
}
|
||||
<%}%>
|
||||
}
|
||||
}
|
||||
<% if(isRunJob) {%>
|
||||
private final ContextProperties localContext = new ContextProperties();
|
||||
<% } %>
|
||||
private java.util.Map<String, Object> globalMap = null;
|
||||
boolean isRunning = false;
|
||||
String iterateId = "";
|
||||
int iterateLoop = 0;
|
||||
<%
|
||||
if(!subTree.isMergeSubTree()) {
|
||||
List< ? extends IConnection> rootConns = subTree.getRootNode().getOutgoingConnections();
|
||||
if ((rootConns!=null)&&(rootConns.size()>0)) {
|
||||
%>
|
||||
<%=createPrivateClassInstance(subTree.getRootNode(), rootConns.get(0).getName(), false)%>
|
||||
<%
|
||||
}
|
||||
} else {
|
||||
List<INode> sortedMergeBranchStarts = subTree.getSortedMergeBranchStarts();
|
||||
for (INode startNode : sortedMergeBranchStarts) {
|
||||
List< ? extends IConnection> rootConns = startNode.getOutgoingConnections();
|
||||
if ((rootConns!=null)&&(rootConns.size()>0)) {
|
||||
%>
|
||||
<%=createPrivateClassInstance(startNode, rootConns.get(0).getName(), false)%>
|
||||
<%
|
||||
}
|
||||
}
|
||||
|
||||
List< ? extends IConnection> rootConns = subTree.getMergeNode().getOutgoingConnections();
|
||||
if ((rootConns!=null)&&(rootConns.size()>0)) {
|
||||
%>
|
||||
<%=createPrivateClassInstance(subTree.getMergeNode(), rootConns.get(0).getName(), false)%>
|
||||
<%
|
||||
}
|
||||
}
|
||||
|
||||
List< ? extends IConnection> rootConns = subTree.getMergeNode().getOutgoingConnections();
|
||||
if ((rootConns!=null)&&(rootConns.size()>0)) {
|
||||
%>
|
||||
<%=createPrivateClassInstance(subTree.getMergeNode(), rootConns.get(0).getName(), false)%>
|
||||
<%
|
||||
}
|
||||
}
|
||||
|
||||
String schemaInstanceDeclaration = createPriveClassMethodDeclaration(subTree.getRootNode(), subTree.getRootNode().getOutgoingConnections().get(0).getName(), false, new java.util.HashSet<String>());
|
||||
if (schemaInstanceDeclaration.length()>0) {
|
||||
schemaInstanceDeclaration = "," + schemaInstanceDeclaration.substring(0,schemaInstanceDeclaration.length()-1);
|
||||
}
|
||||
%>
|
||||
String schemaInstanceDeclaration = createPriveClassMethodDeclaration(subTree.getRootNode(), subTree.getRootNode().getOutgoingConnections().get(0).getName(), false, new java.util.HashSet<String>());
|
||||
if (schemaInstanceDeclaration.length()>0) {
|
||||
schemaInstanceDeclaration = "," + schemaInstanceDeclaration.substring(0,schemaInstanceDeclaration.length()-1);
|
||||
}
|
||||
%>
|
||||
|
||||
public <%=node.getUniqueName() %>Thread(java.util.Map<String, Object> globalMap<%=schemaInstanceDeclaration %>, int threadID) {
|
||||
super();
|
||||
<%
|
||||
for (IConnection connection : allSubProcessConnection) {
|
||||
IMetadataTable table = connection.getMetadataTable();
|
||||
%>
|
||||
if(<%= connection.getName() %> != null){
|
||||
<%
|
||||
List<IMetadataColumn> listColumns = table.getListColumns();
|
||||
for (IMetadataColumn column : listColumns) {
|
||||
%>this.<%= connection.getName() %>.<%= column.getLabel() %> = <%= connection.getName() %>.<%= column.getLabel() %>;
|
||||
<%
|
||||
}
|
||||
%>
|
||||
}
|
||||
<%
|
||||
}
|
||||
%>
|
||||
<%
|
||||
// if codeGenArgument.getIsRunInMultiThread() is true, the job.this.globalMap will wrapped with synchronizedMap, use synchronized(job.this.globalMap) when use globalMap.keySet().iterator()
|
||||
// when codeGenArgument.getIsRunInMultiThread() is false, the job.this.globalMap is HashMap, use synchronized(job.this.object) when do the job.this.globalMap.put() operation(tMap,tIterateToFlow).
|
||||
if(isRunInMultiThread){%>
|
||||
synchronized (globalMap) {
|
||||
this.globalMap = java.util.Collections.synchronizedMap(new ThreadedMap(globalMap));
|
||||
<%}else{%>
|
||||
synchronized (<%=process.getName()%>.this.obj) {
|
||||
this.globalMap = new ThreadedMap(globalMap);
|
||||
<%}%>
|
||||
public <%=node.getUniqueName() %>Thread(java.util.Map<String, Object> globalMap<%=schemaInstanceDeclaration %>, int threadID) {
|
||||
super();
|
||||
<%
|
||||
for (IConnection connection : allSubProcessConnection) {
|
||||
IMetadataTable table = connection.getMetadataTable();
|
||||
%>
|
||||
if(<%= connection.getName() %> != null){
|
||||
<%
|
||||
List<IMetadataColumn> listColumns = table.getListColumns();
|
||||
for (IMetadataColumn column : listColumns) {
|
||||
%>
|
||||
this.<%= connection.getName() %>.<%= column.getLabel() %> = <%= connection.getName() %>.<%= column.getLabel() %>;
|
||||
<%
|
||||
}
|
||||
%>
|
||||
}
|
||||
<%
|
||||
}
|
||||
%>
|
||||
<%
|
||||
// if codeGenArgument.getIsRunInMultiThread() is true, the job.this.globalMap will wrapped with synchronizedMap, use synchronized(job.this.globalMap) when use globalMap.keySet().iterator()
|
||||
// when codeGenArgument.getIsRunInMultiThread() is false, the job.this.globalMap is HashMap, use synchronized(job.this.object) when do the job.this.globalMap.put() operation(tMap,tIterateToFlow).
|
||||
if(isRunInMultiThread){%>
|
||||
synchronized (globalMap) {
|
||||
this.globalMap = java.util.Collections.synchronizedMap(new ThreadedMap(globalMap));
|
||||
<%}else{%>
|
||||
synchronized (<%=process.getName()%>.this.obj) {
|
||||
this.globalMap = new ThreadedMap(globalMap);
|
||||
<%}%>
|
||||
}
|
||||
iterateId = "." + threadID;
|
||||
iterateLoop++;
|
||||
<%if(isRunJob) {%>
|
||||
//bug21906 copy context to local for mutilthread
|
||||
context.synchronizeContext();
|
||||
java.util.Enumeration<?> propertyNames = context.propertyNames();
|
||||
while(propertyNames.hasMoreElements()) {
|
||||
String propertyName = (String)propertyNames.nextElement();
|
||||
String propertyValue = context.getProperty(propertyName);
|
||||
localContext.setProperty(propertyName, propertyValue);
|
||||
}
|
||||
<% for (IContextParameter ctxParam : params){%>
|
||||
localContext.<%=ctxParam.getName()%> = context.<%=ctxParam.getName()%>;
|
||||
<%
|
||||
}
|
||||
}
|
||||
%>
|
||||
}
|
||||
iterateId = "." + threadID;
|
||||
iterateLoop++;
|
||||
<%if(isRunJob) {%>
|
||||
//bug21906 copy context to local for mutilthread
|
||||
context.synchronizeContext();
|
||||
java.util.Enumeration<?> propertyNames = context.propertyNames();
|
||||
while(propertyNames.hasMoreElements()) {
|
||||
String propertyName = (String)propertyNames.nextElement();
|
||||
String propertyValue = context.getProperty(propertyName);
|
||||
localContext.setProperty(propertyName, propertyValue);
|
||||
}
|
||||
<% for (IContextParameter ctxParam : params){%>
|
||||
localContext.<%=ctxParam.getName()%> = context.<%=ctxParam.getName()%>;
|
||||
<% } %>
|
||||
<% } %>
|
||||
}
|
||||
|
||||
|
||||
public void run() {
|
||||
|
||||
java.util.Map threadRunResultMap = new java.util.HashMap();
|
||||
threadRunResultMap.put("errorCode", null);
|
||||
threadRunResultMap.put("status", "");
|
||||
threadLocal.set(threadRunResultMap);
|
||||
|
||||
this.isRunning = true;
|
||||
String currentComponent = "";
|
||||
try {
|
||||
<%
|
||||
if(stat){
|
||||
%>
|
||||
if(execStat){
|
||||
runStat.updateStatOnConnection("<%=iterateConn.getUniqueName() %>",0,"exec"+iterateId);
|
||||
}
|
||||
<%
|
||||
}
|
||||
}//3
|
||||
continue;
|
||||
}else {//2
|
||||
if(stat){
|
||||
%>
|
||||
|
||||
<%
|
||||
public void run() {
|
||||
|
||||
java.util.Map threadRunResultMap = new java.util.HashMap();
|
||||
threadRunResultMap.put("errorCode", null);
|
||||
threadRunResultMap.put("status", "");
|
||||
threadLocal.set(threadRunResultMap);
|
||||
|
||||
this.isRunning = true;
|
||||
String currentComponent = "";
|
||||
java.util.Map<String, Object> resourceMap = new java.util.HashMap<String, Object>();
|
||||
<%
|
||||
if(NodeUtil.hasVirtualComponent(subTree.getNodes())){
|
||||
%>
|
||||
String currentVirtualComponent = null;
|
||||
<%
|
||||
}
|
||||
%>
|
||||
try {
|
||||
<%
|
||||
if(stat){
|
||||
%>
|
||||
if(execStat){
|
||||
runStat.updateStatOnConnection("<%=iterateConn.getUniqueName() %>",0,"exec"+iterateId);
|
||||
}
|
||||
<%
|
||||
}
|
||||
}//3
|
||||
continue;
|
||||
}else {//2
|
||||
if(stat){
|
||||
//iterateConn.getSource().getVirtualLinkTo() only works on the first component of a virtual component, if it works for the second one, the code should change
|
||||
boolean iterateInVComp = iterateConn.getSource().getVirtualLinkTo() != null && iterateConn.getSource().getVirtualLinkTo() == EConnectionType.ITERATE;
|
||||
if(!iterateInVComp){
|
||||
Set<? extends IConnection> allInLineJobConns = NodeUtil.getAllInLineJobConnections(iterateConn.getTarget());
|
||||
for (IConnection inLineConn : allInLineJobConns) {
|
||||
%>
|
||||
if(execStat){
|
||||
runStat.updateStatOnConnection("<%=inLineConn.getUniqueName() %>", 3, 0);
|
||||
}
|
||||
<%
|
||||
%>
|
||||
if(execStat){
|
||||
runStat.updateStatOnConnection("<%=inLineConn.getUniqueName() %>", 3, 0);
|
||||
}
|
||||
<%
|
||||
}
|
||||
%>
|
||||
if(execStat){
|
||||
runStat.updateStatOnConnection("<%=iterateConn.getUniqueName() %>", 1, "exec" + NB_ITERATE_<%=iterateNodeName %>);
|
||||
//Thread.sleep(1000);
|
||||
}
|
||||
<%
|
||||
}
|
||||
}//2
|
||||
}//1
|
||||
}
|
||||
if(node.getDesignSubjobStartNode().getComponent().getName().equals("tCollector")){
|
||||
%>
|
||||
if(execStat){
|
||||
runStat.updateStatOnIterate("<%=iterateConn.getUniqueName() %>", RunStat.RUNNING);
|
||||
}
|
||||
<%
|
||||
}else{
|
||||
%>
|
||||
if(execStat){
|
||||
runStat.updateStatOnConnection("<%=iterateConn.getUniqueName() %>", 1, "exec" + NB_ITERATE_<%=iterateNodeName %>);
|
||||
//Thread.sleep(1000);
|
||||
}
|
||||
<%
|
||||
}
|
||||
}
|
||||
}//2
|
||||
}//1
|
||||
%>
|
||||
|
||||
@@ -10,21 +10,24 @@
|
||||
org.talend.core.model.process.ElementParameterParser
|
||||
java.util.List
|
||||
java.util.Iterator
|
||||
java.util.Vector
|
||||
org.talend.core.model.utils.NodeUtil
|
||||
"
|
||||
class="SubProcessFooter"
|
||||
%>
|
||||
<%
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
Vector v = (Vector) codeGenArgument.getArgument();
|
||||
NodesSubTree subTree = (NodesSubTree) v.get(0);
|
||||
String finallyPart = v.get(1).toString();
|
||||
boolean stat = codeGenArgument.isStatistics();
|
||||
NodesSubTree subTree = (NodesSubTree) codeGenArgument.getArgument();
|
||||
|
||||
for (INode node : subTree.getNodes()) {
|
||||
for(INode node : subTree.getNodes()){
|
||||
List<IMetadataTable> metadatas = node.getMetadataList();
|
||||
List< ? extends IConnection> conns = node.getOutgoingConnections();
|
||||
}
|
||||
|
||||
boolean isParallelize = false;
|
||||
for (INode node : subTree.getNodes()) {
|
||||
for(INode node : subTree.getNodes()){
|
||||
if(node!=null){
|
||||
String parallelize = ElementParameterParser.getValue(node, "__PARALLELIZE__");
|
||||
if(parallelize!=null &¶llelize.equals("true")){
|
||||
@@ -34,7 +37,7 @@
|
||||
}
|
||||
}
|
||||
if(isParallelize){
|
||||
%>
|
||||
%>
|
||||
|
||||
} catch (java.lang.Exception e) {
|
||||
this.status = "failure";
|
||||
@@ -47,6 +50,15 @@
|
||||
pool.setErrorThread(this, new TalendException(e, currentComponent, globalMap));
|
||||
//pool.setErrorThread(this,e);
|
||||
pool.stopAllThreads();
|
||||
}finally{
|
||||
try{
|
||||
<%=finallyPart%>
|
||||
}catch(java.lang.Exception e){
|
||||
//ignore
|
||||
}catch(java.lang.Error error){
|
||||
//ignore
|
||||
}
|
||||
resourceMap = null;
|
||||
}
|
||||
this.isRunning = false;
|
||||
|
||||
@@ -76,7 +88,7 @@
|
||||
}
|
||||
} else {
|
||||
// Start a new thread
|
||||
<%=subTree.getName() %>_ParallelThread pt = new <%=subTree.getName()%>_ParallelThread(
|
||||
<%=subTree.getName()%>_ParallelThread pt = new <%=subTree.getName()%>_ParallelThread(
|
||||
globalMap, (Object[]) globalMap
|
||||
.get("PARALLEL_FLOW_LOCK_<%=(subTree.getName()).replaceAll("tAsyncIn", "tAsyncOut")%>"));
|
||||
pt.putBuffer(buffer);
|
||||
@@ -87,199 +99,198 @@
|
||||
} catch (java.lang.Exception te) {
|
||||
throw new TalendException(te, currentComponent, globalMap);
|
||||
}
|
||||
<%
|
||||
<%
|
||||
}else{
|
||||
%>
|
||||
%>
|
||||
}//end the resume
|
||||
|
||||
|
||||
|
||||
<%
|
||||
//this part for "Resume Management"
|
||||
{
|
||||
INode firstNode = subTree.getNode(subTree.getName());
|
||||
|
||||
List<String> beforeSubProcesses = subTree.getBeforeSubProcesses();
|
||||
|
||||
//System.out.println(firstNode.getUniqueName());
|
||||
List<? extends IConnection> outConns = firstNode.getOutgoingConnections();
|
||||
|
||||
//System.out.println(inConns.size());
|
||||
for(IConnection conn : outConns){
|
||||
|
||||
// boolean activeResume = "true".equals(ElementParameterParser.getValue(conn, "__RESUMING_CHECKPOINT__"));
|
||||
boolean activeResume = true;
|
||||
|
||||
//System.out.println("Test:" + ElementParameterParser.getValue(conn, "__RESUMING_CHECKPOINT__"));
|
||||
|
||||
String uniqueNameTargetNode = conn.getTarget().getUniqueName();
|
||||
|
||||
EConnectionType lineStyle = conn.getLineStyle();
|
||||
|
||||
}
|
||||
}
|
||||
%>
|
||||
}//end the resume
|
||||
|
||||
<%
|
||||
//this part for "Resume Management"
|
||||
{
|
||||
INode firstNode = subTree.getNode(subTree.getName());
|
||||
|
||||
List<String> beforeSubProcesses = subTree.getBeforeSubProcesses();
|
||||
|
||||
//System.out.println(firstNode.getUniqueName());
|
||||
List<? extends IConnection> outConns = firstNode.getOutgoingConnections();
|
||||
|
||||
//System.out.println(inConns.size());
|
||||
for(IConnection conn : outConns){
|
||||
|
||||
// boolean activeResume = "true".equals(ElementParameterParser.getValue(conn, "__RESUMING_CHECKPOINT__"));
|
||||
boolean activeResume = true;
|
||||
|
||||
//System.out.println("Test:" + ElementParameterParser.getValue(conn, "__RESUMING_CHECKPOINT__"));
|
||||
|
||||
String uniqueNameTargetNode = conn.getTarget().getUniqueName();
|
||||
|
||||
EConnectionType lineStyle = conn.getLineStyle();
|
||||
|
||||
if(beforeSubProcesses.indexOf(uniqueNameTargetNode) != -1) {
|
||||
if(activeResume){
|
||||
%>
|
||||
if( resumeEntryMethodName == null || globalResumeTicket){
|
||||
resumeUtil.addLog("CHECKPOINT", "CONNECTION:<%=lineStyle.getName() %>:<%=subTree.getName() %>:<%=conn.getName() %><%=conn.getOutputId() > 0 ? conn.getOutputId() : "" %>", "", Thread.currentThread().getId() + "", "", "", "", "", "");
|
||||
}
|
||||
<%
|
||||
}
|
||||
%>
|
||||
<%
|
||||
if(stat){
|
||||
%>
|
||||
if(execStat){
|
||||
runStat.updateStatOnConnection("<%=conn.getUniqueName() %>", 0, "ok");
|
||||
}
|
||||
<%
|
||||
}
|
||||
%>
|
||||
<%= uniqueNameTargetNode %>Process(globalMap);
|
||||
<%
|
||||
}
|
||||
}
|
||||
}
|
||||
%>
|
||||
|
||||
<%
|
||||
if (subTree.getRootNode().getProcess().getNodesOfType("tFlowMeterCatcher").size() > 0
|
||||
&& subTree.getRootNode().getProcess().getNodesOfType("tFlowMeter").size() >0 ) {
|
||||
List<INode> metterCatchers = (List<INode>)subTree.getRootNode().getProcess().getNodesOfType("tFlowMeterCatcher");
|
||||
List<INode> metters = (List<INode>)subTree.getRootNode().getProcess().getNodesOfType("tFlowMeter");
|
||||
List<INode> nodes = (List<INode>)subTree.getNodes();
|
||||
|
||||
boolean hasMetterProcess = false;
|
||||
for(INode tmp : nodes)
|
||||
{
|
||||
for(INode metter : metters)
|
||||
{
|
||||
if(tmp.getUniqueName().equals(metter.getUniqueName()))
|
||||
{
|
||||
hasMetterProcess = true;
|
||||
break;
|
||||
<%
|
||||
if(subTree.getRootNode().getProcess().getNodesOfType("tFlowMeterCatcher").size() > 0
|
||||
&& subTree.getRootNode().getProcess().getNodesOfType("tFlowMeter").size() > 0){
|
||||
List<INode> metterCatchers = (List<INode>)subTree.getRootNode().getProcess().getNodesOfType("tFlowMeterCatcher");
|
||||
List<INode> metters = (List<INode>)subTree.getRootNode().getProcess().getNodesOfType("tFlowMeter");
|
||||
List<INode> nodes = (List<INode>)subTree.getNodes();
|
||||
|
||||
boolean hasMetterProcess = false;
|
||||
for(INode tmp : nodes){
|
||||
for(INode metter : metters){
|
||||
if(tmp.getUniqueName().equals(metter.getUniqueName())){
|
||||
hasMetterProcess = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(hasMetterProcess){
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(hasMetterProcess){
|
||||
for(INode metterCatcher : metterCatchers){
|
||||
%>
|
||||
<%=metterCatcher.getDesignSubjobStartNode().getUniqueName() %>Process(globalMap);
|
||||
<%
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(hasMetterProcess)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(hasMetterProcess)
|
||||
{
|
||||
for (INode metterCatcher : metterCatchers) {
|
||||
|
||||
%>
|
||||
<%=metterCatcher.getDesignSubjobStartNode().getUniqueName() %>Process(globalMap);
|
||||
<%
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
%>
|
||||
|
||||
|
||||
} catch(java.lang.Exception e) {
|
||||
|
||||
throw new TalendException(e, currentComponent, globalMap);
|
||||
|
||||
} catch(java.lang.Error error) {
|
||||
|
||||
<%
|
||||
if(stat){
|
||||
%>
|
||||
runStat.stopThreadStat();
|
||||
<%
|
||||
}
|
||||
%>
|
||||
throw error;
|
||||
|
||||
}
|
||||
<%
|
||||
//generate the code to free memory for lookup link and virtual component buffered datas
|
||||
boolean firstIn = true;
|
||||
boolean needGc = false;
|
||||
List<INode> nodes = subTree.getNodes();
|
||||
for(INode node:nodes){
|
||||
|
||||
boolean isVirtualGenerateNode = node.isVirtualGenerateNode();
|
||||
|
||||
//check the virtual component generate node
|
||||
if(isVirtualGenerateNode){
|
||||
String origin = ElementParameterParser.getValue(node, "__ORIGIN__");
|
||||
if(origin != null && !"".equals(origin)){
|
||||
if(!needGc) needGc = true;
|
||||
%>
|
||||
<%if(firstIn){%> finally{ <% firstIn = false;}%>
|
||||
//free memory for "<%=node.getUniqueName() %>"
|
||||
globalMap.remove("<%=origin %>");
|
||||
<%
|
||||
}
|
||||
}else{
|
||||
//check the Lookup link
|
||||
List<? extends IConnection> lookupInput = node.getIncomingConnections(EConnectionType.FLOW_REF);
|
||||
if(lookupInput!=null && lookupInput.size()>0){
|
||||
if(!needGc) needGc = true;
|
||||
//check the tMap like this, instanceof can't work
|
||||
if(node.getClass().getName().equals("org.talend.designer.mapper.MapperComponent")){
|
||||
for(IConnection connection:lookupInput){
|
||||
%>
|
||||
<%if(firstIn){%> finally{ <% firstIn = false;}%>
|
||||
//free memory for "<%=node.getUniqueName() %>"
|
||||
globalMap.remove("tHash_Lookup_<%=connection.getName() %>");
|
||||
<%
|
||||
}
|
||||
}else{
|
||||
for(IConnection connection:lookupInput){
|
||||
%>
|
||||
<%if(firstIn){%> finally{ <% firstIn = false;}%>
|
||||
//free memory for "<%=node.getUniqueName() %>"
|
||||
globalMap.remove("tHash_<%=connection.getName() %>");
|
||||
<%
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(needGc) {
|
||||
%>
|
||||
//this part for "Resume Management"
|
||||
{
|
||||
INode firstNode = subTree.getNode(subTree.getName());
|
||||
|
||||
List<String> beforeSubProcesses = subTree.getBeforeSubProcesses();
|
||||
|
||||
//System.out.println(firstNode.getUniqueName());
|
||||
List<? extends IConnection> outConns = firstNode.getOutgoingConnections();
|
||||
|
||||
//System.out.println(inConns.size());
|
||||
for(IConnection conn : outConns){
|
||||
|
||||
//boolean activeResume = "true".equals(ElementParameterParser.getValue(conn, "__RESUMING_CHECKPOINT__"));
|
||||
boolean activeResume = true;
|
||||
|
||||
//System.out.println("Test:" + ElementParameterParser.getValue(conn, "__RESUMING_CHECKPOINT__"));
|
||||
|
||||
String uniqueNameTargetNode = conn.getTarget().getUniqueName();
|
||||
|
||||
EConnectionType lineStyle = conn.getLineStyle();
|
||||
|
||||
}
|
||||
<%
|
||||
}
|
||||
}//isParallelize
|
||||
%>
|
||||
if(beforeSubProcesses.indexOf(uniqueNameTargetNode) != -1){
|
||||
if(activeResume){
|
||||
%>
|
||||
if(resumeEntryMethodName == null || globalResumeTicket){
|
||||
resumeUtil.addLog("CHECKPOINT", "CONNECTION:<%=lineStyle.getName() %>:<%=subTree.getName() %>:<%=conn.getName() %><%=conn.getOutputId() > 0 ? conn.getOutputId() : "" %>", "", Thread.currentThread().getId() + "", "", "", "", "", "");
|
||||
}
|
||||
<%
|
||||
}
|
||||
if(stat){
|
||||
%>
|
||||
if(execStat){
|
||||
runStat.updateStatOnConnection("<%=conn.getUniqueName() %>", 0, "ok");
|
||||
}
|
||||
<%
|
||||
}
|
||||
%>
|
||||
<%= uniqueNameTargetNode %>Process(globalMap);
|
||||
<%
|
||||
}
|
||||
}
|
||||
}
|
||||
%>
|
||||
|
||||
|
||||
|
||||
|
||||
globalMap.put("<%=subTree.getName() %>_SUBPROCESS_STATE", 1);
|
||||
}
|
||||
<% if (subTree.isMethodSizeNeeded()){ %>
|
||||
/**
|
||||
* End of Function: <%=subTree.getName() %>Process
|
||||
*/
|
||||
<% } %>
|
||||
}catch(java.lang.Exception e){
|
||||
|
||||
TalendException te = new TalendException(e, currentComponent, globalMap);
|
||||
<%
|
||||
if(NodeUtil.hasVirtualComponent(subTree.getNodes())){
|
||||
%>
|
||||
te.setVirtualComponentName(currentVirtualComponent);
|
||||
<%
|
||||
}
|
||||
for(INode node : subTree.getNodes()){
|
||||
if(node!=null){
|
||||
if("tDepartitioner".equals(node.getComponent().getName())){
|
||||
String cid = node.getUniqueName();
|
||||
%>
|
||||
if(resourceMap.get("finish_<%=cid%>") == null){
|
||||
if(resourceMap.get("start_<%=cid%>") != null){
|
||||
globalMap.put("THREADS_HAVE_ERROR", e);
|
||||
return;
|
||||
}
|
||||
}
|
||||
<%
|
||||
}
|
||||
}
|
||||
}
|
||||
%>
|
||||
throw te;
|
||||
}catch(java.lang.Error error){
|
||||
<%
|
||||
if(stat){
|
||||
%>
|
||||
runStat.stopThreadStat();
|
||||
<%
|
||||
}
|
||||
for(INode node : subTree.getNodes()){
|
||||
if(node!=null){
|
||||
if("tDepartitioner".equals(node.getComponent().getName())){
|
||||
String cid = node.getUniqueName();
|
||||
%>
|
||||
if(resourceMap.get("finish_<%=cid%>") == null){
|
||||
if(resourceMap.get("start_<%=cid%>") != null){
|
||||
globalMap.put("THREADS_HAVE_ERROR",error);
|
||||
return;
|
||||
}
|
||||
}
|
||||
<%
|
||||
}
|
||||
}
|
||||
}
|
||||
%>
|
||||
throw error;
|
||||
}finally{
|
||||
<%
|
||||
//generate the code to free memory for lookup link and virtual component buffered datas
|
||||
List<INode> nodes = subTree.getNodes();
|
||||
for(INode node:nodes){
|
||||
|
||||
boolean isVirtualGenerateNode = node.isVirtualGenerateNode();
|
||||
|
||||
//check the virtual component generate node
|
||||
if(isVirtualGenerateNode){
|
||||
String origin = ElementParameterParser.getValue(node, "__ORIGIN__");
|
||||
if(origin != null && !"".equals(origin)){
|
||||
%>
|
||||
//free memory for "<%=node.getUniqueName()%>"
|
||||
globalMap.remove("<%=origin%>");
|
||||
<%
|
||||
}
|
||||
}else{
|
||||
//check the Lookup link
|
||||
List<? extends IConnection> lookupInput = node.getIncomingConnections(EConnectionType.FLOW_REF);
|
||||
if(lookupInput!=null && lookupInput.size()>0){
|
||||
//check the tMap like this, instanceof can't work
|
||||
if(node.getClass().getName().equals("org.talend.designer.mapper.MapperComponent")){
|
||||
for(IConnection connection:lookupInput){
|
||||
%>
|
||||
//free memory for "<%=node.getUniqueName()%>"
|
||||
globalMap.remove("tHash_Lookup_<%=connection.getName()%>");
|
||||
<%
|
||||
}
|
||||
}else{
|
||||
for(IConnection connection:lookupInput){
|
||||
%>
|
||||
//free memory for "<%=node.getUniqueName()%>"
|
||||
globalMap.remove("tHash_<%=connection.getName()%>");
|
||||
<%
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
%>
|
||||
try{
|
||||
<%=finallyPart%>
|
||||
}catch(java.lang.Exception e){
|
||||
//ignore
|
||||
}catch(java.lang.Error error){
|
||||
//ignore
|
||||
}
|
||||
resourceMap = null;
|
||||
}
|
||||
<%
|
||||
}//isParallelize
|
||||
%>
|
||||
|
||||
globalMap.put("<%=subTree.getName() %>_SUBPROCESS_STATE", 1);
|
||||
}
|
||||
<%
|
||||
if(subTree.isMethodSizeNeeded()){
|
||||
%>
|
||||
/**
|
||||
* End of Function: <%=subTree.getName() %>Process
|
||||
*/
|
||||
<%
|
||||
}
|
||||
%>
|
||||
@@ -1003,16 +1003,32 @@ public void <%=subTree.getName() %>Process(final java.util.Map<String, Object> g
|
||||
|
||||
this.isRunning = true;
|
||||
String currentComponent = "";
|
||||
java.util.Map<String, Object> resourceMap = new java.util.HashMap<String, Object>();
|
||||
try{
|
||||
|
||||
<%
|
||||
}else{//isParallelize
|
||||
if(NodeUtil.hasVirtualComponent(subTree.getNodes())){
|
||||
%>
|
||||
|
||||
String iterateId = "";
|
||||
String currentVirtualComponent = null;
|
||||
<%
|
||||
}
|
||||
%>
|
||||
<%
|
||||
if(subTree.getRootNode().getComponent().getName().equals("tCollector")){
|
||||
%>
|
||||
String iterateId = "." + globalMap.get("<%=subTree.getRootNode().getDesignSubjobStartNode().getUniqueName()%>_THREAD_ID");
|
||||
<%
|
||||
}else{
|
||||
%>
|
||||
String iterateId = "";
|
||||
<%
|
||||
}
|
||||
%>
|
||||
int iterateLoop = 0;
|
||||
String currentComponent = "";
|
||||
|
||||
java.util.Map<String, Object> resourceMap = new java.util.HashMap<String, Object>();
|
||||
|
||||
try {
|
||||
|
||||
String currentMethodName = new java.lang.Exception().getStackTrace()[0].getMethodName();
|
||||
|
||||
@@ -31,6 +31,7 @@ import org.talend.core.language.ECodeLanguage;
|
||||
import org.talend.core.model.components.IComponentFileNaming;
|
||||
import org.talend.core.model.components.IComponentsFactory;
|
||||
import org.talend.core.model.process.EConnectionType;
|
||||
import org.talend.core.model.process.ElementParameterParser;
|
||||
import org.talend.core.model.process.IConnection;
|
||||
import org.talend.core.model.process.IConnectionCategory;
|
||||
import org.talend.core.model.process.IContext;
|
||||
@@ -205,6 +206,7 @@ public class CodeGenerator implements ICodeGenerator {
|
||||
* @return the generated code
|
||||
* @throws CodeGeneratorException if an error occurs during Code Generation
|
||||
*/
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public String generateProcessCode() throws CodeGeneratorException {
|
||||
// Parse Process, generate Code for Individual Components
|
||||
@@ -273,14 +275,12 @@ public class CodeGenerator implements ICodeGenerator {
|
||||
// Fix bug TESB-2951 Generated Codes error when Route
|
||||
// starts with cFile/cFTP/cActiveMQ/cFTP/cJMS
|
||||
// LiXiaopeng 2011-09-05
|
||||
INode subProcessStartNode = subTree.getRootNode()
|
||||
.getSubProcessStartNode(true);
|
||||
String startNodeName = subProcessStartNode
|
||||
.getComponent().getName();
|
||||
IElementParameter family = subProcessStartNode.getElementParameter("FAMILY");
|
||||
if(subProcessStartNode.isStart() && null != family && "Messaging".equals(family.getValue())){
|
||||
INode subProcessStartNode = subTree.getRootNode().getSubProcessStartNode(true);
|
||||
String startNodeName = subProcessStartNode.getComponent().getName();
|
||||
IElementParameter family = subProcessStartNode.getElementParameter("FAMILY");
|
||||
if (subProcessStartNode.isStart() && null != family && "Messaging".equals(family.getValue())) {
|
||||
nodeSubTreeList.add(subTree);
|
||||
} else if ("cConfig".equals(startNodeName)) {
|
||||
} else if ("cConfig".equals(startNodeName)) {
|
||||
// Customized remove the cConfig routeId codes.
|
||||
// TESB-2825 LiXP 20110823
|
||||
// Do nothing.
|
||||
@@ -327,8 +327,15 @@ public class CodeGenerator implements ICodeGenerator {
|
||||
componentsCode.append(generateTypedComponentCode(EInternalTemplate.PART_ENDMAIN,
|
||||
subTree.getRootNode()));
|
||||
componentsCode.append(generateComponentsCode(subTree, subTree.getRootNode(), ECodePart.END, null));
|
||||
componentsCode.append(generateTypedComponentCode(EInternalTemplate.SUBPROCESS_FOOTER, subTree));
|
||||
StringBuffer finallyPart = new StringBuffer();
|
||||
finallyPart.append(generateComponentsCode(subTree, subTree.getRootNode(), ECodePart.FINALLY, null));
|
||||
Vector subprocess_footerArgument = new Vector(2);
|
||||
subprocess_footerArgument.add(subTree);
|
||||
subprocess_footerArgument.add(finallyPart.toString());
|
||||
componentsCode.append(generateTypedComponentCode(EInternalTemplate.SUBPROCESS_FOOTER,
|
||||
subprocess_footerArgument));
|
||||
} else {
|
||||
StringBuffer finallyPart = new StringBuffer();
|
||||
componentsCode.append(generateTypedComponentCode(EInternalTemplate.SUBPROCESS_HEADER, subTree));
|
||||
componentsCode.append(generateComponentsCode(subTree, subTree.getMergeNode(), ECodePart.BEGIN, null));
|
||||
|
||||
@@ -341,13 +348,17 @@ public class CodeGenerator implements ICodeGenerator {
|
||||
subTree.getRootNode()));
|
||||
|
||||
componentsCode.append(generateComponentsCode(subTree, startNode, ECodePart.END, null));
|
||||
finallyPart.append(generateComponentsCode(subTree, startNode, ECodePart.FINALLY, null));
|
||||
}
|
||||
|
||||
componentsCode.append(generateComponentsCode(subTree, subTree.getMergeNode(), ECodePart.END, null));
|
||||
|
||||
componentsCode.append(generateTypedComponentCode(EInternalTemplate.SUBPROCESS_FOOTER, subTree));
|
||||
finallyPart.append(generateComponentsCode(subTree, subTree.getMergeNode(), ECodePart.FINALLY, null));
|
||||
Vector subprocess_footerArgument = new Vector(2);
|
||||
subprocess_footerArgument.add(subTree);
|
||||
subprocess_footerArgument.add(finallyPart.toString());
|
||||
componentsCode.append(generateTypedComponentCode(EInternalTemplate.SUBPROCESS_FOOTER,
|
||||
subprocess_footerArgument));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -355,10 +366,11 @@ public class CodeGenerator implements ICodeGenerator {
|
||||
Vector footerArgument = new Vector(2);
|
||||
footerArgument.add(process);
|
||||
footerArgument.add(processTree.getRootNodes());
|
||||
if (isCamel)
|
||||
if (isCamel) {
|
||||
componentsCode.append(generateTypedComponentCode(EInternalTemplate.FOOTER_ROUTE, footerArgument));
|
||||
else
|
||||
} else {
|
||||
componentsCode.append(generateTypedComponentCode(EInternalTemplate.FOOTER, footerArgument));
|
||||
}
|
||||
componentsCode.append(generateTypedComponentCode(EInternalTemplate.PROCESSINFO, componentsCode.length()));
|
||||
// ####
|
||||
return componentsCode.toString();
|
||||
@@ -404,6 +416,7 @@ public class CodeGenerator implements ICodeGenerator {
|
||||
* @return the generated code
|
||||
* @throws CodeGeneratorException if an error occurs during Code Generation
|
||||
*/
|
||||
@Override
|
||||
public String generateContextCode(IContext designerContext) throws CodeGeneratorException {
|
||||
if (process != null) {
|
||||
if (designerContext == null) {
|
||||
@@ -444,20 +457,22 @@ public class CodeGenerator implements ICodeGenerator {
|
||||
}
|
||||
return ""; //$NON-NLS-1$
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* ADDED for TESB-7887 By GangLiu(non-Javadoc)
|
||||
*
|
||||
* @see org.talend.designer.codegen.ICodeGenerator#generateSpringContent()
|
||||
*/
|
||||
@Override
|
||||
public String generateSpringContent() throws CodeGeneratorException {
|
||||
if (process == null || !( process instanceof IProcess2) ){
|
||||
return null;
|
||||
}
|
||||
IProcess2 process2 = (IProcess2) process;
|
||||
if(!process2.needsSpring() || process2.getSpringContent() == null){
|
||||
return null;
|
||||
}
|
||||
return process2.getSpringContent();
|
||||
if (process == null || !(process instanceof IProcess2)) {
|
||||
return null;
|
||||
}
|
||||
IProcess2 process2 = (IProcess2) process;
|
||||
if (!process2.needsSpring() || process2.getSpringContent() == null) {
|
||||
return null;
|
||||
}
|
||||
return process2.getSpringContent();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -627,8 +642,16 @@ public class CodeGenerator implements ICodeGenerator {
|
||||
|
||||
codeComponent.append(generateComponentCode(subProcess, node, ECodePart.END, incomingName, typeGen));
|
||||
codeComponent.append(generatesTreeCode(subProcess, node, ECodePart.END, typeGen));
|
||||
codeComponent.append(generateTypedComponentCode(EInternalTemplate.ITERATE_SUBPROCESS_FOOTER, node,
|
||||
ECodePart.END, incomingName, subProcess));
|
||||
|
||||
StringBuffer finallyPart = new StringBuffer();
|
||||
// if iterate with parallel
|
||||
finallyPart.append(generateComponentsCode(subProcess, node, ECodePart.FINALLY, incomingName, typeGen));
|
||||
Vector iterate_Argument = new Vector(2);
|
||||
iterate_Argument.add(node);
|
||||
iterate_Argument.add(finallyPart.toString());
|
||||
|
||||
codeComponent.append(generateTypedComponentCode(EInternalTemplate.ITERATE_SUBPROCESS_FOOTER,
|
||||
iterate_Argument, ECodePart.END, incomingName, subProcess));
|
||||
} else {
|
||||
if (ETypeGen.CAMEL == typeGen) {
|
||||
if (node.getIncomingConnections() != null && node.getIncomingConnections().size() > 0) {
|
||||
@@ -639,32 +662,28 @@ public class CodeGenerator implements ICodeGenerator {
|
||||
}
|
||||
codeComponent.append(generateComponentCode(subProcess, node, ECodePart.MAIN, incomingName, typeGen));
|
||||
if (ETypeGen.CAMEL == typeGen) {
|
||||
if (node.getIncomingConnections().size() < 1 && node.isStart()){
|
||||
// http://jira.talendforge.org/browse/TESB-4086 XiaopengLi
|
||||
String label = null;
|
||||
IElementParameter parameter = node
|
||||
.getElementParameter("LABEL");
|
||||
if (parameter != null
|
||||
&& !"__UNIQUE_NAME__".equals(parameter
|
||||
.getValue())) {
|
||||
label = (String) parameter.getValue();
|
||||
}
|
||||
if (node.getIncomingConnections().size() < 1 && node.isStart()) {
|
||||
// http://jira.talendforge.org/browse/TESB-4086 XiaopengLi
|
||||
String label = null;
|
||||
IElementParameter parameter = node.getElementParameter("LABEL");
|
||||
if (parameter != null && !"__UNIQUE_NAME__".equals(parameter.getValue())) {
|
||||
label = (String) parameter.getValue();
|
||||
}
|
||||
|
||||
/*
|
||||
* Fix https://jira.talendforge.org/browse/TESB-6685
|
||||
* label + uniqueName to make it unique
|
||||
*/
|
||||
if (label == null) {
|
||||
label = node.getUniqueName();
|
||||
}else{
|
||||
label += "_"+node.getUniqueName();
|
||||
}
|
||||
if(!"cErrorHandler".equals(node.getComponent().getName())){
|
||||
codeComponent.append(".routeId(\"" + label + "\")");
|
||||
}
|
||||
}else{
|
||||
codeComponent.append(".id(\"" + node.getUniqueName() + "\")");
|
||||
}
|
||||
/*
|
||||
* Fix https://jira.talendforge.org/browse/TESB-6685 label + uniqueName to make it unique
|
||||
*/
|
||||
if (label == null) {
|
||||
label = node.getUniqueName();
|
||||
} else {
|
||||
label += "_" + node.getUniqueName();
|
||||
}
|
||||
if (!"cErrorHandler".equals(node.getComponent().getName())) {
|
||||
codeComponent.append(".routeId(\"" + label + "\")");
|
||||
}
|
||||
} else {
|
||||
codeComponent.append(".id(\"" + node.getUniqueName() + "\")");
|
||||
}
|
||||
}
|
||||
codeComponent.append(generatesTreeCode(subProcess, node, ECodePart.MAIN, typeGen));
|
||||
}
|
||||
@@ -692,6 +711,10 @@ public class CodeGenerator implements ICodeGenerator {
|
||||
// }
|
||||
}
|
||||
break;
|
||||
case FINALLY:
|
||||
codeComponent.append(generateComponentCode(subProcess, node, ECodePart.FINALLY, incomingName, typeGen));
|
||||
codeComponent.append(generatesTreeCode(subProcess, node, ECodePart.FINALLY, typeGen));
|
||||
break;
|
||||
default:
|
||||
// do nothing
|
||||
}
|
||||
@@ -764,24 +787,21 @@ public class CodeGenerator implements ICodeGenerator {
|
||||
}
|
||||
|
||||
if (ETypeGen.ETL == typeGen) {
|
||||
/**
|
||||
* fix for bug: TDI-8508 aim: change the order of end parts to be the opposite order of begin parts
|
||||
*/
|
||||
// for (IConnection connection : node.getOutgoingConnections()) {
|
||||
for (int i = 0; i < node.getOutgoingConnections().size(); i++) {
|
||||
for (IConnection connection : node.getOutgoingConnections()) {
|
||||
|
||||
IConnection connection = null;
|
||||
if (part == ECodePart.END) {
|
||||
connection = node.getOutgoingConnections().get(node.getOutgoingConnections().size() - (i + 1));
|
||||
} else {
|
||||
connection = node.getOutgoingConnections().get(i);
|
||||
}
|
||||
|
||||
if ((connection.getLineStyle() == EConnectionType.ITERATE) && (part != ECodePart.MAIN)) {
|
||||
if ((connection.getLineStyle() == EConnectionType.ITERATE) && (part != ECodePart.MAIN)
|
||||
&& (part != ECodePart.FINALLY)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((connection.getLineStyle() == EConnectionType.ON_ROWS_END) && (part != ECodePart.END)) {
|
||||
if ((connection.getLineStyle() == EConnectionType.ITERATE)
|
||||
&& ("true".equals(ElementParameterParser.getValue(connection, "__ENABLE_PARALLEL__"))) //$NON-NLS-1$//$NON-NLS-2$
|
||||
&& part == ECodePart.FINALLY) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((connection.getLineStyle() == EConnectionType.ON_ROWS_END) && (part != ECodePart.END)
|
||||
&& (part != ECodePart.FINALLY)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -864,8 +884,9 @@ public class CodeGenerator implements ICodeGenerator {
|
||||
|
||||
StringBuffer content = new StringBuffer();
|
||||
try {
|
||||
if (typeGen == ETypeGen.ETL)
|
||||
if (typeGen == ETypeGen.ETL) {
|
||||
content.append(generateTypedComponentCode(EInternalTemplate.PART_HEADER, node, part, incomingName, subProcess));
|
||||
}
|
||||
|
||||
IComponentFileNaming componentFileNaming = ComponentsFactoryProvider.getFileNamingInstance();
|
||||
String templateURI = node.getComponent().getPathSource() + TemplateUtil.DIR_SEP + node.getComponent().getName()
|
||||
@@ -875,8 +896,9 @@ public class CodeGenerator implements ICodeGenerator {
|
||||
jetBean.setTemplateRelativeUri(templateURI);
|
||||
JetProxy proxy = new JetProxy(jetBean);
|
||||
content.append(proxy.generate());
|
||||
if (typeGen == ETypeGen.ETL)
|
||||
if (typeGen == ETypeGen.ETL) {
|
||||
content.append(generateTypedComponentCode(EInternalTemplate.PART_FOOTER, node, part, incomingName, subProcess));
|
||||
}
|
||||
|
||||
} catch (JETException jetException) {
|
||||
log.error(jetException.getMessage(), jetException);
|
||||
@@ -897,6 +919,7 @@ public class CodeGenerator implements ICodeGenerator {
|
||||
* @return the generated code
|
||||
* @throws CodeGeneratorException if an error occurs during Code Generation
|
||||
*/
|
||||
@Override
|
||||
public String generateComponentCode(INode node, ECodePart part) throws CodeGeneratorException {
|
||||
CodeGeneratorArgument argument = new CodeGeneratorArgument();
|
||||
argument.setNode(node);
|
||||
@@ -980,6 +1003,7 @@ public class CodeGenerator implements ICodeGenerator {
|
||||
* @see org.talend.designer.codegen.ICodeGenerator#generateComponentCodeWithRows (java.lang.String,
|
||||
* java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public String generateComponentCodeWithRows(String nodeName, IAloneProcessNodeConfigurer nodeConfigurer) {
|
||||
StringBuffer componentsCode = new StringBuffer();
|
||||
|
||||
@@ -1010,6 +1034,7 @@ public class CodeGenerator implements ICodeGenerator {
|
||||
// nodeConfigurer.configure(subTreeNode);
|
||||
// }
|
||||
componentsCode.append(generateTypedComponentCode(EInternalTemplate.SUBPROCESS_HEADER, subTree));
|
||||
StringBuffer finallyPart = new StringBuffer();
|
||||
if (subTreeNode != null) {
|
||||
|
||||
if (!subTree.isMergeSubTree()) {
|
||||
@@ -1029,6 +1054,8 @@ public class CodeGenerator implements ICodeGenerator {
|
||||
// generateTypedComponentCode
|
||||
// (EInternalTemplate.SUBPROCESS_FOOTER,
|
||||
// subTree));
|
||||
finallyPart
|
||||
.append(generateComponentsCode(subTree, subTree.getRootNode(), ECodePart.FINALLY, null));
|
||||
} else {
|
||||
// componentsCode.append(
|
||||
// generateTypedComponentCode
|
||||
@@ -1043,6 +1070,8 @@ public class CodeGenerator implements ICodeGenerator {
|
||||
componentsCode.append(generateComponentsCode(subTree, startNode, ECodePart.MAIN, null));
|
||||
|
||||
componentsCode.append(generateComponentsCode(subTree, startNode, ECodePart.END, null));
|
||||
|
||||
finallyPart.append(generateComponentsCode(subTree, startNode, ECodePart.FINALLY, null));
|
||||
}
|
||||
|
||||
componentsCode.append(generateTypedComponentCode(EInternalTemplate.PART_ENDMAIN,
|
||||
@@ -1051,13 +1080,20 @@ public class CodeGenerator implements ICodeGenerator {
|
||||
componentsCode
|
||||
.append(generateComponentsCode(subTree, subTree.getMergeNode(), ECodePart.END, null));
|
||||
|
||||
finallyPart.append(generateComponentsCode(subTree, subTree.getMergeNode(), ECodePart.FINALLY,
|
||||
null));
|
||||
|
||||
// componentsCode.append(
|
||||
// generateTypedComponentCode
|
||||
// (EInternalTemplate.SUBPROCESS_FOOTER,
|
||||
// subTree));
|
||||
}
|
||||
}
|
||||
componentsCode.append(generateTypedComponentCode(EInternalTemplate.SUBPROCESS_FOOTER, subTree));
|
||||
Vector subprocess_footerArgument = new Vector(2);
|
||||
subprocess_footerArgument.add(subTree);
|
||||
subprocess_footerArgument.add(finallyPart.toString());
|
||||
componentsCode.append(generateTypedComponentCode(EInternalTemplate.SUBPROCESS_FOOTER,
|
||||
subprocess_footerArgument));
|
||||
}
|
||||
Vector footerArgument = new Vector(2);
|
||||
footerArgument.add(process);
|
||||
@@ -1093,6 +1129,7 @@ public class CodeGenerator implements ICodeGenerator {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setContextName(String contextName) {
|
||||
this.contextName = contextName;
|
||||
}
|
||||
|
||||
@@ -13,17 +13,21 @@
|
||||
package org.talend.designer.codegen;
|
||||
|
||||
import org.eclipse.core.runtime.jobs.Job;
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
import org.talend.commons.ui.runtime.CommonUIPlugin;
|
||||
import org.talend.core.CorePlugin;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.ILibraryManagerService;
|
||||
import org.talend.core.language.ECodeLanguage;
|
||||
import org.talend.core.language.LanguageManager;
|
||||
import org.talend.core.model.components.ComponentCompilations;
|
||||
import org.talend.core.model.process.Element;
|
||||
import org.talend.core.model.process.IProcess;
|
||||
import org.talend.designer.codegen.i18n.Messages;
|
||||
import org.talend.designer.codegen.model.CodeGeneratorEmittersPoolFactory;
|
||||
import org.talend.designer.core.ICamelDesignerCoreService;
|
||||
import org.talend.designer.core.IDesignerCoreService;
|
||||
import org.talend.designer.core.ui.views.properties.IComponentSettingsView;
|
||||
import org.talend.repository.model.ComponentsFactoryProvider;
|
||||
|
||||
/**
|
||||
@@ -137,18 +141,33 @@ public class CodeGeneratorService implements ICodeGeneratorService {
|
||||
*/
|
||||
@Override
|
||||
public Job refreshTemplates() {
|
||||
// this will force to refresh all components libs when install run ctrl+f3
|
||||
Element oldComponent = null;
|
||||
IComponentSettingsView viewer = null;
|
||||
if (!CommonUIPlugin.isFullyHeadless()) {
|
||||
// TDI-25866:In case select a component and sctrl+shift+f3,need clean its componentSetting view
|
||||
viewer = (IComponentSettingsView) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
|
||||
.findView(IComponentSettingsView.ID);
|
||||
|
||||
if (viewer != null) {
|
||||
oldComponent = viewer.getElement();
|
||||
viewer.cleanDisplay();
|
||||
}
|
||||
}
|
||||
ComponentCompilations.deleteMarkers();
|
||||
ComponentsFactoryProvider.getInstance().resetCache();
|
||||
ILibraryManagerService librairesManagerService = (ILibraryManagerService) GlobalServiceRegister.getDefault().getService(
|
||||
ILibraryManagerService.class);
|
||||
librairesManagerService.clearCache();
|
||||
ComponentCompilations.deleteMarkers();
|
||||
ComponentsFactoryProvider.getInstance().resetCache();
|
||||
Job job = CodeGeneratorEmittersPoolFactory.initialize();
|
||||
CorePlugin.getDefault().getLibrariesService().syncLibraries();
|
||||
Job job = CodeGeneratorEmittersPoolFactory.initialize();
|
||||
// achen modify to record ctrl+shift+f3 is pressed to fix bug 0006107
|
||||
IDesignerCoreService designerCoreService = (IDesignerCoreService) GlobalServiceRegister.getDefault().getService(
|
||||
IDesignerCoreService.class);
|
||||
designerCoreService.getLastGeneratedJobsDateMap().clear();
|
||||
|
||||
if (oldComponent != null) {
|
||||
viewer.setElement(oldComponent);
|
||||
}
|
||||
return job;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,9 +77,14 @@ public class JavaRoutineSynchronizer extends AbstractRoutineSynchronizer {
|
||||
*/
|
||||
@Override
|
||||
public void syncAllRoutines() throws SystemException {
|
||||
syncRoutineItems(getRoutines());
|
||||
syncRoutineItems(getRoutines(),false);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void syncAllRoutinesForLogOn() throws SystemException {
|
||||
syncRoutineItems(getRoutines(),true);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
@@ -87,13 +92,18 @@ public class JavaRoutineSynchronizer extends AbstractRoutineSynchronizer {
|
||||
*/
|
||||
@Override
|
||||
public void syncAllPigudf() throws SystemException {
|
||||
syncRoutineItems(getAllPigudf());
|
||||
syncRoutineItems(getAllPigudf(),false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void syncAllPigudfForLogOn() throws SystemException {
|
||||
syncRoutineItems(getAllPigudf(), true);
|
||||
}
|
||||
|
||||
private void syncRoutineItems(List<IRepositoryViewObject> routineObjects) throws SystemException {
|
||||
private void syncRoutineItems(List<IRepositoryViewObject> routineObjects,boolean forceUpdate) throws SystemException {
|
||||
for (IRepositoryViewObject routine : routineObjects) {
|
||||
RoutineItem routineItem = (RoutineItem) routine.getProperty().getItem();
|
||||
syncRoutine(routineItem, true);
|
||||
syncRoutine(routineItem, true,forceUpdate);
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
@@ -13,15 +13,6 @@
|
||||
package org.talend.designer.codegen;
|
||||
|
||||
import org.eclipse.jface.action.Action;
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
import org.talend.core.CorePlugin;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.model.components.ComponentCompilations;
|
||||
import org.talend.core.model.process.Element;
|
||||
import org.talend.designer.codegen.model.CodeGeneratorEmittersPoolFactory;
|
||||
import org.talend.designer.core.IDesignerCoreService;
|
||||
import org.talend.designer.core.ui.views.properties.IComponentSettingsView;
|
||||
import org.talend.repository.model.ComponentsFactoryProvider;
|
||||
|
||||
/**
|
||||
* DOC mhirt class global comment. Detailled comment <br/>
|
||||
@@ -43,28 +34,8 @@ public class RefreshTemplatesAction extends Action {
|
||||
*/
|
||||
@Override
|
||||
public void run() {
|
||||
// TDI-25866:In case select a component and sctrl+shift+f3,need clean its componentSetting view
|
||||
IComponentSettingsView viewer = (IComponentSettingsView) PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||
.getActivePage().findView(IComponentSettingsView.ID);
|
||||
|
||||
Element oldComponent = null;
|
||||
|
||||
if (viewer != null) {
|
||||
oldComponent = viewer.getElement();
|
||||
viewer.cleanDisplay();
|
||||
}
|
||||
ComponentCompilations.deleteMarkers();
|
||||
ComponentsFactoryProvider.getInstance().resetCache();
|
||||
CorePlugin.getDefault().getLibrariesService().syncLibraries();
|
||||
CodeGeneratorEmittersPoolFactory.initialize();
|
||||
// achen modify to record ctrl+shift+f3 is pressed to fix bug 0006107
|
||||
IDesignerCoreService designerCoreService = (IDesignerCoreService) GlobalServiceRegister.getDefault().getService(
|
||||
IDesignerCoreService.class);
|
||||
designerCoreService.getLastGeneratedJobsDateMap().clear();
|
||||
|
||||
if (oldComponent != null) {
|
||||
viewer.setElement(oldComponent);
|
||||
}
|
||||
CodeGeneratorService service = new CodeGeneratorService();
|
||||
service.refreshTemplates();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -261,7 +261,7 @@ public class ComponentsPreferencePage extends FieldEditorPreferencePage implemen
|
||||
public void modifyText(ModifyEvent e) {
|
||||
String newPath = filePathTemp.getTextControl(parent).getText();
|
||||
File file = new File(newPath);
|
||||
if (!file.exists()) {
|
||||
if (!file.exists() && !"".equals(newPath)) {
|
||||
// getPreferenceStore().setValue(IComponentPreferenceConstant.USER_COMPONENTS_FOLDER, "");
|
||||
filePathTemp.showErrorMessage();
|
||||
setValid(false);
|
||||
|
||||
@@ -19,6 +19,7 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.talend.core.model.process.AbstractNode;
|
||||
import org.talend.core.model.process.EConnectionType;
|
||||
import org.talend.core.model.process.ElementParameterParser;
|
||||
import org.talend.core.model.process.IConnection;
|
||||
@@ -51,6 +52,8 @@ public class NodesSubTree {
|
||||
|
||||
HashMap<INode, Integer> visitedNodesEndCode;
|
||||
|
||||
HashMap<INode, Integer> visitedNodesFinallyCode;
|
||||
|
||||
private static final boolean DEBUG = false;
|
||||
|
||||
boolean isMergeSubTree = false;
|
||||
@@ -63,6 +66,10 @@ public class NodesSubTree {
|
||||
|
||||
INode mergeNode;
|
||||
|
||||
boolean isRefSubTree = false;// for mr only
|
||||
|
||||
List<INode> refNodes; // for mr only
|
||||
|
||||
/* display size of method code in comment */
|
||||
boolean methodSizeNeeded = false;
|
||||
|
||||
@@ -88,6 +95,7 @@ public class NodesSubTree {
|
||||
this.visitedNodesMainCode = new HashMap<INode, Integer>();
|
||||
this.visitedNodesBeginCode = new HashMap<INode, Integer>();
|
||||
this.visitedNodesEndCode = new HashMap<INode, Integer>();
|
||||
this.visitedNodesFinallyCode = new HashMap<INode, Integer>();
|
||||
this.isMergeSubTree = node.isThereLinkWithMerge();
|
||||
allMainSubTreeConnections = new ArrayList<IConnection>();
|
||||
|
||||
@@ -105,17 +113,45 @@ public class NodesSubTree {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public NodesSubTree(INode node, List<? extends INode> nodes, ETypeGen typeGen) {
|
||||
this.rootNode = node;
|
||||
this.name = node.getUniqueName();
|
||||
this.nodes = new ArrayList<INode>();
|
||||
this.visitedNodesMainCode = new HashMap<INode, Integer>();
|
||||
allMainSubTreeConnections = new ArrayList<IConnection>();
|
||||
|
||||
buildCamelSubTree(node, false);
|
||||
public NodesSubTree(INode node, List<? extends INode> nodes, ETypeGen typeGen) {
|
||||
if (typeGen == ETypeGen.CAMEL) {
|
||||
this.rootNode = node;
|
||||
this.name = node.getUniqueName();
|
||||
this.nodes = new ArrayList<INode>();
|
||||
this.visitedNodesMainCode = new HashMap<INode, Integer>();
|
||||
allMainSubTreeConnections = new ArrayList<IConnection>();
|
||||
|
||||
buildCamelSubTree(node, false);
|
||||
} else if (typeGen == ETypeGen.MR) {
|
||||
this.rootNode = node;
|
||||
this.name = node.getUniqueName();
|
||||
this.nodes = new ArrayList<INode>();
|
||||
afterSubProcesses = new ArrayList<String>();
|
||||
beforeSubProcesses = new ArrayList<String>();
|
||||
|
||||
allMainSubTreeConnections = new ArrayList<IConnection>();
|
||||
|
||||
buildMRSubTree(node);
|
||||
|
||||
if (refNodes != null) {
|
||||
for (INode refNode : refNodes) {
|
||||
this.nodes.add(refNode);
|
||||
for (IConnection connection : refNode.getOutgoingSortedConnections()) {
|
||||
if (connection.getTarget().isActivate()) {
|
||||
|
||||
if (connection.getLineStyle().equals(EConnectionType.RUN_AFTER)) {
|
||||
afterSubProcesses.add(connection.getTarget().getUniqueName());
|
||||
}
|
||||
if (connection.getLineStyle().equals(EConnectionType.ON_SUBJOB_OK)) {
|
||||
beforeSubProcesses.add(connection.getTarget().getUniqueName());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* unite all the relative merge nodes to this subTree
|
||||
@@ -159,6 +195,32 @@ public class NodesSubTree {
|
||||
nodes.add(node);
|
||||
}
|
||||
|
||||
private void buildMRSubTree(INode node) {
|
||||
if (((AbstractNode) node).isThereLinkWithRef()) {
|
||||
this.isRefSubTree = true;
|
||||
this.refNodes = ((AbstractNode) node).getRefNodes();
|
||||
}
|
||||
for (IConnection connection : node.getOutgoingSortedConnections()) {
|
||||
if (connection.getTarget().isActivate()) {
|
||||
|
||||
if (connection.getLineStyle().hasConnectionCategory(IConnectionCategory.MAIN)) {
|
||||
if (!connection.getLineStyle().hasConnectionCategory(IConnectionCategory.USE_ITERATE)) {
|
||||
allMainSubTreeConnections.add(connection);
|
||||
}
|
||||
buildMRSubTree(connection.getTarget());
|
||||
}
|
||||
if (connection.getLineStyle().equals(EConnectionType.RUN_AFTER)) {
|
||||
afterSubProcesses.add(connection.getTarget().getUniqueName());
|
||||
}
|
||||
if (connection.getLineStyle().equals(EConnectionType.ON_SUBJOB_OK)) {
|
||||
beforeSubProcesses.add(connection.getTarget().getUniqueName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
nodes.add(node);
|
||||
}
|
||||
|
||||
private void buildSubTree(INode node, boolean breakWhenMerge) {
|
||||
if (DEBUG) {
|
||||
System.out.print(node.getUniqueName());
|
||||
@@ -204,6 +266,7 @@ public class NodesSubTree {
|
||||
visitedNodesMainCode.put(node, 0);
|
||||
visitedNodesBeginCode.put(node, 0);
|
||||
visitedNodesEndCode.put(node, 0);
|
||||
visitedNodesFinallyCode.put(node, 0);
|
||||
nodes.add(node);
|
||||
}
|
||||
|
||||
@@ -237,6 +300,13 @@ public class NodesSubTree {
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
case FINALLY:
|
||||
Integer countFinally = visitedNodesFinallyCode.get(node);
|
||||
if (countFinally == null) {
|
||||
return null;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
default:
|
||||
return result;
|
||||
}
|
||||
@@ -259,6 +329,8 @@ public class NodesSubTree {
|
||||
case END:
|
||||
visitedNodesEndCode.put(node, visitedNodesEndCode.get(node) + 1);
|
||||
break;
|
||||
case FINALLY:
|
||||
visitedNodesFinallyCode.put(node, visitedNodesFinallyCode.get(node) + 1);
|
||||
default:
|
||||
// do nothing
|
||||
}
|
||||
@@ -368,6 +440,7 @@ public class NodesSubTree {
|
||||
|
||||
Collections.sort(mergeBranchStarts, new Comparator<INode>() {
|
||||
|
||||
@Override
|
||||
public int compare(INode node1, INode node2) {
|
||||
if (node1.getLinkedMergeInfo().get(mergeNode) > node2.getLinkedMergeInfo().get(mergeNode)) {
|
||||
return 1;
|
||||
@@ -415,4 +488,40 @@ public class NodesSubTree {
|
||||
public void setSubTreeContainsParallelIterate(boolean subTreeContainsParallelIterate) {
|
||||
this.subTreeContainsParallelIterate = subTreeContainsParallelIterate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for isRefSubTree.
|
||||
*
|
||||
* @return the isRefSubTree
|
||||
*/
|
||||
public boolean isRefSubTree() {
|
||||
return this.isRefSubTree;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the isRefSubTree.
|
||||
*
|
||||
* @param isRefSubTree the isRefSubTree to set
|
||||
*/
|
||||
public void setRefSubTree(boolean isRefSubTree) {
|
||||
this.isRefSubTree = isRefSubTree;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for refNodes.
|
||||
*
|
||||
* @return the refNodes
|
||||
*/
|
||||
public List<INode> getRefNodes() {
|
||||
return this.refNodes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the refNodes.
|
||||
*
|
||||
* @param refNodes the refNodes to set
|
||||
*/
|
||||
public void setRefNodes(List<INode> refNodes) {
|
||||
this.refNodes = refNodes;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.talend.core.model.process.EConnectionType;
|
||||
import org.talend.core.model.process.INode;
|
||||
import org.talend.core.model.process.IProcess;
|
||||
import org.talend.core.model.temp.ETypeGen;
|
||||
@@ -47,12 +48,16 @@ public class NodesTree {
|
||||
buildSubTrees(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public NodesTree(IProcess process, List<? extends INode> treeNodes, boolean init, ETypeGen typeGen) {
|
||||
this.nodes = treeNodes;
|
||||
buildRootNodes(process);
|
||||
if (init) {
|
||||
buildCamelSubTrees(true);
|
||||
if (typeGen == ETypeGen.CAMEL) {
|
||||
buildCamelSubTrees(true);
|
||||
} else if (typeGen == ETypeGen.MR) {
|
||||
buildMRSubTrees();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,6 +98,21 @@ public class NodesTree {
|
||||
}
|
||||
}
|
||||
|
||||
private void buildMRSubTrees() {
|
||||
subTrees = new ArrayList<NodesSubTree>();
|
||||
for (INode node : nodes) {
|
||||
if (((node.isSubProcessStart()) && (node.isActivate())) || (rootNodes.contains(node))) {
|
||||
if (node.getOutgoingConnections(EConnectionType.FLOW_REF) != null
|
||||
&& node.getOutgoingConnections(EConnectionType.FLOW_REF).size() == 1) {
|
||||
// ignore the node when it output connection is flow_ref, because it has been added in
|
||||
// AbstractNode.setRefNodes
|
||||
continue;
|
||||
}
|
||||
subTrees.add(new NodesSubTree(node, nodes, ETypeGen.MR));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Build Root Nodes List.
|
||||
*
|
||||
@@ -111,7 +131,8 @@ public class NodesTree {
|
||||
|
||||
for (INode node : nodes) {
|
||||
String componentName = node.getComponent().getName();
|
||||
if ((node.isStart()) && (node.isActivate()) && (!componentName.equals("tPrejob")) //$NON-NLS-1$
|
||||
if ((node.isStart()) && (node.isActivate()) && (node.isSubtreeStart() || node.isELTComponent())
|
||||
&& (!componentName.equals("tPrejob"))//$NON-NLS-1$
|
||||
&& (!componentName.equals("tPostjob"))) { //$NON-NLS-1$
|
||||
rootNodes.add(node);
|
||||
}
|
||||
|
||||
@@ -378,7 +378,7 @@ public class TalendJetEmitter extends JETEmitter {
|
||||
marker.getAttribute(IMarker.MESSAGE),
|
||||
(CodeGenPlugin.getPlugin().getString("jet.mark.file.line", new Object[] { //$NON-NLS-1$
|
||||
targetFile.getLocation(), marker.getAttribute(IMarker.LINE_NUMBER) }))));
|
||||
classAvailable = false;
|
||||
setClassAvailable(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -516,6 +516,10 @@ public class TalendJetEmitter extends JETEmitter {
|
||||
public boolean isClassAvailable() {
|
||||
return this.classAvailable;
|
||||
}
|
||||
|
||||
public void setClassAvailable(boolean classAvailable) {
|
||||
this.classAvailable = classAvailable;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
|
||||
@@ -424,6 +424,9 @@ public final class CodeGeneratorEmittersPoolFactory {
|
||||
if (component.getAvailableCodeParts().contains(ECodePart.END)) {
|
||||
initComponent(codeLanguage, jetBeans, ECodePart.END, component);
|
||||
}
|
||||
if (component.getAvailableCodeParts().contains(ECodePart.FINALLY)) {
|
||||
initComponent(codeLanguage, jetBeans, ECodePart.FINALLY, component);
|
||||
}
|
||||
if (component.getAvailableCodeParts().contains(ECodePart.MRCODE)) {
|
||||
initComponent(codeLanguage, jetBeans, ECodePart.MRCODE, component);
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
jarprocessor.exclude.children=true
|
||||
@@ -0,0 +1 @@
|
||||
jarprocessor.exclude.children=true
|
||||
@@ -84,25 +84,39 @@
|
||||
<!-- validate the createNewExtension text start-->
|
||||
var labelValidate = document.getElementById("extension_label").value;
|
||||
var lastVersionAvailableValidate = document.getElementById("lastVersionAvailable").value;
|
||||
var filename = document.getElementById("filename").value;
|
||||
var isSkipPage = true;
|
||||
if(labelValidate==0){
|
||||
alert("Extension Title is empty");
|
||||
alert("Extension Title is empty");
|
||||
isSkipPage = false;
|
||||
}else if(labelValidate=="null"){
|
||||
alert("Extension Title can not be null");
|
||||
alert("Extension Title can not be null");
|
||||
isSkipPage = false;
|
||||
}else if(lastVersionAvailableValidate==0){
|
||||
alert("Initial Version is empty");
|
||||
isSkipPage = false;
|
||||
}else if(lastVersionAvailableValidate=="null"){
|
||||
alert("Initial Version can not be null");
|
||||
alert("Initial Version can not be null");
|
||||
isSkipPage = false;
|
||||
}else if(filename==0){
|
||||
alert("Please input a vaild File path");
|
||||
isSkipPage = false;
|
||||
}
|
||||
|
||||
<!-- validate the createNewExtension text end-->
|
||||
|
||||
var listVersionCompatibles = "listVersionCompatibles:" + "'" + checkedType + "'";
|
||||
var filter = "filter:" + "'" + filtervalue + "'";
|
||||
var filename = "filename:" + "'" + document.getElementById("filename").value + "'";
|
||||
filename = filename.replaceAll2Excep("\\", "/");
|
||||
var jsonObj = "{" + label + "," + lastVersionAvailable + "," + description + "," + listVersionCompatibles + "," + filter + "," + filename + "}"
|
||||
if (isSkipPage == true) {
|
||||
var listVersionCompatibles = "listVersionCompatibles:" + "'" + checkedType + "'";
|
||||
var filter = "filter:" + "'" + filtervalue + "'";
|
||||
var filename = "filename:" + "'" + document.getElementById("filename").value + "'";
|
||||
filename = filename.replaceAll2Excep("\\", "/");
|
||||
var jsonObj = "{" + label + "," + lastVersionAvailable + "," + description + "," + listVersionCompatibles + "," + filter + "," + filename + "}"
|
||||
|
||||
var url = prefix + "&extensionValues=" + jsonObj;
|
||||
document.getElementById('commit').href = url;
|
||||
window.location.href=document.getElementById('commit').href;
|
||||
}
|
||||
|
||||
var url = prefix + "&extensionValues=" + jsonObj;
|
||||
document.getElementById('commit').href = url;
|
||||
}
|
||||
|
||||
function updateReWriteUrl() {
|
||||
@@ -133,22 +147,28 @@
|
||||
|
||||
<!-- validate the updateExtension text start-->
|
||||
var lastVersionAvailable_updateValidate = document.getElementById("lastVersionAvailable_update").value;
|
||||
var isSkipPage = true;
|
||||
if(lastVersionAvailable_updateValidate==0){
|
||||
alert("New Version is empty");
|
||||
var isSkipPage = false;
|
||||
}else if(lastVersionAvailable_updateValidate=="null"){
|
||||
alert("New Version can not be null");
|
||||
alert("New Version can not be null");
|
||||
var isSkipPage = false;
|
||||
}
|
||||
<!-- validate the updateExtension text end-->
|
||||
|
||||
var listVersionCompatibles = "listVersionCompatibles:" + "'" + checkedType + "'";
|
||||
var filter = "filter:" + "'" + filtervalue + "'";
|
||||
var filename = "filename:" + "'" + document.getElementById("filename_update").value + "'";
|
||||
filename = filename.replaceAll2Excep("\\", "/");
|
||||
var jsonObj = "{" + lastVersionAvailable + "," + listVersionCompatibles + "," + filter + "," + filename + "}"
|
||||
if (isSkipPage == true) {
|
||||
var listVersionCompatibles = "listVersionCompatibles:" + "'" + checkedType + "'";
|
||||
var filter = "filter:" + "'" + filtervalue + "'";
|
||||
var filename = "filename:" + "'" + document.getElementById("filename_update").value + "'";
|
||||
filename = filename.replaceAll2Excep("\\", "/");
|
||||
var jsonObj = "{" + lastVersionAvailable + "," + listVersionCompatibles + "," + filter + "," + filename + "}"
|
||||
|
||||
var url = prefix + "&extensionValues=" + jsonObj;
|
||||
document.getElementById('commit_update').href = url;
|
||||
window.location.href=document.getElementById('commit_update').href;
|
||||
}
|
||||
|
||||
var url = prefix + "&extensionValues=" + jsonObj;
|
||||
document.getElementById('commit_update').href = url;
|
||||
|
||||
}
|
||||
|
||||
function modifyReWriteUrl() {
|
||||
@@ -460,7 +480,7 @@
|
||||
<td ></td>
|
||||
<td>
|
||||
<a class="xh" href="" id="commit" style="margin-left:5px;">
|
||||
<button onclick="window.location.href=document.getElementById('commit').href" onmouseover="createNewExtensionWriteUrl()" style="width: 176px">
|
||||
<button onclick="createNewExtensionWriteUrl()" style="width: 176px">
|
||||
Add Extension
|
||||
</button>
|
||||
</a>
|
||||
@@ -519,7 +539,7 @@
|
||||
<td ></td>
|
||||
<td>
|
||||
<a class="xh" href="" id="commit_update" style="margin-left:5px;">
|
||||
<button onclick="window.location.href=document.getElementById('commit_update').href" onmouseover="updateReWriteUrl()" style="width: 176px">
|
||||
<button onclick="updateReWriteUrl()" style="width: 176px">
|
||||
Upload Extension
|
||||
</button>
|
||||
</a>
|
||||
|
||||
1
org.talend.designer.components.libs/META-INF/eclipse.inf
Normal file
1
org.talend.designer.components.libs/META-INF/eclipse.inf
Normal file
@@ -0,0 +1 @@
|
||||
jarprocessor.exclude.children=true
|
||||
@@ -71,15 +71,15 @@ public class SAXLooper {
|
||||
}
|
||||
|
||||
private void judgeIsSimple() {
|
||||
if (this.loopPath.indexOf("..") >= 0 || this.loopPath.indexOf("*") >= 0) {
|
||||
this.isSimpleParse = false;
|
||||
}
|
||||
for (int i = 0; i < nodePaths.length; i++) {
|
||||
if (nodePaths[i].indexOf("..") >= 0 || nodePaths[i].indexOf("*") >= 0) {
|
||||
this.isSimpleParse = false;
|
||||
isSimpleParse = isSimplePath(loopPath);
|
||||
|
||||
for(String path : nodePaths) {
|
||||
if(!isSimpleParse) {
|
||||
break;
|
||||
}
|
||||
isSimpleParse = isSimplePath(path);
|
||||
}
|
||||
|
||||
if (this.isSimpleParse) {
|
||||
looper = new SimpleSAXLooper(loopPath, nodePaths, asXMLs);
|
||||
} else {
|
||||
|
||||
@@ -135,7 +135,10 @@ public class SimpleSAXLooper implements ISAXLooper,Callable {
|
||||
String resultCol = node.loopPath;
|
||||
String[] splits = column.split("/");
|
||||
for (String tmp : splits) {
|
||||
if (tmp.equals(".")) {
|
||||
if (tmp.equals("..")) {
|
||||
resultCol = resultCol.substring(0, resultCol.lastIndexOf("/"));
|
||||
node.setAttrOutOfLoop(true);
|
||||
} else if (tmp.equals(".")) {
|
||||
node.isDot = true;
|
||||
} else {
|
||||
resultCol += "/" + tmp;
|
||||
|
||||
@@ -142,22 +142,17 @@ public class FileCopy {
|
||||
if (position + MAP_SIZE >= size) {
|
||||
buf = in.map(FileChannel.MapMode.READ_ONLY, position, size - position);
|
||||
out.write(buf);
|
||||
if (delSrc) {
|
||||
// here must clean first, or it can't delete
|
||||
clean(buf);
|
||||
}
|
||||
//For But TDI-26493, here must clean first, or it can't delete
|
||||
clean(buf);
|
||||
break;
|
||||
} else {
|
||||
buf = in.map(FileChannel.MapMode.READ_ONLY, position, MAP_SIZE);
|
||||
out.write(buf);
|
||||
if (delSrc) {
|
||||
// here must clean first, or it can't delete
|
||||
clean(buf);
|
||||
}
|
||||
// here must clean first, or it can't delete
|
||||
clean(buf);
|
||||
position += MAP_SIZE;
|
||||
}
|
||||
}
|
||||
|
||||
in.close();
|
||||
out.close();
|
||||
|
||||
|
||||
@@ -18,18 +18,14 @@ public class MsmqUtil {
|
||||
private String msgContent;
|
||||
|
||||
boolean bTried = false;
|
||||
|
||||
|
||||
String ipAddr = "";
|
||||
|
||||
final String LOCALIP = "127.0.0.1";
|
||||
|
||||
public MsmqUtil() {
|
||||
try {
|
||||
java.net.InetAddress thisIp = java.net.InetAddress.getLocalHost();
|
||||
ipAddr = thisIp.getHostAddress();
|
||||
} catch (Exception ex1) {
|
||||
ex1.printStackTrace();
|
||||
}
|
||||
public MsmqUtil() throws Exception {
|
||||
java.net.InetAddress thisIp = java.net.InetAddress.getLocalHost();
|
||||
ipAddr = thisIp.getHostAddress();
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws java.lang.Exception {
|
||||
@@ -52,43 +48,29 @@ public class MsmqUtil {
|
||||
}
|
||||
|
||||
// message remain in queue
|
||||
public void peek() {
|
||||
try {
|
||||
checkOpen();
|
||||
System.out.println("peek");
|
||||
Message msg = msmqHandle.peek(2000); // timeout= 2000 ms
|
||||
System.out.println(" ==> message: " + msg.getBodyAsString());
|
||||
System.out.println(" label: " + msg.getLabel());
|
||||
} catch (MessageQueueException ex1) {
|
||||
System.out.println("Peek failure: " + ex1);
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
public void peek() throws MessageQueueException, UnsupportedEncodingException {
|
||||
checkOpen();
|
||||
System.out.println("peek");
|
||||
Message msg = msmqHandle.peek(2000); // timeout= 2000 ms
|
||||
System.out.println(" ==> message: " + msg.getBodyAsString());
|
||||
System.out.println(" label: " + msg.getLabel());
|
||||
}
|
||||
|
||||
// close an open queue
|
||||
public void close() {
|
||||
try {
|
||||
checkOpen();
|
||||
msmqHandle.close();
|
||||
msmqHandle = null;
|
||||
} catch (MessageQueueException ex1) {
|
||||
System.out.println("close failure: " + ex1);
|
||||
}
|
||||
public void close() throws MessageQueueException {
|
||||
checkOpen();
|
||||
msmqHandle.close();
|
||||
msmqHandle = null;
|
||||
}
|
||||
|
||||
// delete the queue
|
||||
private void delete() {
|
||||
try {
|
||||
String fullname = getQueueFullName(".", queueName);
|
||||
ionic.Msmq.Queue.delete(fullname);
|
||||
} catch (MessageQueueException ex1) {
|
||||
System.out.println("Queue deletion failure: " + ex1);
|
||||
}
|
||||
private void delete() throws MessageQueueException {
|
||||
String fullname = getQueueFullName(".", queueName);
|
||||
ionic.Msmq.Queue.delete(fullname);
|
||||
}
|
||||
|
||||
// open the queue, if it not exists, and creating is required, try to create a queue with the name.
|
||||
public void open() {
|
||||
public void open() throws MessageQueueException {
|
||||
try {
|
||||
if (msmqHandle != null) {
|
||||
msmqHandle.close();
|
||||
@@ -98,45 +80,34 @@ public class MsmqUtil {
|
||||
msmqHandle = new Queue(fullname);
|
||||
// msmqHandle= new Queue(fullname, 0x02); // 0x02 == SEND only
|
||||
} catch (MessageQueueException ex1) {
|
||||
System.out.println("Queue open failure: " + ex1);
|
||||
|
||||
if (bTried) {
|
||||
System.out.println("Queue open failure: " + ex1);
|
||||
bTried = false;
|
||||
create();
|
||||
}else{
|
||||
throw ex1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void send() {
|
||||
try {
|
||||
checkOpen();
|
||||
// the transaction flag must agree with the transactional flavor of the queue.
|
||||
int transactionFlag = 0; // 0 = NO TRANSACTION, 1= MTS, 2= XA, 3= SINGLE_MESSAGE
|
||||
String mLabel = "inserted by " + this.getClass().getName() + ".java";
|
||||
String correlationID = "L:none";
|
||||
Message msg = new Message(msgContent, mLabel, correlationID);
|
||||
msmqHandle.send(msg);
|
||||
} catch (MessageQueueException ex1) {
|
||||
System.out.println("Send failure: " + ex1);
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
public void send() throws MessageQueueException, UnsupportedEncodingException {
|
||||
checkOpen();
|
||||
// the transaction flag must agree with the transactional flavor of the queue.
|
||||
int transactionFlag = 0; // 0 = NO TRANSACTION, 1= MTS, 2= XA, 3= SINGLE_MESSAGE
|
||||
String mLabel = "inserted by " + this.getClass().getName() + ".java";
|
||||
String correlationID = "L:none";
|
||||
Message msg = new Message(msgContent, mLabel, correlationID);
|
||||
msmqHandle.send(msg);
|
||||
}
|
||||
|
||||
public String receive() {
|
||||
try {
|
||||
checkOpen();
|
||||
// System.out.println("receive");
|
||||
Message msg = msmqHandle.receive(2000); // timeout= 2000 ms
|
||||
// System.out.println(" ==> message: " + msg.getMessage());
|
||||
// System.out.println(" label: " + msg.getLabel());
|
||||
return msg.getBodyAsString();
|
||||
} catch (MessageQueueException ex1) {
|
||||
System.out.println("Receive failure: " + ex1);
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
public String receive() throws MessageQueueException, UnsupportedEncodingException {
|
||||
checkOpen();
|
||||
// System.out.println("receive");
|
||||
Message msg = msmqHandle.receive(2000); // timeout= 2000 ms
|
||||
// System.out.println(" ==> message: " + msg.getMessage());
|
||||
// System.out.println(" label: " + msg.getLabel());
|
||||
return msg.getBodyAsString();
|
||||
}
|
||||
|
||||
private String getQueueFullName(String hostname, String queueShortName) {
|
||||
@@ -151,19 +122,15 @@ public class MsmqUtil {
|
||||
return "DIRECT=" + a1 + ":" + h1 + "\\private$\\" + queueShortName;
|
||||
}
|
||||
|
||||
private void create() {
|
||||
try {
|
||||
if (!(host == null || "".equals(host) || "localhost".equalsIgnoreCase(host) || host.equals(ipAddr) || LOCALIP
|
||||
.equals(host))) {
|
||||
throw new MessageQueueException("can only create queue locally", -1); // can only create locally.
|
||||
}
|
||||
String fullname = ".\\private$\\" + queueName;
|
||||
String qLabel = "Created by " + this.getClass().getName() + ".java";
|
||||
boolean transactional = false; // should the queue be transactional
|
||||
msmqHandle = Queue.create(fullname, qLabel, transactional);
|
||||
} catch (MessageQueueException ex1) {
|
||||
System.out.println("Queue creation failure: " + ex1);
|
||||
private void create() throws MessageQueueException {
|
||||
if (!(host == null || "".equals(host) || "localhost".equalsIgnoreCase(host) || host.equals(ipAddr) || LOCALIP
|
||||
.equals(host))) {
|
||||
throw new MessageQueueException("can only create queue locally", -1); // can only create locally.
|
||||
}
|
||||
String fullname = ".\\private$\\" + queueName;
|
||||
String qLabel = "Created by " + this.getClass().getName() + ".java";
|
||||
boolean transactional = false; // should the queue be transactional
|
||||
msmqHandle = Queue.create(fullname, qLabel, transactional);
|
||||
}
|
||||
|
||||
private void checkOpen() throws MessageQueueException {
|
||||
|
||||
@@ -102,6 +102,9 @@ public class palodata {
|
||||
csv.setQuoteChar('"');
|
||||
int iCoordElem = 0;
|
||||
while (csv.readNext()) {
|
||||
if(iCoordElem > lstDimensionElementArray.size()-1){
|
||||
break;
|
||||
}
|
||||
String strArrCoord[] = new String[iDimensionElementLength];
|
||||
for (int i = 0; i < iDimensionElementLength; i++) {
|
||||
strArrCoord[i] = (String) lstDimensionElementArray.get(iCoordElem++);
|
||||
|
||||
@@ -256,8 +256,9 @@ public class SalesforceBulkAPI {
|
||||
|
||||
private JobInfo createJob() throws AsyncApiException {
|
||||
JobInfo job = new JobInfo();
|
||||
if (concurrencyMode != null)
|
||||
if (concurrencyMode != null) {
|
||||
job.setConcurrencyMode(concurrencyMode);
|
||||
}
|
||||
job.setObject(sObjectType);
|
||||
job.setOperation(operation);
|
||||
if (OperationEnum.upsert.equals(operation)) {
|
||||
@@ -276,8 +277,8 @@ public class SalesforceBulkAPI {
|
||||
char c = '\"';
|
||||
int num = 0;
|
||||
char[] chars = value.toCharArray();
|
||||
for (int i = 0; i < chars.length; i++) {
|
||||
if (c == chars[i]) {
|
||||
for (char d : chars) {
|
||||
if (c == d) {
|
||||
num++;
|
||||
}
|
||||
}
|
||||
@@ -372,6 +373,12 @@ public class SalesforceBulkAPI {
|
||||
connection.updateJob(closeJob);
|
||||
}
|
||||
|
||||
private long awaitTime = 10000L;
|
||||
|
||||
public void setAwaitTime(long awaitTime) {
|
||||
this.awaitTime = awaitTime;
|
||||
}
|
||||
|
||||
private void awaitCompletion() throws AsyncApiException {
|
||||
long sleepTime = 0L;
|
||||
Set<String> incomplete = new HashSet<String>();
|
||||
@@ -384,7 +391,7 @@ public class SalesforceBulkAPI {
|
||||
} catch (InterruptedException e) {
|
||||
}
|
||||
// System.out.println("Awaiting results..." + incomplete.size());
|
||||
sleepTime = 100L;
|
||||
sleepTime = awaitTime;
|
||||
BatchInfo[] statusList = connection.getBatchInfoList(job.getId()).getBatchInfo();
|
||||
for (BatchInfo b : statusList) {
|
||||
if (b.getState() == BatchStateEnum.Completed || b.getState() == BatchStateEnum.Failed) {
|
||||
@@ -447,8 +454,9 @@ public class SalesforceBulkAPI {
|
||||
job = new JobInfo();
|
||||
job.setObject(moduleName);
|
||||
job.setOperation(OperationEnum.query);
|
||||
if (concurrencyMode != null)
|
||||
if (concurrencyMode != null) {
|
||||
job.setConcurrencyMode(concurrencyMode);
|
||||
}
|
||||
job.setContentType(ContentType.CSV);
|
||||
job = connection.createJob(job);
|
||||
|
||||
@@ -473,6 +481,8 @@ public class SalesforceBulkAPI {
|
||||
}
|
||||
}
|
||||
batchInfoList.add(info);
|
||||
//For TDI-27909
|
||||
closeJob();
|
||||
}
|
||||
|
||||
public String[] getQueryResultIDs() {
|
||||
@@ -487,18 +497,24 @@ public class SalesforceBulkAPI {
|
||||
// batchInfoList was populated when batches were created and submitted
|
||||
List<Map<String, String>> resultInfoList = new ArrayList<Map<String, String>>();
|
||||
Map<String, String> resultInfo;
|
||||
CSVReader rdr = new CSVReader(connection.getQueryResultStream(job.getId(), batchInfoList.get(0).getId(), resultId));
|
||||
// fix for TDI-26533
|
||||
baseFileReader = new com.talend.csv.CSVReader(new java.io.BufferedReader(new java.io.InputStreamReader(
|
||||
connection.getQueryResultStream(job.getId(), batchInfoList.get(0).getId(), resultId), FILE_ENCODING)), ',');
|
||||
|
||||
List<String> resultHeader = rdr.nextRecord();
|
||||
int resultCols = resultHeader.size();
|
||||
List<String> row;
|
||||
while ((row = rdr.nextRecord()) != null) {
|
||||
resultInfo = new HashMap<String, String>();
|
||||
// resultInfo.putAll(getBaseFileRow());
|
||||
for (int i = 0; i < resultCols; i++) {
|
||||
resultInfo.put(resultHeader.get(i), row.get(i));
|
||||
if (baseFileReader.readNext()) {
|
||||
baseFileHeader = Arrays.asList(baseFileReader.getValues());
|
||||
}
|
||||
baseFileHeaderSize = baseFileHeader.size();
|
||||
String[] row;
|
||||
while (baseFileReader.readNext()) {
|
||||
if ((row = baseFileReader.getValues()) != null) {
|
||||
resultInfo = new HashMap<String, String>();
|
||||
// resultInfo.putAll(getBaseFileRow());
|
||||
for (int i = 0; i < baseFileHeaderSize; i++) {
|
||||
resultInfo.put(baseFileHeader.get(i), row[i]);
|
||||
}
|
||||
resultInfoList.add(resultInfo);
|
||||
}
|
||||
resultInfoList.add(resultInfo);
|
||||
// boolean success = Boolean.valueOf(resultInfo.get("Success"));
|
||||
// boolean created = Boolean.valueOf(resultInfo.get("Created"));
|
||||
// String id = resultInfo.get("Id");
|
||||
@@ -509,7 +525,14 @@ public class SalesforceBulkAPI {
|
||||
// System.out.println("Failed with error: " + error);
|
||||
// }
|
||||
}
|
||||
|
||||
closeFileRead();
|
||||
return resultInfoList;
|
||||
}
|
||||
|
||||
// for TDI-26832
|
||||
public void closeFileRead() throws IOException {
|
||||
if (baseFileReader != null) {
|
||||
baseFileReader.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -231,6 +231,8 @@ public class SforceManagementImpl implements SforceManagement {
|
||||
|
||||
private ArrayList<SObject> updateItems;
|
||||
|
||||
private String[] changedItemKeys = new String[0];
|
||||
|
||||
private String upsertKeyColumn;
|
||||
|
||||
public boolean login(String endpoint, String username, String password, String timeout, boolean needCompression,
|
||||
@@ -330,19 +332,22 @@ public class SforceManagementImpl implements SforceManagement {
|
||||
try {
|
||||
if (insertItems.size() > 0) {
|
||||
SObject[] accs = insertItems.toArray(new SObject[insertItems.size()]);
|
||||
changedItemKeys = new String[accs.length];
|
||||
Create create = new Create();
|
||||
create.setSObjects(accs);
|
||||
SaveResult[] sr = stub.create(create, sh, co, null, null, null, null, null, null, null, null, null).getResult();
|
||||
insertItems.clear();
|
||||
accs = null;
|
||||
|
||||
if (exceptionForErrors && sr != null && sr.length != 0) {
|
||||
if (sr != null && sr.length != 0) {
|
||||
int batch_idx = -1;
|
||||
for (SaveResult result : sr) {
|
||||
++batch_idx;
|
||||
StringBuilder errors = new StringBuilder("");
|
||||
if (result.getSuccess()) {
|
||||
// TODO: send back the ID
|
||||
} else {
|
||||
errors = addLog(result.getErrors());
|
||||
errors = addLog(result.getErrors(),batch_idx<changedItemKeys.length?""+(batch_idx+1):"Batch index out of bounds");
|
||||
}
|
||||
if (exceptionForErrors && errors.toString().length() > 0) {
|
||||
if (logWriter != null) {
|
||||
@@ -357,6 +362,10 @@ public class SforceManagementImpl implements SforceManagement {
|
||||
}
|
||||
if (deleteItems.size() > 0) {
|
||||
ID[] delIDs = deleteItems.toArray(new ID[deleteItems.size()]);
|
||||
changedItemKeys = new String[delIDs.length];
|
||||
for(int ix=0;ix<delIDs.length;++ix) {
|
||||
changedItemKeys[ix]=delIDs[ix].getID();
|
||||
}
|
||||
Delete dels = new Delete();
|
||||
dels.setIds(delIDs);
|
||||
DeleteResponse dresp = stub.delete(dels, sh, co, null, null, null, null, null, null, null, null);
|
||||
@@ -364,13 +373,15 @@ public class SforceManagementImpl implements SforceManagement {
|
||||
deleteItems.clear();
|
||||
delIDs = null;
|
||||
|
||||
if (exceptionForErrors && dr != null && dr.length != 0) {
|
||||
if (dr != null && dr.length != 0) {
|
||||
int batch_idx = -1;
|
||||
for (DeleteResult result : dr) {
|
||||
++batch_idx;
|
||||
StringBuilder errors = new StringBuilder("");
|
||||
if (result.getSuccess()) {
|
||||
// TODO: send back the ID
|
||||
} else {
|
||||
errors = addLog(result.getErrors());
|
||||
errors = addLog(result.getErrors(),batch_idx<changedItemKeys.length?changedItemKeys[batch_idx]:"Batch index out of bounds");
|
||||
}
|
||||
if (exceptionForErrors && errors.toString().length() > 0) {
|
||||
if (logWriter != null) {
|
||||
@@ -385,6 +396,10 @@ public class SforceManagementImpl implements SforceManagement {
|
||||
}
|
||||
if (updateItems.size() > 0) {
|
||||
SObject[] upds = updateItems.toArray(new SObject[updateItems.size()]);
|
||||
changedItemKeys = new String[upds.length];
|
||||
for(int ix=0;ix<upds.length;++ix) {
|
||||
changedItemKeys[ix]=upds[ix].getId().getID();
|
||||
}
|
||||
Update update = new Update();
|
||||
update.setSObjects(upds);
|
||||
SaveResult[] saveResults = stub.update(update, sh, co, null, null, null, null, null, null, null, null, null)
|
||||
@@ -392,13 +407,15 @@ public class SforceManagementImpl implements SforceManagement {
|
||||
updateItems.clear();
|
||||
upds = null;
|
||||
|
||||
if (exceptionForErrors && saveResults != null && saveResults.length != 0) {
|
||||
if (saveResults != null && saveResults.length != 0) {
|
||||
int batch_idx = -1;
|
||||
for (SaveResult result : saveResults) {
|
||||
++batch_idx;
|
||||
StringBuilder errors = new StringBuilder("");
|
||||
if (result.getSuccess()) {
|
||||
// TODO: send back the ID
|
||||
} else {
|
||||
errors = addLog(result.getErrors());
|
||||
errors = addLog(result.getErrors(),batch_idx<changedItemKeys.length?changedItemKeys[batch_idx]:"Batch index out of bounds");
|
||||
}
|
||||
if (exceptionForErrors && errors.toString().length() > 0) {
|
||||
if (logWriter != null) {
|
||||
@@ -413,6 +430,17 @@ public class SforceManagementImpl implements SforceManagement {
|
||||
}
|
||||
if (upsertItems.size() > 0) {
|
||||
SObject[] upds = upsertItems.toArray(new SObject[upsertItems.size()]);
|
||||
changedItemKeys = new String[upds.length];
|
||||
for(int ix=0;ix<upds.length;++ix) {
|
||||
changedItemKeys[ix]="No value for "+upsertKeyColumn+" ";
|
||||
OMElement[] oms = upds[ix].getExtraElement();
|
||||
for(int iy=0;iy<oms.length;++iy) {
|
||||
if(upsertKeyColumn!=null && oms[iy]!=null && upsertKeyColumn.equals(oms[iy].getLocalName())) {
|
||||
changedItemKeys[ix]=oms[iy].getText();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
Upsert upsert = new Upsert();
|
||||
upsert.setSObjects(upds);
|
||||
upsert.setExternalIDFieldName(upsertKeyColumn);
|
||||
@@ -421,13 +449,15 @@ public class SforceManagementImpl implements SforceManagement {
|
||||
upsertItems.clear();
|
||||
upds = null;
|
||||
|
||||
if (exceptionForErrors && upsertResults != null && upsertResults.length != 0) {
|
||||
if (upsertResults != null && upsertResults.length != 0) {
|
||||
int batch_idx = -1;
|
||||
for (UpsertResult result : upsertResults) {
|
||||
++batch_idx;
|
||||
StringBuilder errors = new StringBuilder("");
|
||||
if (result.getSuccess()) {
|
||||
// TODO: send back the ID
|
||||
} else {
|
||||
errors = addLog(result.getErrors());
|
||||
errors = addLog(result.getErrors(),batch_idx<changedItemKeys.length?changedItemKeys[batch_idx]:"Batch index out of bounds");
|
||||
}
|
||||
if (exceptionForErrors && errors.toString().length() > 0) {
|
||||
if (logWriter != null) {
|
||||
@@ -462,6 +492,10 @@ public class SforceManagementImpl implements SforceManagement {
|
||||
|
||||
if (deleteItems.size() >= commitLevel) {
|
||||
ID[] delIDs = deleteItems.toArray(new ID[deleteItems.size()]);
|
||||
changedItemKeys = new String[delIDs.length];
|
||||
for(int ix=0;ix<delIDs.length;++ix) {
|
||||
changedItemKeys[ix]=delIDs[ix].getID();
|
||||
}
|
||||
Delete dels = new Delete();
|
||||
dels.setIds(delIDs);
|
||||
DeleteResponse dresp = stub.delete(dels, sh, co, null, null, null, null, null, null, null, null);
|
||||
@@ -470,12 +504,14 @@ public class SforceManagementImpl implements SforceManagement {
|
||||
delIDs = null;
|
||||
|
||||
if (dr != null && dr.length != 0) {
|
||||
int batch_idx = -1;
|
||||
for (DeleteResult result : dr) {
|
||||
++batch_idx;
|
||||
StringBuilder errors = new StringBuilder("");
|
||||
if (result.getSuccess()) {
|
||||
// TODO: send back the ID
|
||||
} else {
|
||||
errors = addLog(result.getErrors());
|
||||
errors = addLog(result.getErrors(),batch_idx<changedItemKeys.length?changedItemKeys[batch_idx]:"Batch index out of bounds");
|
||||
}
|
||||
if (exceptionForErrors && errors.toString().length() > 0) {
|
||||
if (logWriter != null) {
|
||||
@@ -516,6 +552,7 @@ public class SforceManagementImpl implements SforceManagement {
|
||||
|
||||
if (insertItems.size() >= commitLevel) {
|
||||
SObject[] accs = insertItems.toArray(new SObject[insertItems.size()]);
|
||||
changedItemKeys = new String[accs.length];
|
||||
Create create = new Create();
|
||||
create.setSObjects(accs);
|
||||
SaveResult[] sr = stub.create(create, sh, co, null, null, null, null, null, null, null, null, null).getResult();
|
||||
@@ -523,12 +560,14 @@ public class SforceManagementImpl implements SforceManagement {
|
||||
accs = null;
|
||||
|
||||
if (sr != null && sr.length != 0) {
|
||||
int batch_idx = -1;
|
||||
for (SaveResult result : sr) {
|
||||
++batch_idx;
|
||||
StringBuilder errors = new StringBuilder("");
|
||||
if (result.getSuccess()) {
|
||||
// TODO: send back the ID
|
||||
} else {
|
||||
errors = addLog(result.getErrors());
|
||||
errors = addLog(result.getErrors(),batch_idx<changedItemKeys.length?""+(batch_idx+1):"Batch index out of bounds");
|
||||
}
|
||||
if (exceptionForErrors && errors.toString().length() > 0) {
|
||||
if (logWriter != null) {
|
||||
@@ -561,6 +600,10 @@ public class SforceManagementImpl implements SforceManagement {
|
||||
// call the update passing an array of object
|
||||
if (updateItems.size() >= commitLevel) {
|
||||
SObject[] upds = updateItems.toArray(new SObject[updateItems.size()]);
|
||||
changedItemKeys = new String[upds.length];
|
||||
for(int ix=0;ix<upds.length;++ix) {
|
||||
changedItemKeys[ix]=upds[ix].getId().getID();
|
||||
}
|
||||
Update update = new Update();
|
||||
update.setSObjects(upds);
|
||||
SaveResult[] saveResults = stub.update(update, sh, co, null, null, null, null, null, null, null, null, null)
|
||||
@@ -568,13 +611,15 @@ public class SforceManagementImpl implements SforceManagement {
|
||||
updateItems.clear();
|
||||
upds = null;
|
||||
|
||||
if (exceptionForErrors && saveResults != null && saveResults.length != 0) {
|
||||
if (saveResults != null && saveResults.length != 0) {
|
||||
int batch_idx = -1;
|
||||
for (SaveResult result : saveResults) {
|
||||
++batch_idx;
|
||||
StringBuilder errors = new StringBuilder("");
|
||||
if (result.getSuccess()) {
|
||||
// TODO: send back the ID
|
||||
} else {
|
||||
errors = addLog(result.getErrors());
|
||||
errors = addLog(result.getErrors(),batch_idx<changedItemKeys.length?changedItemKeys[batch_idx]:"Batch index out of bounds");
|
||||
}
|
||||
if (exceptionForErrors && errors.toString().length() > 0) {
|
||||
if (logWriter != null) {
|
||||
@@ -611,6 +656,17 @@ public class SforceManagementImpl implements SforceManagement {
|
||||
// call the update passing an array of object
|
||||
if (upsertItems.size() >= commitLevel) {
|
||||
SObject[] upds = upsertItems.toArray(new SObject[upsertItems.size()]);
|
||||
changedItemKeys = new String[upds.length];
|
||||
for(int ix=0;ix<upds.length;++ix) {
|
||||
changedItemKeys[ix]="No value for "+upsertKeyColumn+" ";
|
||||
OMElement[] oms = upds[ix].getExtraElement();
|
||||
for(int iy=0;iy<oms.length;++iy) {
|
||||
if(upsertKeyColumn!=null && oms[iy]!=null && upsertKeyColumn.equals(oms[iy].getLocalName())) {
|
||||
changedItemKeys[ix]=oms[iy].getText();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
Upsert upsert = new Upsert();
|
||||
upsert.setSObjects(upds);
|
||||
upsert.setExternalIDFieldName(upsertKeyColumn);
|
||||
@@ -619,13 +675,15 @@ public class SforceManagementImpl implements SforceManagement {
|
||||
upsertItems.clear();
|
||||
upds = null;
|
||||
|
||||
if (exceptionForErrors && upsertResults != null && upsertResults.length != 0) {
|
||||
if (upsertResults != null && upsertResults.length != 0) {
|
||||
int batch_idx = -1;
|
||||
for (UpsertResult result : upsertResults) {
|
||||
++batch_idx;
|
||||
StringBuilder errors = new StringBuilder("");
|
||||
if (result.getSuccess()) {
|
||||
// TODO: send back the ID
|
||||
} else {
|
||||
errors = addLog(result.getErrors());
|
||||
errors = addLog(result.getErrors(),batch_idx<changedItemKeys.length?changedItemKeys[batch_idx]:"Batch index out of bounds");
|
||||
}
|
||||
if (exceptionForErrors && errors.toString().length() > 0) {
|
||||
if (logWriter != null) {
|
||||
@@ -642,7 +700,7 @@ public class SforceManagementImpl implements SforceManagement {
|
||||
|
||||
}
|
||||
|
||||
private StringBuilder addLog(Error[] resultErrors) throws Exception {
|
||||
private StringBuilder addLog(Error[] resultErrors, String row_key) throws Exception {
|
||||
StringBuilder errors = new StringBuilder("");
|
||||
if (resultErrors != null) {
|
||||
for (Error error : resultErrors) {
|
||||
@@ -651,8 +709,10 @@ public class SforceManagementImpl implements SforceManagement {
|
||||
logWriter.append("\tStatus Code: ").append(error.getStatusCode().toString());
|
||||
logWriter.newLine();
|
||||
logWriter.newLine();
|
||||
logWriter.append("\tFields: ");
|
||||
logWriter.append("\tRowKey/RowNo: "+row_key);
|
||||
if (error.getFields() != null) {
|
||||
logWriter.newLine();
|
||||
logWriter.append("\tFields: ");
|
||||
boolean flag = false;
|
||||
for (String field : error.getFields()) {
|
||||
if (flag) {
|
||||
|
||||
@@ -221,7 +221,7 @@ public class ExcelTool {
|
||||
}
|
||||
|
||||
private CellStyle getPreCellStyle() {
|
||||
if (isAbsY && keepCellFormat) {
|
||||
if (preSheet!=null && isAbsY && keepCellFormat) {
|
||||
CellStyle preCellStyle =null;
|
||||
if (preCell == null) {
|
||||
preCellStyle = preSheet.getColumnStyle(curCell.getColumnIndex());
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project name="org.talend.designer.components.libs" default="process" basedir=".">
|
||||
|
||||
<property name="component.plugin.home" value="../../../org.talend.designer.components.localprovider/components" />
|
||||
<property name="jar.plugin.home" value="../../../org.talend.libraries.custom/lib" />
|
||||
|
||||
<!-- #################################################### -->
|
||||
|
||||
<!-- modification 1: config -->
|
||||
<property name="jar.name" value="talend_file_enhanced_20070724.jar" />
|
||||
<property name="component.name" value="tFileInputDelimited" />
|
||||
<property name="author.name" value="wyang" />
|
||||
|
||||
<!-- modification 2: compile classpath -->
|
||||
@@ -19,7 +18,7 @@
|
||||
|
||||
<!-- sourcecode and final jar path -->
|
||||
<property name="source.home" value="." />
|
||||
<property name="jar.home" value="${component.plugin.home}/${component.name}/${jar.name}" />
|
||||
<property name="jar.home" value="${jar.plugin.home}/${jar.name}" />
|
||||
|
||||
<!-- temp dir for clasee files -->
|
||||
<property name="build.dir" value="../../build" />
|
||||
|
||||
@@ -68,12 +68,14 @@ public class RowParser extends DelimitedDataReader {
|
||||
|
||||
values = null;
|
||||
|
||||
if (rowSeparator.equals("\n") || rowSeparator.equals("\r\n")) {
|
||||
if ("\n".equals(rowSeparator) || "\r\n".equals(rowSeparator)) {
|
||||
// simpleMode = true;
|
||||
mode = 0;
|
||||
scanner = new Scanner(inputStream);
|
||||
scanner.useDelimiter(rowSeparator);
|
||||
} else {
|
||||
if("\r\n".equals(rowSeparator)){
|
||||
scanner = new Scanner(inputStream);
|
||||
scanner.useDelimiter(rowSeparator);
|
||||
}
|
||||
} else if(rowSeparator!=null) {
|
||||
streamBuffer = new StreamBuffer();
|
||||
|
||||
rowBuffer = new ColumnBuffer();
|
||||
@@ -125,7 +127,7 @@ public class RowParser extends DelimitedDataReader {
|
||||
}
|
||||
|
||||
try {
|
||||
if (initialized && mode == 0) {
|
||||
if (initialized && scanner != null) {
|
||||
scanner.close();
|
||||
} else if(initialized) {
|
||||
inputStream.close();
|
||||
@@ -151,10 +153,17 @@ public class RowParser extends DelimitedDataReader {
|
||||
if (skipEmptyRecord) {
|
||||
do {
|
||||
rowRecord = null;
|
||||
if (!scanner.hasNext()) {
|
||||
return false;
|
||||
}
|
||||
rowRecord = scanner.next();
|
||||
if(scanner != null){
|
||||
if (!scanner.hasNext()) {
|
||||
return false;
|
||||
}
|
||||
rowRecord = scanner.next();
|
||||
}else{
|
||||
rowRecord = inputStream.readLine();
|
||||
if (rowRecord == null) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (!rowRecord.equals("")) {
|
||||
currentRecord++;
|
||||
return true;
|
||||
@@ -162,13 +171,23 @@ public class RowParser extends DelimitedDataReader {
|
||||
} while (true);
|
||||
} else {
|
||||
rowRecord = null;
|
||||
if (!scanner.hasNext()) {
|
||||
return false;
|
||||
} else {
|
||||
rowRecord = scanner.next();
|
||||
currentRecord++;
|
||||
return true;
|
||||
}
|
||||
if (scanner != null) {
|
||||
if (!scanner.hasNext()) {
|
||||
return false;
|
||||
} else {
|
||||
rowRecord = scanner.next();
|
||||
currentRecord++;
|
||||
return true;
|
||||
}
|
||||
}else{
|
||||
rowRecord = inputStream.readLine();
|
||||
if (rowRecord == null) {
|
||||
return false;
|
||||
} else {
|
||||
currentRecord++;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (mode == 1) {
|
||||
hasReadRecord = false;
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
jarprocessor.exclude.children=true
|
||||
@@ -0,0 +1 @@
|
||||
jarprocessor.exclude.children=true
|
||||
@@ -36,6 +36,7 @@
|
||||
<PARAMETER
|
||||
NAME="SCHEMA"
|
||||
FIELD="SCHEMA_TYPE"
|
||||
READONLY="true"
|
||||
REQUIRED="true"
|
||||
NUM_ROW="10"
|
||||
>
|
||||
|
||||
@@ -70,6 +70,7 @@ List<Column> stmtStructure = null;
|
||||
Manager manager = null;
|
||||
if(columnList != null && columnList.size() > 0) {
|
||||
stmtStructure = getManager(dbmsId, cid).createColumnList(columnList, useFieldOptions, fieldOptions, addCols);
|
||||
isDynamic = isDynamic && !getManager(dbmsId, cid).isDynamicColumnReplaced();
|
||||
}
|
||||
%>
|
||||
|
||||
@@ -78,7 +79,7 @@ if(("UPDATE").equals(dataAction) || ("INSERT_OR_UPDATE").equals(dataAction) || (
|
||||
int updateKeyCount = 0;
|
||||
if(stmtStructure != null) {
|
||||
for(Column column : stmtStructure) {
|
||||
if(column.isUpdateKey()) {
|
||||
if(column.isUpdateKey() && !column.isDynamic()) {
|
||||
updateKeyCount++;
|
||||
}
|
||||
}
|
||||
@@ -93,7 +94,7 @@ if(("UPDATE").equals(dataAction) || ("INSERT_OR_UPDATE").equals(dataAction) || (
|
||||
int deleteKeyCount = 0;
|
||||
if(stmtStructure != null) {
|
||||
for(Column column : stmtStructure) {
|
||||
if(column.isDeleteKey()) {
|
||||
if(column.isDeleteKey() && !column.isDynamic()) {
|
||||
deleteKeyCount++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,8 +73,6 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
}
|
||||
}
|
||||
|
||||
List<Column> stmtStructure = getManager(dbmsId, cid).createColumnList(columnList, useFieldOptions, fieldOptions, addCols);
|
||||
|
||||
Manager manager = null;
|
||||
boolean isDynamic = false;
|
||||
List<IMetadataTable> metadatas = node.getMetadataList();
|
||||
@@ -83,10 +81,13 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
isDynamic = metadata.isDynamicSchema();
|
||||
}
|
||||
|
||||
List<Column> stmtStructure = getManager(dbmsId, cid).createColumnList(columnList, useFieldOptions, fieldOptions, addCols);
|
||||
isDynamic = isDynamic && !getManager(dbmsId, cid).isDynamicColumnReplaced();
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
List<Column> colStruct = new ArrayList<Column>();
|
||||
for(Column colStmt : stmtStructure) {
|
||||
if(!colStmt.isReplaced() && !colStmt.isAddCol()) {
|
||||
if(!colStmt.isReplaced() && !colStmt.isAddCol() && !colStmt.isDynamic()) {
|
||||
colStruct.add(colStmt);
|
||||
}
|
||||
}
|
||||
@@ -118,10 +119,10 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
IConnection conn = conns_dynamic.get(0);
|
||||
if(!("".equals(insertColName.toString()))) {
|
||||
%>
|
||||
String insert_<%=cid%> = "INSERT INTO " + tableName_<%=cid%> + " (<%=insertColName.toString()%>, "+DynamicUtils.getInsertIntoStmtColumnsList(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>, "<%=dbmsId %>")+") VALUES (<%=insertValueStmt.toString()%>, "+DynamicUtils.getInsertIntoStmtValuesList(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>)+")";
|
||||
String insert_<%=cid%> = "INSERT INTO " + tableName_<%=cid%> + " (<%=insertColName.toString()%>, "+DynamicUtils.getInsertIntoStmtColumnsList(<%=conn.getName()%>.<%=getDynamicColumn()%>, "<%=dbmsId %>")+") VALUES (<%=insertValueStmt.toString()%>, "+DynamicUtils.getInsertIntoStmtValuesList(<%=conn.getName()%>.<%=getDynamicColumn()%>)+")";
|
||||
<% } else {
|
||||
%>
|
||||
String insert_<%=cid%> = "INSERT INTO " + tableName_<%=cid%> + " ("+DynamicUtils.getInsertIntoStmtColumnsList(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>, "<%=dbmsId %>")+") VALUES ("+DynamicUtils.getInsertIntoStmtValuesList(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>)+")";
|
||||
String insert_<%=cid%> = "INSERT INTO " + tableName_<%=cid%> + " ("+DynamicUtils.getInsertIntoStmtColumnsList(<%=conn.getName()%>.<%=getDynamicColumn()%>, "<%=dbmsId %>")+") VALUES ("+DynamicUtils.getInsertIntoStmtValuesList(<%=conn.getName()%>.<%=getDynamicColumn()%>)+")";
|
||||
<%
|
||||
}
|
||||
}
|
||||
@@ -134,10 +135,10 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
IConnection conn = conns_dynamic.get(0);
|
||||
if(!("".equals(updateSetStmt.toString()))) {
|
||||
%>
|
||||
String update_<%=cid%> = "UPDATE " + tableName_<%=cid%> + " SET <%=updateSetStmt.toString()%>, "+DynamicUtils.getUpdateSet(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>, "<%=dbmsId %>")+" WHERE <%=updateWhereStmt.toString()%>";
|
||||
String update_<%=cid%> = "UPDATE " + tableName_<%=cid%> + " SET <%=updateSetStmt.toString()%>, "+DynamicUtils.getUpdateSet(<%=conn.getName()%>.<%=getDynamicColumn()%>, "<%=dbmsId %>")+" WHERE <%=updateWhereStmt.toString()%>";
|
||||
<% } else {
|
||||
%>
|
||||
String update_<%=cid%> = "UPDATE " + tableName_<%=cid%> + " SET "+DynamicUtils.getUpdateSet(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>, "<%=dbmsId %>")+" WHERE <%=updateWhereStmt.toString()%>";
|
||||
String update_<%=cid%> = "UPDATE " + tableName_<%=cid%> + " SET "+DynamicUtils.getUpdateSet(<%=conn.getName()%>.<%=getDynamicColumn()%>, "<%=dbmsId %>")+" WHERE <%=updateWhereStmt.toString()%>";
|
||||
<%
|
||||
}
|
||||
}
|
||||
@@ -150,18 +151,18 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
IConnection conn = conns_dynamic.get(0);
|
||||
if(!("".equals(insertColName.toString()))) {
|
||||
%>
|
||||
String insert_<%=cid%> = "INSERT INTO " + tableName_<%=cid%> + " (<%=insertColName.toString()%>, "+DynamicUtils.getInsertIntoStmtColumnsList(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>, "<%=dbmsId %>")+") VALUES (<%=insertValueStmt.toString()%>, "+DynamicUtils.getInsertIntoStmtValuesList(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>)+")";
|
||||
String insert_<%=cid%> = "INSERT INTO " + tableName_<%=cid%> + " (<%=insertColName.toString()%>, "+DynamicUtils.getInsertIntoStmtColumnsList(<%=conn.getName()%>.<%=getDynamicColumn()%>, "<%=dbmsId %>")+") VALUES (<%=insertValueStmt.toString()%>, "+DynamicUtils.getInsertIntoStmtValuesList(<%=conn.getName()%>.<%=getDynamicColumn()%>)+")";
|
||||
<% } else {
|
||||
%>
|
||||
String insert_<%=cid%> = "INSERT INTO " + tableName_<%=cid%> + " ("+DynamicUtils.getInsertIntoStmtColumnsList(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>, "<%=dbmsId %>")+") VALUES ("+DynamicUtils.getInsertIntoStmtValuesList(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>)+")";
|
||||
String insert_<%=cid%> = "INSERT INTO " + tableName_<%=cid%> + " ("+DynamicUtils.getInsertIntoStmtColumnsList(<%=conn.getName()%>.<%=getDynamicColumn()%>, "<%=dbmsId %>")+") VALUES ("+DynamicUtils.getInsertIntoStmtValuesList(<%=conn.getName()%>.<%=getDynamicColumn()%>)+")";
|
||||
<%
|
||||
}
|
||||
if(!("".equals(updateSetStmt.toString()))) {
|
||||
%>
|
||||
String update_<%=cid%> = "UPDATE " + tableName_<%=cid%> + " SET <%=updateSetStmt.toString()%>, "+DynamicUtils.getUpdateSet(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>, "<%=dbmsId %>")+" WHERE <%=updateWhereStmt.toString()%>";
|
||||
String update_<%=cid%> = "UPDATE " + tableName_<%=cid%> + " SET <%=updateSetStmt.toString()%>, "+DynamicUtils.getUpdateSet(<%=conn.getName()%>.<%=getDynamicColumn()%>, "<%=dbmsId %>")+" WHERE <%=updateWhereStmt.toString()%>";
|
||||
<% } else {
|
||||
%>
|
||||
String update_<%=cid%> = "UPDATE " + tableName_<%=cid%> + " SET "+DynamicUtils.getUpdateSet(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>, "<%=dbmsId %>")+" WHERE <%=updateWhereStmt.toString()%>";
|
||||
String update_<%=cid%> = "UPDATE " + tableName_<%=cid%> + " SET "+DynamicUtils.getUpdateSet(<%=conn.getName()%>.<%=getDynamicColumn()%>, "<%=dbmsId %>")+" WHERE <%=updateWhereStmt.toString()%>";
|
||||
<%
|
||||
}
|
||||
}
|
||||
@@ -176,18 +177,18 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
IConnection conn = conns_dynamic.get(0);
|
||||
if(!("".equals(insertColName.toString()))) {
|
||||
%>
|
||||
String insert_<%=cid%> = "INSERT INTO " + tableName_<%=cid%> + " (<%=insertColName.toString()%>, "+DynamicUtils.getInsertIntoStmtColumnsList(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>, "<%=dbmsId %>")+") VALUES (<%=insertValueStmt.toString()%>, "+DynamicUtils.getInsertIntoStmtValuesList(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>)+")";
|
||||
String insert_<%=cid%> = "INSERT INTO " + tableName_<%=cid%> + " (<%=insertColName.toString()%>, "+DynamicUtils.getInsertIntoStmtColumnsList(<%=conn.getName()%>.<%=getDynamicColumn()%>, "<%=dbmsId %>")+") VALUES (<%=insertValueStmt.toString()%>, "+DynamicUtils.getInsertIntoStmtValuesList(<%=conn.getName()%>.<%=getDynamicColumn()%>)+")";
|
||||
<% } else {
|
||||
%>
|
||||
String insert_<%=cid%> = "INSERT INTO " + tableName_<%=cid%> + " ("+DynamicUtils.getInsertIntoStmtColumnsList(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>, "<%=dbmsId %>")+") VALUES ("+DynamicUtils.getInsertIntoStmtValuesList(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>)+")";
|
||||
String insert_<%=cid%> = "INSERT INTO " + tableName_<%=cid%> + " ("+DynamicUtils.getInsertIntoStmtColumnsList(<%=conn.getName()%>.<%=getDynamicColumn()%>, "<%=dbmsId %>")+") VALUES ("+DynamicUtils.getInsertIntoStmtValuesList(<%=conn.getName()%>.<%=getDynamicColumn()%>)+")";
|
||||
<%
|
||||
}
|
||||
if(!("".equals(updateSetStmt.toString()))) {
|
||||
%>
|
||||
String update_<%=cid%> = "UPDATE " + tableName_<%=cid%> + " SET <%=updateSetStmt.toString()%>, "+DynamicUtils.getUpdateSet(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>, "<%=dbmsId %>")+" WHERE <%=updateWhereStmt.toString()%>";
|
||||
String update_<%=cid%> = "UPDATE " + tableName_<%=cid%> + " SET <%=updateSetStmt.toString()%>, "+DynamicUtils.getUpdateSet(<%=conn.getName()%>.<%=getDynamicColumn()%>, "<%=dbmsId %>")+" WHERE <%=updateWhereStmt.toString()%>";
|
||||
<% } else {
|
||||
%>
|
||||
String update_<%=cid%> = "UPDATE " + tableName_<%=cid%> + " SET "+DynamicUtils.getUpdateSet(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>, "<%=dbmsId %>")+" WHERE <%=updateWhereStmt.toString()%>";
|
||||
String update_<%=cid%> = "UPDATE " + tableName_<%=cid%> + " SET "+DynamicUtils.getUpdateSet(<%=conn.getName()%>.<%=getDynamicColumn()%>, "<%=dbmsId %>")+" WHERE <%=updateWhereStmt.toString()%>";
|
||||
<%
|
||||
}
|
||||
}
|
||||
@@ -261,7 +262,7 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
}
|
||||
}
|
||||
if(isDynamic) {
|
||||
Column dynamicColumn = getColumn(columnList.get(columnList.size()-1));
|
||||
Column dynamicColumn = getColumn(getDynamicColumn());
|
||||
String typeToGenerate = JavaTypesManager.getTypeToGenerate(dynamicColumn.getColumn().getTalendType(), dynamicColumn.getColumn().isNullable());
|
||||
if("Dynamic".equals(typeToGenerate)) {
|
||||
%>
|
||||
@@ -289,8 +290,8 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
}else {
|
||||
%>
|
||||
try {
|
||||
insertedCount_<%=cid%> = insertedCount_<%=cid%> + pstmt_<%=cid %>.executeUpdate();
|
||||
nb_line_<%=cid%>++;
|
||||
insertedCount_<%=cid%> = insertedCount_<%=cid%> + pstmt_<%=cid %>.executeUpdate();
|
||||
} catch(java.sql.SQLException e) {
|
||||
whetherReject_<%=cid%> = true;
|
||||
<%
|
||||
@@ -310,6 +311,7 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
}
|
||||
%>
|
||||
rejectedCount_<%=cid%> = rejectedCount_<%=cid%> + 1;
|
||||
<%=rejectConnName%>.errorCode = ((java.sql.SQLException)e).getSQLState();
|
||||
<%=rejectConnName%>.errorMessage = e.getMessage() + " - Line: " + tos_count_<%=node.getUniqueName() %>;
|
||||
<%
|
||||
} else {
|
||||
@@ -339,7 +341,7 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
}
|
||||
}
|
||||
if(isDynamic) {
|
||||
Column dynamicColumn = getColumn(columnList.get(columnList.size()-1));
|
||||
Column dynamicColumn = getColumn(getDynamicColumn());
|
||||
String typeToGenerate = JavaTypesManager.getTypeToGenerate(dynamicColumn.getColumn().getTalendType(), dynamicColumn.getColumn().isNullable());
|
||||
if("Dynamic".equals(typeToGenerate)) {
|
||||
%>
|
||||
@@ -395,8 +397,8 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
}else {
|
||||
%>
|
||||
try {
|
||||
updatedCount_<%=cid%> = updatedCount_<%=cid%> + pstmt_<%=cid %>.executeUpdate();
|
||||
nb_line_<%=cid%>++;
|
||||
updatedCount_<%=cid%> = updatedCount_<%=cid%> + pstmt_<%=cid %>.executeUpdate();
|
||||
} catch(java.sql.SQLException e) {
|
||||
whetherReject_<%=cid%> = true;
|
||||
<%
|
||||
@@ -416,6 +418,7 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
}
|
||||
%>
|
||||
rejectedCount_<%=cid%> = rejectedCount_<%=cid%> + 1;
|
||||
<%=rejectConnName%>.errorCode = ((java.sql.SQLException)e).getSQLState();
|
||||
<%=rejectConnName%>.errorMessage = e.getMessage() + " - Line: " + tos_count_<%=node.getUniqueName() %>;
|
||||
<%
|
||||
} else {
|
||||
@@ -471,7 +474,7 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
}
|
||||
}
|
||||
if(isDynamic) {
|
||||
Column dynamicColumn = getColumn(columnList.get(columnList.size()-1));
|
||||
Column dynamicColumn = getColumn(getDynamicColumn());
|
||||
String typeToGenerate = JavaTypesManager.getTypeToGenerate(dynamicColumn.getColumn().getTalendType(), dynamicColumn.getColumn().isNullable());
|
||||
if("Dynamic".equals(typeToGenerate)) {
|
||||
%>
|
||||
@@ -533,6 +536,7 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
}
|
||||
%>
|
||||
rejectedCount_<%=cid%> = rejectedCount_<%=cid%> + 1;
|
||||
<%=rejectConnName%>.errorCode = ((java.sql.SQLException)e).getSQLState();
|
||||
<%=rejectConnName%>.errorMessage = e.getMessage() + " - Line: " + tos_count_<%=node.getUniqueName() %>;
|
||||
<%
|
||||
} else {
|
||||
@@ -562,7 +566,7 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
}
|
||||
}
|
||||
if(isDynamic) {
|
||||
Column dynamicColumn = getColumn(columnList.get(columnList.size()-1));
|
||||
Column dynamicColumn = getColumn(getDynamicColumn());
|
||||
String typeToGenerate = JavaTypesManager.getTypeToGenerate(dynamicColumn.getColumn().getTalendType(), dynamicColumn.getColumn().isNullable());
|
||||
if("Dynamic".equals(typeToGenerate)) {
|
||||
%>
|
||||
@@ -596,6 +600,7 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
}
|
||||
%>
|
||||
rejectedCount_<%=cid%> = rejectedCount_<%=cid%> + 1;
|
||||
<%=rejectConnName%>.errorCode = ((java.sql.SQLException)e).getSQLState();
|
||||
<%=rejectConnName%>.errorMessage = e.getMessage() + " - Line: " + tos_count_<%=node.getUniqueName() %>;
|
||||
<%
|
||||
} else {
|
||||
@@ -631,7 +636,7 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
}
|
||||
}
|
||||
if(isDynamic) {
|
||||
Column dynamicColumn = getColumn(columnList.get(columnList.size()-1));
|
||||
Column dynamicColumn = getColumn(getDynamicColumn());
|
||||
String typeToGenerate = JavaTypesManager.getTypeToGenerate(dynamicColumn.getColumn().getTalendType(), dynamicColumn.getColumn().isNullable());
|
||||
if("Dynamic".equals(typeToGenerate)) {
|
||||
%>
|
||||
@@ -695,6 +700,7 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
}
|
||||
%>
|
||||
rejectedCount_<%=cid%> = rejectedCount_<%=cid%> + 1;
|
||||
<%=rejectConnName%>.errorCode = ((java.sql.SQLException)e).getSQLState();
|
||||
<%=rejectConnName%>.errorMessage = e.getMessage() + " - Line: " + tos_count_<%=node.getUniqueName() %>;
|
||||
<%
|
||||
} else {
|
||||
@@ -730,7 +736,7 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
}
|
||||
}
|
||||
if(isDynamic) {
|
||||
Column dynamicColumn = getColumn(columnList.get(columnList.size()-1));
|
||||
Column dynamicColumn = getColumn(getDynamicColumn());
|
||||
String typeToGenerate = JavaTypesManager.getTypeToGenerate(dynamicColumn.getColumn().getTalendType(), dynamicColumn.getColumn().isNullable());
|
||||
if("Dynamic".equals(typeToGenerate)) {
|
||||
%>
|
||||
@@ -764,6 +770,7 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
}
|
||||
%>
|
||||
rejectedCount_<%=cid%> = rejectedCount_<%=cid%> + 1;
|
||||
<%=rejectConnName%>.errorCode = ((java.sql.SQLException)e).getSQLState();
|
||||
<%=rejectConnName%>.errorMessage = e.getMessage() + " - Line: " + tos_count_<%=node.getUniqueName() %>;
|
||||
<%
|
||||
} else {
|
||||
@@ -845,6 +852,7 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
}
|
||||
%>
|
||||
rejectedCount_<%=cid%> = rejectedCount_<%=cid%> + 1;
|
||||
<%=rejectConnName%>.errorCode = ((java.sql.SQLException)e).getSQLState();
|
||||
<%=rejectConnName%>.errorMessage = e.getMessage() + " - Line: " + tos_count_<%=node.getUniqueName() %>;
|
||||
<%
|
||||
} else {
|
||||
|
||||
@@ -153,6 +153,7 @@ try {
|
||||
}
|
||||
}
|
||||
%>
|
||||
<%=rejectConnName%>.errorCode = ((java.sql.SQLException)e).getSQLState();
|
||||
<%=rejectConnName%>.errorMessage = e.getMessage() + " - Line: " + tos_count_<%=node.getUniqueName() %>;
|
||||
<%
|
||||
} else {
|
||||
|
||||
@@ -88,6 +88,9 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
Manager manager = null;
|
||||
if(columnList != null && columnList.size() > 0) {
|
||||
stmtStructure = getManager(dbmsId, cid).createColumnList(columnList, false, null, null);
|
||||
}
|
||||
if((columnList != null && columnList.size() > 0) || "CLEAR".equals(tableAction)){
|
||||
|
||||
%>
|
||||
<%@ include file="../templates/_tableActionForBulk.javajet"%>
|
||||
<%
|
||||
|
||||
@@ -68,6 +68,11 @@
|
||||
</ITEMS>
|
||||
</PARAMETER>
|
||||
|
||||
<PARAMETER NAME="TYPE" FIELD="TEXT" NUM_ROW="20" SHOW="false"
|
||||
REPOSITORY_VALUE="TYPE">
|
||||
<DEFAULT>Access</DEFAULT>
|
||||
</PARAMETER>
|
||||
|
||||
|
||||
<PARAMETER
|
||||
NAME="DBNAME"
|
||||
|
||||
@@ -48,6 +48,7 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
|
||||
String dbproperties = ElementParameterParser.getValue(node, "__PROPERTIES__");
|
||||
|
||||
boolean isParallelize ="true".equalsIgnoreCase(ElementParameterParser.getValue(node, "__PARALLELIZE__"));
|
||||
%>
|
||||
|
||||
<%
|
||||
@@ -167,7 +168,7 @@ if(!useExistingConnection) {
|
||||
|
||||
<%
|
||||
if(columnList != null && columnList.size()>0) {
|
||||
if(!("NONE").equals(tableAction)) {
|
||||
if(!isParallelize && !("NONE").equals(tableAction)) {
|
||||
Manager manager = getManager(dbmsId, cid);
|
||||
if(("DROP_CREATE").equals(tableAction)) {
|
||||
%>
|
||||
|
||||
@@ -157,6 +157,7 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
<%
|
||||
}
|
||||
%>
|
||||
<%=rejectConnName%>.errorCode = ((java.sql.SQLException)e).getSQLState();
|
||||
<%=rejectConnName%>.errorMessage = e.getMessage() + " - Line: " + tos_count_<%=node.getUniqueName() %>;
|
||||
<%
|
||||
} else {
|
||||
@@ -242,6 +243,7 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
<%
|
||||
}
|
||||
%>
|
||||
<%=rejectConnName%>.errorCode = ((java.sql.SQLException)e).getSQLState();
|
||||
<%=rejectConnName%>.errorMessage = e.getMessage() + " - Line: " + tos_count_<%=node.getUniqueName() %>;
|
||||
<%
|
||||
} else {
|
||||
@@ -353,6 +355,7 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
<%
|
||||
}
|
||||
%>
|
||||
<%=rejectConnName%>.errorCode = ((java.sql.SQLException)e).getSQLState();
|
||||
<%=rejectConnName%>.errorMessage = e.getMessage() + " - Line: " + tos_count_<%=node.getUniqueName() %>;
|
||||
<%
|
||||
} else {
|
||||
@@ -406,6 +409,7 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
<%
|
||||
}
|
||||
%>
|
||||
<%=rejectConnName%>.errorCode = ((java.sql.SQLException)e).getSQLState();
|
||||
<%=rejectConnName%>.errorMessage = e.getMessage() + " - Line: " + tos_count_<%=node.getUniqueName() %>;
|
||||
<%
|
||||
} else {
|
||||
@@ -496,6 +500,7 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
<%
|
||||
}
|
||||
%>
|
||||
<%=rejectConnName%>.errorCode = ((java.sql.SQLException)e).getSQLState();
|
||||
<%=rejectConnName%>.errorMessage = e.getMessage() + " - Line: " + tos_count_<%=node.getUniqueName() %>;
|
||||
<%
|
||||
} else {
|
||||
@@ -554,6 +559,7 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
<%
|
||||
}
|
||||
%>
|
||||
<%=rejectConnName%>.errorCode = ((java.sql.SQLException)e).getSQLState();
|
||||
<%=rejectConnName%>.errorMessage = e.getMessage() + " - Line: " + tos_count_<%=node.getUniqueName() %>;
|
||||
<%
|
||||
} else {
|
||||
@@ -625,6 +631,7 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
<%
|
||||
}
|
||||
%>
|
||||
<%=rejectConnName%>.errorCode = ((java.sql.SQLException)e).getSQLState();
|
||||
<%=rejectConnName%>.errorMessage = e.getMessage() + " - Line: " + tos_count_<%=node.getUniqueName() %>;
|
||||
<%
|
||||
} else {
|
||||
|
||||
@@ -71,10 +71,15 @@ if ((metadatas!=null)&&(metadatas.size()>0)) {
|
||||
}
|
||||
%>
|
||||
|
||||
java.io.File file_<%=cid%>=new java.io.File(<%=filename %>);
|
||||
final java.io.BufferedWriter out<%=cid %> = new java.io.BufferedWriter(new java.io.OutputStreamWriter(
|
||||
new java.io.FileOutputStream(fileName_<%=cid%>, <%= isAppend%>),<%= encoding%>));
|
||||
new java.io.FileOutputStream(file_<%=cid%>, <%= isAppend%>),<%= encoding%>));
|
||||
resourceMap.put("out<%=cid%>", out<%=cid%>);
|
||||
<%
|
||||
if(isIncludeHeader){
|
||||
%>
|
||||
if(file_<%=cid%>.length()==0){
|
||||
<%
|
||||
if(isIncludeHeader&&!isAppend){
|
||||
List<IMetadataColumn> columns = metadata.getListColumns();
|
||||
int sizeColumns = columns.size();
|
||||
for (int i = 0; i < sizeColumns; i++) {
|
||||
@@ -88,6 +93,7 @@ if ((metadatas!=null)&&(metadatas.size()>0)) {
|
||||
}%>
|
||||
out<%=cid %>.write(OUT_DELIM_ROWSEP_<%=cid %>);
|
||||
out<%=cid%>.flush();
|
||||
}
|
||||
<%
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,4 +10,5 @@
|
||||
String cid = node.getUniqueName();
|
||||
%>
|
||||
out<%=cid %>.close();
|
||||
resourceMap.put("finish_<%=cid%>", true);
|
||||
globalMap.put("<%=cid %>_NB_LINE",nb_line_<%=cid %>);
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
<%@ jet
|
||||
imports="
|
||||
org.talend.core.model.process.INode
|
||||
org.talend.designer.codegen.config.CodeGeneratorArgument
|
||||
"
|
||||
%>
|
||||
<%
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode)codeGenArgument.getArgument();
|
||||
String cid = node.getUniqueName();
|
||||
%>
|
||||
if(resourceMap.get("finish_<%=cid%>") == null){
|
||||
if(resourceMap.get("out<%=cid%>") != null){
|
||||
((java.io.BufferedWriter)resourceMap.get("out<%=cid%>")).close();
|
||||
}
|
||||
}
|
||||
@@ -68,6 +68,10 @@
|
||||
</ITEMS>
|
||||
</PARAMETER>
|
||||
|
||||
<PARAMETER NAME="TYPE" FIELD="TEXT" NUM_ROW="20" SHOW="false"
|
||||
REPOSITORY_VALUE="TYPE">
|
||||
<DEFAULT>Access</DEFAULT>
|
||||
</PARAMETER>
|
||||
|
||||
<PARAMETER
|
||||
NAME="DBNAME"
|
||||
@@ -231,6 +235,7 @@
|
||||
|
||||
<TEMPLATE_PARAM SOURCE="self.DB_VERSION" TARGET="tABE.DB_VERSION" />
|
||||
<TEMPLATE_PARAM SOURCE="self.DBNAME" TARGET="tABE.DBNAME" />
|
||||
<TEMPLATE_PARAM SOURCE="self.TYPE" TARGET="tABE.TYPE" />
|
||||
<TEMPLATE_PARAM SOURCE="self.USER" TARGET="tABE.USER" />
|
||||
<TEMPLATE_PARAM SOURCE="self.PASS" TARGET="tABE.PASS" />
|
||||
<TEMPLATE_PARAM SOURCE="self.TABLE_ACTION" TARGET="tABE.TABLE_ACTION" />
|
||||
|
||||
@@ -44,6 +44,11 @@
|
||||
</ITEMS>
|
||||
</PARAMETER>
|
||||
|
||||
<PARAMETER NAME="TYPE" FIELD="TEXT" NUM_ROW="20" SHOW="false"
|
||||
REPOSITORY_VALUE="TYPE">
|
||||
<DEFAULT>Access</DEFAULT>
|
||||
</PARAMETER>
|
||||
|
||||
|
||||
<PARAMETER NAME="DBNAME" FIELD="FILE" NUM_ROW="20"
|
||||
REQUIRED="true" REPOSITORY_VALUE="FILE" SHOW_IF="USE_EXISTING_CONNECTION == 'false'">
|
||||
|
||||
@@ -157,6 +157,7 @@ whetherReject_<%=cid%> = false;
|
||||
}
|
||||
}
|
||||
%>
|
||||
<%=rejectConnName%>.errorCode = ((java.sql.SQLException)e).getSQLState();
|
||||
<%=rejectConnName%>.errorMessage = e.getMessage() + " - Line: " + tos_count_<%=node.getUniqueName() %>;
|
||||
<%
|
||||
} else {
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
<PARAMETERS>
|
||||
|
||||
<PARAMETER NAME="SCHEMA" FIELD="SCHEMA_TYPE" REQUIRED="true"
|
||||
<PARAMETER NAME="SCHEMA" FIELD="SCHEMA_TYPE" READONLY="true" REQUIRED="true"
|
||||
NUM_ROW="10">
|
||||
<TABLE READONLY="true">
|
||||
<COLUMN NAME="CRC" TYPE="id_Long" LENGTH="255"
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
<PARAMETER
|
||||
NAME="SCHEMA"
|
||||
FIELD="SCHEMA_TYPE"
|
||||
READONLY="true"
|
||||
REQUIRED="true"
|
||||
NUM_ROW="10"
|
||||
>
|
||||
|
||||
@@ -159,20 +159,33 @@ class GenerateToolByDom4j{
|
||||
}
|
||||
if(isAppend){
|
||||
%>
|
||||
int app_size_<%=cid %>=<%=parentName%>_<%=cid%>.elements("<%=node.name%>").size();
|
||||
List currentList_<%=cid %> = <%=parentName%>_<%=cid%>.elements("<%=node.name%>");
|
||||
int app_size_<%=cid %> = currentList_<%=cid %>.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{
|
||||
orders_<%=cid %>[<%=currPos %>] =1+ <%=parentName%>_<%=cid%>.elements().indexOf(currentList_<%=cid %>.get(app_size_<%=cid %>-1));
|
||||
}else{//when the group or loop element appear first time
|
||||
<%
|
||||
if(currPos==0){
|
||||
List<XMLNode> nextSiblings = node.getNextSiblings();
|
||||
%>
|
||||
orders_<%=cid %>[<%=currPos %>] = <%=parentName%>_<%=cid%>.elements().size();
|
||||
List allList_<%=cid %> = <%=parentName%>_<%=cid%>.elements();
|
||||
//append tail as default action
|
||||
orders_<%=cid %>[<%=currPos %>] = allList_<%=cid%>.size();
|
||||
<%
|
||||
}else{
|
||||
if(nextSiblings.size() > 0) {
|
||||
%>
|
||||
orders_<%=cid %>[<%=currPos %>] = <%=node.getNodeInsertIndex() %>;
|
||||
if(orders_<%=cid %>[<%=currPos %>] == 0 && <%=parentName%>_<%=cid%>.elements().size() != 0 && !bl_<%=cid%>) {
|
||||
orders_<%=cid %>[<%=currPos %>] = <%=parentName%>_<%=cid%>.elements().size();
|
||||
List siblingList_<%=cid %> = null;
|
||||
boolean findInsertPosition_<%=cid%> = false;
|
||||
<%
|
||||
}
|
||||
|
||||
for(XMLNode sibling : nextSiblings) {
|
||||
%>
|
||||
if(!findInsertPosition_<%=cid%> && allList_<%=cid%>.size()!=0) {
|
||||
siblingList_<%=cid%> = <%=parentName%>_<%=cid%>.elements("<%=sibling.name%>");
|
||||
if(siblingList_<%=cid %>.size() > 0) {
|
||||
findInsertPosition_<%=cid%> = true;
|
||||
orders_<%=cid %>[<%=currPos %>] = allList_<%=cid %>.indexOf(siblingList_<%=cid %>.get(0));
|
||||
}
|
||||
}
|
||||
<%
|
||||
}
|
||||
|
||||
@@ -149,7 +149,6 @@ String cid = node.getUniqueName();
|
||||
String cid_original = cid;
|
||||
cid = cid_original.replace("tAdvancedFileOutputXML","tAFOX");
|
||||
|
||||
String filename = ElementParameterParser.getValue(node, "__FILENAME__");
|
||||
boolean isDeleteEmptyFile = ("true").equals(ElementParameterParser.getValue(node, "__DELETE_EMPTYFILE__"));
|
||||
boolean isCompact = ("true").equals(ElementParameterParser.getValue(node, "__PRETTY_COMPACT__"));
|
||||
|
||||
@@ -331,6 +330,6 @@ globalMap.put("<%=cid_original %>_NB_LINE",nb_line_<%=cid %>);
|
||||
|
||||
<%if(!useStream && isDeleteEmptyFile){%>
|
||||
if((nb_line_<%=cid %> == 0) && !alreadyExistsFile_<%=cid%>){
|
||||
new java.io.File(<%=filename %>).delete();
|
||||
createFile<%=cid%>.delete();
|
||||
}
|
||||
<%}%>
|
||||
|
||||
@@ -78,6 +78,18 @@ public class CLASS {
|
||||
return insertIndex;
|
||||
}
|
||||
|
||||
public List<XMLNode> getNextSiblings(){
|
||||
List<XMLNode> result = new ArrayList<XMLNode>();
|
||||
if(parent!=null && parent.elements!=null){
|
||||
for(XMLNode tmpNode: parent.elements){
|
||||
if(order < tmpNode.order){
|
||||
result.add(tmpNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public int getCurrGroupPos(){
|
||||
int currPos =0;
|
||||
if(5==(special & 5)){//group and loop main node
|
||||
|
||||
@@ -290,8 +290,7 @@ if(column_gr.length > 0){//while loop
|
||||
%>
|
||||
while(true){
|
||||
<% for(int i = 0; i < column_gr.length; i++){
|
||||
JavaType javaType = JavaTypesManager.getJavaTypeFromId(column_gr[i][0].getTalendType());
|
||||
if(JavaTypesManager.isNumberType(javaType) && javaType != JavaTypesManager.BIGDECIMAL && !column_gr[i][0].isNullable()){
|
||||
if(JavaTypesManager.isJavaPrimitiveType(column_gr[i][0].getTalendType(),column_gr[i][0].isNullable())){
|
||||
%>
|
||||
if(group_<%=column_gr[i][0].getLabel() %>_<%=cid %> != <%=connName %>.<%=column_gr[i][0].getLabel() %>){
|
||||
sameGroup_<%=cid %> = false;
|
||||
|
||||
@@ -96,6 +96,7 @@ List<Column> stmtStructure = null;
|
||||
Manager manager = null;
|
||||
if(columnList != null && columnList.size() > 0) {
|
||||
stmtStructure = getManager(dbmsId, cid).createColumnList(columnList, useFieldOptions, fieldOptions, addCols);
|
||||
isDynamic = isDynamic && !getManager(dbmsId, cid).isDynamicColumnReplaced();
|
||||
}
|
||||
%>
|
||||
|
||||
@@ -104,7 +105,7 @@ if(("UPDATE").equals(dataAction) || ("INSERT_OR_UPDATE").equals(dataAction) || (
|
||||
int updateKeyCount = 0;
|
||||
if(stmtStructure != null) {
|
||||
for(Column column : stmtStructure) {
|
||||
if(column.isUpdateKey()) {
|
||||
if(column.isUpdateKey() && !column.isDynamic()) {
|
||||
updateKeyCount++;
|
||||
}
|
||||
}
|
||||
@@ -119,7 +120,7 @@ if(("UPDATE").equals(dataAction) || ("INSERT_OR_UPDATE").equals(dataAction) || (
|
||||
int deleteKeyCount = 0;
|
||||
if(stmtStructure != null) {
|
||||
for(Column column : stmtStructure) {
|
||||
if(column.isDeleteKey()) {
|
||||
if(column.isDeleteKey() && !column.isDynamic()) {
|
||||
deleteKeyCount++;
|
||||
}
|
||||
}
|
||||
@@ -481,7 +482,7 @@ if(isDynamic) {
|
||||
class BufferLine_<%=cid%> {
|
||||
<%
|
||||
for(Column column : stmtStructure) {
|
||||
if(!column.isReplaced() && !column.isAddCol() && column.isInsertable()) {
|
||||
if(!column.isReplaced() && !column.isAddCol() && column.isInsertable() && !column.isDynamic()) {
|
||||
String typeToGenerate = JavaTypesManager.getTypeToGenerate(column.getColumn().getTalendType(), column.getColumn().isNullable());
|
||||
%>
|
||||
<%=typeToGenerate%> <%=column.getName()%>;
|
||||
@@ -489,7 +490,7 @@ if(isDynamic) {
|
||||
}
|
||||
}
|
||||
if(isDynamic) {
|
||||
Column dynamicColumn = getColumn(columnList.get(columnList.size()-1));
|
||||
Column dynamicColumn = getColumn(getDynamicColumn());
|
||||
String typeToGenerate = JavaTypesManager.getTypeToGenerate(dynamicColumn.getColumn().getTalendType(), dynamicColumn.getColumn().isNullable());
|
||||
if("Dynamic".equals(typeToGenerate)) {
|
||||
%>
|
||||
@@ -503,7 +504,7 @@ if(isDynamic) {
|
||||
<%
|
||||
int count = 0;
|
||||
for(Column column : stmtStructure) {
|
||||
if(!column.isReplaced() && !column.isAddCol() && column.isInsertable()) {
|
||||
if(!column.isReplaced() && !column.isAddCol() && column.isInsertable() && !column.isDynamic()) {
|
||||
if(count != 0) {
|
||||
%>
|
||||
,
|
||||
@@ -517,7 +518,7 @@ if(isDynamic) {
|
||||
}
|
||||
}
|
||||
if(isDynamic) {
|
||||
Column dynamicColumn = getColumn(columnList.get(columnList.size()-1));
|
||||
Column dynamicColumn = getColumn(getDynamicColumn());
|
||||
String typeToGenerate = JavaTypesManager.getTypeToGenerate(dynamicColumn.getColumn().getTalendType(), dynamicColumn.getColumn().isNullable());
|
||||
if("Dynamic".equals(typeToGenerate)) {
|
||||
%>
|
||||
@@ -530,14 +531,14 @@ if(isDynamic) {
|
||||
){
|
||||
<%
|
||||
for(Column column : stmtStructure) {
|
||||
if(!column.isReplaced() && !column.isAddCol() && column.isInsertable()) {
|
||||
if(!column.isReplaced() && !column.isAddCol() && column.isInsertable() && !column.isDynamic()) {
|
||||
%>
|
||||
this.<%=column.getName()%> = <%=column.getName()%>;
|
||||
<%
|
||||
}
|
||||
}
|
||||
if(isDynamic) {
|
||||
Column dynamicColumn = getColumn(columnList.get(columnList.size()-1));
|
||||
Column dynamicColumn = getColumn(getDynamicColumn());
|
||||
String typeToGenerate = JavaTypesManager.getTypeToGenerate(dynamicColumn.getColumn().getTalendType(), dynamicColumn.getColumn().isNullable());
|
||||
if("Dynamic".equals(typeToGenerate)) {
|
||||
%>
|
||||
|
||||
@@ -77,8 +77,7 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
IConnection conn = conns.get(0);
|
||||
incomingConnName = conn.getName();
|
||||
}
|
||||
List<Column> stmtStructure = getManager(dbmsId, cid).createColumnList(columnList, useFieldOptions, fieldOptions, addCols);
|
||||
|
||||
|
||||
boolean isDynamic = false;
|
||||
List<IMetadataTable> metadatas = node.getMetadataList();
|
||||
if ((metadatas!=null)&&(metadatas.size()>0)) {
|
||||
@@ -86,6 +85,9 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
isDynamic = metadata.isDynamicSchema();
|
||||
}
|
||||
|
||||
List<Column> stmtStructure = getManager(dbmsId, cid).createColumnList(columnList, useFieldOptions, fieldOptions, addCols);
|
||||
isDynamic = isDynamic && !getManager(dbmsId, cid).isDynamicColumnReplaced();
|
||||
|
||||
String dbVersion = "" ;
|
||||
String connection = ElementParameterParser.getValue(node,"__CONNECTION__");
|
||||
if(("true").equals(useExistingConn)) {
|
||||
@@ -312,7 +314,7 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
<%
|
||||
}
|
||||
for(Column column : stmtStructure) {
|
||||
if(!column.isReplaced() && !column.isAddCol() && column.isInsertable()) {
|
||||
if(!column.isReplaced() && !column.isAddCol() && column.isInsertable() && !column.isDynamic()) {
|
||||
String typeToGenerate = JavaTypesManager.getTypeToGenerate(column.getColumn().getTalendType(), column.getColumn().isNullable());
|
||||
eiOperation.generateSetStmt(typeToGenerate, column, cid);
|
||||
%>
|
||||
@@ -321,7 +323,7 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
}
|
||||
}
|
||||
if(isDynamic) {
|
||||
Column dynamicColumn = getColumn(columnList.get(columnList.size()-1));
|
||||
Column dynamicColumn = getColumn(getDynamicColumn());
|
||||
String typeToGenerate = JavaTypesManager.getTypeToGenerate(dynamicColumn.getColumn().getTalendType(), dynamicColumn.getColumn().isNullable());
|
||||
if("Dynamic".equals(typeToGenerate)) {
|
||||
%>
|
||||
|
||||
@@ -89,8 +89,6 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
}
|
||||
}
|
||||
|
||||
List<Column> stmtStructure = getManager(dbmsId, cid).createColumnList(columnList, useFieldOptions, fieldOptions, addCols);
|
||||
|
||||
Manager manager = null;
|
||||
boolean isDynamic = false;
|
||||
List<IMetadataTable> metadatas = node.getMetadataList();
|
||||
@@ -99,6 +97,9 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
isDynamic = metadata.isDynamicSchema();
|
||||
}
|
||||
|
||||
List<Column> stmtStructure = getManager(dbmsId, cid).createColumnList(columnList, useFieldOptions, fieldOptions, addCols);
|
||||
isDynamic = isDynamic && !getManager(dbmsId, cid).isDynamicColumnReplaced();
|
||||
|
||||
if(isDynamic) {
|
||||
%>
|
||||
if(nb_line_<%=cid%>==0) {
|
||||
@@ -190,10 +191,10 @@ if(columnList != null && columnList.size() > 0) {
|
||||
|
||||
if(!("".equals(insertColName.toString()))) {
|
||||
%>
|
||||
String insert_<%=cid%> = "INSERT INTO `" + tableName_<%=cid%> + "` (<%=insertColName.toString()%>, "+DynamicUtils.getInsertIntoStmtColumnsList(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>, "<%=dbmsId %>")+") VALUES (<%=insertValueStmt.toString()%>, "+DynamicUtils.getInsertIntoStmtValuesList(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>)+")";
|
||||
String insert_<%=cid%> = "INSERT INTO `" + tableName_<%=cid%> + "` (<%=insertColName.toString()%>, "+DynamicUtils.getInsertIntoStmtColumnsList(<%=conn.getName()%>.<%=getDynamicColumn()%>, "<%=dbmsId %>")+") VALUES (<%=insertValueStmt.toString()%>, "+DynamicUtils.getInsertIntoStmtValuesList(<%=conn.getName()%>.<%=getDynamicColumn()%>)+")";
|
||||
<% } else {
|
||||
%>
|
||||
String insert_<%=cid%> = "INSERT INTO `" + tableName_<%=cid%> + "` ("+DynamicUtils.getInsertIntoStmtColumnsList(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>, "<%=dbmsId %>")+") VALUES ("+DynamicUtils.getInsertIntoStmtValuesList(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>)+")";
|
||||
String insert_<%=cid%> = "INSERT INTO `" + tableName_<%=cid%> + "` ("+DynamicUtils.getInsertIntoStmtColumnsList(<%=conn.getName()%>.<%=getDynamicColumn()%>, "<%=dbmsId %>")+") VALUES ("+DynamicUtils.getInsertIntoStmtValuesList(<%=conn.getName()%>.<%=getDynamicColumn()%>)+")";
|
||||
<%
|
||||
}
|
||||
}
|
||||
@@ -243,7 +244,7 @@ if(columnList != null && columnList.size() > 0) {
|
||||
if(conns_dynamic!=null && conns_dynamic.size()>0){
|
||||
IConnection conn = conns_dynamic.get(0);
|
||||
%>
|
||||
extendInsertValueStmt_<%=cid%>.append("(<%=insertValueStmt.toString()%>,"+DynamicUtils.getInsertIntoStmtValuesList(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>)+")");
|
||||
extendInsertValueStmt_<%=cid%>.append("(<%=insertValueStmt.toString()%>,"+DynamicUtils.getInsertIntoStmtValuesList(<%=conn.getName()%>.<%=getDynamicColumn()%>)+")");
|
||||
<%
|
||||
}
|
||||
} else {
|
||||
@@ -260,10 +261,10 @@ if(columnList != null && columnList.size() > 0) {
|
||||
IConnection conn = conns_dynamic.get(0);
|
||||
if(!("".equals(insertColName.toString()))) {
|
||||
%>
|
||||
insert_<%=cid%> = "INSERT INTO `" + <%=table%> + "` (<%=insertColName.toString()%>, "+DynamicUtils.getInsertIntoStmtColumnsList(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>, "<%=dbmsId %>")+") VALUES " + extendInsertValueStmt_<%=cid%>.toString();
|
||||
insert_<%=cid%> = "INSERT INTO `" + <%=table%> + "` (<%=insertColName.toString()%>, "+DynamicUtils.getInsertIntoStmtColumnsList(<%=conn.getName()%>.<%=getDynamicColumn()%>, "<%=dbmsId %>")+") VALUES " + extendInsertValueStmt_<%=cid%>.toString();
|
||||
<% } else {
|
||||
%>
|
||||
insert_<%=cid%> = "INSERT INTO `" + <%=table%> + "` ("+DynamicUtils.getInsertIntoStmtColumnsList(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>, "<%=dbmsId %>")+") VALUES " + extendInsertValueStmt_<%=cid%>.toString();
|
||||
insert_<%=cid%> = "INSERT INTO `" + <%=table%> + "` ("+DynamicUtils.getInsertIntoStmtColumnsList(<%=conn.getName()%>.<%=getDynamicColumn()%>, "<%=dbmsId %>")+") VALUES " + extendInsertValueStmt_<%=cid%>.toString();
|
||||
<%
|
||||
}
|
||||
if (supportDuplicateUpdate) {
|
||||
@@ -278,13 +279,13 @@ if(columnList != null && columnList.size() > 0) {
|
||||
if(!("".equals(insertColName.toString()))) {
|
||||
%>
|
||||
|
||||
insertColName<%=cid%> = "<%=insertColName.toString()%>, "+DynamicUtils.getInsertIntoStmtColumnsList(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>, "<%=dbmsId %>");
|
||||
insertColValue<%=cid%> = "<%=insertValueStmt.toString()%>, "+DynamicUtils.getInsertIntoStmtValuesList(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>);
|
||||
insertColName<%=cid%> = "<%=insertColName.toString()%>, "+DynamicUtils.getInsertIntoStmtColumnsList(<%=conn.getName()%>.<%=getDynamicColumn()%>, "<%=dbmsId %>");
|
||||
insertColValue<%=cid%> = "<%=insertValueStmt.toString()%>, "+DynamicUtils.getInsertIntoStmtValuesList(<%=conn.getName()%>.<%=getDynamicColumn()%>);
|
||||
<%
|
||||
} else {
|
||||
%>
|
||||
insertColName<%=cid%> = DynamicUtils.getInsertIntoStmtColumnsList(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>, "<%=dbmsId %>");
|
||||
insertColValue<%=cid%> = DynamicUtils.getInsertIntoStmtValuesList(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>);
|
||||
insertColName<%=cid%> = DynamicUtils.getInsertIntoStmtColumnsList(<%=conn.getName()%>.<%=getDynamicColumn()%>, "<%=dbmsId %>");
|
||||
insertColValue<%=cid%> = DynamicUtils.getInsertIntoStmtValuesList(<%=conn.getName()%>.<%=getDynamicColumn()%>);
|
||||
<%
|
||||
}
|
||||
}
|
||||
@@ -303,10 +304,10 @@ if(columnList != null && columnList.size() > 0) {
|
||||
IConnection conn = conns_dynamic.get(0);
|
||||
if(!("".equals(insertColName.toString()))) {
|
||||
%>
|
||||
String insert_<%=cid%> = "INSERT INTO `" + <%=table%> + "` (<%=insertColName.toString()%>, "+DynamicUtils.getInsertIntoStmtColumnsList(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>, "<%=dbmsId %>")+") VALUES (<%=insertValueStmt.toString()%>, "+DynamicUtils.getInsertIntoStmtValuesList(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>)+")";
|
||||
String insert_<%=cid%> = "INSERT INTO `" + <%=table%> + "` (<%=insertColName.toString()%>, "+DynamicUtils.getInsertIntoStmtColumnsList(<%=conn.getName()%>.<%=getDynamicColumn()%>, "<%=dbmsId %>")+") VALUES (<%=insertValueStmt.toString()%>, "+DynamicUtils.getInsertIntoStmtValuesList(<%=conn.getName()%>.<%=getDynamicColumn()%>)+")";
|
||||
<% } else {
|
||||
%>
|
||||
String insert_<%=cid%> = "INSERT INTO `" + <%=table%> + "` ("+DynamicUtils.getInsertIntoStmtColumnsList(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>, "<%=dbmsId %>")+") VALUES ("+DynamicUtils.getInsertIntoStmtValuesList(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>)+")";
|
||||
String insert_<%=cid%> = "INSERT INTO `" + <%=table%> + "` ("+DynamicUtils.getInsertIntoStmtColumnsList(<%=conn.getName()%>.<%=getDynamicColumn()%>, "<%=dbmsId %>")+") VALUES ("+DynamicUtils.getInsertIntoStmtValuesList(<%=conn.getName()%>.<%=getDynamicColumn()%>)+")";
|
||||
<%
|
||||
}
|
||||
}
|
||||
@@ -340,10 +341,10 @@ if(columnList != null && columnList.size() > 0) {
|
||||
IConnection conn = conns_dynamic.get(0);
|
||||
if(!("".equals(updateSetStmt.toString()))) {
|
||||
%>
|
||||
String update_<%=cid%> = "UPDATE `" + tableName_<%=cid%> + "` SET <%=updateSetStmt.toString()%>, "+DynamicUtils.getUpdateSet(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>, "<%=dbmsId %>")+" WHERE <%=updateWhereStmt.toString()%>";
|
||||
String update_<%=cid%> = "UPDATE `" + tableName_<%=cid%> + "` SET <%=updateSetStmt.toString()%>, "+DynamicUtils.getUpdateSet(<%=conn.getName()%>.<%=getDynamicColumn()%>, "<%=dbmsId %>")+" WHERE <%=updateWhereStmt.toString()%>";
|
||||
<% } else {
|
||||
%>
|
||||
String update_<%=cid%> = "UPDATE `" + tableName_<%=cid%> + "` SET "+DynamicUtils.getUpdateSet(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>, "<%=dbmsId %>")+" WHERE <%=updateWhereStmt.toString()%>";
|
||||
String update_<%=cid%> = "UPDATE `" + tableName_<%=cid%> + "` SET "+DynamicUtils.getUpdateSet(<%=conn.getName()%>.<%=getDynamicColumn()%>, "<%=dbmsId %>")+" WHERE <%=updateWhereStmt.toString()%>";
|
||||
<%
|
||||
}
|
||||
}
|
||||
@@ -358,18 +359,18 @@ if(columnList != null && columnList.size() > 0) {
|
||||
|
||||
if(!("".equals(insertColName.toString()))) {
|
||||
%>
|
||||
String insert_<%=cid%> = "INSERT INTO `" + tableName_<%=cid%> + "` (<%=insertColName.toString()%>, "+DynamicUtils.getInsertIntoStmtColumnsList(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>, "<%=dbmsId %>")+") VALUES (<%=insertValueStmt.toString()%>, "+DynamicUtils.getInsertIntoStmtValuesList(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>)+")";
|
||||
String insert_<%=cid%> = "INSERT INTO `" + tableName_<%=cid%> + "` (<%=insertColName.toString()%>, "+DynamicUtils.getInsertIntoStmtColumnsList(<%=conn.getName()%>.<%=getDynamicColumn()%>, "<%=dbmsId %>")+") VALUES (<%=insertValueStmt.toString()%>, "+DynamicUtils.getInsertIntoStmtValuesList(<%=conn.getName()%>.<%=getDynamicColumn()%>)+")";
|
||||
<% } else {
|
||||
%>
|
||||
String insert_<%=cid%> = "INSERT INTO `" + tableName_<%=cid%> + "` ("+DynamicUtils.getInsertIntoStmtColumnsList(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>, "<%=dbmsId %>")+") VALUES ("+DynamicUtils.getInsertIntoStmtValuesList(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>)+")";
|
||||
String insert_<%=cid%> = "INSERT INTO `" + tableName_<%=cid%> + "` ("+DynamicUtils.getInsertIntoStmtColumnsList(<%=conn.getName()%>.<%=getDynamicColumn()%>, "<%=dbmsId %>")+") VALUES ("+DynamicUtils.getInsertIntoStmtValuesList(<%=conn.getName()%>.<%=getDynamicColumn()%>)+")";
|
||||
<%
|
||||
}
|
||||
if(!("".equals(updateSetStmt.toString()))) {
|
||||
%>
|
||||
String update_<%=cid%> = "UPDATE `" + tableName_<%=cid%> + "` SET <%=updateSetStmt.toString()%>, "+DynamicUtils.getUpdateSet(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>, "<%=dbmsId %>")+" WHERE <%=updateWhereStmt.toString()%>";
|
||||
String update_<%=cid%> = "UPDATE `" + tableName_<%=cid%> + "` SET <%=updateSetStmt.toString()%>, "+DynamicUtils.getUpdateSet(<%=conn.getName()%>.<%=getDynamicColumn()%>, "<%=dbmsId %>")+" WHERE <%=updateWhereStmt.toString()%>";
|
||||
<% } else {
|
||||
%>
|
||||
String update_<%=cid%> = "UPDATE `" + tableName_<%=cid%> + "` SET "+DynamicUtils.getUpdateSet(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>, "<%=dbmsId %>")+" WHERE <%=updateWhereStmt.toString()%>";
|
||||
String update_<%=cid%> = "UPDATE `" + tableName_<%=cid%> + "` SET "+DynamicUtils.getUpdateSet(<%=conn.getName()%>.<%=getDynamicColumn()%>, "<%=dbmsId %>")+" WHERE <%=updateWhereStmt.toString()%>";
|
||||
<%
|
||||
}
|
||||
}
|
||||
@@ -387,18 +388,18 @@ if(columnList != null && columnList.size() > 0) {
|
||||
|
||||
if(!("".equals(insertColName.toString()))) {
|
||||
%>
|
||||
String insert_<%=cid%> = "INSERT INTO `" + tableName_<%=cid%> + "` (<%=insertColName.toString()%>, "+DynamicUtils.getInsertIntoStmtColumnsList(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>, "<%=dbmsId %>")+") VALUES (<%=insertValueStmt.toString()%>, "+DynamicUtils.getInsertIntoStmtValuesList(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>)+")";
|
||||
String insert_<%=cid%> = "INSERT INTO `" + tableName_<%=cid%> + "` (<%=insertColName.toString()%>, "+DynamicUtils.getInsertIntoStmtColumnsList(<%=conn.getName()%>.<%=getDynamicColumn()%>, "<%=dbmsId %>")+") VALUES (<%=insertValueStmt.toString()%>, "+DynamicUtils.getInsertIntoStmtValuesList(<%=conn.getName()%>.<%=getDynamicColumn()%>)+")";
|
||||
<% } else {
|
||||
%>
|
||||
String insert_<%=cid%> = "INSERT INTO `" + tableName_<%=cid%> + "` ("+DynamicUtils.getInsertIntoStmtColumnsList(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>, "<%=dbmsId %>")+") VALUES ("+DynamicUtils.getInsertIntoStmtValuesList(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>)+")";
|
||||
String insert_<%=cid%> = "INSERT INTO `" + tableName_<%=cid%> + "` ("+DynamicUtils.getInsertIntoStmtColumnsList(<%=conn.getName()%>.<%=getDynamicColumn()%>, "<%=dbmsId %>")+") VALUES ("+DynamicUtils.getInsertIntoStmtValuesList(<%=conn.getName()%>.<%=getDynamicColumn()%>)+")";
|
||||
<%
|
||||
}
|
||||
if(!("".equals(updateSetStmt.toString()))) {
|
||||
%>
|
||||
String update_<%=cid%> = "UPDATE `" + tableName_<%=cid%> + "` SET <%=updateSetStmt.toString()%>, "+DynamicUtils.getUpdateSet(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>, "<%=dbmsId %>")+" WHERE <%=updateWhereStmt.toString()%>";
|
||||
String update_<%=cid%> = "UPDATE `" + tableName_<%=cid%> + "` SET <%=updateSetStmt.toString()%>, "+DynamicUtils.getUpdateSet(<%=conn.getName()%>.<%=getDynamicColumn()%>, "<%=dbmsId %>")+" WHERE <%=updateWhereStmt.toString()%>";
|
||||
<% } else {
|
||||
%>
|
||||
String update_<%=cid%> = "UPDATE `" + tableName_<%=cid%> + "` SET "+DynamicUtils.getUpdateSet(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>, "<%=dbmsId %>")+" WHERE <%=updateWhereStmt.toString()%>";
|
||||
String update_<%=cid%> = "UPDATE `" + tableName_<%=cid%> + "` SET "+DynamicUtils.getUpdateSet(<%=conn.getName()%>.<%=getDynamicColumn()%>, "<%=dbmsId %>")+" WHERE <%=updateWhereStmt.toString()%>";
|
||||
<%
|
||||
}
|
||||
}
|
||||
@@ -447,7 +448,7 @@ if(columnList != null && columnList.size() > 0) {
|
||||
////////////////////////////////////////////////////////////
|
||||
List<Column> colStruct = new ArrayList();
|
||||
for(Column colStmt : stmtStructure){
|
||||
if(!colStmt.isReplaced() && !colStmt.isAddCol()){
|
||||
if(!colStmt.isReplaced() && !colStmt.isAddCol() && !colStmt.isDynamic()){
|
||||
colStruct.add(colStmt);
|
||||
}
|
||||
}
|
||||
@@ -667,7 +668,7 @@ if(columnList != null && columnList.size() > 0) {
|
||||
}
|
||||
}
|
||||
if(isDynamic) {
|
||||
Column dynamicColumn = getColumn(columnList.get(columnList.size()-1));
|
||||
Column dynamicColumn = getColumn(getDynamicColumn());
|
||||
String typeToGenerate = JavaTypesManager.getTypeToGenerate(dynamicColumn.getColumn().getTalendType(), dynamicColumn.getColumn().isNullable());
|
||||
if("Dynamic".equals(typeToGenerate)) {
|
||||
%>
|
||||
@@ -695,7 +696,7 @@ if(columnList != null && columnList.size() > 0) {
|
||||
}
|
||||
}
|
||||
if(isDynamic) {
|
||||
Column dynamicColumn = getColumn(columnList.get(columnList.size()-1));
|
||||
Column dynamicColumn = getColumn(getDynamicColumn());
|
||||
String typeToGenerate = JavaTypesManager.getTypeToGenerate(dynamicColumn.getColumn().getTalendType(), dynamicColumn.getColumn().isNullable());
|
||||
if("Dynamic".equals(typeToGenerate)) {
|
||||
%>
|
||||
@@ -741,7 +742,7 @@ if(columnList != null && columnList.size() > 0) {
|
||||
|
||||
}
|
||||
if(isDynamic) {
|
||||
Column dynamicColumn = getColumn(columnList.get(columnList.size()-1));
|
||||
Column dynamicColumn = getColumn(getDynamicColumn());
|
||||
String typeToGenerate = JavaTypesManager.getTypeToGenerate(dynamicColumn.getColumn().getTalendType(), dynamicColumn.getColumn().isNullable());
|
||||
if("Dynamic".equals(typeToGenerate)) {
|
||||
%>
|
||||
@@ -770,8 +771,8 @@ if(columnList != null && columnList.size() > 0) {
|
||||
}else {
|
||||
%>
|
||||
try {
|
||||
insertedCount_<%=cid%> = insertedCount_<%=cid%> + pstmt_<%=cid %>.executeUpdate();
|
||||
nb_line_<%=cid%>++;
|
||||
insertedCount_<%=cid%> = insertedCount_<%=cid%> + pstmt_<%=cid %>.executeUpdate();
|
||||
} catch(java.lang.Exception e) {
|
||||
whetherReject_<%=cid%> = true;
|
||||
<%
|
||||
@@ -789,6 +790,8 @@ if(columnList != null && columnList.size() > 0) {
|
||||
<%
|
||||
}
|
||||
%>
|
||||
rejectedCount_<%=cid%> = rejectedCount_<%=cid%>+ 1;
|
||||
<%=rejectConnName%>.errorCode = ((java.sql.SQLException)e).getSQLState();
|
||||
<%=rejectConnName%>.errorMessage = e.getMessage() + " - Line: " + tos_count_<%=node.getUniqueName() %>;
|
||||
<%
|
||||
} else {
|
||||
@@ -823,7 +826,7 @@ if(columnList != null && columnList.size() > 0) {
|
||||
}
|
||||
|
||||
if(isDynamic) {
|
||||
Column dynamicColumn = getColumn(columnList.get(columnList.size()-1));
|
||||
Column dynamicColumn = getColumn(getDynamicColumn());
|
||||
String typeToGenerate = JavaTypesManager.getTypeToGenerate(dynamicColumn.getColumn().getTalendType(), dynamicColumn.getColumn().isNullable());
|
||||
if("Dynamic".equals(typeToGenerate)) {
|
||||
%>
|
||||
@@ -838,8 +841,8 @@ if(columnList != null && columnList.size() > 0) {
|
||||
}
|
||||
%>
|
||||
try {
|
||||
insertedCount_<%=cid%> = insertedCount_<%=cid%> + pstmt_<%=cid %>.executeUpdate();
|
||||
nb_line_<%=cid%>++;
|
||||
insertedCount_<%=cid%> = insertedCount_<%=cid%> + pstmt_<%=cid %>.executeUpdate();
|
||||
} catch(java.lang.Exception e) {
|
||||
whetherReject_<%=cid%> = true;
|
||||
<%
|
||||
@@ -857,6 +860,8 @@ if(columnList != null && columnList.size() > 0) {
|
||||
<%
|
||||
}
|
||||
%>
|
||||
rejectedCount_<%=cid%> = rejectedCount_<%=cid%>+ 1;
|
||||
<%=rejectConnName%>.errorCode = ((java.sql.SQLException)e).getSQLState();
|
||||
<%=rejectConnName%>.errorMessage = e.getMessage() + " - Line: " + tos_count_<%=node.getUniqueName() %>;
|
||||
<%
|
||||
} else {
|
||||
@@ -886,7 +891,7 @@ if(columnList != null && columnList.size() > 0) {
|
||||
}
|
||||
}
|
||||
if(isDynamic) {
|
||||
Column dynamicColumn = getColumn(columnList.get(columnList.size()-1));
|
||||
Column dynamicColumn = getColumn(getDynamicColumn());
|
||||
String typeToGenerate = JavaTypesManager.getTypeToGenerate(dynamicColumn.getColumn().getTalendType(), dynamicColumn.getColumn().isNullable());
|
||||
if("Dynamic".equals(typeToGenerate)) {
|
||||
%>
|
||||
@@ -947,8 +952,8 @@ if(columnList != null && columnList.size() > 0) {
|
||||
}else {
|
||||
%>
|
||||
try {
|
||||
updatedCount_<%=cid%> = updatedCount_<%=cid%> + pstmt_<%=cid %>.executeUpdate();
|
||||
nb_line_<%=cid%>++;
|
||||
updatedCount_<%=cid%> = updatedCount_<%=cid%> + pstmt_<%=cid %>.executeUpdate();
|
||||
} catch(java.lang.Exception e) {
|
||||
whetherReject_<%=cid%> = true;
|
||||
<%
|
||||
@@ -966,6 +971,8 @@ if(columnList != null && columnList.size() > 0) {
|
||||
<%
|
||||
}
|
||||
%>
|
||||
rejectedCount_<%=cid%> = rejectedCount_<%=cid%>+ 1;
|
||||
<%=rejectConnName%>.errorCode = ((java.sql.SQLException)e).getSQLState();
|
||||
<%=rejectConnName%>.errorMessage = e.getMessage() + " - Line: " + tos_count_<%=node.getUniqueName() %>;
|
||||
<%
|
||||
} else {
|
||||
@@ -1026,7 +1033,7 @@ if(columnList != null && columnList.size() > 0) {
|
||||
}
|
||||
}
|
||||
if(isDynamic) {
|
||||
Column dynamicColumn = getColumn(columnList.get(columnList.size()-1));
|
||||
Column dynamicColumn = getColumn(getDynamicColumn());
|
||||
String typeToGenerate = JavaTypesManager.getTypeToGenerate(dynamicColumn.getColumn().getTalendType(), dynamicColumn.getColumn().isNullable());
|
||||
if("Dynamic".equals(typeToGenerate)) {
|
||||
%>
|
||||
@@ -1089,6 +1096,8 @@ if(columnList != null && columnList.size() > 0) {
|
||||
<%
|
||||
}
|
||||
%>
|
||||
rejectedCount_<%=cid%> = rejectedCount_<%=cid%>+ 1;
|
||||
<%=rejectConnName%>.errorCode = ((java.sql.SQLException)e).getSQLState();
|
||||
<%=rejectConnName%>.errorMessage = e.getMessage() + " - Line: " + tos_count_<%=node.getUniqueName() %>;
|
||||
<%
|
||||
} else {
|
||||
@@ -1118,7 +1127,7 @@ if(columnList != null && columnList.size() > 0) {
|
||||
}
|
||||
}
|
||||
if(isDynamic) {
|
||||
Column dynamicColumn = getColumn(columnList.get(columnList.size()-1));
|
||||
Column dynamicColumn = getColumn(getDynamicColumn());
|
||||
String typeToGenerate = JavaTypesManager.getTypeToGenerate(dynamicColumn.getColumn().getTalendType(), dynamicColumn.getColumn().isNullable());
|
||||
if("Dynamic".equals(typeToGenerate)) {
|
||||
%>
|
||||
@@ -1151,6 +1160,8 @@ if(columnList != null && columnList.size() > 0) {
|
||||
<%
|
||||
}
|
||||
%>
|
||||
rejectedCount_<%=cid%> = rejectedCount_<%=cid%>+ 1;
|
||||
<%=rejectConnName%>.errorCode = ((java.sql.SQLException)e).getSQLState();
|
||||
<%=rejectConnName%>.errorMessage = e.getMessage() + " - Line: " + tos_count_<%=node.getUniqueName() %>;
|
||||
<%
|
||||
} else {
|
||||
@@ -1184,7 +1195,7 @@ if(columnList != null && columnList.size() > 0) {
|
||||
}
|
||||
}
|
||||
if(isDynamic) {
|
||||
Column dynamicColumn = getColumn(columnList.get(columnList.size()-1));
|
||||
Column dynamicColumn = getColumn(getDynamicColumn());
|
||||
String typeToGenerate = JavaTypesManager.getTypeToGenerate(dynamicColumn.getColumn().getTalendType(), dynamicColumn.getColumn().isNullable());
|
||||
if("Dynamic".equals(typeToGenerate)) {
|
||||
%>
|
||||
@@ -1252,6 +1263,8 @@ if(columnList != null && columnList.size() > 0) {
|
||||
<%
|
||||
}
|
||||
%>
|
||||
rejectedCount_<%=cid%> = rejectedCount_<%=cid%>+ 1;
|
||||
<%=rejectConnName%>.errorCode = ((java.sql.SQLException)e).getSQLState();
|
||||
<%=rejectConnName%>.errorMessage = e.getMessage() + " - Line: " + tos_count_<%=node.getUniqueName() %>;
|
||||
<%
|
||||
} else {
|
||||
@@ -1287,7 +1300,7 @@ if(columnList != null && columnList.size() > 0) {
|
||||
}
|
||||
}
|
||||
if(isDynamic) {
|
||||
Column dynamicColumn = getColumn(columnList.get(columnList.size()-1));
|
||||
Column dynamicColumn = getColumn(getDynamicColumn());
|
||||
String typeToGenerate = JavaTypesManager.getTypeToGenerate(dynamicColumn.getColumn().getTalendType(), dynamicColumn.getColumn().isNullable());
|
||||
if("Dynamic".equals(typeToGenerate)) {
|
||||
%>
|
||||
@@ -1320,6 +1333,8 @@ if(columnList != null && columnList.size() > 0) {
|
||||
<%
|
||||
}
|
||||
%>
|
||||
rejectedCount_<%=cid%> = rejectedCount_<%=cid%>+ 1;
|
||||
<%=rejectConnName%>.errorCode = ((java.sql.SQLException)e).getSQLState();
|
||||
<%=rejectConnName%>.errorMessage = e.getMessage() + " - Line: " + tos_count_<%=node.getUniqueName() %>;
|
||||
<%
|
||||
} else {
|
||||
@@ -1405,6 +1420,7 @@ if(columnList != null && columnList.size() > 0) {
|
||||
}
|
||||
%>
|
||||
rejectedCount_<%=cid%> = rejectedCount_<%=cid%>+ 1;
|
||||
<%=rejectConnName%>.errorCode = ((java.sql.SQLException)e).getSQLState();
|
||||
<%=rejectConnName%>.errorMessage = e.getMessage() + " - Line: " + tos_count_<%=node.getUniqueName() %>;
|
||||
|
||||
<%
|
||||
@@ -1466,6 +1482,7 @@ if(columnList != null && columnList.size() > 0) {
|
||||
}
|
||||
%>
|
||||
rejectedCount_<%=cid%> = rejectedCount_<%=cid%>+ 1;
|
||||
<%=rejectConnName%>.errorCode = ((java.sql.SQLException)e).getSQLState();
|
||||
<%=rejectConnName%>.errorMessage = e.getMessage() + " - Line: " + tos_count_<%=node.getUniqueName() %>;
|
||||
<%
|
||||
} else {
|
||||
@@ -1542,6 +1559,7 @@ if(columnList != null && columnList.size() > 0) {
|
||||
}
|
||||
%>
|
||||
rejectedCount_<%=cid%> = rejectedCount_<%=cid%>+ 1;
|
||||
<%=rejectConnName%>.errorCode = ((java.sql.SQLException)e).getSQLState();
|
||||
<%=rejectConnName%>.errorMessage = e.getMessage() + " - Line: " + tos_count_<%=node.getUniqueName() %>;
|
||||
<%
|
||||
} else {
|
||||
@@ -1583,8 +1601,8 @@ if(columnList != null && columnList.size() > 0) {
|
||||
}
|
||||
%>
|
||||
try {
|
||||
insertedCount_<%=cid%> = insertedCount_<%=cid%> + pstmt_<%=cid %>.executeUpdate();
|
||||
nb_line_<%=cid%>++;
|
||||
insertedCount_<%=cid%> = insertedCount_<%=cid%> + pstmt_<%=cid %>.executeUpdate();
|
||||
} catch(java.lang.Exception e) {
|
||||
whetherReject_<%=cid%> = true;
|
||||
<%
|
||||
@@ -1603,6 +1621,7 @@ if(columnList != null && columnList.size() > 0) {
|
||||
}
|
||||
%>
|
||||
rejectedCount_<%=cid%> = rejectedCount_<%=cid%>+ 1;
|
||||
<%=rejectConnName%>.errorCode = ((java.sql.SQLException)e).getSQLState();
|
||||
<%=rejectConnName%>.errorMessage = e.getMessage() + " - Line: " + tos_count_<%=node.getUniqueName() %>;
|
||||
<%
|
||||
} else {
|
||||
|
||||
@@ -157,6 +157,7 @@ try {
|
||||
}
|
||||
}
|
||||
%>
|
||||
<%=rejectConnName%>.errorCode = ((java.sql.SQLException)e).getSQLState();
|
||||
<%=rejectConnName%>.errorMessage = e.getMessage() + " - Line: " + tos_count_<%=node.getUniqueName() %>;
|
||||
<%
|
||||
} else {
|
||||
|
||||
@@ -83,13 +83,15 @@ Manager manager = null;
|
||||
|
||||
if(columnList != null && columnList.size() > 0) {
|
||||
stmtStructure = getManager(dbmsId, cid).createColumnList(columnList, useFieldOptions, fieldOptions, addCols);
|
||||
isDynamic = isDynamic && !getManager(dbmsId, cid).isDynamicColumnReplaced();
|
||||
|
||||
if(convertToUppercase) {
|
||||
for(Column column : stmtStructure) {
|
||||
if(column.isReplaced()) {
|
||||
for (Column replacedColumn : column.getReplacement()) {
|
||||
replacedColumn.setColumnName(replacedColumn.getColumnName().toUpperCase());
|
||||
}
|
||||
} else {
|
||||
} else if(!column.isDynamic()){
|
||||
column.setColumnName(column.getColumnName().toUpperCase());
|
||||
}
|
||||
}
|
||||
@@ -98,7 +100,7 @@ if(columnList != null && columnList.size() > 0) {
|
||||
boolean xmlTypeExist = false;
|
||||
for(Column column : stmtStructure) {
|
||||
//when use Additional column column.getColumn() == null
|
||||
if (column.getColumn()!= null && "XMLTYPE".equals(column.getColumn().getType())) {
|
||||
if (column.getColumn()!= null && "XMLTYPE".equals(column.getColumn().getType()) && !column.isDynamic()) {
|
||||
column.setSqlStmt("XMLType(?)");
|
||||
xmlTypeExist = true;
|
||||
}
|
||||
@@ -110,7 +112,7 @@ if(("UPDATE").equals(dataAction) || ("INSERT_OR_UPDATE").equals(dataAction) || (
|
||||
int updateKeyCount = 0;
|
||||
if(stmtStructure != null) {
|
||||
for(Column column : stmtStructure) {
|
||||
if(column.isUpdateKey()) {
|
||||
if(column.isUpdateKey() && !column.isDynamic()) {
|
||||
updateKeyCount++;
|
||||
}
|
||||
}
|
||||
@@ -125,7 +127,7 @@ if(("UPDATE").equals(dataAction) || ("INSERT_OR_UPDATE").equals(dataAction) || (
|
||||
int deleteKeyCount = 0;
|
||||
if(stmtStructure != null) {
|
||||
for(Column column : stmtStructure) {
|
||||
if(column.isDeleteKey()) {
|
||||
if(column.isDeleteKey() && !column.isDynamic()) {
|
||||
deleteKeyCount++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -199,7 +199,7 @@
|
||||
</PARAMETER>
|
||||
|
||||
<PARAMETER NAME="NOTE" FIELD="LABEL" NUM_ROW="81"
|
||||
NOT_SHOW_IF="(TABLE_ACTION == 'NONE') OR (USE_EXISTING_CONNECTION == 'false')"
|
||||
NOT_SHOW_IF="(PARALLELIZE == 'true') OR (TABLE_ACTION == 'NONE') OR (USE_EXISTING_CONNECTION == 'false')"
|
||||
>
|
||||
<DEFAULT>Warning : this component configuration will automatically generate a commit before data insert/update/delete</DEFAULT>
|
||||
</PARAMETER>
|
||||
|
||||
@@ -85,8 +85,6 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
}
|
||||
}
|
||||
|
||||
List<Column> stmtStructure = getManager(dbmsId, cid).createColumnList(columnList, useFieldOptions, fieldOptions, addCols);
|
||||
|
||||
Manager manager = null;
|
||||
boolean isDynamic = false;
|
||||
List<IMetadataTable> metadatas = node.getMetadataList();
|
||||
@@ -95,6 +93,9 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
isDynamic = metadata.isDynamicSchema();
|
||||
}
|
||||
|
||||
List<Column> stmtStructure = getManager(dbmsId, cid).createColumnList(columnList, useFieldOptions, fieldOptions, addCols);
|
||||
isDynamic = isDynamic && !getManager(dbmsId, cid).isDynamicColumnReplaced();
|
||||
|
||||
if(isDynamic) {
|
||||
%>
|
||||
if(nb_line_<%=cid%>==0) {
|
||||
@@ -178,10 +179,10 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
|
||||
if(!("".equals(insertColName.toString()))) {
|
||||
%>
|
||||
String insert_<%=cid%> = "INSERT INTO " + tableName_<%=cid%> + " (<%=insertColName.toString()%>, "+DynamicUtils.getInsertIntoStmtColumnsList(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>,"<%=dbmsId %>")+") VALUES (<%=insertValueStmt.toString()%>, "+DynamicUtils.getInsertIntoStmtValuesList(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>)+")";
|
||||
String insert_<%=cid%> = "INSERT INTO " + tableName_<%=cid%> + " (<%=insertColName.toString()%>, "+DynamicUtils.getInsertIntoStmtColumnsList(<%=conn.getName()%>.<%=getDynamicColumn()%>,"<%=dbmsId %>")+") VALUES (<%=insertValueStmt.toString()%>, "+DynamicUtils.getInsertIntoStmtValuesList(<%=conn.getName()%>.<%=getDynamicColumn()%>)+")";
|
||||
<% } else {
|
||||
%>
|
||||
String insert_<%=cid%> = "INSERT INTO " + tableName_<%=cid%> + " ("+DynamicUtils.getInsertIntoStmtColumnsList(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>, "<%=dbmsId %>")+") VALUES ("+DynamicUtils.getInsertIntoStmtValuesList(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>)+")";
|
||||
String insert_<%=cid%> = "INSERT INTO " + tableName_<%=cid%> + " ("+DynamicUtils.getInsertIntoStmtColumnsList(<%=conn.getName()%>.<%=getDynamicColumn()%>, "<%=dbmsId %>")+") VALUES ("+DynamicUtils.getInsertIntoStmtValuesList(<%=conn.getName()%>.<%=getDynamicColumn()%>)+")";
|
||||
<%
|
||||
}
|
||||
}
|
||||
@@ -215,10 +216,10 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
IConnection conn = conns_dynamic.get(0);
|
||||
if(!("".equals(updateSetStmt.toString()))) {
|
||||
%>
|
||||
String update_<%=cid%> = "UPDATE " + tableName_<%=cid%> + " SET <%=updateSetStmt.toString()%>, "+DynamicUtils.getUpdateSet(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>, "<%=dbmsId %>")+" WHERE <%=updateWhereStmt.toString()%>";
|
||||
String update_<%=cid%> = "UPDATE " + tableName_<%=cid%> + " SET <%=updateSetStmt.toString()%>, "+DynamicUtils.getUpdateSet(<%=conn.getName()%>.<%=getDynamicColumn()%>, "<%=dbmsId %>")+" WHERE <%=updateWhereStmt.toString()%>";
|
||||
<% } else {
|
||||
%>
|
||||
String update_<%=cid%> = "UPDATE " + tableName_<%=cid%> + " SET "+DynamicUtils.getUpdateSet(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>, "<%=dbmsId %>")+" WHERE <%=updateWhereStmt.toString()%>";
|
||||
String update_<%=cid%> = "UPDATE " + tableName_<%=cid%> + " SET "+DynamicUtils.getUpdateSet(<%=conn.getName()%>.<%=getDynamicColumn()%>, "<%=dbmsId %>")+" WHERE <%=updateWhereStmt.toString()%>";
|
||||
<%
|
||||
}
|
||||
}
|
||||
@@ -236,18 +237,18 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
|
||||
if(!("".equals(insertColName.toString()))) {
|
||||
%>
|
||||
String insert_<%=cid%> = "INSERT INTO " + tableName_<%=cid%> + " (<%=insertColName.toString()%>, "+DynamicUtils.getInsertIntoStmtColumnsList(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>, "<%=dbmsId %>")+") VALUES (<%=insertValueStmt.toString()%>, "+DynamicUtils.getInsertIntoStmtValuesList(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>)+")";
|
||||
String insert_<%=cid%> = "INSERT INTO " + tableName_<%=cid%> + " (<%=insertColName.toString()%>, "+DynamicUtils.getInsertIntoStmtColumnsList(<%=conn.getName()%>.<%=getDynamicColumn()%>, "<%=dbmsId %>")+") VALUES (<%=insertValueStmt.toString()%>, "+DynamicUtils.getInsertIntoStmtValuesList(<%=conn.getName()%>.<%=getDynamicColumn()%>)+")";
|
||||
<% } else {
|
||||
%>
|
||||
String insert_<%=cid%> = "INSERT INTO " + tableName_<%=cid%> + " ("+DynamicUtils.getInsertIntoStmtColumnsList(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>, "<%=dbmsId %>")+") VALUES ("+DynamicUtils.getInsertIntoStmtValuesList(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>)+")";
|
||||
String insert_<%=cid%> = "INSERT INTO " + tableName_<%=cid%> + " ("+DynamicUtils.getInsertIntoStmtColumnsList(<%=conn.getName()%>.<%=getDynamicColumn()%>, "<%=dbmsId %>")+") VALUES ("+DynamicUtils.getInsertIntoStmtValuesList(<%=conn.getName()%>.<%=getDynamicColumn()%>)+")";
|
||||
<%
|
||||
}
|
||||
if(!("".equals(updateSetStmt.toString()))) {
|
||||
%>
|
||||
String update_<%=cid%> = "UPDATE " + tableName_<%=cid%> + " SET <%=updateSetStmt.toString()%>, "+DynamicUtils.getUpdateSet(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>, "<%=dbmsId %>")+" WHERE <%=updateWhereStmt.toString()%>";
|
||||
String update_<%=cid%> = "UPDATE " + tableName_<%=cid%> + " SET <%=updateSetStmt.toString()%>, "+DynamicUtils.getUpdateSet(<%=conn.getName()%>.<%=getDynamicColumn()%>, "<%=dbmsId %>")+" WHERE <%=updateWhereStmt.toString()%>";
|
||||
<% } else {
|
||||
%>
|
||||
String update_<%=cid%> = "UPDATE " + tableName_<%=cid%> + " SET "+DynamicUtils.getUpdateSet(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>, "<%=dbmsId %>")+" WHERE <%=updateWhereStmt.toString()%>";
|
||||
String update_<%=cid%> = "UPDATE " + tableName_<%=cid%> + " SET "+DynamicUtils.getUpdateSet(<%=conn.getName()%>.<%=getDynamicColumn()%>, "<%=dbmsId %>")+" WHERE <%=updateWhereStmt.toString()%>";
|
||||
<%
|
||||
}
|
||||
}
|
||||
@@ -264,18 +265,18 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
|
||||
if(!("".equals(insertColName.toString()))) {
|
||||
%>
|
||||
String insert_<%=cid%> = "INSERT INTO " + tableName_<%=cid%> + " (<%=insertColName.toString()%>, "+DynamicUtils.getInsertIntoStmtColumnsList(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>, "<%=dbmsId %>")+") VALUES (<%=insertValueStmt.toString()%>, "+DynamicUtils.getInsertIntoStmtValuesList(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>)+")";
|
||||
String insert_<%=cid%> = "INSERT INTO " + tableName_<%=cid%> + " (<%=insertColName.toString()%>, "+DynamicUtils.getInsertIntoStmtColumnsList(<%=conn.getName()%>.<%=getDynamicColumn()%>, "<%=dbmsId %>")+") VALUES (<%=insertValueStmt.toString()%>, "+DynamicUtils.getInsertIntoStmtValuesList(<%=conn.getName()%>.<%=getDynamicColumn()%>)+")";
|
||||
<% } else {
|
||||
%>
|
||||
String insert_<%=cid%> = "INSERT INTO " + tableName_<%=cid%> + " ("+DynamicUtils.getInsertIntoStmtColumnsList(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>, "<%=dbmsId %>")+") VALUES ("+DynamicUtils.getInsertIntoStmtValuesList(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>)+")";
|
||||
String insert_<%=cid%> = "INSERT INTO " + tableName_<%=cid%> + " ("+DynamicUtils.getInsertIntoStmtColumnsList(<%=conn.getName()%>.<%=getDynamicColumn()%>, "<%=dbmsId %>")+") VALUES ("+DynamicUtils.getInsertIntoStmtValuesList(<%=conn.getName()%>.<%=getDynamicColumn()%>)+")";
|
||||
<%
|
||||
}
|
||||
if(!("".equals(updateSetStmt.toString()))) {
|
||||
%>
|
||||
String update_<%=cid%> = "UPDATE " + tableName_<%=cid%> + " SET <%=updateSetStmt.toString()%>, "+DynamicUtils.getUpdateSet(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>, "<%=dbmsId %>")+" WHERE <%=updateWhereStmt.toString()%>";
|
||||
String update_<%=cid%> = "UPDATE " + tableName_<%=cid%> + " SET <%=updateSetStmt.toString()%>, "+DynamicUtils.getUpdateSet(<%=conn.getName()%>.<%=getDynamicColumn()%>, "<%=dbmsId %>")+" WHERE <%=updateWhereStmt.toString()%>";
|
||||
<% } else {
|
||||
%>
|
||||
String update_<%=cid%> = "UPDATE " + tableName_<%=cid%> + " SET "+DynamicUtils.getUpdateSet(<%=conn.getName()%>.<%=columnList.get(columnList.size()-1)%>, "<%=dbmsId %>")+" WHERE <%=updateWhereStmt.toString()%>";
|
||||
String update_<%=cid%> = "UPDATE " + tableName_<%=cid%> + " SET "+DynamicUtils.getUpdateSet(<%=conn.getName()%>.<%=getDynamicColumn()%>, "<%=dbmsId %>")+" WHERE <%=updateWhereStmt.toString()%>";
|
||||
<%
|
||||
}
|
||||
}
|
||||
@@ -307,7 +308,7 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
////////////////////////////////////////////////////////////
|
||||
List<Column> colStruct = new ArrayList();
|
||||
for(Column colStmt : stmtStructure) {
|
||||
if(!colStmt.isReplaced() && !colStmt.isAddCol()) {
|
||||
if(!colStmt.isReplaced() && !colStmt.isAddCol() && !colStmt.isDynamic()) {
|
||||
colStruct.add(colStmt);
|
||||
}
|
||||
}
|
||||
@@ -413,7 +414,7 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
}
|
||||
}
|
||||
if(isDynamic) {
|
||||
Column dynamicColumn = getColumn(columnList.get(columnList.size()-1));
|
||||
Column dynamicColumn = getColumn(getDynamicColumn());
|
||||
String typeToGenerate = JavaTypesManager.getTypeToGenerate(dynamicColumn.getColumn().getTalendType(), dynamicColumn.getColumn().isNullable());
|
||||
if("Dynamic".equals(typeToGenerate)) {
|
||||
%>
|
||||
@@ -442,8 +443,8 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
}else {
|
||||
%>
|
||||
try {
|
||||
insertedCount_<%=cid%> = insertedCount_<%=cid%> + pstmt_<%=cid %>.executeUpdate();
|
||||
nb_line_<%=cid%>++;
|
||||
insertedCount_<%=cid%> = insertedCount_<%=cid%> + pstmt_<%=cid %>.executeUpdate();
|
||||
} catch(java.lang.Exception e) {
|
||||
whetherReject_<%=cid%> = true;
|
||||
<%
|
||||
@@ -463,6 +464,7 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
}
|
||||
%>
|
||||
rejectedCount_<%=cid%> = rejectedCount_<%=cid%> + 1;
|
||||
<%=rejectConnName%>.errorCode = ((java.sql.SQLException)e).getSQLState();
|
||||
<%=rejectConnName%>.errorMessage = e.getMessage() + " - Line: " + tos_count_<%=node.getUniqueName() %>;
|
||||
<%
|
||||
} else {
|
||||
@@ -497,7 +499,7 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
}
|
||||
}
|
||||
if(isDynamic) {
|
||||
Column dynamicColumn = getColumn(columnList.get(columnList.size()-1));
|
||||
Column dynamicColumn = getColumn(getDynamicColumn());
|
||||
String typeToGenerate = JavaTypesManager.getTypeToGenerate(dynamicColumn.getColumn().getTalendType(), dynamicColumn.getColumn().isNullable());
|
||||
if("Dynamic".equals(typeToGenerate)) {
|
||||
%>
|
||||
@@ -560,8 +562,8 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
}else {
|
||||
%>
|
||||
try {
|
||||
updatedCount_<%=cid%> = updatedCount_<%=cid%> + pstmt_<%=cid %>.executeUpdate();
|
||||
nb_line_<%=cid%>++;
|
||||
updatedCount_<%=cid%> = updatedCount_<%=cid%> + pstmt_<%=cid %>.executeUpdate();
|
||||
} catch(java.lang.Exception e) {
|
||||
whetherReject_<%=cid%> = true;
|
||||
<%
|
||||
@@ -581,6 +583,7 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
}
|
||||
%>
|
||||
rejectedCount_<%=cid%> = rejectedCount_<%=cid%> + 1;
|
||||
<%=rejectConnName%>.errorCode = ((java.sql.SQLException)e).getSQLState();
|
||||
<%=rejectConnName%>.errorMessage = e.getMessage() + " - Line: " + tos_count_<%=node.getUniqueName() %>;
|
||||
<%
|
||||
} else {
|
||||
@@ -651,7 +654,7 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
}
|
||||
}
|
||||
if(isDynamic) {
|
||||
Column dynamicColumn = getColumn(columnList.get(columnList.size()-1));
|
||||
Column dynamicColumn = getColumn(getDynamicColumn());
|
||||
String typeToGenerate = JavaTypesManager.getTypeToGenerate(dynamicColumn.getColumn().getTalendType(), dynamicColumn.getColumn().isNullable());
|
||||
if("Dynamic".equals(typeToGenerate)) {
|
||||
%>
|
||||
@@ -719,6 +722,7 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
}
|
||||
%>
|
||||
rejectedCount_<%=cid%> = rejectedCount_<%=cid%> + 1;
|
||||
<%=rejectConnName%>.errorCode = ((java.sql.SQLException)e).getSQLState();
|
||||
<%=rejectConnName%>.errorMessage = e.getMessage() + " - Line: " + tos_count_<%=node.getUniqueName() %>;
|
||||
<%
|
||||
} else {
|
||||
@@ -752,7 +756,7 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
}
|
||||
}
|
||||
if(isDynamic) {
|
||||
Column dynamicColumn = getColumn(columnList.get(columnList.size()-1));
|
||||
Column dynamicColumn = getColumn(getDynamicColumn());
|
||||
String typeToGenerate = JavaTypesManager.getTypeToGenerate(dynamicColumn.getColumn().getTalendType(), dynamicColumn.getColumn().isNullable());
|
||||
if("Dynamic".equals(typeToGenerate)) {
|
||||
%>
|
||||
@@ -787,6 +791,7 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
}
|
||||
%>
|
||||
rejectedCount_<%=cid%> = rejectedCount_<%=cid%> + 1;
|
||||
<%=rejectConnName%>.errorCode = ((java.sql.SQLException)e).getSQLState();
|
||||
<%=rejectConnName%>.errorMessage = e.getMessage() + " - Line: " + tos_count_<%=node.getUniqueName() %>;
|
||||
<%
|
||||
} else {
|
||||
@@ -824,7 +829,7 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
}
|
||||
}
|
||||
if(isDynamic) {
|
||||
Column dynamicColumn = getColumn(columnList.get(columnList.size()-1));
|
||||
Column dynamicColumn = getColumn(getDynamicColumn());
|
||||
String typeToGenerate = JavaTypesManager.getTypeToGenerate(dynamicColumn.getColumn().getTalendType(), dynamicColumn.getColumn().isNullable());
|
||||
if("Dynamic".equals(typeToGenerate)) {
|
||||
%>
|
||||
@@ -896,6 +901,7 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
}
|
||||
%>
|
||||
rejectedCount_<%=cid%> = rejectedCount_<%=cid%> + 1;
|
||||
<%=rejectConnName%>.errorCode = ((java.sql.SQLException)e).getSQLState();
|
||||
<%=rejectConnName%>.errorMessage = e.getMessage() + " - Line: " + tos_count_<%=node.getUniqueName() %>;
|
||||
<%
|
||||
} else {
|
||||
@@ -934,7 +940,7 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
}
|
||||
}
|
||||
if(isDynamic) {
|
||||
Column dynamicColumn = getColumn(columnList.get(columnList.size()-1));
|
||||
Column dynamicColumn = getColumn(getDynamicColumn());
|
||||
String typeToGenerate = JavaTypesManager.getTypeToGenerate(dynamicColumn.getColumn().getTalendType(), dynamicColumn.getColumn().isNullable());
|
||||
if("Dynamic".equals(typeToGenerate)) {
|
||||
%>
|
||||
@@ -970,6 +976,7 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
}
|
||||
%>
|
||||
rejectedCount_<%=cid%> = rejectedCount_<%=cid%> + 1;
|
||||
<%=rejectConnName%>.errorCode = ((java.sql.SQLException)e).getSQLState();
|
||||
<%=rejectConnName%>.errorMessage = e.getMessage() + " - Line: " + tos_count_<%=node.getUniqueName() %>;
|
||||
<%
|
||||
} else {
|
||||
@@ -1056,6 +1063,7 @@ skeleton="../templates/db_output_bulk.skeleton"
|
||||
}
|
||||
%>
|
||||
rejectedCount_<%=cid%> = rejectedCount_<%=cid%> + 1;
|
||||
<%=rejectConnName%>.errorCode = ((java.sql.SQLException)e).getSQLState();
|
||||
<%=rejectConnName%>.errorMessage = e.getMessage() + " - Line: " + tos_count_<%=node.getUniqueName() %>;
|
||||
<%
|
||||
} else {
|
||||
|
||||
@@ -197,6 +197,7 @@ try {
|
||||
}
|
||||
}
|
||||
%>
|
||||
<%=rejectConnName%>.errorCode = ((java.sql.SQLException)e).getSQLState();
|
||||
<%=rejectConnName%>.errorMessage = e.getMessage() + " - Line: " + tos_count_<%=node.getUniqueName() %>;
|
||||
<%
|
||||
} else {
|
||||
|
||||
@@ -80,6 +80,7 @@
|
||||
<PARAMETER
|
||||
NAME="SCHEMA"
|
||||
FIELD="SCHEMA_TYPE"
|
||||
READONLY="true"
|
||||
REQUIRED="true"
|
||||
NUM_ROW="10"
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ COMPATIBILITY="ALL"
|
||||
</CONNECTORS>
|
||||
|
||||
<PARAMETERS>
|
||||
<PARAMETER NAME="SCHEMA" FIELD="SCHEMA_TYPE" REQUIRED="true" NUM_ROW="1" >
|
||||
<PARAMETER NAME="SCHEMA" FIELD="SCHEMA_TYPE" READONLY="true" REQUIRED="true" NUM_ROW="1" >
|
||||
<TABLE READONLY="true">
|
||||
<COLUMN NAME="moment" TYPE="id_Date" PATTERN='"yyyy-MM-dd HH:mm:ss"'/>
|
||||
<COLUMN NAME="pid" TYPE="id_String" LENGTH="20"/>
|
||||
|
||||
@@ -23,7 +23,9 @@ if (inConns != null && !inConns.isEmpty()) {
|
||||
for (IMetadataColumn column : columns) {
|
||||
columnsName.add(column.getLabel());
|
||||
}
|
||||
|
||||
%>
|
||||
int nb_line_<%=cid%> = 0;
|
||||
<%
|
||||
if (columnsName.contains("value") && columnsName.contains("series") && columnsName.contains("category")) {
|
||||
%>
|
||||
org.jfree.data.category.DefaultCategoryDataset dataset_<%=cid%> = new org.jfree.data.category.DefaultCategoryDataset();
|
||||
|
||||
@@ -50,4 +50,7 @@ if (inConns != null && !inConns.isEmpty()) {
|
||||
org.jfree.chart.ChartUtilities.saveChartAsPNG(new java.io.File(<%=filePath%>), chart_<%=cid%>, <%=imageWidth%>, <%=imageHeight%>);
|
||||
<%
|
||||
}
|
||||
%>
|
||||
globalMap.put("<%=cid %>_NB_LINE",nb_line_<%=cid%>);
|
||||
<%
|
||||
}%>
|
||||
|
||||
@@ -27,6 +27,7 @@ if (inConns != null && !inConns.isEmpty()) {
|
||||
if (columnsName.contains("value") && columnsName.contains("series") && columnsName.contains("category")) {
|
||||
%>
|
||||
dataset_<%=cid%>.setValue(<%=sInConnName%>.value, <%=sInConnName%>.series, <%=sInConnName%>.category);
|
||||
nb_line_<%=cid%> ++;
|
||||
<%}
|
||||
}
|
||||
%>
|
||||
|
||||
@@ -13,4 +13,5 @@ VALUE_AXIS.NAME=Value axis name
|
||||
FORE_GROUND_ALPHA.NAME=Foreground alpha
|
||||
PLOT_ORIENTATION.NAME=Plot orientation
|
||||
PLOT_ORIENTATION.ITEM.VERTICAL=VERTICAL
|
||||
PLOT_ORIENTATION.ITEM.HORIZONTAL=HORIZONTAL
|
||||
PLOT_ORIENTATION.ITEM.HORIZONTAL=HORIZONTAL
|
||||
NB_LINE.NAME=Number of line
|
||||
@@ -19,23 +19,23 @@ imports="
|
||||
String process_name = ElementParameterParser.getValue(node, "__PROCESS_NAME__");
|
||||
String process_version = ElementParameterParser.getValue(node, "__PROCESS_VERSION__");
|
||||
String userName = ElementParameterParser.getValue(node, "__USERNAME__");
|
||||
%>
|
||||
String processInstanceUUID_<%=cid%> = null;
|
||||
StringBuilder parameters_<%=cid%> = new StringBuilder("options=user:");
|
||||
parameters_<%=cid%>.append(<%=userName%>);
|
||||
String url_<%=cid %> = <%=url%> + "API/runtimeAPI/instantiateProcessWithVariables/" + <%=process_name%> +"--" +<%=process_version%>;
|
||||
java.net.HttpURLConnection httpConn_<%=cid %> = null;
|
||||
%>
|
||||
String processInstanceUUID_<%=cid%> = null;
|
||||
StringBuilder parameters_<%=cid%> = new StringBuilder("options=user:");
|
||||
parameters_<%=cid%>.append(<%=userName%>);
|
||||
String url_<%=cid %> = <%=url%> + "API/runtimeAPI/instantiateProcessWithVariables/" + <%=process_name%> +"--" +<%=process_version%>;
|
||||
java.net.HttpURLConnection httpConn_<%=cid %> = null;
|
||||
|
||||
try {
|
||||
httpConn_<%=cid %> = (java.net.HttpURLConnection) new java.net.URL(url_<%=cid%>).openConnection();
|
||||
resourceMap.put("httpConn_<%=cid%>", httpConn_<%=cid%>);
|
||||
httpConn_<%=cid %>.setUseCaches (false);
|
||||
httpConn_<%=cid %>.setDoInput(true);
|
||||
httpConn_<%=cid %>.setDoOutput(true);
|
||||
httpConn_<%=cid %>.setInstanceFollowRedirects(false);
|
||||
httpConn_<%=cid %>.setRequestMethod("POST");
|
||||
httpConn_<%=cid %>.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
|
||||
httpConn_<%=cid %>.setRequestProperty("Authorization", "Basic " + org.ow2.bonita.util.Base64.encodeBytes((<%=authUserName%>+":"+<%=authPasswd%>).getBytes()));
|
||||
<%
|
||||
httpConn_<%=cid %>.setRequestProperty("Authorization", "Basic " + new String(org.apache.commons.codec.binary.Base64.encodeBase64((<%=authUserName%>+ ":"+ <%=authPasswd%>).getBytes(utf8Charset)),utf8Charset));
|
||||
<%
|
||||
} else { // JAVA CLIENT
|
||||
|
||||
String processID = ElementParameterParser.getValue(node, "__PROCESS_ID__");
|
||||
@@ -57,15 +57,15 @@ imports="
|
||||
String bonitaHome = ElementParameterParser.getValue(node, "__BONITA_HOME__");
|
||||
|
||||
if("BONITA_561".equals(dbVersion)){
|
||||
%>
|
||||
System.setProperty("BONITA_HOME", <%=bonitaHome%>);
|
||||
<%
|
||||
%>
|
||||
System.setProperty("BONITA_HOME", <%=bonitaHome%>);
|
||||
<%
|
||||
}else if("BONITA_531".equals(dbVersion)||"BONITA_523".equals(dbVersion)){
|
||||
%>
|
||||
System.setProperty("org.ow2.bonita.environment", <%=bonitaEnvironmentFile%> );
|
||||
<%
|
||||
%>
|
||||
System.setProperty("org.ow2.bonita.environment", <%=bonitaEnvironmentFile%> );
|
||||
<%
|
||||
}
|
||||
%>
|
||||
%>
|
||||
System.setProperty("java.security.auth.login.config", <%=jassFile%> );
|
||||
System.setProperty("java.util.logging.config.file", new java.io.File(<%=loggingFile%>).toURI().toURL().toString());
|
||||
|
||||
@@ -77,19 +77,18 @@ imports="
|
||||
String processInstanceUUID_<%=cid%> = null;
|
||||
java.util.Map<String, Object> parameters_<%=cid%>=new java.util.HashMap<String, Object>();
|
||||
|
||||
try {
|
||||
|
||||
loginContext_<%=cid%> = new javax.security.auth.login.LoginContext(<%=loginModule%>, new org.ow2.bonita.util.SimpleCallbackHandler(<%=userName%>, <%=password%>));
|
||||
loginContext_<%=cid%>.login();
|
||||
<%
|
||||
loginContext_<%=cid%> = new javax.security.auth.login.LoginContext(<%=loginModule%>, new org.ow2.bonita.util.SimpleCallbackHandler(<%=userName%>, <%=password%>));
|
||||
resourceMap.put("loginContext_<%=cid%>", loginContext_<%=cid%>);
|
||||
loginContext_<%=cid%>.login();
|
||||
<%
|
||||
if("true".equals(use_process_id)) {
|
||||
%>
|
||||
%>
|
||||
processID_<%=cid%> = new org.ow2.bonita.facade.uuid.ProcessDefinitionUUID(<%=processID%>);
|
||||
<%
|
||||
<%
|
||||
} else {
|
||||
%>
|
||||
%>
|
||||
processID_<%=cid%> = new org.ow2.bonita.facade.uuid.ProcessDefinitionUUID(<%=process_name%>, <%=process_version%>);
|
||||
<%
|
||||
<%
|
||||
}
|
||||
}
|
||||
%>
|
||||
}
|
||||
%>
|
||||
|
||||
@@ -11,22 +11,8 @@ imports="
|
||||
INode node = (INode)codeGenArgument.getArgument();
|
||||
String cid = node.getUniqueName();
|
||||
|
||||
boolean dieOnError = ("true").equals(ElementParameterParser.getValue(node, "__DIE_ON_ERROR__"));
|
||||
String clientMode = ElementParameterParser.getValue(node, "__CLIENT_MODE__");
|
||||
%>
|
||||
} catch (java.lang.Exception lee_<%=cid%>) {
|
||||
<%
|
||||
if (dieOnError) {
|
||||
%>
|
||||
throw lee_<%=cid%>;
|
||||
<%
|
||||
} else {
|
||||
%>
|
||||
System.err.println(lee_<%=cid%>.getMessage());
|
||||
<%
|
||||
}
|
||||
%>
|
||||
} finally {
|
||||
<%
|
||||
if ("HTTP_CLIENT".equals(clientMode)) {
|
||||
%>
|
||||
@@ -42,4 +28,4 @@ imports="
|
||||
<%
|
||||
}
|
||||
%>
|
||||
}
|
||||
resourceMap.put("finish_<%=cid%>", true);
|
||||
@@ -0,0 +1,32 @@
|
||||
<%@ jet
|
||||
imports="
|
||||
org.talend.core.model.process.INode
|
||||
org.talend.core.model.process.ElementParameterParser
|
||||
org.talend.designer.codegen.config.CodeGeneratorArgument
|
||||
"
|
||||
%>
|
||||
|
||||
<%
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode)codeGenArgument.getArgument();
|
||||
String cid = node.getUniqueName();
|
||||
|
||||
String clientMode = ElementParameterParser.getValue(node, "__CLIENT_MODE__");
|
||||
%>
|
||||
if(resourceMap.get("finish_<%=cid%>") == null){
|
||||
<%
|
||||
if ("HTTP_CLIENT".equals(clientMode)) {
|
||||
%>
|
||||
if (resourceMap.get("httpConn_<%=cid %>") != null) {
|
||||
((java.net.HttpURLConnection)resourceMap.get("httpConn_<%=cid %>")).disconnect();
|
||||
}
|
||||
<%
|
||||
} else {
|
||||
%>
|
||||
if (resourceMap.get("loginContext_<%=cid%>") != null) {
|
||||
((javax.security.auth.login.LoginContext)resourceMap.get("loginContext_<%=cid%>")).logout();
|
||||
}
|
||||
<%
|
||||
}
|
||||
%>
|
||||
}
|
||||
@@ -40,6 +40,7 @@
|
||||
<PARAMETER
|
||||
NAME="SCHEMA"
|
||||
FIELD="SCHEMA_TYPE"
|
||||
READONLY="true"
|
||||
NUM_ROW="1"
|
||||
>
|
||||
<TABLE READONLY="true">
|
||||
@@ -211,7 +212,7 @@
|
||||
<!-- Bonita 5.2.3 -->
|
||||
<IMPORT NAME="bonita_client_523" MODULE="bonita-client-5.2.3.jar" UrlPath="platform:/plugin/org.talend.libraries.bonita/lib/bonita-client-5.2.3.jar" REQUIRED="false" />
|
||||
<IMPORT NAME="bonita_server_523" MODULE="bonita-server-5.2.3.jar" UrlPath="platform:/plugin/org.talend.libraries.bonita/lib/bonita-server-5.2.3.jar" REQUIRED="false" />
|
||||
<IMPORT NAME="atlr_276" MODULE="antlr-2.7.6.jar" UrlPath="platform:/plugin/org.talend.libraries.apache.axis2/lib/antlr-2.7.6.jar" REQUIRED_IF="DB_VERSION=='BONITA_561'" />
|
||||
<IMPORT NAME="atlr_276" MODULE="antlr-2.7.6.jar" UrlPath="platform:/plugin/org.talend.libraries.apache.axis2/lib/antlr-2.7.6.jar" REQUIRED_IF="(CLIENT_MODE=='JAVA_CLIENT') AND (DB_VERSION=='BONITA_561')" />
|
||||
<IMPORT NAME="asm_153" MODULE="asm-1.5.3.jar" UrlPath="platform:/plugin/org.talend.libraries.asm/lib/asm-1.5.3.jar" REQUIRED="false" />
|
||||
<IMPORT NAME="asm_31" MODULE="asm-3.1.jar" UrlPath="platform:/plugin/org.talend.libraries.asm/lib/asm-3.1.jar" REQUIRED="false" />
|
||||
<IMPORT NAME="asm_attrs_153" MODULE="asm-attrs-1.5.3.jar" UrlPath="platform:/plugin/org.talend.libraries.asm/lib/asm-attrs-1.5.3.jar" REQUIRED="false" />
|
||||
@@ -219,14 +220,14 @@
|
||||
<IMPORT NAME="cglib_nodep_213" MODULE="cglib-nodep-2.1_3.jar" REQUIRED="false" />
|
||||
<IMPORT NAME="commons_collections_211" MODULE="commons-collections-2.1.1.jar" UrlPath="platform:/plugin/org.talend.libraries.apache.common/lib/commons-collections-2.1.1.jar" REQUIRED="false" />
|
||||
<IMPORT NAME="commons_logging_104" MODULE="commons-logging-1.0.4.jar" UrlPath="platform:/base/plugins/org.apache.commons.logging_1.0.4.v201101211617.jar" REQUIRED="false" />
|
||||
<IMPORT NAME="dom4j_161" MODULE="dom4j-1.6.1.jar" UrlPath="platform:/plugin/org.talend.libraries.dom4j-jaxen/lib/dom4j-1.6.1.jar" REQUIRED_IF="DB_VERSION=='BONITA_561'" />
|
||||
<IMPORT NAME="dom4j_161" MODULE="dom4j-1.6.1.jar" UrlPath="platform:/plugin/org.talend.libraries.dom4j-jaxen/lib/dom4j-1.6.1.jar" REQUIRED_IF="(CLIENT_MODE=='JAVA_CLIENT') AND (DB_VERSION=='BONITA_561')" />
|
||||
<IMPORT NAME="ehcache_123" MODULE="ehcache-1.2.3.jar" UrlPath="platform:/plugin/org.talend.libraries.ehcache/lib/ehcache-1.2.3.jar" REQUIRED="false" />
|
||||
<IMPORT NAME="groovy_all_170" MODULE="groovy-all-1.7.0.jar" UrlPath="platform:/plugin/org.talend.libraries.groovy/lib/groovy-all-1.7.0.jar" REQUIRED="false" />
|
||||
|
||||
<IMPORT NAME="h2_12132" MODULE="h2-1.2.132.jar" UrlPath="platform:/plugin/org.talend.libraries.jdbc.h2/lib/h2-1.2.132.jar" REQUIRED="false" />
|
||||
<IMPORT NAME="hibernate_326_ga" MODULE="hibernate-3.2.6.ga.jar" UrlPath="platform:/plugin/org.talend.libraries.hibernate/lib/hibernate-3.2.6.ga.jar" REQUIRED="false" />
|
||||
<IMPORT NAME="jline_0994" MODULE="jline-0.9.94.jar" REQUIRED="false" />
|
||||
<IMPORT NAME="jta_11" MODULE="jta-1.1.jar" REQUIRED_IF="DB_VERSION=='BONITA_561'" />
|
||||
<IMPORT NAME="jta_11" MODULE="jta-1.1.jar" REQUIRED_IF="(CLIENT_MODE=='JAVA_CLIENT') AND (DB_VERSION=='BONITA_561')" />
|
||||
<IMPORT NAME="novabpmidentity_10" MODULE="novaBpmIdentity-1.0.jar" UrlPath="platform:/plugin/org.talend.libraries.novabpm/lib/novaBpmIdentity-1.0.jar" REQUIRED="false" />
|
||||
<IMPORT NAME="novabpmperf_10" MODULE="novaBpmPerf-1.0.jar" UrlPath="platform:/plugin/org.talend.libraries.novabpm/lib/novaBpmPerf-1.0.jar" REQUIRED="false" />
|
||||
|
||||
@@ -237,26 +238,26 @@
|
||||
<!-- Bonita 5.3.1 -->
|
||||
<IMPORT NAME="bonita_client_53" MODULE="bonita-client-5.3.jar" UrlPath="platform:/plugin/org.talend.libraries.bonita/lib/bonita-client-5.3.jar" REQUIRED="false" />
|
||||
<IMPORT NAME="bonita_server_53" MODULE="bonita-server-5.3.jar" UrlPath="platform:/plugin/org.talend.libraries.bonita/lib/bonita-server-5.3.jar" REQUIRED="false" />
|
||||
<IMPORT NAME="hibernate_core_356" MODULE="hibernate-core-3.5.6-Final.jar" UrlPath="platform:/plugin/org.talend.libraries.hibernate/lib/hibernate-core-3.5.6-Final.jar" REQUIRED_IF="DB_VERSION=='BONITA_561'" />
|
||||
<IMPORT NAME="commons_collections_31" MODULE="commons-collections-3.1.jar" UrlPath="platform:/plugin/org.talend.libraries.apache.common/lib/commons-collections-3.1.jar" REQUIRED_IF="DB_VERSION=='BONITA_561'" />
|
||||
<IMPORT NAME="hibernate_core_356" MODULE="hibernate-core-3.5.6-Final.jar" UrlPath="platform:/plugin/org.talend.libraries.hibernate/lib/hibernate-core-3.5.6-Final.jar" REQUIRED_IF="(CLIENT_MODE=='JAVA_CLIENT') AND (DB_VERSION=='BONITA_561')" />
|
||||
<IMPORT NAME="commons_collections_31" MODULE="commons-collections-3.1.jar" UrlPath="platform:/plugin/org.talend.libraries.apache.common/lib/commons-collections-3.1.jar" REQUIRED_IF="(CLIENT_MODE=='JAVA_CLIENT') AND (DB_VERSION=='BONITA_561')" />
|
||||
<IMPORT NAME="ehcache_core_220" MODULE="ehcache-core-2.2.0.jar" UrlPath="platform:/plugin/org.talend.libraries.ehcache/lib/ehcache-core-2.2.0.jar" REQUIRED="false" />
|
||||
<IMPORT NAME="hibernate_commons_annotations_320_Final" MODULE="hibernate-commons-annotations-3.2.0.Final.jar" UrlPath="platform:/plugin/org.talend.libraries.hibernate/lib/hibernate-commons-annotations-3.2.0.Final.jar" REQUIRED_IF="DB_VERSION=='BONITA_561'" />
|
||||
<IMPORT NAME="hibernate_search_321_Final" MODULE="hibernate-search-3.2.1.Final.jar" UrlPath="platform:/plugin/org.talend.libraries.hibernate/lib/hibernate-search-3.2.1.Final.jar" REQUIRED_IF="DB_VERSION=='BONITA_561'" />
|
||||
<IMPORT NAME="javassist_380_GA" MODULE="javassist-3.8.0.GA.jar" REQUIRED_IF="DB_VERSION=='BONITA_561'" />
|
||||
<IMPORT NAME="lucene_core_293" MODULE="lucene-core-2.9.3.jar" UrlPath="platform:/plugin/org.talend.libraries.apache.lucene/lib/lucene-core-2.9.3.jar" REQUIRED_IF="DB_VERSION=='BONITA_561'" />
|
||||
<IMPORT NAME="hibernate_commons_annotations_320_Final" MODULE="hibernate-commons-annotations-3.2.0.Final.jar" UrlPath="platform:/plugin/org.talend.libraries.hibernate/lib/hibernate-commons-annotations-3.2.0.Final.jar" REQUIRED_IF="(CLIENT_MODE=='JAVA_CLIENT') AND (DB_VERSION=='BONITA_561')" />
|
||||
<IMPORT NAME="hibernate_search_321_Final" MODULE="hibernate-search-3.2.1.Final.jar" UrlPath="platform:/plugin/org.talend.libraries.hibernate/lib/hibernate-search-3.2.1.Final.jar" REQUIRED_IF="(CLIENT_MODE=='JAVA_CLIENT') AND (DB_VERSION=='BONITA_561')" />
|
||||
<IMPORT NAME="javassist_380_GA" MODULE="javassist-3.8.0.GA.jar" REQUIRED_IF="(CLIENT_MODE=='JAVA_CLIENT') AND (DB_VERSION=='BONITA_561')" />
|
||||
<IMPORT NAME="lucene_core_293" MODULE="lucene-core-2.9.3.jar" UrlPath="platform:/plugin/org.talend.libraries.apache.lucene/lib/lucene-core-2.9.3.jar" REQUIRED_IF="(CLIENT_MODE=='JAVA_CLIENT') AND (DB_VERSION=='BONITA_561')" />
|
||||
<IMPORT NAME="slf4j_api_161" MODULE="slf4j-api-1.6.1.jar" UrlPath="platform:/plugin/org.talend.libraries.slf4j/lib/slf4j-api-1.6.1.jar" REQUIRED="false" />
|
||||
<IMPORT NAME="commons_logging_111" MODULE="commons-logging-1.1.1.jar" UrlPath="platform:/base/plugins/org.apache.commons.logging_1.1.1.v201101211721.jar" REQUIRED_IF="DB_VERSION=='BONITA_561'" />
|
||||
<IMPORT NAME="commons_logging_111" MODULE="commons-logging-1.1.1.jar" UrlPath="platform:/base/plugins/org.apache.commons.logging_1.1.1.v201101211721.jar" REQUIRED_IF="(CLIENT_MODE=='JAVA_CLIENT') AND (DB_VERSION=='BONITA_561')" />
|
||||
|
||||
<!-- Bonita 5.6.1 -->
|
||||
<IMPORT NAME="bonita_server_561" MODULE="bonita-server-5.6.1.jar" UrlPath="platform:/plugin/org.talend.libraries.bonita/lib/bonita-server-5.6.1.jar" REQUIRED_IF="DB_VERSION=='BONITA_561'" />
|
||||
<IMPORT NAME="chemistry_opencmis_client_api_020_incubating" MODULE="chemistry-opencmis-client-api-0.2.0-incubating.jar" UrlPath="platform:/plugin/org.talend.libraries.apache.chemistry/lib/chemistry-opencmis-client-api-0.2.0-incubating.jar" REQUIRED_IF="DB_VERSION=='BONITA_561'" />
|
||||
<IMPORT NAME="chemistry_opencmis_commons_api_020_incubating" MODULE="chemistry-opencmis-commons-api-0.2.0-incubating.jar" UrlPath="platform:/plugin/org.talend.libraries.apache.chemistry/lib/chemistry-opencmis-commons-api-0.2.0-incubating.jar" REQUIRED_IF="DB_VERSION=='BONITA_561'" />
|
||||
<IMPORT NAME="h2_12139" MODULE="h2-1.2.139.jar" UrlPath="platform:/plugin/org.talend.libraries.jdbc.h2/lib/h2-1.2.139.jar" REQUIRED_IF="DB_VERSION=='BONITA_561'" />
|
||||
<IMPORT NAME="slf4j_api_161" MODULE="slf4j-api-1.6.1.jar" UrlPath="platform:/plugin/org.talend.libraries.slf4j/lib/slf4j-api-1.6.1.jar" REQUIRED_IF="DB_VERSION=='BONITA_561'" />
|
||||
<IMPORT NAME="slf4j_jdk14_161" MODULE="slf4j-jdk14-1.6.1.jar" REQUIRED_IF="DB_VERSION=='BONITA_561'" />
|
||||
<IMPORT NAME="bonita_server_561" MODULE="bonita-server-5.6.1.jar" UrlPath="platform:/plugin/org.talend.libraries.bonita/lib/bonita-server-5.6.1.jar" REQUIRED_IF="(CLIENT_MODE=='JAVA_CLIENT') AND (DB_VERSION=='BONITA_561')" />
|
||||
<IMPORT NAME="chemistry_opencmis_client_api_020_incubating" MODULE="chemistry-opencmis-client-api-0.2.0-incubating.jar" UrlPath="platform:/plugin/org.talend.libraries.apache.chemistry/lib/chemistry-opencmis-client-api-0.2.0-incubating.jar" REQUIRED_IF="(CLIENT_MODE=='JAVA_CLIENT') AND (DB_VERSION=='BONITA_561')" />
|
||||
<IMPORT NAME="chemistry_opencmis_commons_api_020_incubating" MODULE="chemistry-opencmis-commons-api-0.2.0-incubating.jar" UrlPath="platform:/plugin/org.talend.libraries.apache.chemistry/lib/chemistry-opencmis-commons-api-0.2.0-incubating.jar" REQUIRED_IF="(CLIENT_MODE=='JAVA_CLIENT') AND (DB_VERSION=='BONITA_561')" />
|
||||
<IMPORT NAME="h2_12139" MODULE="h2-1.2.139.jar" UrlPath="platform:/plugin/org.talend.libraries.jdbc.h2/lib/h2-1.2.139.jar" REQUIRED_IF="(CLIENT_MODE=='JAVA_CLIENT') AND (DB_VERSION=='BONITA_561')" />
|
||||
<IMPORT NAME="slf4j_api_161" MODULE="slf4j-api-1.6.1.jar" UrlPath="platform:/plugin/org.talend.libraries.slf4j/lib/slf4j-api-1.6.1.jar" REQUIRED_IF="(CLIENT_MODE=='JAVA_CLIENT') AND (DB_VERSION=='BONITA_561')" />
|
||||
<IMPORT NAME="slf4j_jdk14_161" MODULE="slf4j-jdk14-1.6.1.jar" REQUIRED_IF="(CLIENT_MODE=='JAVA_CLIENT') AND (DB_VERSION=='BONITA_561')" />
|
||||
|
||||
<!-- Bonita Http Client -->
|
||||
<IMPORT NAME="bonita_http_client" MODULE="bonita-client-5.2.3.jar" UrlPath="platform:/plugin/org.talend.libraries.bonita/lib/bonita-client-5.2.3.jar" REQUIRED_IF="CLIENT_MODE=='HTTP_CLIENT'" />
|
||||
<IMPORT NAME="apache_commons_codec_1_7" MODULE="commons-codec-1.7.jar" UrlPath="platform:/plugin/org.talend.libraries.apache.common/lib/commons-codec-1.7.jar" REQUIRED_IF="CLIENT_MODE=='HTTP_CLIENT'" />
|
||||
</IMPORTS>
|
||||
</CODEGENERATION>
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ imports="
|
||||
org.talend.core.model.process.IConnectionCategory
|
||||
org.talend.core.model.metadata.IMetadataColumn
|
||||
org.talend.core.model.metadata.IMetadataTable
|
||||
org.talend.core.model.metadata.types.JavaTypesManager
|
||||
"
|
||||
%>
|
||||
|
||||
@@ -18,107 +19,128 @@ imports="
|
||||
|
||||
String processID = ElementParameterParser.getValue(node, "__PROCESS_ID__");
|
||||
String clientMode = ElementParameterParser.getValue(node, "__CLIENT_MODE__");
|
||||
boolean dieOnError = ("true").equals(ElementParameterParser.getValue(node, "__DIE_ON_ERROR__"));
|
||||
|
||||
List< ? extends IConnection> conns = node.getIncomingConnections();
|
||||
if(conns != null && conns.size() > 0 && conns.get(0) != null) {
|
||||
IConnection conn = conns.get(0);
|
||||
if(conn!=null && conn.getLineStyle().hasConnectionCategory(IConnectionCategory.DATA)){
|
||||
INode previousNode = conn.getSource();
|
||||
if(previousNode != null) {
|
||||
List<IMetadataTable> metadatas = previousNode.getMetadataList();
|
||||
if ((metadatas!=null)&&(metadatas.size()>0)) {
|
||||
IMetadataTable metadata = metadatas.get(0);
|
||||
if (metadata!=null) {
|
||||
List<IMetadataColumn> columns = metadata.getListColumns();
|
||||
int sizeColumns = columns.size();
|
||||
for (int i = 0; i < sizeColumns; i++) {
|
||||
if ("HTTP_CLIENT".equals(clientMode)) {
|
||||
if (i==0) {
|
||||
%>
|
||||
parameters_<%=cid%>.append("&variables=<map>");
|
||||
<%
|
||||
}
|
||||
%>
|
||||
parameters_<%=cid%>.append("<entry><string><%=columns.get(i).getLabel() %></string><string>");
|
||||
parameters_<%=cid%>.append("<![CDATA[");
|
||||
parameters_<%=cid%>.append(String.valueOf(<%=conn.getName()%>.<%=(columns.get(i)).getLabel()%>).replaceAll("&","%26"));
|
||||
parameters_<%=cid%>.append("]]>");
|
||||
parameters_<%=cid%>.append("</string></entry>");
|
||||
<%
|
||||
if (i==sizeColumns-1) {
|
||||
%>
|
||||
parameters_<%=cid%>.append("</map>");
|
||||
<%
|
||||
}
|
||||
} else {
|
||||
%>
|
||||
parameters_<%=cid%>.put("<%=(columns.get(i)).getLabel()%>", <%=conn.getName()%>.<%=(columns.get(i)).getLabel()%>);
|
||||
<%
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ("HTTP_CLIENT".equals(clientMode)) {
|
||||
%>
|
||||
java.io.DataOutputStream output_<%=cid%> = new java.io.DataOutputStream(httpConn_<%=cid %>.getOutputStream());
|
||||
output_<%=cid%>.writeBytes(parameters_<%=cid%>.toString());
|
||||
output_<%=cid%>.flush();
|
||||
if (output_<%=cid%> != null) {
|
||||
output_<%=cid%>.close();
|
||||
output_<%=cid%> = null;
|
||||
}
|
||||
int responseCode_<%=cid%> = httpConn_<%=cid %>.getResponseCode();
|
||||
|
||||
if(responseCode_<%=cid %> != java.net.HttpURLConnection.HTTP_OK){
|
||||
System.out.println("----------\nRequest failled: " + responseCode_<%=cid%>+ "----------");
|
||||
throw new java.lang.Exception("Request the url:" + url_<%=cid%> + " failed: " + responseCode_<%=cid%>);
|
||||
} else {
|
||||
java.io.InputStream is_<%=cid%> = httpConn_<%=cid %>.getInputStream();
|
||||
javax.xml.xpath.XPath xPath_<%=cid%> = javax.xml.xpath.XPathFactory.newInstance().newXPath();
|
||||
org.xml.sax.InputSource inputSource_<%=cid %> = new org.xml.sax.InputSource(is_<%=cid %>);
|
||||
processInstanceUUID_<%=cid%> = (String) xPath_<%=cid%>.evaluate("/ProcessInstanceUUID/value/text()", inputSource_<%=cid %>, javax.xml.xpath.XPathConstants.STRING);
|
||||
if (is_<%=cid%> != null) {
|
||||
is_<%=cid%>.close();
|
||||
is_<%=cid%> = null;
|
||||
}
|
||||
}
|
||||
<%
|
||||
} else { // Java Client
|
||||
%>
|
||||
|
||||
org.ow2.bonita.facade.uuid.ProcessInstanceUUID instanceUUID_<%=cid%> = runtimeAPI_<%=cid%>.instantiateProcess(processID_<%=cid%>, parameters_<%=cid%>);
|
||||
processInstanceUUID_<%=cid%> = instanceUUID_<%=cid%>.getValue();
|
||||
<%
|
||||
}
|
||||
|
||||
List<IMetadataTable> metadatas = node.getMetadataList();
|
||||
if ((metadatas!=null)&&(metadatas.size()>0)) {
|
||||
IMetadataTable metadata = metadatas.get(0);
|
||||
if (metadata!=null) {
|
||||
List< ? extends IConnection> conns_out = node.getOutgoingConnections();
|
||||
for (IConnection conn : conns_out) {
|
||||
String connName = conn.getName();
|
||||
if (conn.getLineStyle().hasConnectionCategory(IConnectionCategory.DATA)) {
|
||||
List< ? extends IConnection> conns = node.getIncomingConnections();
|
||||
if(conns != null && conns.size() > 0 && conns.get(0) != null) {
|
||||
IConnection conn = conns.get(0);
|
||||
if(conn!=null && conn.getLineStyle().hasConnectionCategory(IConnectionCategory.DATA)){
|
||||
INode previousNode = conn.getSource();
|
||||
if(previousNode != null) {
|
||||
List<IMetadataTable> metadatas = previousNode.getMetadataList();
|
||||
if ((metadatas!=null)&&(metadatas.size()>0)) {
|
||||
IMetadataTable metadata = metadatas.get(0);
|
||||
if (metadata!=null) {
|
||||
List<IMetadataColumn> columns = metadata.getListColumns();
|
||||
int sizeColumns = columns.size();
|
||||
for (int i = 0; i < sizeColumns; i++) {
|
||||
if ("ProcessInstanceUUID".equals(columns.get(i).getLabel()) ) {
|
||||
%>
|
||||
<%=connName%>.<%=(columns.get(i)).getLabel()%> = processInstanceUUID_<%=cid%>;
|
||||
<%
|
||||
break;
|
||||
if ("HTTP_CLIENT".equals(clientMode)) {
|
||||
if (i==0) {
|
||||
%>
|
||||
parameters_<%=cid%>.append("&variables=<map>");
|
||||
<%
|
||||
}
|
||||
%>
|
||||
parameters_<%=cid%>.append("<entry><string><%=columns.get(i).getLabel() %></string><string>");
|
||||
<%if(!JavaTypesManager.isJavaPrimitiveType(columns.get(i).getTalendType(), columns.get(i).isNullable())) {%>
|
||||
if(<%=conn.getName()%>.<%=(columns.get(i)).getLabel()%> != null) {
|
||||
<%}%>
|
||||
parameters_<%=cid%>.append("<![CDATA[");
|
||||
parameters_<%=cid%>.append(java.net.URLEncoder.encode(java.net.URLEncoder.encode(String.valueOf(<%=conn.getName()%>.<%=(columns.get(i)).getLabel()%>), utf8Charset),utf8Charset));
|
||||
parameters_<%=cid%>.append("]]>");
|
||||
<%if(!JavaTypesManager.isJavaPrimitiveType(columns.get(i).getTalendType(), columns.get(i).isNullable())) {%>
|
||||
}
|
||||
<%}%>
|
||||
parameters_<%=cid%>.append("</string></entry>");
|
||||
<%
|
||||
if (i==sizeColumns-1) {
|
||||
%>
|
||||
parameters_<%=cid%>.append("</map>");
|
||||
<%
|
||||
}
|
||||
} else {
|
||||
%>
|
||||
parameters_<%=cid%>.put("<%=(columns.get(i)).getLabel()%>", <%=conn.getName()%>.<%=(columns.get(i)).getLabel()%>);
|
||||
<%
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
%>
|
||||
try{
|
||||
<%
|
||||
if ("HTTP_CLIENT".equals(clientMode)) {
|
||||
%>
|
||||
java.io.DataOutputStream output_<%=cid%> = new java.io.DataOutputStream(httpConn_<%=cid %>.getOutputStream());
|
||||
output_<%=cid%>.writeBytes(parameters_<%=cid%>.toString());
|
||||
output_<%=cid%>.flush();
|
||||
if (output_<%=cid%> != null) {
|
||||
output_<%=cid%>.close();
|
||||
output_<%=cid%> = null;
|
||||
}
|
||||
int responseCode_<%=cid%> = httpConn_<%=cid %>.getResponseCode();
|
||||
|
||||
if(responseCode_<%=cid %> != java.net.HttpURLConnection.HTTP_OK){
|
||||
System.out.println("----------\nRequest failled: " + responseCode_<%=cid%>+ "----------");
|
||||
throw new java.lang.Exception("Request the url:" + url_<%=cid%> + " failed: " + responseCode_<%=cid%>);
|
||||
} else {
|
||||
java.io.InputStream is_<%=cid%> = httpConn_<%=cid %>.getInputStream();
|
||||
javax.xml.xpath.XPath xPath_<%=cid%> = javax.xml.xpath.XPathFactory.newInstance().newXPath();
|
||||
org.xml.sax.InputSource inputSource_<%=cid %> = new org.xml.sax.InputSource(is_<%=cid %>);
|
||||
processInstanceUUID_<%=cid%> = (String) xPath_<%=cid%>.evaluate("/ProcessInstanceUUID/value/text()", inputSource_<%=cid %>, javax.xml.xpath.XPathConstants.STRING);
|
||||
if (is_<%=cid%> != null) {
|
||||
is_<%=cid%>.close();
|
||||
is_<%=cid%> = null;
|
||||
}
|
||||
}
|
||||
<%
|
||||
} else { // Java Client
|
||||
%>
|
||||
org.ow2.bonita.facade.uuid.ProcessInstanceUUID instanceUUID_<%=cid%> = runtimeAPI_<%=cid%>.instantiateProcess(processID_<%=cid%>, parameters_<%=cid%>);
|
||||
processInstanceUUID_<%=cid%> = instanceUUID_<%=cid%>.getValue();
|
||||
<%
|
||||
}
|
||||
%>
|
||||
} catch (java.lang.Exception lee_<%=cid%>) {
|
||||
<%
|
||||
if (dieOnError) {
|
||||
%>
|
||||
throw lee_<%=cid%>;
|
||||
<%
|
||||
} else {
|
||||
%>
|
||||
System.err.println(lee_<%=cid%>.getMessage());
|
||||
<%
|
||||
}
|
||||
%>
|
||||
}
|
||||
<%
|
||||
List<IMetadataTable> metadatas = node.getMetadataList();
|
||||
if ((metadatas!=null)&&(metadatas.size()>0)) {
|
||||
IMetadataTable metadata = metadatas.get(0);
|
||||
if (metadata!=null) {
|
||||
List< ? extends IConnection> conns_out = node.getOutgoingConnections();
|
||||
for (IConnection conn : conns_out) {
|
||||
String connName = conn.getName();
|
||||
if (conn.getLineStyle().hasConnectionCategory(IConnectionCategory.DATA)) {
|
||||
List<IMetadataColumn> columns = metadata.getListColumns();
|
||||
int sizeColumns = columns.size();
|
||||
for (int i = 0; i < sizeColumns; i++) {
|
||||
if ("ProcessInstanceUUID".equals(columns.get(i).getLabel()) ) {
|
||||
%>
|
||||
<%=connName%>.<%=(columns.get(i)).getLabel()%> = processInstanceUUID_<%=cid%>;
|
||||
<%
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
%>
|
||||
|
||||
}
|
||||
%>
|
||||
|
||||
System.out.println("**** Instance "+ processInstanceUUID_<%=cid%> + " created ****");
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
HELP=org.talend.help.tCloudInstanceStop
|
||||
LONG_NAME=Allows to suspend, resume, reboot or stop cloud provider instances.
|
||||
LONG_NAME=Allows to suspend, resume or terminate cloud provider instances.
|
||||
|
||||
AUTHENTICATION.NAME=Authentication
|
||||
CONFIGURATION.NAME=Configuration
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
<PARAMETER
|
||||
NAME="SCHEMA"
|
||||
FIELD="SCHEMA_TYPE"
|
||||
READONLY="true"
|
||||
REQUIRED="true"
|
||||
NUM_ROW="1"
|
||||
>
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
<PARAMETER
|
||||
NAME="SCHEMA"
|
||||
FIELD="SCHEMA_TYPE"
|
||||
READONLY="true"
|
||||
REQUIRED="true"
|
||||
NUM_ROW="1"
|
||||
>
|
||||
|
||||
@@ -208,7 +208,7 @@
|
||||
FIELD="TEXT"
|
||||
NUM_ROW="70"
|
||||
REPOSITORY_VALUE="SCHEMA"
|
||||
SHOW_IF="(DBTYPE=='DBORACLE' or DBTYPE=='POSTGRE' or DBTYPE=='POSTGREPLUS' or DBTYPE=='INFORMIX' or DBTYPE=='DB2' or DBTYPE=='GREENPLUM' or DBTYPE=='VERTICA') and (USE_EXISTING_CONNECTION == 'false')"
|
||||
SHOW_IF="(DBTYPE=='DBORACLE' or DBTYPE=='POSTGRE' or DBTYPE=='POSTGREPLUS' or DBTYPE=='INFORMIX' or DBTYPE=='DB2' or DBTYPE=='GREENPLUM' or DBTYPE=='VERTICA' or DBTYPE=='MSSQL' or DBTYPE=='SYBASE') and (USE_EXISTING_CONNECTION == 'false')"
|
||||
>
|
||||
<DEFAULT>""</DEFAULT>
|
||||
</PARAMETER>
|
||||
@@ -482,6 +482,18 @@
|
||||
NUM_ROW="30"
|
||||
SHOW_IF="(DBTYPE=='POSTGRE') and (USE_EXISTING_CONNECTION == 'true')"
|
||||
/>
|
||||
|
||||
<PARAMETER
|
||||
NAME="DB_POSTGRE_VERSION"
|
||||
FIELD="CLOSED_LIST"
|
||||
NUM_ROW="50"
|
||||
SHOW_IF="((DBTYPE=='POSTGRE') or (DBTYPE=='POSTGREPLUS')) and (USE_EXISTING_CONNECTION == 'false')">
|
||||
<ITEMS DEFAULT="PRIOR_TO_V9">
|
||||
<ITEM NAME="PRIOR_TO_V9" VALUE="PRIOR_TO_V9" />
|
||||
<ITEM NAME="V9_X" VALUE="V9_X" />
|
||||
</ITEMS>
|
||||
</PARAMETER>
|
||||
|
||||
<!--Postgre configuration end-->
|
||||
|
||||
<!--PostgrePlus configuration start-->
|
||||
@@ -657,37 +669,38 @@
|
||||
<IMPORTS>
|
||||
<IMPORT NAME="Driver-V5R2_V5R4" MODULE="jt400_V5R2.jar" UrlPath="platform:/plugin/org.talend.libraries.jdbc.as400/lib/jt400_V5R2.jar" REQUIRED_IF="(USE_EXISTING_CONNECTION == 'false') and (DBTYPE=='AS400') and (DB_AS400_VERSION=='V5R2_V5R4')"/>
|
||||
<IMPORT NAME="Driver-V5R3_V6R1" MODULE="jt400_V5R3.jar" UrlPath="platform:/plugin/org.talend.libraries.jdbc.as400/lib/jt400_V5R3.jar" REQUIRED_IF="(USE_EXISTING_CONNECTION == 'false') and (DBTYPE=='AS400') and (DB_AS400_VERSION=='V5R3_V6R1')"/>
|
||||
<IMPORT NAME="Driver-DB2" MODULE="db2jcc.jar" REQUIRED_IF="DBTYPE=='DB2'" />
|
||||
<IMPORT NAME="Driver-DB2-LICENSE-CISUZ" MODULE="db2jcc_license_cisuz.jar" REQUIRED_IF="DBTYPE=='DB2'" />
|
||||
<IMPORT NAME="Driver-DB2-LICENSE-CU" MODULE="db2jcc_license_cu.jar" REQUIRED_IF="DBTYPE=='DB2'" />
|
||||
<IMPORT NAME="Driver-DB2" MODULE="db2jcc.jar" REQUIRED_IF="(USE_EXISTING_CONNECTION == 'false') AND (DBTYPE=='DB2')" />
|
||||
<IMPORT NAME="Driver-DB2-LICENSE-CISUZ" MODULE="db2jcc_license_cisuz.jar" REQUIRED_IF="(USE_EXISTING_CONNECTION == 'false') AND (DBTYPE=='DB2')" />
|
||||
<IMPORT NAME="Driver-DB2-LICENSE-CU" MODULE="db2jcc_license_cu.jar" REQUIRED_IF="(USE_EXISTING_CONNECTION == 'false') AND (DBTYPE=='DB2')" />
|
||||
<IMPORT NAME="Driver_MaxDB" MODULE="sapdbc.jar" REQUIRED_IF="DBTYPE=='MAXDB'" />
|
||||
<IMPORT NAME="Driver-MSSQL" MODULE="jtds-1.2.5.jar" UrlPath="platform:/plugin/org.talend.libraries.jdbc.jtds/lib/jtds-1.2.5.jar" REQUIRED_IF="DBTYPE=='MSSQL'" />
|
||||
<IMPORT NAME="Driver-MSSQL" MODULE="jtds-1.2.5.jar" UrlPath="platform:/plugin/org.talend.libraries.jdbc.jtds/lib/jtds-1.2.5.jar" REQUIRED_IF="(USE_EXISTING_CONNECTION == 'false') AND (DBTYPE=='MSSQL')" />
|
||||
<IMPORT NAME="Driver-MYSQL4" MODULE="mysql-connector-java-3.1.14-bin.jar" UrlPath="platform:/plugin/org.talend.libraries.jdbc.mysql/lib/mysql-connector-java-3.1.14-bin.jar" REQUIRED_IF="(USE_EXISTING_CONNECTION == 'false') and (DBTYPE=='MYSQL') and (DB_MYSQL_VERSION=='MYSQL_4')"/>
|
||||
<IMPORT NAME="Driver-MYSQL5" MODULE="mysql-connector-java-5.1.22-bin.jar" UrlPath="platform:/plugin/org.talend.libraries.jdbc.mysql/lib/mysql-connector-java-5.1.22-bin.jar" REQUIRED_IF="(USE_EXISTING_CONNECTION == 'false') and (DBTYPE=='MYSQL') and (DB_MYSQL_VERSION=='MYSQL_5')"/>
|
||||
<IMPORT NAME="Driver-Oracle8i" MODULE="ojdbc12.jar" UrlPath="platform:/plugin/org.talend.libraries.jdbc.oracle/lib/ojdbc12.jar" REQUIRED_IF="(DB_VERSION == 'ORACLE_8') AND (USE_EXISTING_CONNECTION == 'false')" />
|
||||
<IMPORT NAME="Driver-Oracle9i" MODULE="ojdbc14-9i.jar" UrlPath="platform:/plugin/org.talend.libraries.jdbc.oracle/lib/ojdbc14-9i.jar" REQUIRED_IF="(DB_VERSION == 'ORACLE_9') AND (USE_EXISTING_CONNECTION == 'false')" />
|
||||
<IMPORT NAME="Driver-Oracle10g" MODULE="ojdbc14.jar" UrlPath="platform:/plugin/org.talend.libraries.jdbc.oracle/lib/ojdbc14.jar" REQUIRED_IF="(DB_VERSION == 'ORACLE_10') AND (USE_EXISTING_CONNECTION == 'false')" />
|
||||
<IMPORT NAME="Driver-Oracle11g-1" MODULE="ojdbc5.jar" UrlPath="platform:/plugin/org.talend.libraries.jdbc.oracle/lib/ojdbc5.jar" REQUIRED_IF="(DB_VERSION == 'ORACLE_11') AND (USE_EXISTING_CONNECTION == 'false')" />
|
||||
<IMPORT NAME="Driver-Oracle11g-2" MODULE="ojdbc6.jar" UrlPath="platform:/plugin/org.talend.libraries.jdbc.oracle/lib/ojdbc6.jar" REQUIRED_IF="(DB_VERSION == 'ORACLE_11-6') AND (USE_EXISTING_CONNECTION == 'false')" />
|
||||
<IMPORT NAME="Driver-POSTGRESQL" MODULE="postgresql-8.3-603.jdbc3.jar" UrlPath="platform:/plugin/org.talend.libraries.jdbc.postgresql/lib/postgresql-8.3-603.jdbc3.jar" REQUIRED_IF="(DBTYPE=='POSTGRE') or (DBTYPE=='POSTGREPLUS') or (DBTYPE=='GREENPLUM')" />
|
||||
<IMPORT NAME="Driver-FIREBIRD" MODULE="jaybird-full-2.1.1.jar" UrlPath="platform:/plugin/org.talend.libraries.jdbc.firebird/lib/jaybird-full-2.1.1.jar" REQUIRED_IF="DBTYPE=='FIREBIRD'" />
|
||||
<IMPORT NAME="Driver-Oracle8i" MODULE="ojdbc12.jar" UrlPath="platform:/plugin/org.talend.libraries.jdbc.oracle/lib/ojdbc12.jar" REQUIRED_IF="(DBTYPE=='DBORACLE') AND (DB_VERSION == 'ORACLE_8') AND (USE_EXISTING_CONNECTION == 'false')" />
|
||||
<IMPORT NAME="Driver-Oracle9i" MODULE="ojdbc14-9i.jar" UrlPath="platform:/plugin/org.talend.libraries.jdbc.oracle/lib/ojdbc14-9i.jar" REQUIRED_IF="(DBTYPE=='DBORACLE') AND (DB_VERSION == 'ORACLE_9') AND (USE_EXISTING_CONNECTION == 'false')" />
|
||||
<IMPORT NAME="Driver-Oracle10g" MODULE="ojdbc14.jar" UrlPath="platform:/plugin/org.talend.libraries.jdbc.oracle/lib/ojdbc14.jar" REQUIRED_IF="(DBTYPE=='DBORACLE') AND (DB_VERSION == 'ORACLE_10') AND (USE_EXISTING_CONNECTION == 'false')" />
|
||||
<IMPORT NAME="Driver-Oracle11g-1" MODULE="ojdbc5.jar" UrlPath="platform:/plugin/org.talend.libraries.jdbc.oracle/lib/ojdbc5.jar" REQUIRED_IF="(DBTYPE=='DBORACLE') AND (DB_VERSION == 'ORACLE_11') AND (USE_EXISTING_CONNECTION == 'false')" />
|
||||
<IMPORT NAME="Driver-Oracle11g-2" MODULE="ojdbc6.jar" UrlPath="platform:/plugin/org.talend.libraries.jdbc.oracle/lib/ojdbc6.jar" REQUIRED_IF="(DBTYPE=='DBORACLE') AND (DB_VERSION == 'ORACLE_11-6') AND (USE_EXISTING_CONNECTION == 'false')" />
|
||||
<IMPORT NAME="Driver-POSTGRESQL" MODULE="postgresql-8.3-603.jdbc3.jar" UrlPath="platform:/plugin/org.talend.libraries.jdbc.postgresql/lib/postgresql-8.3-603.jdbc3.jar" REQUIRED_IF="(USE_EXISTING_CONNECTION == 'false') AND ((((DBTYPE=='POSTGRE') or (DBTYPE=='POSTGREPLUS')) AND (DB_POSTGRE_VERSION =='PRIOR_TO_V9')) or (DBTYPE=='GREENPLUM'))" />
|
||||
<IMPORT NAME="Driver-Postgres9" MODULE="postgresql-9.2-1003.jdbc3.jar" UrlPath="platform:/plugin/org.talend.libraries.jdbc.postgresql/lib/postgresql-9.2-1003.jdbc3.jar" REQUIRED_IF="(USE_EXISTING_CONNECTION == 'false') AND (((DBTYPE=='POSTGRE') or (DBTYPE=='POSTGREPLUS')) AND (DB_POSTGRE_VERSION =='V9_X'))" />
|
||||
<IMPORT NAME="Driver-FIREBIRD" MODULE="jaybird-full-2.1.1.jar" UrlPath="platform:/plugin/org.talend.libraries.jdbc.firebird/lib/jaybird-full-2.1.1.jar" REQUIRED_IF="(USE_EXISTING_CONNECTION == 'false') AND (DBTYPE=='FIREBIRD')" />
|
||||
<IMPORT NAME="Driver-HSQLDb" MODULE="hsqldb.jar" UrlPath="platform:/plugin/org.talend.libraries.jdbc.hsql/lib/hsqldb.jar" REQUIRED_IF="DBTYPE=='HSQLDB'"/>
|
||||
<IMPORT NAME="Driver-INFORMIX-JDBC" MODULE="ifxjdbc.jar" REQUIRED_IF="DBTYPE=='INFORMIX'" />
|
||||
<IMPORT NAME="Driver-INFORMIX-JDBCX" MODULE="ifxjdbcx.jar" REQUIRED_IF="DBTYPE=='INFORMIX'" />
|
||||
<IMPORT NAME="Driver-INFORMIX-LANG" MODULE="ifxlang.jar" REQUIRED_IF="DBTYPE=='INFORMIX'" />
|
||||
<IMPORT NAME="Driver-INFORMIX-LSUPP" MODULE="ifxlsupp.jar" REQUIRED_IF="DBTYPE=='INFORMIX'" />
|
||||
<IMPORT NAME="Driver-INFORMIX-SQLJ" MODULE="ifxsqlj.jar" REQUIRED_IF="DBTYPE=='INFORMIX'" />
|
||||
<IMPORT NAME="Driver-INFORMIX-TOOLS" MODULE="ifxtools.jar" REQUIRED_IF="DBTYPE=='INFORMIX'"/>
|
||||
<IMPORT NAME="Driver-INGRES" MODULE="iijdbc.jar" UrlPath="platform:/plugin/org.talend.libraries.jdbc.ingres/lib/iijdbc.jar" REQUIRED_IF="DBTYPE=='INGRES'"/>
|
||||
<IMPORT NAME="Driver-Interbase" MODULE="interclient.jar" REQUIRED_IF="DBTYPE=='INTERBASE'" />
|
||||
<IMPORT NAME="Driver-INFORMIX-JDBC" MODULE="ifxjdbc.jar" REQUIRED_IF="(USE_EXISTING_CONNECTION == 'false') AND (DBTYPE=='INFORMIX')" />
|
||||
<IMPORT NAME="Driver-INFORMIX-JDBCX" MODULE="ifxjdbcx.jar" REQUIRED_IF="(USE_EXISTING_CONNECTION == 'false') AND (DBTYPE=='INFORMIX')" />
|
||||
<IMPORT NAME="Driver-INFORMIX-LANG" MODULE="ifxlang.jar" REQUIRED_IF="(USE_EXISTING_CONNECTION == 'false') AND (DBTYPE=='INFORMIX')" />
|
||||
<IMPORT NAME="Driver-INFORMIX-LSUPP" MODULE="ifxlsupp.jar" REQUIRED_IF="(USE_EXISTING_CONNECTION == 'false') AND (DBTYPE=='INFORMIX')" />
|
||||
<IMPORT NAME="Driver-INFORMIX-SQLJ" MODULE="ifxsqlj.jar" REQUIRED_IF="(USE_EXISTING_CONNECTION == 'false') AND (DBTYPE=='INFORMIX')" />
|
||||
<IMPORT NAME="Driver-INFORMIX-TOOLS" MODULE="ifxtools.jar" REQUIRED_IF="(USE_EXISTING_CONNECTION == 'false') AND (DBTYPE=='INFORMIX')"/>
|
||||
<IMPORT NAME="Driver-INGRES" MODULE="iijdbc.jar" UrlPath="platform:/plugin/org.talend.libraries.jdbc.ingres/lib/iijdbc.jar" REQUIRED_IF="(USE_EXISTING_CONNECTION == 'false') AND (DBTYPE=='INGRES')"/>
|
||||
<IMPORT NAME="Driver-Interbase" MODULE="interclient.jar" REQUIRED_IF="(USE_EXISTING_CONNECTION == 'false') AND (DBTYPE=='INTERBASE')" />
|
||||
<IMPORT NAME="Driver-JAVADB-DERBY" MODULE="derby.jar" UrlPath="platform:/plugin/org.talend.libraries.jdbc.derby/lib/derby.jar" REQUIRED_IF="DBTYPE=='JAVADB'"/>
|
||||
<IMPORT NAME="Driver-JAVADB-DERBYCLIENT" MODULE="derbyclient.jar" UrlPath="platform:/plugin/org.talend.libraries.jdbc.derby/lib/derbyclient.jar" REQUIRED_IF="DBTYPE=='JAVADB'"/>
|
||||
<IMPORT NAME="Driver-JAVADB-DERBYNET" MODULE="derbynet.jar" UrlPath="platform:/plugin/org.talend.libraries.jdbc.derby/lib/derbynet.jar" REQUIRED_IF="DBTYPE=='JAVADB'"/>
|
||||
<IMPORT NAME="Driver-SQLITE-JDBC-NESTED" MODULE="sqlitejdbc-v056.jar" UrlPath="platform:/plugin/org.talend.libraries.jdbc.sqlite3/lib/sqlitejdbc-v056.jar" REQUIRED_IF="DBTYPE=='SQLITE'" />
|
||||
<IMPORT NAME="Driver-SYBASE-JCONN3" MODULE="jconn3.jar" REQUIRED_IF="DBTYPE=='SYBASE'" />
|
||||
<IMPORT NAME="Driver-Teradata_jdbc" MODULE="terajdbc4.jar" UrlPath="platform:/plugin/org.talend.libraries.jdbc.teradata/lib/terajdbc4.jar" REQUIRED_IF="DBTYPE=='TERADATA'" />
|
||||
<IMPORT NAME="Driver-Teradata_config" MODULE="tdgssconfig.jar" UrlPath="platform:/plugin/org.talend.libraries.jdbc.teradata/lib/tdgssconfig.jar" REQUIRED_IF="DBTYPE=='TERADATA'" />
|
||||
<IMPORT NAME="Driver-Netezza" MODULE="nzjdbc.jar" REQUIRED_IF="DBTYPE=='NETEZZA'" />
|
||||
<IMPORT NAME="Driver-SQLITE-JDBC-NESTED" MODULE="sqlitejdbc-v056.jar" UrlPath="platform:/plugin/org.talend.libraries.jdbc.sqlite3/lib/sqlitejdbc-v056.jar" REQUIRED_IF="(USE_EXISTING_CONNECTION == 'false') AND (DBTYPE=='SQLITE')" />
|
||||
<IMPORT NAME="Driver-SYBASE-JCONN3" MODULE="jconn3.jar" REQUIRED_IF="(USE_EXISTING_CONNECTION == 'false') AND (DBTYPE=='SYBASE')" />
|
||||
<IMPORT NAME="Driver-Teradata_jdbc" MODULE="terajdbc4.jar" UrlPath="platform:/plugin/org.talend.libraries.jdbc.teradata/lib/terajdbc4.jar" REQUIRED_IF="(USE_EXISTING_CONNECTION == 'false') AND (DBTYPE=='TERADATA')" />
|
||||
<IMPORT NAME="Driver-Teradata_config" MODULE="tdgssconfig.jar" UrlPath="platform:/plugin/org.talend.libraries.jdbc.teradata/lib/tdgssconfig.jar" REQUIRED_IF="(USE_EXISTING_CONNECTION == 'false') AND (DBTYPE=='TERADATA')" />
|
||||
<IMPORT NAME="Driver-Netezza" MODULE="nzjdbc.jar" REQUIRED_IF="(USE_EXISTING_CONNECTION == 'false') AND (DBTYPE=='NETEZZA')" />
|
||||
<IMPORT NAME="Driver-VERTICA" MODULE="vertica_3.0_jdk_5.jar" UrlPath="platform:/plugin/org.talend.libraries.jdbc.vertica/lib/vertica_3.0_jdk_5.jar" REQUIRED_IF="(DBTYPE=='VERTICA') and (USE_EXISTING_CONNECTION == 'false') and (DB_VERTICA_VERSION=='VERTICA_3')" />
|
||||
<IMPORT NAME="Driver-VERTICA_3.5" MODULE="vertica_3.5_jdk_5.jar" UrlPath="platform:/plugin/org.talend.libraries.jdbc.vertica/lib/vertica_3.5_jdk_5.jar" REQUIRED_IF="(DBTYPE=='VERTICA') and (USE_EXISTING_CONNECTION == 'false') and (DB_VERTICA_VERSION=='VERTICA_3.5')" />
|
||||
<IMPORT NAME="Driver-VERTICA_4" MODULE="vertica_4.0_jdk_5.jar" UrlPath="platform:/plugin/org.talend.libraries.jdbc.vertica/lib/vertica_4.0_jdk_5.jar" REQUIRED_IF="(DBTYPE=='VERTICA') and (USE_EXISTING_CONNECTION == 'false') and (DB_VERTICA_VERSION=='VERTICA_4')" />
|
||||
|
||||
@@ -351,6 +351,7 @@ class AccessManager extends Manager {
|
||||
class DB2Manager extends Manager {
|
||||
private String host;
|
||||
private String port;
|
||||
private String userName;
|
||||
private String dbSchema;
|
||||
private boolean useExistingConnection;
|
||||
private String connection;
|
||||
@@ -359,6 +360,7 @@ class DB2Manager extends Manager {
|
||||
this.host = host;
|
||||
this.port = port;
|
||||
this.dbSchema = dbSchema;
|
||||
this.userName = userName;
|
||||
this.useExistingConnection = useExistingConnection;
|
||||
this.connection = connection;
|
||||
}
|
||||
@@ -402,8 +404,10 @@ class DB2Manager extends Manager {
|
||||
javaCode.append(super.retrieveTable());
|
||||
if(useExistingConnection) {
|
||||
javaCode.append("String dbSchema_" + cid + " = (String)globalMap.get(\"tableschema_" + connection + "\");\r\n");
|
||||
javaCode.append("String dbUser_" + cid + " = (String)globalMap.get(\"username_" + connection + "\");\r\n");
|
||||
} else {
|
||||
javaCode.append("String dbSchema_" + cid + " = " + dbSchema + ";\r\n");
|
||||
javaCode.append("String dbUser_" + cid + " = " + userName + ";\r\n");
|
||||
}
|
||||
javaCode.append("if(dbSchema_" + cid + " != null && dbSchema_" + cid + ".trim().length() != 0) {");
|
||||
javaCode.append("tableName_" + cid + " = dbSchema_" + cid + " + \"" + getLProtectedChar() + "." + getRProtectedChar() + "\" + tableName_" + cid + ";\r\n");
|
||||
@@ -744,7 +748,7 @@ class JavaDBManager extends Manager {
|
||||
javaCode.append("}\r\n");
|
||||
javaCode.append("}\r\n");
|
||||
javaCode.append("if(!isServerUp_" + cid + ") {\r\n");
|
||||
javaCode.append("System.exit(1);\r\n");
|
||||
javaCode.append("throw new java.lang.Exception(\"Can not obtain a connection to network server\");\r\n");
|
||||
javaCode.append("}\r\n");
|
||||
return javaCode.toString();
|
||||
}
|
||||
@@ -796,13 +800,15 @@ class MaxDBManager extends Manager {
|
||||
class MSSQLManager extends Manager {
|
||||
private String host;
|
||||
private String port;
|
||||
private String dbSchema;
|
||||
private boolean useExistingConnection;
|
||||
private String connection;
|
||||
private String dbproperty;
|
||||
public MSSQLManager(String host, String port, String dbName, String tableName, String userName, String password, boolean useExistingConnection, String connection, String cid, String dbproperty) {
|
||||
public MSSQLManager(String host, String port, String dbName, String dbSchema, String tableName, String userName, String password, boolean useExistingConnection, String connection, String cid, String dbproperty) {
|
||||
super(dbName, tableName, userName, password, cid);
|
||||
this.host = host;
|
||||
this.port = port;
|
||||
this.dbSchema = dbSchema;
|
||||
this.useExistingConnection = useExistingConnection;
|
||||
this.connection = connection;
|
||||
this.dbproperty = dbproperty;
|
||||
@@ -845,6 +851,19 @@ class MSSQLManager extends Manager {
|
||||
}
|
||||
return javaCode.toString();
|
||||
}
|
||||
protected String retrieveTable() {
|
||||
StringBuilder javaCode = new StringBuilder();
|
||||
javaCode.append(super.retrieveTable());
|
||||
if(useExistingConnection) {
|
||||
javaCode.append("String dbSchema_" + cid + " = (String)globalMap.get(\"dbschema_" + connection + "\");\r\n");
|
||||
} else {
|
||||
javaCode.append("String dbSchema_" + cid + " = " + dbSchema + ";\r\n");
|
||||
}
|
||||
javaCode.append("if(dbSchema_" + cid + " != null && dbSchema_" + cid + ".trim().length() != 0) {");
|
||||
javaCode.append("tableName_" + cid + " = dbSchema_" + cid + " + \"" + getRProtectedChar() + "." + getLProtectedChar() + "\" + tableName_" + cid + ";\r\n");
|
||||
javaCode.append("}");
|
||||
return javaCode.toString();
|
||||
}
|
||||
}
|
||||
class MysqlManager extends Manager {
|
||||
private String host;
|
||||
@@ -1274,12 +1293,14 @@ class SQLiteManager extends Manager {
|
||||
class SybaseManager extends Manager {
|
||||
private String host;
|
||||
private String port;
|
||||
private String dbSchema;
|
||||
private boolean useExistingConnection;
|
||||
private String connection;
|
||||
public SybaseManager(String host, String port, String dbName, String tableName, String userName, String password, String cid, boolean useExistingConnection, String connection) {
|
||||
public SybaseManager(String host, String port, String dbName, String dbSchema, String tableName, String userName, String password, String cid, boolean useExistingConnection, String connection) {
|
||||
super(dbName, tableName, userName, password, cid);
|
||||
this.host = host;
|
||||
this.port = port;
|
||||
this.dbSchema = dbSchema;
|
||||
this.useExistingConnection = useExistingConnection;
|
||||
this.connection = connection;
|
||||
}
|
||||
@@ -1324,6 +1345,19 @@ class SybaseManager extends Manager {
|
||||
}
|
||||
return javaCode.toString();
|
||||
}
|
||||
protected String retrieveTable() {
|
||||
StringBuilder javaCode = new StringBuilder();
|
||||
javaCode.append(super.retrieveTable());
|
||||
if(useExistingConnection) {
|
||||
javaCode.append("String dbSchema_" + cid + " = (String)globalMap.get(\"dbschema_" + connection + "\");\r\n");
|
||||
} else {
|
||||
javaCode.append("String dbSchema_" + cid + " = " + dbSchema + ";\r\n");
|
||||
}
|
||||
javaCode.append("if(dbSchema_" + cid + " != null && dbSchema_" + cid + ".trim().length() != 0) {");
|
||||
javaCode.append("tableName_" + cid + " = dbSchema_" + cid + " + \"" + getRProtectedChar() + "." + getLProtectedChar() + "\" + tableName_" + cid + ";\r\n");
|
||||
javaCode.append("}");
|
||||
return javaCode.toString();
|
||||
}
|
||||
}
|
||||
class ODBCManager extends Manager {
|
||||
public ODBCManager(String dbName, String tableName, String userName, String password, String cid) {
|
||||
@@ -1786,12 +1820,13 @@ class ManagerFactory {
|
||||
String host = ElementParameterParser.getValue(node, "__HOST__");
|
||||
String port = ElementParameterParser.getValue(node, "__PORT__");
|
||||
String dbName = ElementParameterParser.getValue(node, "__DBNAME__");
|
||||
String dbSchema = ElementParameterParser.getValue(node, "__SCHEMA_DB__");
|
||||
String userName = ElementParameterParser.getValue(node, "__USER__");
|
||||
String password = ElementParameterParser.getValue(node, "__PASS__");
|
||||
boolean useExistingConnection = ("true").equals(ElementParameterParser.getValue(node, "__USE_EXISTING_CONNECTION__"));
|
||||
String connection = stringUtil.getString(ElementParameterParser.getValue(node, "__CONNECTION_MSSQL__"));
|
||||
String dbproperties = ElementParameterParser.getValue(node, "__PROPERTIES__");
|
||||
manager = new MSSQLManager(host, port, dbName, tableName, userName, password, useExistingConnection, connection, cid, dbproperties);
|
||||
manager = new MSSQLManager(host, port, dbName,dbSchema, tableName, userName, password, useExistingConnection, connection, cid, dbproperties);
|
||||
} else if(("MYSQL").equals(dbType)) {
|
||||
String host = ElementParameterParser.getValue(node, "__HOST__");
|
||||
String port = ElementParameterParser.getValue(node, "__PORT__");
|
||||
@@ -1855,11 +1890,12 @@ class ManagerFactory {
|
||||
String host = ElementParameterParser.getValue(node, "__HOST__");
|
||||
String port = ElementParameterParser.getValue(node, "__PORT__");
|
||||
String dbName = ElementParameterParser.getValue(node, "__DBNAME__");
|
||||
String dbSchema = ElementParameterParser.getValue(node, "__SCHEMA_DB__");
|
||||
String userName = ElementParameterParser.getValue(node, "__USER__");
|
||||
String password = ElementParameterParser.getValue(node, "__PASS__");
|
||||
boolean useExistingConnection = ("true").equals(ElementParameterParser.getValue(node, "__USE_EXISTING_CONNECTION__"));
|
||||
String connection = stringUtil.getString(ElementParameterParser.getValue(node, "__CONNECTION_SYBASE__"));
|
||||
manager = new SybaseManager(host, port, dbName, tableName, userName, password, cid,useExistingConnection, connection);
|
||||
manager = new SybaseManager(host, port, dbName, dbSchema, tableName, userName, password, cid,useExistingConnection, connection);
|
||||
} else if(("TERADATA").equals(dbType)) {
|
||||
String host = ElementParameterParser.getValue(node, "__HOST__");
|
||||
String port = ElementParameterParser.getValue(node, "__PORT__");
|
||||
@@ -1942,6 +1978,9 @@ if(columnList != null && columnList.size() > 0) {
|
||||
<%
|
||||
} else {
|
||||
String tableName = ElementParameterParser.getValue(node,"__TABLE__");
|
||||
%>
|
||||
boolean whetherExist_<%=cid%> = false;
|
||||
<%
|
||||
if("DBORACLE".equalsIgnoreCase(dbType)) {
|
||||
%>
|
||||
<%=manager.generateCode4TabelExist()%>
|
||||
@@ -1952,16 +1991,77 @@ if(columnList != null && columnList.size() > 0) {
|
||||
tableNameForSearch_<%=cid%> = tableNameForSearch_<%=cid%>.replaceAll("\"","");
|
||||
}
|
||||
java.sql.ResultSet rsTable_<%=cid%> = dbMetaData_<%=cid%>.getTables(null, dbschemaForSearch_<%=cid%>, tableNameForSearch_<%=cid%>, new String[]{"TABLE"});
|
||||
boolean whetherExist_<%=cid%> = false;
|
||||
if(rsTable_<%=cid%>.next()) {
|
||||
whetherExist_<%=cid%> = true;
|
||||
}
|
||||
<%
|
||||
} else if("DB2".equalsIgnoreCase(dbType) ){
|
||||
%>
|
||||
java.sql.DatabaseMetaData dbMetaData_<%=cid%> = conn_<%=cid%>.getMetaData();
|
||||
java.sql.ResultSet rsTable_<%=cid%> = dbMetaData_<%=cid%>.getTables(null, null, null, new String[]{"TABLE"});
|
||||
while(rsTable_<%=cid%>.next()) {
|
||||
String table_<%=cid%> = rsTable_<%=cid%>.getString("TABLE_NAME");
|
||||
String schema_<%=cid%> = rsTable_<%=cid%>.getString("TABLE_SCHEM");
|
||||
if(table_<%=cid%>.equals<%if(!tableNameCaseSensitive){%>IgnoreCase<%}%>(<%=tableName%>)
|
||||
&& (schema_<%=cid%>.equals<%if(!tableNameCaseSensitive){%>IgnoreCase<%}%>(dbSchema_<%=cid%>) || (dbSchema_<%=cid%>.trim().length() ==0 && dbUser_<%=cid%>.equalsIgnoreCase(schema_<%=cid%>)))) {
|
||||
whetherExist_<%=cid%> = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
<%
|
||||
} else if ("GREENPLUM".equalsIgnoreCase(dbType) || "POSTGRE".equalsIgnoreCase(dbType) || "POSTGREPLUS".equalsIgnoreCase(dbType)) {
|
||||
%>
|
||||
java.sql.DatabaseMetaData dbMetaData_<%=cid%> = conn_<%=cid%>.getMetaData();
|
||||
java.sql.ResultSet rsTable_<%=cid%> = dbMetaData_<%=cid%>.getTables(null, null, null, new String[]{"TABLE"});
|
||||
String defaultSchema_<%=cid%> = "public";
|
||||
if(dbSchema_<%=cid%> == null || dbSchema_<%=cid%>.trim().length() == 0) {
|
||||
java.sql.Statement stmtSchema_<%=cid%> = conn_<%=cid%>.createStatement();
|
||||
java.sql.ResultSet rsSchema_<%=cid%> = stmtSchema_<%=cid%>.executeQuery("select current_schema() ");
|
||||
while(rsSchema_<%=cid%>.next()){
|
||||
defaultSchema_<%=cid%> = rsSchema_<%=cid%>.getString("current_schema");
|
||||
}
|
||||
rsSchema_<%=cid%>.close();
|
||||
stmtSchema_<%=cid%>.close();
|
||||
}
|
||||
while(rsTable_<%=cid%>.next()) {
|
||||
String table_<%=cid%> = rsTable_<%=cid%>.getString("TABLE_NAME");
|
||||
String schema_<%=cid%> = rsTable_<%=cid%>.getString("TABLE_SCHEM");
|
||||
if(table_<%=cid%>.equals<%if(!tableNameCaseSensitive){%>IgnoreCase<%}%>(<%=tableName%>)
|
||||
&& (schema_<%=cid%>.equals<%if(!tableNameCaseSensitive){%>IgnoreCase<%}%>(dbSchema_<%=cid%>) || ((dbSchema_<%=cid%> ==null || dbSchema_<%=cid%>.trim().length() ==0) && defaultSchema_<%=cid%>.equals<%if(!tableNameCaseSensitive){%>IgnoreCase<%}%>(schema_<%=cid%>)))) {
|
||||
whetherExist_<%=cid%> = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
<%
|
||||
} else if ("MSSQL".equalsIgnoreCase(dbType)){
|
||||
%>
|
||||
java.sql.Statement rsTable_<%=cid%> = conn_<%=cid%>.createStatement();
|
||||
try {
|
||||
rsTable_<%=cid%>.execute("SELECT TOP 1 1 FROM [" + tableName_<%=cid%> + "]" );
|
||||
whetherExist_<%=cid%> = true;
|
||||
} catch (Exception e){
|
||||
whetherExist_<%=cid%> = false;
|
||||
}
|
||||
<%
|
||||
} else if ( "SYBASE".equalsIgnoreCase(dbType)
|
||||
|| "INFORMIX".equalsIgnoreCase(dbType) ) {
|
||||
%>
|
||||
java.sql.DatabaseMetaData dbMetaData_<%=cid%> = conn_<%=cid%>.getMetaData();
|
||||
java.sql.ResultSet rsTable_<%=cid%> = dbMetaData_<%=cid%>.getTables(null, null, null, new String[]{"TABLE"});
|
||||
while(rsTable_<%=cid%>.next()) {
|
||||
String table_<%=cid%> = rsTable_<%=cid%>.getString("TABLE_NAME");
|
||||
String schema_<%=cid%> = rsTable_<%=cid%>.getString("TABLE_SCHEM");
|
||||
if(table_<%=cid%>.equals<%if(!tableNameCaseSensitive){%>IgnoreCase<%}%>(<%=tableName%>)
|
||||
&& (schema_<%=cid%>.equals<%if(!tableNameCaseSensitive){%>IgnoreCase<%}%>(dbSchema_<%=cid%>) || dbSchema_<%=cid%>.trim().length() ==0)) {
|
||||
whetherExist_<%=cid%> = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
<%
|
||||
} else {
|
||||
%>
|
||||
java.sql.DatabaseMetaData dbMetaData_<%=cid%> = conn_<%=cid%>.getMetaData();
|
||||
java.sql.ResultSet rsTable_<%=cid%> = dbMetaData_<%=cid%>.getTables(null, null, null, new String[]{"TABLE"});
|
||||
boolean whetherExist_<%=cid%> = false;
|
||||
while(rsTable_<%=cid%>.next()) {
|
||||
String table_<%=cid%> = rsTable_<%=cid%>.getString("TABLE_NAME");
|
||||
if(table_<%=cid%>.equals<%if(!tableNameCaseSensitive){%>IgnoreCase<%}%>(<%=tableName%>)) {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user