Compare commits
50 Commits
patch/TPS-
...
patch/6.2.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2f13f612d1 | ||
|
|
8a29ce0cca | ||
|
|
3baad3ccb4 | ||
|
|
000d0a7303 | ||
|
|
7ff2c1ed85 | ||
|
|
f29a245b37 | ||
|
|
353ddf4c81 | ||
|
|
628b9823d0 | ||
|
|
e43eddc640 | ||
|
|
7324909e47 | ||
|
|
07dbb2290b | ||
|
|
0d9fcd37aa | ||
|
|
04e548767d | ||
|
|
05b930b03c | ||
|
|
57129a397b | ||
|
|
9ae828aff5 | ||
|
|
9070781c2f | ||
|
|
b4a3af4f67 | ||
|
|
48f72b11d7 | ||
|
|
46220f02bc | ||
|
|
13c80b2c88 | ||
|
|
f0da35cf60 | ||
|
|
2537ae8e2e | ||
|
|
b55cf75135 | ||
|
|
0627124947 | ||
|
|
190450f915 | ||
|
|
86c77c0416 | ||
|
|
2fb6ef6e53 | ||
|
|
b1311bcd54 | ||
|
|
b271f83c1c | ||
|
|
45afa66efd | ||
|
|
3aa3e47855 | ||
|
|
eb1301dccf | ||
|
|
ac1022bc79 | ||
|
|
cd3a00d088 | ||
|
|
164fcde5b0 | ||
|
|
9335d70831 | ||
|
|
9a5d16c730 | ||
|
|
a32215f49e | ||
|
|
fa2e0bf792 | ||
|
|
d68cf06314 | ||
|
|
52b889c93b | ||
|
|
471fe65fb5 | ||
|
|
f79830afa4 | ||
|
|
2785036086 | ||
|
|
d189eab24e | ||
|
|
9030083da6 | ||
|
|
3daf9e5f0d | ||
|
|
975352f4d1 | ||
|
|
6a28240d32 |
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.componentdesigner.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.componentdesigner.rcp.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.designer.abstractmap.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.designer.alfrescooutput.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.designer.business.diagram.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.designer.codegen.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.designer.components.exchange.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.designer.core.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.designer.dbmap.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.designer.documentation.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.designer.fileoutputxml.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.designer.gefabstractmap.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.designer.hl7.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.designer.mapper.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.designer.maven.job.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.designer.rowgenerator.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.designer.runprocess.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.designer.scd.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.designer.webservice.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.designer.xmlmap.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.expressionbuilder.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.presentation.onboarding.resource.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.presentation.onboarding.resource.tos.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.repository.ftp.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.repository.json.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.repository.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.repository.view.di.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.sbi.engines.client.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.spagic.engines.client.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.sqlbuilder.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.componentdesigner.feature</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.designer.business.feature</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.designer.feature</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.rcp.branding.tos.feature</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.rcp.branding.tos.test.feature</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.repository.feature</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.sbi.feature</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.spagic.feature</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.tos.components.feature</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.tos.feature</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.tos.libraries.feature</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.componentdesigner.rcp</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.componentdesigner</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.designer.abstractmap</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.designer.alfrescooutput</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.designer.business.diagram</artifactId>
|
||||
|
||||
@@ -1110,13 +1110,16 @@ if (execStat) {
|
||||
<% if(exist_tMDM) { %>
|
||||
private void closeMDMConnections() {
|
||||
try {
|
||||
<% for (INode mdmComponent : mdmComponentsList) { %>
|
||||
org.talend.mdm.webservice.TMDMService service_<%=mdmComponent.getUniqueName() %> = (org.talend.mdm.webservice.TMDMService)globalMap.get("TMDMService_<%=mdmComponent.getUniqueName() %>");
|
||||
if(service_<%=mdmComponent.getUniqueName() %> != null)
|
||||
{
|
||||
service_<%=mdmComponent.getUniqueName() %>.logout(new org.talend.mdm.webservice.WSLogout());
|
||||
}
|
||||
<% } %>
|
||||
java.util.Iterator keySets = globalMap.keySet().iterator();
|
||||
while (keySets.hasNext()) {
|
||||
String key = keySets.next().toString();
|
||||
if (key.startsWith("TMDMService_tMDMConnection_")) {
|
||||
org.talend.mdm.webservice.TMDMService service = (org.talend.mdm.webservice.TMDMService)globalMap.get(key);
|
||||
if (service != null) {
|
||||
service.logout(new org.talend.mdm.webservice.WSLogout());
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (java.lang.Exception e) {
|
||||
}
|
||||
}
|
||||
@@ -1228,12 +1231,14 @@ if (execStat) {
|
||||
connections.put("connBaseDN_<%=ldapNode.getUniqueName() %>", globalMap.get("connBaseDN_<%=ldapNode.getUniqueName() %>"));
|
||||
<% } %>
|
||||
|
||||
<% for (INode mdmNode : mdmComponentsList) {%>
|
||||
connections.put("TMDMService_<%=mdmNode.getUniqueName() %>", globalMap.get("TMDMService_<%=mdmNode.getUniqueName() %>"));
|
||||
<% if( "false".equals(ElementParameterParser.getValue(mdmNode, "__AUTO_COMMIT__"))) {%>
|
||||
connections.put("mdmTransaction_<%=mdmNode.getUniqueName() %>", globalMap.get("mdmTransaction_<%=mdmNode.getUniqueName() %>"));
|
||||
<% }
|
||||
} %>
|
||||
<% for (INode mdmNode : mdmComponentsList) {%>
|
||||
connections.put("mdmUrl_<%=mdmNode.getUniqueName() %>", globalMap.get("mdmUrl_<%=mdmNode.getUniqueName() %>"));
|
||||
connections.put("username_<%=mdmNode.getUniqueName() %>", globalMap.get("username_<%=mdmNode.getUniqueName() %>"));
|
||||
connections.put("password_<%=mdmNode.getUniqueName() %>", globalMap.get("password_<%=mdmNode.getUniqueName() %>"));
|
||||
connections.put("useTransaction_<%=mdmNode.getUniqueName() %>", globalMap.get("useTransaction_<%=mdmNode.getUniqueName() %>"));
|
||||
connections.put("useClientTranId_<%=mdmNode.getUniqueName() %>", globalMap.get("useClientTranId_<%=mdmNode.getUniqueName() %>"));
|
||||
<% } %>
|
||||
|
||||
<% for (INode paloNode : paloComponentsList) { %>
|
||||
connections.put("p_<%=paloNode.getUniqueName() %>", globalMap.get("p_<%=paloNode.getUniqueName() %>"));
|
||||
connections.put("pConn_<%=paloNode.getUniqueName() %>", globalMap.get("pConn_<%=paloNode.getUniqueName() %>"));
|
||||
|
||||
@@ -118,27 +118,52 @@ class IndexedRecordToRowStructGenerator {
|
||||
dynamicMetadata_<%=cid%>.setName(childDynamic_<%=cid%>.name());
|
||||
dynamicMetadata_<%=cid%>.setDbName(childDynamic_<%=cid%>.name());
|
||||
String talendType_<%=cid%> = null;
|
||||
if (childDynamic_<%=cid%>.schema().getType() == org.apache.avro.Schema.Type.ARRAY) {
|
||||
org.apache.avro.Schema.Type type_<%=cid%> = childDynamic_<%=cid%>.schema().getType();
|
||||
if(type_<%=cid%> == org.apache.avro.Schema.Type.UNION){
|
||||
java.util.List<org.apache.avro.Schema> fieldTypes_<%=cid%> = childDynamic_<%=cid%>.schema().getTypes();
|
||||
for(org.apache.avro.Schema fieldType_<%=cid%>:fieldTypes_<%=cid%>){
|
||||
if(fieldType_<%=cid%>.getType() == org.apache.avro.Schema.Type.NULL){
|
||||
dynamicMetadata_<%=cid%>.setNullable(true);
|
||||
}else{
|
||||
type_<%=cid%> = fieldType_<%=cid%>.getType();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (type_<%=cid%> == org.apache.avro.Schema.Type.ARRAY) {
|
||||
talendType_<%=cid%> = "<%=JavaTypesManager.LIST.getId()%>";
|
||||
} else if (childDynamic_<%=cid%>.schema().getType() == org.apache.avro.Schema.Type.BOOLEAN) {
|
||||
} else if (type_<%=cid%> == org.apache.avro.Schema.Type.BOOLEAN) {
|
||||
talendType_<%=cid%> = "<%=JavaTypesManager.BOOLEAN.getId()%>";
|
||||
} else if (childDynamic_<%=cid%>.schema().getType() == org.apache.avro.Schema.Type.BYTES) {
|
||||
} else if (type_<%=cid%> == org.apache.avro.Schema.Type.BYTES) {
|
||||
talendType_<%=cid%> = "<%=JavaTypesManager.BYTE_ARRAY.getId()%>";
|
||||
} else if (childDynamic_<%=cid%>.schema().getType() == org.apache.avro.Schema.Type.FIXED) {
|
||||
} else if (type_<%=cid%> == org.apache.avro.Schema.Type.FIXED) {
|
||||
talendType_<%=cid%> = "<%=JavaTypesManager.BYTE_ARRAY.getId()%>";
|
||||
} else if (childDynamic_<%=cid%>.schema().getType() == org.apache.avro.Schema.Type.DOUBLE) {
|
||||
} else if (type_<%=cid%> == org.apache.avro.Schema.Type.DOUBLE) {
|
||||
talendType_<%=cid%> = "<%=JavaTypesManager.DOUBLE.getId()%>";
|
||||
} else if (childDynamic_<%=cid%>.schema().getType() == org.apache.avro.Schema.Type.FLOAT) {
|
||||
} else if (type_<%=cid%> == org.apache.avro.Schema.Type.FLOAT) {
|
||||
talendType_<%=cid%> = "<%=JavaTypesManager.FLOAT.getId()%>";
|
||||
} else if (childDynamic_<%=cid%>.schema().getType() == org.apache.avro.Schema.Type.INT) {
|
||||
} else if (type_<%=cid%> == org.apache.avro.Schema.Type.INT) {
|
||||
talendType_<%=cid%> = "<%=JavaTypesManager.INTEGER.getId()%>";
|
||||
} else if (childDynamic_<%=cid%>.schema().getType() == org.apache.avro.Schema.Type.LONG) {
|
||||
talendType_<%=cid%> = "<%=JavaTypesManager.LONG.getId()%>";
|
||||
} else if (childDynamic_<%=cid%>.schema().getType() == org.apache.avro.Schema.Type.ENUM) {
|
||||
} else if (type_<%=cid%> == org.apache.avro.Schema.Type.LONG) {
|
||||
String pattern_<%=cid%> = childDynamic_<%=cid%>.getProp(org.talend.daikon.di.DiSchemaConstants.TALEND6_COLUMN_PATTERN);
|
||||
if(pattern_<%=cid%>!=null && !pattern_<%=cid%>.trim().isEmpty()){
|
||||
talendType_<%=cid%> = "<%=JavaTypesManager.DATE.getId()%>";
|
||||
dynamicMetadata_<%=cid%>.setFormat(pattern_<%=cid%>);
|
||||
}else{
|
||||
talendType_<%=cid%> = "<%=JavaTypesManager.LONG.getId()%>";
|
||||
}
|
||||
} else if (type_<%=cid%> == org.apache.avro.Schema.Type.ENUM) {
|
||||
talendType_<%=cid%> = "<%=JavaTypesManager.STRING.getId()%>";
|
||||
} else if (childDynamic_<%=cid%>.schema().getType() == org.apache.avro.Schema.Type.STRING) {
|
||||
} else if (type_<%=cid%> == org.apache.avro.Schema.Type.STRING) {
|
||||
talendType_<%=cid%> = "<%=JavaTypesManager.STRING.getId()%>";
|
||||
}
|
||||
Object length_<%=cid%> = childDynamic_<%=cid%>.getProp(org.talend.daikon.di.DiSchemaConstants.TALEND6_COLUMN_LENGTH);
|
||||
if(length_<%=cid%> != null){
|
||||
dynamicMetadata_<%=cid%>.setLength(Integer.parseInt(String.valueOf(length_<%=cid%>)));
|
||||
}
|
||||
Object precision_<%=cid%> = childDynamic_<%=cid%>.getProp(org.talend.daikon.di.DiSchemaConstants.TALEND6_COLUMN_PRECISION);
|
||||
if(precision_<%=cid%> != null){
|
||||
dynamicMetadata_<%=cid%>.setPrecision(Integer.parseInt(String.valueOf(precision_<%=cid%>)));
|
||||
}
|
||||
dynamicMetadata_<%=cid%>.setType(talendType_<%=cid%>);
|
||||
<%=codeVarDynamic%>.metadatas.add(dynamicMetadata_<%=cid%>);
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.designer.codegen</artifactId>
|
||||
|
||||
@@ -20,6 +20,7 @@ import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
@@ -99,7 +100,7 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
|
||||
private static Logger log = Logger.getLogger(ComponentsFactory.class);
|
||||
|
||||
private static HashSet<IComponent> componentList = null;
|
||||
private static Set<IComponent> componentList = null;
|
||||
|
||||
private static HashSet<IComponent> customComponentList = null;
|
||||
|
||||
@@ -145,7 +146,7 @@ public class ComponentsFactory implements IComponentsFactory {
|
||||
// TimeMeasure.measureActive = true;
|
||||
// TimeMeasure.begin("initComponents");
|
||||
|
||||
componentList = new HashSet<IComponent>();
|
||||
componentList = Collections.synchronizedSet(new HashSet<IComponent>());
|
||||
customComponentList = new HashSet<IComponent>();
|
||||
skeletonList = new ArrayList<String>();
|
||||
userComponentList = new HashSet<IComponent>();
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.designer.components.exchange</artifactId>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<talend.nexus.url>http://newbuild.talend.com:8081</talend.nexus.url>
|
||||
<talend.nexus.url>https://artifacts-zl.talend.com</talend.nexus.url>
|
||||
</properties>
|
||||
|
||||
<distributionManagement>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<cxf.version>3.1.1</cxf.version>
|
||||
<talend.nexus.url>http://newbuild.talend.com:8081</talend.nexus.url>
|
||||
<talend.nexus.url>https://artifacts-zl.talend.com</talend.nexus.url>
|
||||
</properties>
|
||||
|
||||
<distributionManagement>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.designer.components.libs</artifactId>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,181 +1,207 @@
|
||||
<%@ jet
|
||||
imports="
|
||||
org.talend.core.model.process.INode
|
||||
org.talend.core.model.metadata.IMetadataTable
|
||||
org.talend.core.model.metadata.IMetadataColumn
|
||||
org.talend.designer.codegen.config.CodeGeneratorArgument
|
||||
org.talend.core.model.process.ElementParameterParser
|
||||
java.util.List
|
||||
java.util.ArrayList
|
||||
java.util.LinkedList
|
||||
java.util.Map
|
||||
java.util.HashMap
|
||||
org.talend.core.model.process.IConnection
|
||||
org.talend.core.model.process.IConnectionCategory
|
||||
org.talend.core.model.metadata.types.JavaTypesManager
|
||||
org.talend.core.model.metadata.types.JavaType
|
||||
org.talend.core.model.utils.NodeUtil
|
||||
org.talend.core.model.process.EConnectionType
|
||||
"
|
||||
skeleton="tFileOutputMSXML_java.skeleton"
|
||||
%>
|
||||
<%@ include file="../templates/Log4j/Log4jFileUtil.javajet"%>
|
||||
<%
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
final INode node = (INode)codeGenArgument.getArgument();
|
||||
String cid = node.getUniqueName();
|
||||
|
||||
final boolean isLog4jEnabled = "true".equals(ElementParameterParser.getValue(node.getProcess(), "__LOG4J_ACTIVATE__"));
|
||||
|
||||
String incomingName = (String)codeGenArgument.getIncomingName();
|
||||
List<IMetadataTable> metadatas = NodeUtil.getIncomingMetadataTable(node, IConnectionCategory.FLOW);
|
||||
|
||||
if ((metadatas!=null)&&(metadatas.size()>0)) {
|
||||
final List< ? extends IConnection> incomingConns = node.getIncomingConnections();
|
||||
//Notice here: only for the code viewer, because when click the tUnite component, it doesn't know which is the right input connection.
|
||||
if (incomingName == null && incomingConns.size() > 0)
|
||||
{
|
||||
incomingName = incomingConns.get(0).getName();
|
||||
}
|
||||
|
||||
if(incomingConns!=null && incomingConns.size()>0){
|
||||
|
||||
String encoding = ElementParameterParser.getValue(node, "__ENCODING__");
|
||||
String fileName = ElementParameterParser.getValue(node, "__FILENAME__");
|
||||
boolean trimText = ("true").equals(ElementParameterParser.getValue(node,"__TRIM_TEXT__"));
|
||||
|
||||
// List<Map<String, String>> rootTable =
|
||||
// (List<Map<String,String>>)ElementParameterParser.getObjectValue(node, "__ROOT__");
|
||||
// List<Map<String, String>> groupTable =
|
||||
// (List<Map<String,String>>)ElementParameterParser.getObjectValue(node, "__GROUP__");
|
||||
// List<Map<String, String>> loopTable =
|
||||
// (List<Map<String,String>>)ElementParameterParser.getObjectValue(node, "__LOOP__");
|
||||
%>
|
||||
int nb_line_<%=cid%> = 0;
|
||||
|
||||
String fileName_<%=cid%> = <%=fileName%>;
|
||||
java.io.File createFile<%=cid%> = new java.io.File(fileName_<%=cid%>);
|
||||
<%
|
||||
if(("true").equals(ElementParameterParser.getValue(node,"__CREATE__"))){
|
||||
%>
|
||||
//create directory only if not exists
|
||||
java.io.File parentFile_<%=cid%> = createFile<%=cid%>.getParentFile();
|
||||
if(parentFile_<%=cid%> != null && !parentFile_<%=cid%>.exists()) {
|
||||
parentFile_<%=cid%>.mkdirs();
|
||||
}
|
||||
<%
|
||||
}
|
||||
%>
|
||||
|
||||
class NestXMLTool_<%=cid%>{
|
||||
public void parseAndAdd(org.dom4j.Element nestRoot, String value){
|
||||
try {
|
||||
org.dom4j.Document doc4Str = org.dom4j.DocumentHelper.parseText("<root>"+ value + "</root>");
|
||||
nestRoot.setContent(doc4Str.getRootElement().content());
|
||||
} catch (java.lang.Exception e) {
|
||||
e.printStackTrace();
|
||||
<%if(isLog4jEnabled) {%>
|
||||
log.error("<%=cid%> - " + e.getMessage());
|
||||
<%}%>
|
||||
nestRoot.setText(value);
|
||||
}
|
||||
}
|
||||
|
||||
public void setText(org.dom4j.Element element, String value){
|
||||
if (value.startsWith("<![CDATA[") && value.endsWith("]]>")) {
|
||||
String text = value.substring(9, value.length()-3);
|
||||
element.addCDATA(text);
|
||||
}else{
|
||||
element.setText(value);
|
||||
}
|
||||
}
|
||||
|
||||
public void replaceDefaultNameSpace(org.dom4j.Element nestRoot){
|
||||
if (nestRoot!=null) {
|
||||
for (org.dom4j.Element tmp: (java.util.List<org.dom4j.Element>) nestRoot.elements()) {
|
||||
if (("").equals(tmp.getQName().getNamespace().getURI()) && ("").equals(tmp.getQName().getNamespace().getPrefix())){
|
||||
tmp.setQName(org.dom4j.DocumentHelper.createQName(tmp.getName(), nestRoot.getQName().getNamespace()));
|
||||
}
|
||||
replaceDefaultNameSpace(tmp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void removeEmptyElement(org.dom4j.Element root){
|
||||
if (root!=null) {
|
||||
for (org.dom4j.Element tmp: (java.util.List<org.dom4j.Element>) root.elements()) {
|
||||
removeEmptyElement(tmp);
|
||||
}
|
||||
if (root.content().size() == 0
|
||||
&& root.attributes().size() == 0
|
||||
&& root.declaredNamespaces().size() == 0) {
|
||||
if(root.getParent()!=null){
|
||||
root.getParent().remove(root);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
final org.dom4j.Document doc_<%=cid %> = org.dom4j.DocumentHelper.createDocument();
|
||||
|
||||
final java.util.Map<String,org.dom4j.Branch> nameToElement_<%=cid%> = new java.util.HashMap<String,org.dom4j.Branch>();
|
||||
|
||||
final NestXMLTool_<%=cid%> nestXMLTool_<%=cid%> = new NestXMLTool_<%=cid%>();
|
||||
|
||||
final org.dom4j.io.OutputFormat format_<%=cid%> = org.dom4j.io.OutputFormat.createPrettyPrint();
|
||||
format_<%=cid %>.setEncoding(<%=encoding%>);
|
||||
format_<%=cid %>.setTrimText(<%=trimText%>);
|
||||
|
||||
class OrderHelper_<%=cid%> {
|
||||
java.util.Map<String,Boolean> recalculateOrderMap = new java.util.HashMap<String,Boolean>();
|
||||
java.util.Map<String,Integer> orderMap = new java.util.HashMap<String,Integer>();
|
||||
java.util.Map<String,Boolean> tailAppendMap = new java.util.HashMap<String,Boolean>();
|
||||
|
||||
boolean need_recalculate(String field) {
|
||||
Boolean result = recalculateOrderMap.get(field);
|
||||
return result == null ? true : result;
|
||||
}
|
||||
|
||||
boolean tailAppend(String field) {
|
||||
Boolean result = tailAppendMap.get(field);
|
||||
return result == null ? false : result;
|
||||
}
|
||||
|
||||
int order(String field) {
|
||||
Integer order = orderMap.get(field);
|
||||
return order == null ? 0 : order;
|
||||
}
|
||||
|
||||
void fillRecalculateOrderMap(String field,Boolean value) {
|
||||
recalculateOrderMap.put(field,value);
|
||||
}
|
||||
|
||||
void fillTailAppendMap(String field,Boolean value) {
|
||||
tailAppendMap.put(field,value);
|
||||
}
|
||||
|
||||
void setOrder(String field,Integer order) {
|
||||
orderMap.put(field,order);
|
||||
}
|
||||
}
|
||||
|
||||
final OrderHelper_<%=cid%> orderHelper_<%=cid%> = new OrderHelper_<%=cid%>();
|
||||
|
||||
<%@ include file="tFileOutputMSXML_begin.inc.javajet"%>
|
||||
|
||||
<%
|
||||
int schemaOptNum=100;
|
||||
String schemaOptNumStr=ElementParameterParser.getValue(node, "__SCHEMA_OPT_NUM__");
|
||||
if(schemaOptNumStr!=null && !"".equals(schemaOptNumStr) && !"\"\"".equals(schemaOptNumStr)){
|
||||
schemaOptNum = Integer.parseInt(schemaOptNumStr);
|
||||
}
|
||||
OptimizeCodeGenerator optimizeGen = new OptimizeCodeGenerator(cid,schemaOptNum );
|
||||
optimizeGen.setBeginPart(true);
|
||||
optimizeGen.incomingName = incomingName;
|
||||
optimizeGen.generateCode(node);
|
||||
}
|
||||
}
|
||||
%>
|
||||
<%@ jet
|
||||
imports="
|
||||
org.talend.core.model.process.INode
|
||||
org.talend.core.model.metadata.IMetadataTable
|
||||
org.talend.core.model.metadata.IMetadataColumn
|
||||
org.talend.designer.codegen.config.CodeGeneratorArgument
|
||||
org.talend.core.model.process.ElementParameterParser
|
||||
java.util.List
|
||||
java.util.ArrayList
|
||||
java.util.LinkedList
|
||||
java.util.Map
|
||||
java.util.HashMap
|
||||
org.talend.core.model.process.IConnection
|
||||
org.talend.core.model.process.IConnectionCategory
|
||||
org.talend.core.model.metadata.types.JavaTypesManager
|
||||
org.talend.core.model.metadata.types.JavaType
|
||||
org.talend.core.model.utils.NodeUtil
|
||||
org.talend.core.model.process.EConnectionType
|
||||
"
|
||||
skeleton="tFileOutputMSXML_java.skeleton"
|
||||
%>
|
||||
<%@ include file="../templates/Log4j/Log4jFileUtil.javajet"%>
|
||||
<%
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
final INode node = (INode)codeGenArgument.getArgument();
|
||||
String cid = node.getUniqueName();
|
||||
|
||||
final boolean isLog4jEnabled = "true".equals(ElementParameterParser.getValue(node.getProcess(), "__LOG4J_ACTIVATE__"));
|
||||
|
||||
String incomingName = (String)codeGenArgument.getIncomingName();
|
||||
List<IMetadataTable> metadatas = NodeUtil.getIncomingMetadataTable(node, IConnectionCategory.FLOW);
|
||||
|
||||
if ((metadatas!=null)&&(metadatas.size()>0)) {
|
||||
final List< ? extends IConnection> incomingConns = node.getIncomingConnections();
|
||||
//Notice here: only for the code viewer, because when click the tUnite component, it doesn't know which is the right input connection.
|
||||
if (incomingName == null && incomingConns.size() > 0)
|
||||
{
|
||||
incomingName = incomingConns.get(0).getName();
|
||||
}
|
||||
|
||||
if(incomingConns!=null && incomingConns.size()>0){
|
||||
|
||||
String encoding = ElementParameterParser.getValue(node, "__ENCODING__");
|
||||
String fileName = ElementParameterParser.getValue(node, "__FILENAME__");
|
||||
boolean trimText = ("true").equals(ElementParameterParser.getValue(node,"__TRIM_TEXT__"));
|
||||
|
||||
// List<Map<String, String>> rootTable =
|
||||
// (List<Map<String,String>>)ElementParameterParser.getObjectValue(node, "__ROOT__");
|
||||
// List<Map<String, String>> groupTable =
|
||||
// (List<Map<String,String>>)ElementParameterParser.getObjectValue(node, "__GROUP__");
|
||||
// List<Map<String, String>> loopTable =
|
||||
// (List<Map<String,String>>)ElementParameterParser.getObjectValue(node, "__LOOP__");
|
||||
%>
|
||||
int nb_line_<%=cid%> = 0;
|
||||
|
||||
String fileName_<%=cid%> = <%=fileName%>;
|
||||
java.io.File createFile<%=cid%> = new java.io.File(fileName_<%=cid%>);
|
||||
<%
|
||||
if(("true").equals(ElementParameterParser.getValue(node,"__CREATE__"))){
|
||||
%>
|
||||
//create directory only if not exists
|
||||
java.io.File parentFile_<%=cid%> = createFile<%=cid%>.getParentFile();
|
||||
if(parentFile_<%=cid%> != null && !parentFile_<%=cid%>.exists()) {
|
||||
parentFile_<%=cid%>.mkdirs();
|
||||
}
|
||||
<%
|
||||
}
|
||||
%>
|
||||
|
||||
class NestXMLTool_<%=cid%>{
|
||||
public void parseAndAdd(org.dom4j.Element nestRoot, String value){
|
||||
try {
|
||||
org.dom4j.Document doc4Str = org.dom4j.DocumentHelper.parseText("<root>"+ value + "</root>");
|
||||
nestRoot.setContent(doc4Str.getRootElement().content());
|
||||
} catch (java.lang.Exception e) {
|
||||
e.printStackTrace();
|
||||
<%if(isLog4jEnabled) {%>
|
||||
log.error("<%=cid%> - " + e.getMessage());
|
||||
<%}%>
|
||||
nestRoot.setText(value);
|
||||
}
|
||||
}
|
||||
|
||||
public void setText(org.dom4j.Element element, String value){
|
||||
if (value.startsWith("<![CDATA[") && value.endsWith("]]>")) {
|
||||
String text = value.substring(9, value.length()-3);
|
||||
element.addCDATA(text);
|
||||
}else{
|
||||
element.setText(value);
|
||||
}
|
||||
}
|
||||
|
||||
public void replaceDefaultNameSpace(org.dom4j.Element nestRoot){
|
||||
if (nestRoot!=null) {
|
||||
for (org.dom4j.Element tmp: (java.util.List<org.dom4j.Element>) nestRoot.elements()) {
|
||||
if (("").equals(tmp.getQName().getNamespace().getURI()) && ("").equals(tmp.getQName().getNamespace().getPrefix())){
|
||||
tmp.setQName(org.dom4j.DocumentHelper.createQName(tmp.getName(), nestRoot.getQName().getNamespace()));
|
||||
}
|
||||
replaceDefaultNameSpace(tmp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void removeEmptyElement(org.dom4j.Element root){
|
||||
if (root!=null) {
|
||||
for (org.dom4j.Element tmp: (java.util.List<org.dom4j.Element>) root.elements()) {
|
||||
removeEmptyElement(tmp);
|
||||
}
|
||||
if (root.content().size() == 0
|
||||
&& root.attributes().size() == 0
|
||||
&& root.declaredNamespaces().size() == 0) {
|
||||
if(root.getParent()!=null){
|
||||
root.getParent().remove(root);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
final org.dom4j.Document doc_<%=cid %> = org.dom4j.DocumentHelper.createDocument();
|
||||
|
||||
final java.util.Map<String,org.dom4j.Branch> nameToElement_<%=cid%> = new java.util.HashMap<String,org.dom4j.Branch>();
|
||||
|
||||
final NestXMLTool_<%=cid%> nestXMLTool_<%=cid%> = new NestXMLTool_<%=cid%>();
|
||||
|
||||
final org.dom4j.io.OutputFormat format_<%=cid%> = org.dom4j.io.OutputFormat.createPrettyPrint();
|
||||
format_<%=cid %>.setEncoding(<%=encoding%>);
|
||||
format_<%=cid %>.setTrimText(<%=trimText%>);
|
||||
|
||||
class OrderHelper_<%=cid%> {
|
||||
java.util.Map<String,Boolean> recalculateOrderMap = new java.util.HashMap<String,Boolean>();
|
||||
java.util.Map<String,Integer> orderMap = new java.util.HashMap<String,Integer>();
|
||||
java.util.Map<String,Integer> indexMap = new java.util.HashMap<String,Integer>();
|
||||
java.util.Map<String,Boolean> tailAppendMap = new java.util.HashMap<String,Boolean>();
|
||||
String lastProcessedField;
|
||||
|
||||
boolean need_recalculate(String field) {
|
||||
Boolean result = recalculateOrderMap.get(field);
|
||||
return result == null ? true : result;
|
||||
}
|
||||
|
||||
boolean tailAppend(String field) {
|
||||
Boolean result = tailAppendMap.get(field);
|
||||
return result == null ? false : result;
|
||||
}
|
||||
|
||||
int order(String field) {
|
||||
Integer order = orderMap.get(field);
|
||||
return order == null ? 0 : order;
|
||||
}
|
||||
|
||||
void setOrder(String field,Integer order) {
|
||||
orderMap.put(field,order);
|
||||
indexMap.put(field,order);
|
||||
}
|
||||
|
||||
void fillRecalculateOrderMap(String field,Boolean value) {
|
||||
recalculateOrderMap.put(field,value);
|
||||
}
|
||||
|
||||
void fillTailAppendMap(String field,Boolean value) {
|
||||
tailAppendMap.put(field,value);
|
||||
}
|
||||
|
||||
int index(String field) {
|
||||
Integer i = indexMap.get(field);
|
||||
return i == null ? 0 : i;
|
||||
}
|
||||
|
||||
void incrementIndex(String field){
|
||||
Integer i = index(field);
|
||||
indexMap.put(field, ++i);
|
||||
}
|
||||
|
||||
void resetIndex(String field){
|
||||
Integer order = order(field);
|
||||
indexMap.put(field, order);
|
||||
}
|
||||
|
||||
boolean isLastProcessedField(String field){
|
||||
return (lastProcessedField != null && lastProcessedField.equals(field)) ? true : false;
|
||||
}
|
||||
|
||||
void setLastPorcessedField(String field){
|
||||
lastProcessedField = field;
|
||||
}
|
||||
}
|
||||
|
||||
final OrderHelper_<%=cid%> orderHelper_<%=cid%> = new OrderHelper_<%=cid%>();
|
||||
|
||||
<%@ include file="tFileOutputMSXML_begin.inc.javajet"%>
|
||||
|
||||
<%
|
||||
int schemaOptNum=100;
|
||||
String schemaOptNumStr=ElementParameterParser.getValue(node, "__SCHEMA_OPT_NUM__");
|
||||
if(schemaOptNumStr!=null && !"".equals(schemaOptNumStr) && !"\"\"".equals(schemaOptNumStr)){
|
||||
schemaOptNum = Integer.parseInt(schemaOptNumStr);
|
||||
}
|
||||
OptimizeCodeGenerator optimizeGen = new OptimizeCodeGenerator(cid,schemaOptNum );
|
||||
optimizeGen.setBeginPart(true);
|
||||
optimizeGen.incomingName = incomingName;
|
||||
optimizeGen.generateCode(node);
|
||||
}
|
||||
}
|
||||
%>
|
||||
|
||||
@@ -63,9 +63,11 @@ if(!usePartialUpdate){%>
|
||||
<%
|
||||
}else{%>
|
||||
if(miList_<%=cid %>.size() > 0){
|
||||
org.talend.mdm.webservice.WSPutItemArray putItemArray = new org.talend.mdm.webservice.WSPutItemArray(miList_<%=cid %>);
|
||||
|
||||
<% logUtil.debug("\"Try to put item array.\"");%>
|
||||
|
||||
wspks_<%=cid %> = service_<%=cid %>.putItemArray(miList_<%=cid %>).getWsItemPK();
|
||||
wspks_<%=cid %> = service_<%=cid %>.putItemArray(putItemArray).getWsItemPK();
|
||||
|
||||
<% logUtil.debug("\"Put item size:\"+wspks_"+cid+".size()");%>
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.designer.components.localprovider</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.designer.core.generic</artifactId>
|
||||
|
||||
@@ -30,6 +30,8 @@ import org.talend.commons.exception.ExceptionHandler;
|
||||
import org.talend.components.api.component.Connector;
|
||||
import org.talend.components.api.properties.ComponentProperties;
|
||||
import org.talend.components.api.service.ComponentService;
|
||||
import org.talend.core.model.components.EComponentType;
|
||||
import org.talend.core.model.components.IComponent;
|
||||
import org.talend.core.model.metadata.IMetadataTable;
|
||||
import org.talend.core.model.metadata.MetadataToolAvroHelper;
|
||||
import org.talend.core.model.metadata.MetadataToolHelper;
|
||||
@@ -302,18 +304,33 @@ public class GenericElementParameter extends ElementParameter {
|
||||
if ((!mainTable.sameMetadataAs(newTable) || !newTable.sameMetadataAs(mainTable))) {
|
||||
mainTable.setListColumns(newTable.getListColumns());
|
||||
if (this.askPropagate == null && node.getOutgoingConnections().size() != 0) {
|
||||
Display.getDefault().syncExec(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
askPropagate = ChangeMetadataCommand.askPropagate();
|
||||
boolean hasPropagation = false;
|
||||
for (IConnection connection : node.getOutgoingConnections()) {
|
||||
if (connector.getName().equals(connection.getConnectorName())) {
|
||||
if (isSchemaPropagated(connection.getTarget())) {
|
||||
hasPropagation = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
if (hasPropagation) {
|
||||
Display.getDefault().syncExec(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
askPropagate = ChangeMetadataCommand.askPropagate();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
if (this.askPropagate != null && this.askPropagate) {
|
||||
for (IConnection connection : node.getOutgoingConnections()) {
|
||||
if (connector.getName().equals(connection.getConnectorName())) {
|
||||
ChangeMetadataCommand cmd = new ChangeMetadataCommand(connection.getTarget(), null, null,
|
||||
INode target = connection.getTarget();
|
||||
if (!isSchemaPropagated(target)) {
|
||||
continue;
|
||||
}
|
||||
ChangeMetadataCommand cmd = new ChangeMetadataCommand(target, null, null,
|
||||
newTable, null);
|
||||
cmd.setPropagate(true);
|
||||
IProcess process = node.getProcess();
|
||||
@@ -333,7 +350,22 @@ public class GenericElementParameter extends ElementParameter {
|
||||
}
|
||||
}
|
||||
|
||||
private String getParameterName() {
|
||||
private boolean isSchemaPropagated(INode node) {
|
||||
if (node == null) {
|
||||
return false;
|
||||
}
|
||||
IComponent component = node.getComponent();
|
||||
if (component == null) {
|
||||
return false;
|
||||
}
|
||||
// Always consider it is true for the new component.
|
||||
if (EComponentType.GENERIC.equals(component.getComponentType())) {
|
||||
return true;
|
||||
}
|
||||
return component.isSchemaAutoPropagated();
|
||||
}
|
||||
|
||||
public String getParameterName() {
|
||||
String paramName = getName();
|
||||
if (paramName.indexOf(IGenericConstants.EXP_SEPARATOR) != -1) {
|
||||
paramName = paramName.substring(paramName.lastIndexOf(IGenericConstants.EXP_SEPARATOR) + 1);
|
||||
|
||||
@@ -272,7 +272,8 @@ public class ComponentsUtils {
|
||||
Property property = (Property) widgetProperty;
|
||||
param.setRequired(property.isRequired());
|
||||
param.setValue(getParameterValue(element, property, fieldType, isInitializing));
|
||||
if (EParameterFieldType.NAME_SELECTION_AREA.equals(fieldType)) {
|
||||
boolean isNameProperty = IGenericConstants.NAME_PROPERTY.equals(param.getParameterName());
|
||||
if (EParameterFieldType.NAME_SELECTION_AREA.equals(fieldType) || isNameProperty) {
|
||||
// Disable context support for this filed type.
|
||||
param.setSupportContext(false);
|
||||
} else {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.designer.core</artifactId>
|
||||
|
||||
@@ -483,6 +483,10 @@ public abstract class Processor implements IProcessor, IEclipseProcessor, Talend
|
||||
// do something...
|
||||
}
|
||||
|
||||
public void generateCode(boolean statistics, boolean trace, boolean properties, int option) throws ProcessorException {
|
||||
generateCode(statistics, trace, properties);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
|
||||
@@ -419,7 +419,7 @@ public class StandAloneTalendJavaEditor extends CompilationUnitEditor implements
|
||||
if (!isEditable()) {
|
||||
return false;
|
||||
}
|
||||
return propertyIsDirty || super.isDirty();
|
||||
return super.isDirty();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -562,14 +562,12 @@ public class StandAloneTalendJavaEditor extends CompilationUnitEditor implements
|
||||
|
||||
private FileItem item;
|
||||
|
||||
private boolean propertyIsDirty;
|
||||
|
||||
private final AdapterImpl dirtyListener = new AdapterImpl() {
|
||||
|
||||
@Override
|
||||
public void notifyChanged(Notification notification) {
|
||||
if (notification.getEventType() != Notification.REMOVING_ADAPTER) {
|
||||
propertyIsDirty = true;
|
||||
Display.getDefault().syncExec(new Runnable() {
|
||||
|
||||
@Override
|
||||
@@ -611,7 +609,6 @@ public class StandAloneTalendJavaEditor extends CompilationUnitEditor implements
|
||||
|
||||
ICompilationUnit unit = (ICompilationUnit) this.getInputJavaElement();
|
||||
String newName = item.getProperty().getLabel();
|
||||
propertyIsDirty = false;
|
||||
try {
|
||||
boolean noError = true;
|
||||
// String newName2 = newName + SuffixConstants.SUFFIX_STRING_java;
|
||||
|
||||
@@ -20,7 +20,9 @@ import java.util.Map;
|
||||
|
||||
import org.apache.commons.lang.ArrayUtils;
|
||||
import org.eclipse.gef.commands.Command;
|
||||
import org.eclipse.jface.dialogs.MessageDialog;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.talend.commons.utils.threading.ExecutionLimiter;
|
||||
import org.talend.commons.utils.threading.ExecutionLimiterImproved;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
@@ -84,7 +86,7 @@ public class PropertyChangeCommand extends Command {
|
||||
|
||||
// private ChangeMetadataCommand changeMetadataCommand;
|
||||
private List<ChangeMetadataCommand> changeMetadataCommands;
|
||||
|
||||
|
||||
private Command updateELTMapComponentCommand;
|
||||
|
||||
private String propertyTypeName;
|
||||
@@ -246,6 +248,22 @@ public class PropertyChangeCommand extends Command {
|
||||
|
||||
oldValue = elem.getPropertyValue(propName);
|
||||
elem.setPropertyValue(propName, newValue);
|
||||
if (currentParam.getFieldType().equals(EParameterFieldType.CONNECTION_LIST) && currentParam.getContext() != null
|
||||
&& (elem instanceof Node)) {
|
||||
String connParaname = currentParam.getContext() + ":" + currentParam.getName();
|
||||
if (connParaname.equals(propName)) {
|
||||
IConnection selectedConn = null;
|
||||
for (IConnection conn : ((Node) elem).getIncomingConnections()) {
|
||||
if (conn.getUniqueName().equals(newValue)) {
|
||||
selectedConn = conn;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (selectedConn != null && getTakeSchema()) {
|
||||
((Node) selectedConn.getSource()).takeSchemaFrom((Node) elem, currentParam.getContext());
|
||||
}
|
||||
}
|
||||
}
|
||||
if ("ELT_TABLE_NAME".equals(propName) || "ELT_SCHEMA_NAME".equals(propName)) { //$NON-NLS-1$ //$NON-NLS-2$
|
||||
String oldELTValue = ""; //$NON-NLS-1$
|
||||
String newELTValue = ""; //$NON-NLS-1$
|
||||
@@ -264,12 +282,12 @@ public class PropertyChangeCommand extends Command {
|
||||
String tableName = TalendQuoteUtils.removeQuotes((String) elem.getPropertyValue("ELT_TABLE_NAME")); //$NON-NLS-1$
|
||||
if (oldParamValue != null && !"".equals(oldParamValue.trim())) {
|
||||
oldELTValue = oldParamValue + "."; //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
if (newParamValue != null && !"".equals(newParamValue.trim())) {
|
||||
newELTValue = newParamValue + "."; //$NON-NLS-1$
|
||||
}
|
||||
oldELTValue = oldELTValue + tableName; //$NON-NLS-1$
|
||||
newELTValue = newELTValue + tableName; //$NON-NLS-1$
|
||||
oldELTValue = oldELTValue + tableName; // $NON-NLS-1$
|
||||
newELTValue = newELTValue + tableName; // $NON-NLS-1$
|
||||
}
|
||||
List<? extends IConnection> connections = ((Node) elem).getOutgoingConnections();
|
||||
for (IConnection connection : connections) {
|
||||
@@ -279,7 +297,8 @@ public class PropertyChangeCommand extends Command {
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IDbMapDesignerService.class)) {
|
||||
IDbMapDesignerService service = (IDbMapDesignerService) GlobalServiceRegister.getDefault()
|
||||
.getService(IDbMapDesignerService.class);
|
||||
updateELTMapComponentCommand = service.getUpdateELTMapComponentCommand(targetNode, connection, oldELTValue, newELTValue);
|
||||
updateELTMapComponentCommand = service.getUpdateELTMapComponentCommand(targetNode, connection,
|
||||
oldELTValue, newELTValue);
|
||||
updateELTMapComponentCommand.execute();
|
||||
}
|
||||
}
|
||||
@@ -295,13 +314,12 @@ public class PropertyChangeCommand extends Command {
|
||||
Node node = (Node) elem;
|
||||
for (IElementParameter param : node.getElementParameters()) {
|
||||
String repositoryValue = param.getRepositoryValue();
|
||||
if ((repositoryValue != null)
|
||||
&& (!param.getName().equals(EParameterName.PROPERTY_TYPE.getName()))
|
||||
if ((repositoryValue != null) && (!param.getName().equals(EParameterName.PROPERTY_TYPE.getName()))
|
||||
&& param.getFieldType() != EParameterFieldType.MEMO_SQL
|
||||
&& !("tMDMReceive".equals(node.getComponent().getName()) && "XPATH_PREFIX".equals(param //$NON-NLS-1$ //$NON-NLS-2$
|
||||
.getRepositoryValue()))
|
||||
&& !("tSAPOutput".equals(node.getComponent().getName()) && param.getName().equals(
|
||||
UpdatesConstants.MAPPING))
|
||||
&& !("tSAPOutput".equals(node.getComponent().getName())
|
||||
&& param.getName().equals(UpdatesConstants.MAPPING))
|
||||
&& !("tFileInputEBCDIC".equals(node.getComponent().getName()) && "DATA_FILE".equals(repositoryValue))) {
|
||||
param.setRepositoryValueUsed(true);
|
||||
if (!(EParameterName.DB_VERSION.getName()).equals(param.getName())) {
|
||||
@@ -423,10 +441,10 @@ public class PropertyChangeCommand extends Command {
|
||||
JobSettingVersionUtil.setDbVersion(elementParameter, dbType, true);
|
||||
DesignerUtilities.setSchemaDB(schemaParameter, newValue);
|
||||
} else if (propName.equals(JobSettingsConstants.getExtraParameterName(EParameterName.DB_TYPE.getName()))) {
|
||||
IElementParameter elementParameter = elem.getElementParameter(JobSettingsConstants
|
||||
.getExtraParameterName(EParameterName.DB_VERSION.getName()));
|
||||
schemaParameter = elem.getElementParameter(JobSettingsConstants.getExtraParameterName(EParameterName.SCHEMA_DB
|
||||
.getName()));
|
||||
IElementParameter elementParameter = elem
|
||||
.getElementParameter(JobSettingsConstants.getExtraParameterName(EParameterName.DB_VERSION.getName()));
|
||||
schemaParameter = elem
|
||||
.getElementParameter(JobSettingsConstants.getExtraParameterName(EParameterName.SCHEMA_DB.getName()));
|
||||
JobSettingVersionUtil.setDbVersion(elementParameter, dbType, true);
|
||||
DesignerUtilities.setSchemaDB(schemaParameter, newValue);
|
||||
}
|
||||
@@ -435,13 +453,12 @@ public class PropertyChangeCommand extends Command {
|
||||
&& !schemaParameter.getValue().equals("")) {
|
||||
schemaParameter.setValue("");
|
||||
}
|
||||
if (!toUpdate
|
||||
&& (currentParam.getFieldType().equals(EParameterFieldType.RADIO)
|
||||
|| currentParam.getFieldType().equals(EParameterFieldType.CLOSED_LIST)
|
||||
|| currentParam.getFieldType().equals(EParameterFieldType.OPENED_LIST)
|
||||
|| currentParam.getFieldType().equals(EParameterFieldType.CHECK)
|
||||
|| currentParam.getFieldType().equals(EParameterFieldType.AS400_CHECK) || currentParam.getFieldType()
|
||||
.equals(EParameterFieldType.COMPONENT_LIST))) {
|
||||
if (!toUpdate && (currentParam.getFieldType().equals(EParameterFieldType.RADIO)
|
||||
|| currentParam.getFieldType().equals(EParameterFieldType.CLOSED_LIST)
|
||||
|| currentParam.getFieldType().equals(EParameterFieldType.OPENED_LIST)
|
||||
|| currentParam.getFieldType().equals(EParameterFieldType.CHECK)
|
||||
|| currentParam.getFieldType().equals(EParameterFieldType.AS400_CHECK)
|
||||
|| currentParam.getFieldType().equals(EParameterFieldType.COMPONENT_LIST))) {
|
||||
toUpdate = false;
|
||||
setDefaultValues(currentParam, elem);
|
||||
}
|
||||
@@ -700,8 +717,8 @@ public class PropertyChangeCommand extends Command {
|
||||
oldElementValues.put(testedParam, testedParam.getValue());
|
||||
|
||||
// if the field is not a schema type, then use standard "set value".
|
||||
if (!(testedParam.getFieldType().equals(EParameterFieldType.SCHEMA_TYPE) || testedParam.getFieldType().equals(
|
||||
EParameterFieldType.SCHEMA_REFERENCE))) {
|
||||
if (!(testedParam.getFieldType().equals(EParameterFieldType.SCHEMA_TYPE)
|
||||
|| testedParam.getFieldType().equals(EParameterFieldType.SCHEMA_REFERENCE))) {
|
||||
String oldMapping = ""; //$NON-NLS-1$
|
||||
if (!testedParam.getFieldType().equals(EParameterFieldType.CHECK)
|
||||
&& !testedParam.getFieldType().equals(EParameterFieldType.RADIO)) {
|
||||
@@ -729,8 +746,8 @@ public class PropertyChangeCommand extends Command {
|
||||
// for feature 0014652
|
||||
boolean isBuiltIn = false;
|
||||
|
||||
final IElementParameter elementParameter = testedParam.getChildParameters().get(
|
||||
EParameterFieldType.SCHEMA_TYPE.getName());
|
||||
final IElementParameter elementParameter = testedParam.getChildParameters()
|
||||
.get(EParameterFieldType.SCHEMA_TYPE.getName());
|
||||
if (elementParameter != null) {
|
||||
Object value = elementParameter.getValue();
|
||||
if ("BUILT_IN".equals(value.toString())) {//$NON-NLS-1$
|
||||
@@ -844,7 +861,7 @@ public class PropertyChangeCommand extends Command {
|
||||
}
|
||||
if (updateELTMapComponentCommand != null) {
|
||||
updateELTMapComponentCommand.undo();
|
||||
}
|
||||
}
|
||||
CodeView.refreshCodeView(elem);
|
||||
ComponentSettings.switchToCurComponentSettingsView();
|
||||
JobSettings.switchToCurJobSettingsView();
|
||||
@@ -905,7 +922,7 @@ public class PropertyChangeCommand extends Command {
|
||||
}
|
||||
if (updateELTMapComponentCommand != null) {
|
||||
updateELTMapComponentCommand.redo();
|
||||
}
|
||||
}
|
||||
CodeView.refreshCodeView(elem);
|
||||
ComponentSettings.switchToCurComponentSettingsView();
|
||||
JobSettings.switchToCurJobSettingsView();
|
||||
@@ -929,8 +946,8 @@ public class PropertyChangeCommand extends Command {
|
||||
private void refreshResumingConnections() {
|
||||
if (propName.equals(EParameterName.RESUMING_CHECKPOINT.getName()) && this.elem instanceof Connection) {
|
||||
if (((Connection) this.elem).getConnectionTrace() != null && !propName.equals(EParameterName.CONDITION)) {
|
||||
((Connection) this.elem).getConnectionTrace()
|
||||
.setPropertyValue(EParameterName.RESUMING_CHECKPOINT.getName(), true);
|
||||
((Connection) this.elem).getConnectionTrace().setPropertyValue(EParameterName.RESUMING_CHECKPOINT.getName(),
|
||||
true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1007,4 +1024,8 @@ public class PropertyChangeCommand extends Command {
|
||||
|
||||
}
|
||||
|
||||
private boolean getTakeSchema() {
|
||||
return MessageDialog.openQuestion(new Shell(), "", Messages.getString("Node.getSchemaOrNot")); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -669,7 +669,24 @@ public class Connection extends Element implements IConnection, IPerformance {
|
||||
IConnection.TRACE_SCHEMA_COLUMN_CONDITION };
|
||||
param.setListItemsDisplayCodeName(columns);
|
||||
param.setListItemsDisplayName(columns);
|
||||
param.setListItemsValue(new ElementParameter[0]);
|
||||
|
||||
ElementParameter traceColumn = new ElementParameter(this);
|
||||
traceColumn.setName(IConnection.TRACE_SCHEMA_COLUMN);
|
||||
traceColumn.setDisplayName(""); //$NON-NLS-1$
|
||||
traceColumn.setFieldType(EParameterFieldType.TEXT);
|
||||
traceColumn.setValue(""); //$NON-NLS-1$
|
||||
ElementParameter traceColumnChecked = new ElementParameter(this);
|
||||
traceColumnChecked.setName(IConnection.TRACE_SCHEMA_COLUMN_CHECKED);
|
||||
traceColumnChecked.setDisplayName(""); //$NON-NLS-1$
|
||||
traceColumnChecked.setFieldType(EParameterFieldType.CHECK);
|
||||
traceColumnChecked.setValue(true);
|
||||
ElementParameter traceColumnCondition = new ElementParameter(this);
|
||||
traceColumnCondition.setName(IConnection.TRACE_SCHEMA_COLUMN_CHECKED);
|
||||
traceColumnCondition.setDisplayName(""); //$NON-NLS-1$
|
||||
traceColumnCondition.setFieldType(EParameterFieldType.TEXT);
|
||||
traceColumnCondition.setValue(""); //$NON-NLS-1$
|
||||
ElementParameter[] listItemsValue = new ElementParameter[] { traceColumn, traceColumnChecked, traceColumnCondition };
|
||||
param.setListItemsValue(listItemsValue);
|
||||
param.setValue(new ArrayList<Map<String, Object>>());
|
||||
param.setCategory(EComponentCategory.ADVANCED);
|
||||
param.setShow(false);
|
||||
|
||||
@@ -3289,12 +3289,12 @@ public class Process extends Element implements IProcess2, IGEFProcess, ILastVer
|
||||
*/
|
||||
@Override
|
||||
public void checkProcess() {
|
||||
if (isActivate()) {
|
||||
if (isActivate() && !isDuplicate()) {
|
||||
checkProblems();
|
||||
}
|
||||
}
|
||||
|
||||
private void checkProblems() {
|
||||
protected void checkProblems() {
|
||||
Problems.removeProblemsByProcess(this);
|
||||
|
||||
for (INode node : nodes) {
|
||||
|
||||
@@ -16,8 +16,6 @@ import java.beans.PropertyChangeEvent;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.eclipse.emf.common.util.EList;
|
||||
import org.eclipse.gef.commands.Command;
|
||||
import org.eclipse.jface.fieldassist.DecoratedField;
|
||||
import org.eclipse.jface.fieldassist.FieldDecoration;
|
||||
@@ -36,36 +34,22 @@ import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Control;
|
||||
import org.eclipse.swt.widgets.Text;
|
||||
import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
|
||||
import org.talend.commons.exception.PersistenceException;
|
||||
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
|
||||
import org.talend.commons.ui.runtime.image.ImageProvider;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.IESBService;
|
||||
import org.talend.core.model.metadata.builder.connection.Connection;
|
||||
import org.talend.core.model.metadata.builder.connection.DatabaseConnection;
|
||||
import org.talend.core.model.metadata.builder.connection.QueriesConnection;
|
||||
import org.talend.core.model.metadata.builder.connection.Query;
|
||||
import org.talend.core.model.metadata.builder.database.ExtractMetaDataUtils;
|
||||
import org.talend.core.model.process.EParameterFieldType;
|
||||
import org.talend.core.model.process.IElementParameter;
|
||||
import org.talend.core.model.properties.ConnectionItem;
|
||||
import org.talend.core.model.properties.DatabaseConnectionItem;
|
||||
import org.talend.core.model.properties.FileItem;
|
||||
import org.talend.core.model.properties.Item;
|
||||
import org.talend.core.model.properties.LinkRulesItem;
|
||||
import org.talend.core.model.properties.RulesItem;
|
||||
import org.talend.core.model.repository.ERepositoryObjectType;
|
||||
import org.talend.core.model.repository.IRepositoryViewObject;
|
||||
import org.talend.core.ui.CoreUIPlugin;
|
||||
import org.talend.core.ui.properties.tab.IDynamicProperty;
|
||||
import org.talend.designer.core.DesignerPlugin;
|
||||
import org.talend.designer.core.model.components.EParameterName;
|
||||
import org.talend.designer.core.model.components.EmfComponent;
|
||||
import org.talend.designer.core.ui.editor.cmd.ChangeMetadataCommand;
|
||||
import org.talend.designer.core.ui.editor.nodes.Node;
|
||||
import org.talend.designer.core.ui.editor.properties.controllers.creator.SelectAllTextControlCreator;
|
||||
import org.talend.repository.UpdateRepositoryUtils;
|
||||
import org.talend.repository.model.IProxyRepositoryFactory;
|
||||
|
||||
/**
|
||||
* DOC nrousseau class global comment. Detailled comment
|
||||
@@ -76,6 +60,8 @@ public abstract class AbstractRepositoryController extends AbstractElementProper
|
||||
|
||||
protected static final int STANDARD_REPOSITORY_WIDTH = 250;
|
||||
|
||||
protected ControllerRepositoryValueHander repositoryValueHander;
|
||||
|
||||
/**
|
||||
* DOC nrousseau AbstractRepositoryController constructor comment.
|
||||
*
|
||||
@@ -83,6 +69,7 @@ public abstract class AbstractRepositoryController extends AbstractElementProper
|
||||
*/
|
||||
public AbstractRepositoryController(IDynamicProperty dp) {
|
||||
super(dp);
|
||||
repositoryValueHander = new ControllerRepositoryValueHander();
|
||||
}
|
||||
|
||||
protected abstract String getRepositoryTypeParamName();
|
||||
@@ -321,204 +308,8 @@ public abstract class AbstractRepositoryController extends AbstractElementProper
|
||||
return initialSize.y + ITabbedPropertyConstants.VSPACE;
|
||||
}
|
||||
|
||||
protected ConnectionItem lastItemUsed;
|
||||
|
||||
private FileItem lastFileItemUsed; // hywang add for 6484
|
||||
|
||||
private LinkRulesItem lastLinkItem;
|
||||
|
||||
private void fastRepositoryUpdateProperty(IElementParameter param) {
|
||||
if (param != null && param.getValue() != null) {
|
||||
IProxyRepositoryFactory factory = DesignerPlugin.getDefault().getProxyRepositoryFactory();
|
||||
String linkedRepository = (String) param.getValue();
|
||||
// value stored is the id, so we can get this item directly
|
||||
Item item;
|
||||
String displayName = "";
|
||||
try {
|
||||
IRepositoryViewObject object = factory.getLastVersion(linkedRepository.split(" - ")[0]);
|
||||
if (object == null) {
|
||||
return;
|
||||
}
|
||||
item = object.getProperty().getItem();
|
||||
// Assert.isTrue(item instanceof ConnectionItem);
|
||||
IESBService service = null;
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IESBService.class)) {
|
||||
service = (IESBService) GlobalServiceRegister.getDefault().getService(IESBService.class);
|
||||
}
|
||||
if (service != null && ERepositoryObjectType.getItemType(item) == service.getServicesType()) {
|
||||
lastItemUsed = (ConnectionItem) item;
|
||||
displayName = "Service:" + service.getServiceLabel(item, linkedRepository);
|
||||
} else if (item instanceof ConnectionItem) {
|
||||
lastItemUsed = (ConnectionItem) item;
|
||||
displayName = dynamicProperty.getRepositoryAliasName(lastItemUsed) + ":" //$NON-NLS-1$
|
||||
+ lastItemUsed.getProperty().getLabel();
|
||||
}
|
||||
if (item instanceof FileItem) { // hywang add for 6484
|
||||
lastFileItemUsed = (FileItem) item;
|
||||
if (lastFileItemUsed instanceof RulesItem) {
|
||||
displayName = "Rules:" //$NON-NLS-1$
|
||||
+ lastFileItemUsed.getProperty().getLabel();
|
||||
}
|
||||
}
|
||||
if (item instanceof LinkRulesItem) {
|
||||
lastLinkItem = (LinkRulesItem) item;
|
||||
displayName = "Rules:" //$NON-NLS-1$
|
||||
+ lastLinkItem.getProperty().getLabel();
|
||||
|
||||
}
|
||||
} catch (PersistenceException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
|
||||
param.setListItemsDisplayName(new String[] { displayName });
|
||||
param.setListItemsValue(new String[] { (String) param.getValue() });
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void fastRepositoryUpdateSchema(IElementParameter param) {
|
||||
if (param != null && param.getValue() != null) {
|
||||
String queryIdAndName = (String) param.getValue();
|
||||
String[] names = queryIdAndName.split(" - "); //$NON-NLS-1$
|
||||
if (names.length < 2) {
|
||||
return;
|
||||
}
|
||||
String linkedRepository = names[0];
|
||||
String tableName = null;
|
||||
if (names.length == 2) {
|
||||
tableName = names[1];
|
||||
} else if (names.length > 2) {
|
||||
tableName = queryIdAndName.substring(linkedRepository.length() + 3);
|
||||
}
|
||||
|
||||
if (lastItemUsed != null) {
|
||||
if (!linkedRepository.equals(lastItemUsed.getProperty().getId())) {
|
||||
lastItemUsed = null;
|
||||
}
|
||||
}
|
||||
if (lastItemUsed == null) {
|
||||
IProxyRepositoryFactory factory = DesignerPlugin.getDefault().getProxyRepositoryFactory();
|
||||
Item item;
|
||||
try {
|
||||
IRepositoryViewObject object = factory.getLastVersion(linkedRepository);
|
||||
if (object == null) {
|
||||
return;
|
||||
}
|
||||
item = object.getProperty().getItem();
|
||||
Assert.isTrue(item instanceof ConnectionItem);
|
||||
lastItemUsed = (ConnectionItem) item;
|
||||
} catch (PersistenceException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
|
||||
// EList<MetadataTable> tableList = lastItemUsed.getConnection().getTables();
|
||||
// for (MetadataTable table )
|
||||
|
||||
String displayName = dynamicProperty.getRepositoryAliasName(lastItemUsed) + ":" //$NON-NLS-1$
|
||||
+ lastItemUsed.getProperty().getLabel() + " - " + tableName; //$NON-NLS-1$
|
||||
IElementParameter infoObjectTypeParam = param.getElement().getElementParameter("INFO_OBJECT_TYPE"); //$NON-NLS-1$
|
||||
if (infoObjectTypeParam != null) {
|
||||
String innerIOType = (String) infoObjectTypeParam.getValue();
|
||||
if (innerIOType != null) {
|
||||
displayName = displayName + " (" + innerIOType + ")"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
}
|
||||
param.setListItemsDisplayName(new String[] { displayName });
|
||||
param.setListItemsValue(new String[] { (String) param.getValue() });
|
||||
}
|
||||
}
|
||||
|
||||
private void fastRepositoryUpdateQuery(IElementParameter param) {
|
||||
if (param != null && param.getValue() != null) {
|
||||
String queryIdAndName = (String) param.getValue();
|
||||
String[] names = queryIdAndName.split(" - "); //$NON-NLS-1$
|
||||
if (names.length < 2) {
|
||||
return;
|
||||
}
|
||||
String linkedRepository = names[0];
|
||||
String queryName = null;
|
||||
if (names.length == 2) {
|
||||
queryName = names[1];
|
||||
} else if (names.length > 2) {
|
||||
queryName = queryIdAndName.substring(linkedRepository.length() + 3);
|
||||
}
|
||||
if (lastItemUsed != null) {
|
||||
if (!linkedRepository.equals(lastItemUsed.getProperty().getId())) {
|
||||
lastItemUsed = null;
|
||||
}
|
||||
}
|
||||
if (lastItemUsed == null) {
|
||||
IProxyRepositoryFactory factory = DesignerPlugin.getDefault().getProxyRepositoryFactory();
|
||||
Item item;
|
||||
try {
|
||||
IRepositoryViewObject object = factory.getLastVersion(linkedRepository);
|
||||
if (object == null) {
|
||||
return;
|
||||
}
|
||||
item = object.getProperty().getItem();
|
||||
lastItemUsed = (ConnectionItem) item;
|
||||
} catch (PersistenceException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
Assert.isTrue(lastItemUsed instanceof DatabaseConnectionItem);
|
||||
QueriesConnection queriesConnection = ((DatabaseConnection) lastItemUsed.getConnection()).getQueries();
|
||||
EList<Query> queries = queriesConnection.getQuery();
|
||||
|
||||
String repositoryAliasName = dynamicProperty.getRepositoryAliasName(lastItemUsed);
|
||||
for (Query currentQuery : queries) {
|
||||
if (currentQuery.getLabel().equals(queryName)) {
|
||||
String displayName = repositoryAliasName + ":" //$NON-NLS-1$
|
||||
+ lastItemUsed.getProperty().getLabel() + " - " + currentQuery.getLabel(); //$NON-NLS-1$
|
||||
|
||||
param.setListItemsDisplayName(new String[] { displayName });
|
||||
param.setListItemsValue(new String[] { (String) param.getValue() });
|
||||
/* query cache should be deleted ,bug 16969 */
|
||||
// dynamicProperty.getRepositoryQueryStoreMap().clear();
|
||||
// dynamicProperty.getRepositoryQueryStoreMap().put((String) param.getValue(), currentQuery);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void fastInitializeRepositoryNames(IElementParameter param) {
|
||||
lastItemUsed = null;
|
||||
|
||||
if (param.getValue() == null || param.getValue().equals("")) {
|
||||
return;
|
||||
}
|
||||
if (param.getName().equals(EParameterName.REPOSITORY_PROPERTY_TYPE.getName())) {
|
||||
fastRepositoryUpdateProperty(param);
|
||||
} else if (param.getName().equals(EParameterName.REPOSITORY_SCHEMA_TYPE.getName())) {
|
||||
fastRepositoryUpdateSchema(param);
|
||||
} else if (param.getName().equals(EParameterName.REPOSITORY_QUERYSTORE_TYPE.getName())) {
|
||||
fastRepositoryUpdateQuery(param);
|
||||
}
|
||||
}
|
||||
|
||||
protected String getDisplayNameFromValue(IElementParameter param, String value) {
|
||||
// to load informations from repository only if needed.
|
||||
|
||||
int index = param.getIndexOfItemFromList(value);
|
||||
IElementParameter infoObjectParam = param.getElement().getElementParameter("INFO_OBJECT_TYPE"); //$NON-NLS-1$
|
||||
if (infoObjectParam != null && infoObjectParam.getValue() != null) {
|
||||
index = -1;
|
||||
}
|
||||
if (index == -1) {
|
||||
|
||||
fastInitializeRepositoryNames(param);
|
||||
// if even after the initialize there is nothing, just return an empty string
|
||||
if (param.getListItemsDisplayName().length == 0) {
|
||||
return ""; //$NON-NLS-1$
|
||||
}
|
||||
index = param.getIndexOfItemFromList(value);
|
||||
if (index == -1) {
|
||||
return ""; //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
|
||||
return param.getListItemsDisplayName()[index];
|
||||
return repositoryValueHander.getDisplayNameFromValue(param, value);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -585,4 +376,12 @@ public abstract class AbstractRepositoryController extends AbstractElementProper
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for repositoryValueHander.
|
||||
*
|
||||
* @return the repositoryValueHander
|
||||
*/
|
||||
public ControllerRepositoryValueHander getRepositoryValueHander() {
|
||||
return this.repositoryValueHander;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -369,6 +369,12 @@ public class ConnectionListController extends AbstractElementPropertySectionCont
|
||||
}
|
||||
curLine.put(newConnectionName, newValue);
|
||||
}
|
||||
}else if(curParam.getFieldType().equals(EParameterFieldType.SCHEMA_TYPE)){
|
||||
Map<String, IElementParameter> children = curParam.getChildParameters();
|
||||
IElementParameter ele = children.get(EParameterName.CONNECTION.getName());
|
||||
if(ele!=null && ele.getFieldType().equals(EParameterFieldType.CONNECTION_LIST) && ele.getValue().equals(oldConnectionName)){
|
||||
ele.setValue(newConnectionName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,258 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2014 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend.designer.core.ui.editor.properties.controllers;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.eclipse.emf.common.util.EList;
|
||||
import org.talend.commons.exception.PersistenceException;
|
||||
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.IESBService;
|
||||
import org.talend.core.model.metadata.builder.connection.DatabaseConnection;
|
||||
import org.talend.core.model.metadata.builder.connection.QueriesConnection;
|
||||
import org.talend.core.model.metadata.builder.connection.Query;
|
||||
import org.talend.core.model.process.EParameterFieldType;
|
||||
import org.talend.core.model.process.IElementParameter;
|
||||
import org.talend.core.model.properties.ConnectionItem;
|
||||
import org.talend.core.model.properties.DatabaseConnectionItem;
|
||||
import org.talend.core.model.properties.FileItem;
|
||||
import org.talend.core.model.properties.Item;
|
||||
import org.talend.core.model.properties.LinkRulesItem;
|
||||
import org.talend.core.model.properties.RulesItem;
|
||||
import org.talend.core.model.repository.ERepositoryObjectType;
|
||||
import org.talend.core.model.repository.IRepositoryViewObject;
|
||||
import org.talend.designer.core.DesignerPlugin;
|
||||
import org.talend.designer.core.model.components.EParameterName;
|
||||
import org.talend.designer.core.model.metadata.RepositoryObjectHelper;
|
||||
import org.talend.repository.model.IProxyRepositoryFactory;
|
||||
|
||||
/**
|
||||
* created by wchen on Aug 23, 2016 Detailled comment
|
||||
*
|
||||
*/
|
||||
public class ControllerRepositoryValueHander {
|
||||
|
||||
private static Map<EParameterFieldType, ControllerRepositoryValueHander> repositoryValueHandlerMap = new HashMap<EParameterFieldType, ControllerRepositoryValueHander>();
|
||||
|
||||
protected ConnectionItem lastItemUsed;
|
||||
|
||||
private FileItem lastFileItemUsed; // hywang add for 6484
|
||||
|
||||
private LinkRulesItem lastLinkItem;
|
||||
|
||||
public String getDisplayNameFromValue(IElementParameter param, String value) {
|
||||
// to load informations from repository only if needed.
|
||||
|
||||
int index = param.getIndexOfItemFromList(value);
|
||||
IElementParameter infoObjectParam = param.getElement().getElementParameter("INFO_OBJECT_TYPE"); //$NON-NLS-1$
|
||||
if (infoObjectParam != null && infoObjectParam.getValue() != null) {
|
||||
index = -1;
|
||||
}
|
||||
if (index == -1) {
|
||||
|
||||
fastInitializeRepositoryNames(param);
|
||||
// if even after the initialize there is nothing, just return an empty string
|
||||
if (param.getListItemsDisplayName().length == 0) {
|
||||
return ""; //$NON-NLS-1$
|
||||
}
|
||||
index = param.getIndexOfItemFromList(value);
|
||||
if (index == -1) {
|
||||
return ""; //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
|
||||
return param.getListItemsDisplayName()[index];
|
||||
}
|
||||
|
||||
protected void fastInitializeRepositoryNames(IElementParameter param) {
|
||||
lastItemUsed = null;
|
||||
|
||||
if (param.getValue() == null || param.getValue().equals("")) {
|
||||
return;
|
||||
}
|
||||
if (param.getName().equals(EParameterName.REPOSITORY_PROPERTY_TYPE.getName())) {
|
||||
fastRepositoryUpdateProperty(param);
|
||||
} else if (param.getName().equals(EParameterName.REPOSITORY_SCHEMA_TYPE.getName())) {
|
||||
fastRepositoryUpdateSchema(param);
|
||||
} else if (param.getName().equals(EParameterName.REPOSITORY_QUERYSTORE_TYPE.getName())) {
|
||||
fastRepositoryUpdateQuery(param);
|
||||
}
|
||||
}
|
||||
|
||||
private void fastRepositoryUpdateProperty(IElementParameter param) {
|
||||
if (param != null && param.getValue() != null) {
|
||||
IProxyRepositoryFactory factory = DesignerPlugin.getDefault().getProxyRepositoryFactory();
|
||||
String linkedRepository = (String) param.getValue();
|
||||
// value stored is the id, so we can get this item directly
|
||||
Item item;
|
||||
String displayName = "";
|
||||
try {
|
||||
IRepositoryViewObject object = factory.getLastVersion(linkedRepository.split(" - ")[0]);
|
||||
if (object == null) {
|
||||
return;
|
||||
}
|
||||
item = object.getProperty().getItem();
|
||||
// Assert.isTrue(item instanceof ConnectionItem);
|
||||
IESBService service = null;
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IESBService.class)) {
|
||||
service = (IESBService) GlobalServiceRegister.getDefault().getService(IESBService.class);
|
||||
}
|
||||
if (service != null && ERepositoryObjectType.getItemType(item) == service.getServicesType()) {
|
||||
lastItemUsed = (ConnectionItem) item;
|
||||
displayName = "Service:" + service.getServiceLabel(item, linkedRepository);
|
||||
} else if (item instanceof ConnectionItem) {
|
||||
lastItemUsed = (ConnectionItem) item;
|
||||
displayName = RepositoryObjectHelper.getRepositoryAliasName(lastItemUsed) + ":" //$NON-NLS-1$
|
||||
+ lastItemUsed.getProperty().getLabel();
|
||||
}
|
||||
if (item instanceof FileItem) { // hywang add for 6484
|
||||
lastFileItemUsed = (FileItem) item;
|
||||
if (lastFileItemUsed instanceof RulesItem) {
|
||||
displayName = "Rules:" //$NON-NLS-1$
|
||||
+ lastFileItemUsed.getProperty().getLabel();
|
||||
}
|
||||
}
|
||||
if (item instanceof LinkRulesItem) {
|
||||
lastLinkItem = (LinkRulesItem) item;
|
||||
displayName = "Rules:" //$NON-NLS-1$
|
||||
+ lastLinkItem.getProperty().getLabel();
|
||||
|
||||
}
|
||||
} catch (PersistenceException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
|
||||
param.setListItemsDisplayName(new String[] { displayName });
|
||||
param.setListItemsValue(new String[] { (String) param.getValue() });
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void fastRepositoryUpdateSchema(IElementParameter param) {
|
||||
if (param != null && param.getValue() != null) {
|
||||
String queryIdAndName = (String) param.getValue();
|
||||
String[] names = queryIdAndName.split(" - "); //$NON-NLS-1$
|
||||
if (names.length < 2) {
|
||||
return;
|
||||
}
|
||||
String linkedRepository = names[0];
|
||||
String tableName = null;
|
||||
if (names.length == 2) {
|
||||
tableName = names[1];
|
||||
} else if (names.length > 2) {
|
||||
tableName = queryIdAndName.substring(linkedRepository.length() + 3);
|
||||
}
|
||||
|
||||
if (lastItemUsed != null) {
|
||||
if (!linkedRepository.equals(lastItemUsed.getProperty().getId())) {
|
||||
lastItemUsed = null;
|
||||
}
|
||||
}
|
||||
if (lastItemUsed == null) {
|
||||
IProxyRepositoryFactory factory = DesignerPlugin.getDefault().getProxyRepositoryFactory();
|
||||
Item item;
|
||||
try {
|
||||
IRepositoryViewObject object = factory.getLastVersion(linkedRepository);
|
||||
if (object == null) {
|
||||
return;
|
||||
}
|
||||
item = object.getProperty().getItem();
|
||||
Assert.isTrue(item instanceof ConnectionItem);
|
||||
lastItemUsed = (ConnectionItem) item;
|
||||
} catch (PersistenceException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
|
||||
// EList<MetadataTable> tableList = lastItemUsed.getConnection().getTables();
|
||||
// for (MetadataTable table )
|
||||
|
||||
String displayName = RepositoryObjectHelper.getRepositoryAliasName(lastItemUsed) + ":" //$NON-NLS-1$
|
||||
+ lastItemUsed.getProperty().getLabel() + " - " + tableName; //$NON-NLS-1$
|
||||
IElementParameter infoObjectTypeParam = param.getElement().getElementParameter("INFO_OBJECT_TYPE"); //$NON-NLS-1$
|
||||
if (infoObjectTypeParam != null) {
|
||||
String innerIOType = (String) infoObjectTypeParam.getValue();
|
||||
if (innerIOType != null) {
|
||||
displayName = displayName + " (" + innerIOType + ")"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
}
|
||||
param.setListItemsDisplayName(new String[] { displayName });
|
||||
param.setListItemsValue(new String[] { (String) param.getValue() });
|
||||
}
|
||||
}
|
||||
|
||||
private void fastRepositoryUpdateQuery(IElementParameter param) {
|
||||
if (param != null && param.getValue() != null) {
|
||||
String queryIdAndName = (String) param.getValue();
|
||||
String[] names = queryIdAndName.split(" - "); //$NON-NLS-1$
|
||||
if (names.length < 2) {
|
||||
return;
|
||||
}
|
||||
String linkedRepository = names[0];
|
||||
String queryName = null;
|
||||
if (names.length == 2) {
|
||||
queryName = names[1];
|
||||
} else if (names.length > 2) {
|
||||
queryName = queryIdAndName.substring(linkedRepository.length() + 3);
|
||||
}
|
||||
if (lastItemUsed != null) {
|
||||
if (!linkedRepository.equals(lastItemUsed.getProperty().getId())) {
|
||||
lastItemUsed = null;
|
||||
}
|
||||
}
|
||||
if (lastItemUsed == null) {
|
||||
IProxyRepositoryFactory factory = DesignerPlugin.getDefault().getProxyRepositoryFactory();
|
||||
Item item;
|
||||
try {
|
||||
IRepositoryViewObject object = factory.getLastVersion(linkedRepository);
|
||||
if (object == null) {
|
||||
return;
|
||||
}
|
||||
item = object.getProperty().getItem();
|
||||
lastItemUsed = (ConnectionItem) item;
|
||||
} catch (PersistenceException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
Assert.isTrue(lastItemUsed instanceof DatabaseConnectionItem);
|
||||
QueriesConnection queriesConnection = ((DatabaseConnection) lastItemUsed.getConnection()).getQueries();
|
||||
EList<Query> queries = queriesConnection.getQuery();
|
||||
|
||||
String repositoryAliasName = RepositoryObjectHelper.getRepositoryAliasName(lastItemUsed);
|
||||
for (Query currentQuery : queries) {
|
||||
if (currentQuery.getLabel().equals(queryName)) {
|
||||
String displayName = repositoryAliasName + ":" //$NON-NLS-1$
|
||||
+ lastItemUsed.getProperty().getLabel() + " - " + currentQuery.getLabel(); //$NON-NLS-1$
|
||||
|
||||
param.setListItemsDisplayName(new String[] { displayName });
|
||||
param.setListItemsValue(new String[] { (String) param.getValue() });
|
||||
/* query cache should be deleted ,bug 16969 */
|
||||
// dynamicProperty.getRepositoryQueryStoreMap().clear();
|
||||
// dynamicProperty.getRepositoryQueryStoreMap().put((String) param.getValue(), currentQuery);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for repositoryValueHandlerMap.
|
||||
*
|
||||
* @return the repositoryValueHandlerMap
|
||||
*/
|
||||
public static Map<EParameterFieldType, ControllerRepositoryValueHander> getRepositoryValueHandlerMap() {
|
||||
return repositoryValueHandlerMap;
|
||||
}
|
||||
}
|
||||
@@ -241,40 +241,25 @@ public class GuessSchemaProcess {
|
||||
if (ConnectionUtils.isVertica(info.getUrl())) {
|
||||
createStatament = "conn.createStatement()";
|
||||
}
|
||||
codeStart = systemProperty
|
||||
+ "java.lang.Class.forName(\"" + info.getDriverClassName() + "\");\r\n" + "String url = \"" + info.getUrl() //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
+ "\";\r\n" + "java.sql.Connection conn = java.sql.DriverManager.getConnection(url, \"" + info.getUsername() //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ "\", \"" + info.getPwd() + "\");\r\n" + "java.sql.Statement stm = " + createStatament + ";\r\n" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
+ "try {\r\nstm.setFetchSize(" + fetchSize + ");\r\n} catch (Exception e) {\r\n// Exception is thrown if db don't support, no need to catch exception here\r\n} \r\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ "java.sql.ResultSet rs = stm.executeQuery(" + memoSQL + ");\r\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ "java.sql.ResultSetMetaData rsmd = rs.getMetaData();\r\n" + "int numbOfColumn = rsmd.getColumnCount();\r\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ "\r\n" + "String fileName = (new java.io.File(\r\n" + " \"" + temppath //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
+ "\")).getAbsolutePath().replace(\r\n" + " \"\\\\\", \"/\");\r\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ "com.talend.csv.CSVWriter csvWriter = new com.talend.csv.CSVWriter(\r\n" //$NON-NLS-1$
|
||||
+ " new java.io.BufferedWriter(new java.io.OutputStreamWriter(\r\n" //$NON-NLS-1$
|
||||
+ " new java.io.FileOutputStream(\r\n" //$NON-NLS-1$
|
||||
+ " fileName, false),\r\n" //$NON-NLS-1$
|
||||
+ " \"GBK\")));\r\n" + " \r\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ "csvWriter.setSeparator(';');\r\n" + "csvWriter.setQuoteStatus(com.talend.csv.CSVWriter.QuoteStatus.FORCE);\r\n" + "int nbRows = 0;\r\n" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
+ "String[] columnNames = new String[numbOfColumn];\r\n" + "String[] nullables = new String[numbOfColumn];\r\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ "String[] lengths = new String[numbOfColumn];\r\n" + "String[] precisions = new String[numbOfColumn];\r\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ "String[] dbtypes = new String[numbOfColumn];\r\n" //$NON-NLS-1$
|
||||
+ "for(int i = 1;i<=numbOfColumn;i++){\r\n" + "columnNames[i-1] = rsmd.getColumnName(i);\r\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ "nullables[i-1] = rsmd.isNullable(i) == 0? \"false\" : \"true\";\r\n" //$NON-NLS-1$
|
||||
+ "lengths[i-1] = Integer.toString(rsmd.getScale(i));\r\n" //$NON-NLS-1$
|
||||
+ "precisions[i-1] = Integer.toString(rsmd.getPrecision(i));" //$NON-NLS-1$
|
||||
+ "dbtypes[i-1] = rsmd.getColumnTypeName(i);\r\n" + "}\r\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
+ "csvWriter.writeNext(columnNames);\r\n" + "csvWriter.writeNext(nullables);\r\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ "csvWriter.writeNext(lengths);\r\n" + "csvWriter.writeNext(precisions);\r\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ "csvWriter.writeNext(dbtypes);\r\n" + "while (rs.next()) {"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
if (EDatabaseTypeName.GENERAL_JDBC.getXmlName().equals(info.getDbType())
|
||||
&& "com.sap.db.jdbc.Driver".equals(info.getDriverClassName())
|
||||
|| EDatabaseTypeName.SAPHana.getXmlName().equals(info.getDbType())) {
|
||||
createStatament = "conn.createStatement()";
|
||||
}
|
||||
codeStart = systemProperty + getCodeStart(connectionNode, createStatament, fetchSize);
|
||||
|
||||
codeMain = "String[] dataOneRow = new String[numbOfColumn];\r\n" + "for (int i = 1; i <= numbOfColumn; i++) {\r\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ " \r\n" + " try{\r\n" + " String tempStr = rs.getString(i);\r\n" + " dataOneRow[i-1] = tempStr;\r\n" + " } catch (java.sql.SQLException e) {\r\n" + "}\r\n" + "}\r\n" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
|
||||
+ "csvWriter.writeNext(dataOneRow);"; //$NON-NLS-1$
|
||||
|
||||
codeEnd = "nbRows++;\r\n" + " if (nbRows > " + maximumRowsToPreview + ") break;\r\n" + "}\r\n" + "stm.close();\r\n" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
|
||||
+ "conn.close();\r\n" + "csvWriter.close();\r\n"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
|
||||
if(EDatabaseTypeName.REDSHIFT.getXmlName().equals(info.getDbType())){
|
||||
codeEnd = "nbRows++;\r\n" + " if (nbRows > " + maximumRowsToPreview + ") break;\r\n" + "}\r\n" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
|
||||
+ "conn.close();\r\n" + "csvWriter.close();\r\n"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}else{
|
||||
codeEnd = "nbRows++;\r\n" + " if (nbRows > " + maximumRowsToPreview + ") break;\r\n" + "}\r\n" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
|
||||
+ "conn.close();\r\n" + "csvWriter.close();\r\n"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
|
||||
IComponent component = null;
|
||||
switch (LanguageManager.getCurrentLanguage()) {
|
||||
@@ -295,6 +280,101 @@ public class GuessSchemaProcess {
|
||||
|
||||
process.addNodeContainer(new NodeContainer(flexNode));
|
||||
}
|
||||
|
||||
private String getCodeStart(INode connectionNode, String createStatament, int fetchSize){
|
||||
String codeStart = null;
|
||||
if(EDatabaseTypeName.REDSHIFT.getXmlName().equals(info.getDbType())){
|
||||
String tableName = (String) node.getElementParameter("TABLE").getValue();
|
||||
String dbName = null;
|
||||
String schema = null;
|
||||
if(connectionNode!=null){
|
||||
if(connectionNode.getElementParameter("DBNAME")!=null){
|
||||
dbName = (String) connectionNode.getElementParameter("DBNAME").getValue();
|
||||
}
|
||||
if(connectionNode.getElementParameter("SCHEMA_DB")!=null){
|
||||
schema = (String) connectionNode.getElementParameter("SCHEMA_DB").getValue();
|
||||
}
|
||||
}else{
|
||||
if(node.getElementParameter("DBNAME")!=null){
|
||||
dbName = (String) node.getElementParameter("DBNAME").getValue();
|
||||
}
|
||||
if(node.getElementParameter("SCHEMA_DB")!=null){
|
||||
schema = (String) node.getElementParameter("SCHEMA_DB").getValue();
|
||||
}
|
||||
}
|
||||
codeStart = "java.lang.Class.forName(\"" + info.getDriverClassName() + "\");\r\n" + "String url = \"" + info.getUrl() //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
+ "\";\r\n" + "java.sql.Connection conn = java.sql.DriverManager.getConnection(url, \"" + info.getUsername() //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ "\", \"" + info.getPwd() + "\");\r\n" + "java.sql.DatabaseMetaData metaData = conn.getMetaData();\r\n" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
+ "java.sql.ResultSet rs = metaData.getColumns(" + dbName + "," + schema + "," + tableName + ",null);\r\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
+ "\r\n" + "String fileName = (new java.io.File(\r\n" + " \"" + temppath //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
+ "\")).getAbsolutePath().replace(\r\n" + " \"\\\\\", \"/\");\r\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ "com.talend.csv.CSVWriter csvWriter = new com.talend.csv.CSVWriter(\r\n" //$NON-NLS-1$
|
||||
+ " new java.io.BufferedWriter(new java.io.OutputStreamWriter(\r\n" //$NON-NLS-1$
|
||||
+ " new java.io.FileOutputStream(\r\n" //$NON-NLS-1$
|
||||
+ " fileName, false),\r\n" //$NON-NLS-1$
|
||||
+ " \"GBK\")));\r\n" + " \r\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ "csvWriter.setSeparator(';');\r\n" + "csvWriter.setQuoteStatus(com.talend.csv.CSVWriter.QuoteStatus.FORCE);\r\n" + "int nbRows = 0;\r\n" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
|
||||
|
||||
|
||||
+ "java.util.List<String> columnNameList= new java.util.ArrayList<String>();\r\n" + "java.util.List<String> nullableList= new java.util.ArrayList<String>();\r\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ "java.util.List<String> lengthList= new java.util.ArrayList<String>();\r\n" + "java.util.List<String> precisionList= new java.util.ArrayList<String>();\r\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ "java.util.List<String> dbtypeList= new java.util.ArrayList<String>();\r\n" //$NON-NLS-1$
|
||||
|
||||
+"while (rs.next()) {\r\n" //$NON-NLS-1$
|
||||
+"columnNameList.add(rs.getString(\"COLUMN_NAME\"));\r\n" //$NON-NLS-1$
|
||||
+"nullableList.add(rs.getBoolean(\"NULLABLE\") ? \"true\" : \"false\");\r\n" //$NON-NLS-1$
|
||||
+"lengthList.add(Integer.toString(rs.getInt(\"COLUMN_SIZE\")));\r\n" //$NON-NLS-1$
|
||||
+"precisionList.add(Integer.toString(rs.getInt(\"NUM_PREC_RADIX\")));\r\n" //$NON-NLS-1$
|
||||
+"dbtypeList.add(rs.getString(\"TYPE_NAME\"));\r\n" //$NON-NLS-1$
|
||||
+"}\r\n" //$NON-NLS-1$
|
||||
|
||||
+"int numbOfColumn = columnNameList.size();" //$NON-NLS-1$
|
||||
+ "String[] columnNames = new String[numbOfColumn];\r\n" + "String[] nullables = new String[numbOfColumn];\r\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ "String[] lengths = new String[numbOfColumn];\r\n" + "String[] precisions = new String[numbOfColumn];\r\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ "String[] dbtypes = new String[numbOfColumn];\r\n" //$NON-NLS-1$
|
||||
|
||||
|
||||
+ "for(int i = 0;i<=numbOfColumn-1;i++){\r\n" + "columnNames[i] = columnNameList.get(i);\r\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ "nullables[i] = nullableList.get(i);\r\n" //$NON-NLS-1$
|
||||
+ "lengths[i] = lengthList.get(i);\r\n" //$NON-NLS-1$
|
||||
+ "precisions[i] = precisionList.get(i);" //$NON-NLS-1$
|
||||
+ "dbtypes[i] = dbtypeList.get(i);\r\n" + "}\r\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
+ "csvWriter.writeNext(columnNames);\r\n" + "csvWriter.writeNext(nullables);\r\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ "csvWriter.writeNext(lengths);\r\n" + "csvWriter.writeNext(precisions);\r\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ "csvWriter.writeNext(dbtypes);\r\n" + "while (rs.next()) {"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}else{
|
||||
codeStart = "java.lang.Class.forName(\"" + info.getDriverClassName() + "\");\r\n" + "String url = \"" + info.getUrl() //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
+ "\";\r\n" + "java.sql.Connection conn = java.sql.DriverManager.getConnection(url, \"" + info.getUsername() //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ "\", \"" + info.getPwd() + "\");\r\n" + "java.sql.Statement stm = " + createStatament + ";\r\n" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
+ "try {\r\nstm.setFetchSize(" + fetchSize + ");\r\n} catch (Exception e) {\r\n// Exception is thrown if db don't support, no need to catch exception here\r\n} \r\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ "java.sql.ResultSet rs = stm.executeQuery(" + memoSQL + ");\r\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ "java.sql.ResultSetMetaData rsmd = rs.getMetaData();\r\n" + "int numbOfColumn = rsmd.getColumnCount();\r\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ "\r\n" + "String fileName = (new java.io.File(\r\n" + " \"" + temppath //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
+ "\")).getAbsolutePath().replace(\r\n" + " \"\\\\\", \"/\");\r\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ "com.talend.csv.CSVWriter csvWriter = new com.talend.csv.CSVWriter(\r\n" //$NON-NLS-1$
|
||||
+ " new java.io.BufferedWriter(new java.io.OutputStreamWriter(\r\n" //$NON-NLS-1$
|
||||
+ " new java.io.FileOutputStream(\r\n" //$NON-NLS-1$
|
||||
+ " fileName, false),\r\n" //$NON-NLS-1$
|
||||
+ " \"GBK\")));\r\n" + " \r\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ "csvWriter.setSeparator(';');\r\n" + "csvWriter.setQuoteStatus(com.talend.csv.CSVWriter.QuoteStatus.FORCE);\r\n" + "int nbRows = 0;\r\n" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
+ "String[] columnNames = new String[numbOfColumn];\r\n" + "String[] nullables = new String[numbOfColumn];\r\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ "String[] lengths = new String[numbOfColumn];\r\n" + "String[] precisions = new String[numbOfColumn];\r\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ "String[] dbtypes = new String[numbOfColumn];\r\n" //$NON-NLS-1$
|
||||
+ "for(int i = 1;i<=numbOfColumn;i++){\r\n" + "columnNames[i-1] = rsmd.getColumnName(i);\r\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ "nullables[i-1] = rsmd.isNullable(i) == 0? \"false\" : \"true\";\r\n" //$NON-NLS-1$
|
||||
+ "lengths[i-1] = Integer.toString(rsmd.getScale(i));\r\n" //$NON-NLS-1$
|
||||
+ "precisions[i-1] = Integer.toString(rsmd.getPrecision(i));" //$NON-NLS-1$
|
||||
+ "dbtypes[i-1] = rsmd.getColumnTypeName(i);\r\n" + "}\r\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
+ "csvWriter.writeNext(columnNames);\r\n" + "csvWriter.writeNext(nullables);\r\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ "csvWriter.writeNext(lengths);\r\n" + "csvWriter.writeNext(precisions);\r\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ "csvWriter.writeNext(dbtypes);\r\n" + "while (rs.next()) {"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
return codeStart;
|
||||
}
|
||||
|
||||
// write content to a temp .csv file
|
||||
private IPath buildTempCSVFilename() {
|
||||
|
||||
@@ -43,15 +43,12 @@ import org.talend.commons.ui.runtime.exception.ExceptionHandler;
|
||||
import org.talend.commons.ui.runtime.image.ImageProvider;
|
||||
import org.talend.commons.utils.VersionUtils;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.language.ECodeLanguage;
|
||||
import org.talend.core.language.LanguageManager;
|
||||
import org.talend.core.model.process.EParameterFieldType;
|
||||
import org.talend.core.model.process.IElementParameter;
|
||||
import org.talend.core.model.properties.Item;
|
||||
import org.talend.core.model.properties.ProcessItem;
|
||||
import org.talend.core.model.repository.ERepositoryObjectType;
|
||||
import org.talend.core.model.repository.IRepositoryViewObject;
|
||||
import org.talend.core.model.utils.PerlResourcesHelper;
|
||||
import org.talend.core.ui.CoreUIPlugin;
|
||||
import org.talend.core.ui.branding.IBrandingService;
|
||||
import org.talend.core.ui.properties.tab.IDynamicProperty;
|
||||
@@ -64,7 +61,6 @@ import org.talend.designer.core.ui.editor.properties.controllers.creator.SelectA
|
||||
import org.talend.designer.runprocess.ItemCacheManager;
|
||||
import org.talend.designer.runprocess.ProcessorUtilities;
|
||||
import org.talend.repository.model.RepositoryNode;
|
||||
import org.talend.repository.model.RepositoryNodeUtilities;
|
||||
import org.talend.repository.ui.dialog.RepositoryReviewDialog;
|
||||
import org.talend.repository.ui.dialog.UseDynamicJobSelectionDialog;
|
||||
|
||||
@@ -173,10 +169,6 @@ public class ProcessController extends AbstractElementPropertySectionController
|
||||
|
||||
Point initialSize = dField.getLayoutControl().computeSize(SWT.DEFAULT, SWT.DEFAULT);
|
||||
|
||||
boolean addVersionCombo = true;
|
||||
if (LanguageManager.getCurrentLanguage() == ECodeLanguage.PERL) {
|
||||
addVersionCombo = PerlResourcesHelper.USE_VERSIONING;
|
||||
}
|
||||
// feature 19312
|
||||
IElementParameter useDynamicJobParameter = param.getElement().getElementParameter(
|
||||
EParameterName.USE_DYNAMIC_JOB.getName());
|
||||
@@ -190,7 +182,7 @@ public class ProcessController extends AbstractElementPropertySectionController
|
||||
IBrandingService brandingService = (IBrandingService) GlobalServiceRegister.getDefault().getService(
|
||||
IBrandingService.class);
|
||||
boolean allowVerchange = brandingService.getBrandingConfiguration().isAllowChengeVersion();
|
||||
if (addVersionCombo && allowVerchange) {
|
||||
if (allowVerchange) {
|
||||
lastControlUsed = addJobVersionCombo(subComposite,
|
||||
param.getChildParameters().get(EParameterName.PROCESS_TYPE_VERSION.getName()), lastControlUsed, numInRow + 1,
|
||||
nbInRow, top);
|
||||
@@ -547,20 +539,10 @@ public class ProcessController extends AbstractElementPropertySectionController
|
||||
if (elem != null && elem instanceof Node) {
|
||||
Node runJobNode = (Node) elem;
|
||||
String paramName = (String) button.getData(PARAMETER_NAME);
|
||||
String jobIds = (String) runJobNode.getPropertyValue(paramName); // .getElementParameter(name).getValue();
|
||||
String jobIds = (String) runJobNode.getPropertyValue(paramName);
|
||||
if (StringUtils.isNotEmpty(jobIds)) {
|
||||
String[] jobsArr = jobIds.split(ProcessController.COMMA);
|
||||
List<RepositoryNode> repositoryNodeList = new ArrayList<RepositoryNode>();
|
||||
for (String id : jobsArr) {
|
||||
if (StringUtils.isNotEmpty(id)) {
|
||||
// if user have selected jobs
|
||||
RepositoryNode node = RepositoryNodeUtilities.getRepositoryNode(id);
|
||||
repositoryNodeList.add(node);
|
||||
}
|
||||
}
|
||||
if (repositoryNodeList != null || repositoryNodeList.size() != 0) {
|
||||
dialog.setRepositoryNodes(repositoryNodeList);
|
||||
}
|
||||
dialog.setNeedCheckedjobs(jobsArr);
|
||||
}
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
|
||||
@@ -32,6 +32,7 @@ import org.talend.core.repository.model.ProxyRepositoryFactory;
|
||||
import org.talend.core.ui.properties.tab.IDynamicProperty;
|
||||
import org.talend.designer.core.model.components.EParameterName;
|
||||
import org.talend.designer.core.model.components.EmfComponent;
|
||||
import org.talend.designer.core.model.metadata.RepositoryObjectHelper;
|
||||
import org.talend.designer.core.ui.editor.cmd.ChangeValuesFromRepository;
|
||||
import org.talend.designer.core.ui.editor.cmd.PropertyChangeCommand;
|
||||
import org.talend.designer.core.utils.ValidationRulesUtil;
|
||||
@@ -46,6 +47,7 @@ public class ValidationRuleTypeController extends AbstractRepositoryController {
|
||||
|
||||
public ValidationRuleTypeController(IDynamicProperty dp) {
|
||||
super(dp);
|
||||
repositoryValueHander = new ValidationRuleValueHander();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -127,42 +129,6 @@ public class ValidationRuleTypeController extends AbstractRepositoryController {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void fastInitializeRepositoryNames(IElementParameter param) {
|
||||
super.fastInitializeRepositoryNames(param);
|
||||
|
||||
if (param.getName().equals(EParameterName.REPOSITORY_VALIDATION_RULE_TYPE.getName())) {
|
||||
fastRepositoryUpdateValidationRule(param);
|
||||
}
|
||||
}
|
||||
|
||||
private void fastRepositoryUpdateValidationRule(IElementParameter param) {
|
||||
if (param != null && param.getValue() != null) {
|
||||
IProxyRepositoryFactory factory = ProxyRepositoryFactory.getInstance();
|
||||
String linkedRepository = (String) param.getValue();
|
||||
Item item;
|
||||
String displayName = "";
|
||||
try {
|
||||
IRepositoryViewObject object = factory.getLastVersion(linkedRepository);
|
||||
if (object == null) {
|
||||
return;
|
||||
}
|
||||
item = object.getProperty().getItem();
|
||||
if (item instanceof ConnectionItem) {
|
||||
lastItemUsed = (ConnectionItem) item;
|
||||
displayName = dynamicProperty.getRepositoryAliasName(lastItemUsed) + ":" //$NON-NLS-1$
|
||||
+ lastItemUsed.getProperty().getLabel();
|
||||
}
|
||||
} catch (PersistenceException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
|
||||
param.setListItemsDisplayName(new String[] { displayName });
|
||||
param.setListItemsValue(new String[] { (String) param.getValue() });
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
@@ -209,4 +175,41 @@ public class ValidationRuleTypeController extends AbstractRepositoryController {
|
||||
}
|
||||
}
|
||||
|
||||
private class ValidationRuleValueHander extends ControllerRepositoryValueHander {
|
||||
|
||||
@Override
|
||||
protected void fastInitializeRepositoryNames(IElementParameter param) {
|
||||
if (param.getName().equals(EParameterName.REPOSITORY_VALIDATION_RULE_TYPE.getName())) {
|
||||
fastRepositoryUpdateValidationRule(param);
|
||||
}
|
||||
}
|
||||
|
||||
private void fastRepositoryUpdateValidationRule(IElementParameter param) {
|
||||
if (param != null && param.getValue() != null) {
|
||||
IProxyRepositoryFactory factory = ProxyRepositoryFactory.getInstance();
|
||||
String linkedRepository = (String) param.getValue();
|
||||
Item item;
|
||||
String displayName = "";
|
||||
try {
|
||||
IRepositoryViewObject object = factory.getLastVersion(linkedRepository);
|
||||
if (object == null) {
|
||||
return;
|
||||
}
|
||||
item = object.getProperty().getItem();
|
||||
if (item instanceof ConnectionItem) {
|
||||
lastItemUsed = (ConnectionItem) item;
|
||||
displayName = RepositoryObjectHelper.getRepositoryAliasName(lastItemUsed) + ":" //$NON-NLS-1$
|
||||
+ lastItemUsed.getProperty().getLabel();
|
||||
}
|
||||
} catch (PersistenceException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
|
||||
param.setListItemsDisplayName(new String[] { displayName });
|
||||
param.setListItemsValue(new String[] { (String) param.getValue() });
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,6 +23,8 @@ import org.talend.commons.ui.runtime.exception.ExceptionHandler;
|
||||
import org.talend.core.model.process.EParameterFieldType;
|
||||
import org.talend.core.ui.properties.tab.IDynamicProperty;
|
||||
import org.talend.designer.core.ui.editor.properties.controllers.AbstractElementPropertySectionController;
|
||||
import org.talend.designer.core.ui.editor.properties.controllers.AbstractRepositoryController;
|
||||
import org.talend.designer.core.ui.editor.properties.controllers.ControllerRepositoryValueHander;
|
||||
import org.talend.designer.core.ui.editor.properties.controllers.generator.IControllerGenerator;
|
||||
|
||||
/**
|
||||
@@ -49,8 +51,7 @@ public class DynamicPropertyGenerator {
|
||||
public void initController(IDynamicProperty dp) {
|
||||
if (!initialized) {
|
||||
|
||||
for (int i = 0; i < extensionElements.length; i++) {
|
||||
IConfigurationElement element = extensionElements[i];
|
||||
for (IConfigurationElement element : extensionElements) {
|
||||
try {
|
||||
String controllerName = element.getAttribute("mapping"); //$NON-NLS-1$
|
||||
EParameterFieldType key = EParameterFieldType.getFieldTypeByName(controllerName);
|
||||
@@ -63,6 +64,11 @@ public class DynamicPropertyGenerator {
|
||||
generator.setDynamicProperty(dp);
|
||||
AbstractElementPropertySectionController controller = generator.generate();
|
||||
dtpControls.put(key, controller);
|
||||
if (controller instanceof AbstractRepositoryController) {
|
||||
ControllerRepositoryValueHander repositoryValueHander = ((AbstractRepositoryController) controller)
|
||||
.getRepositoryValueHander();
|
||||
ControllerRepositoryValueHander.getRepositoryValueHandlerMap().put(key, repositoryValueHander);
|
||||
}
|
||||
}
|
||||
} catch (CoreException e) {
|
||||
ExceptionHandler.process(e);
|
||||
|
||||
@@ -708,7 +708,7 @@ public class MultipleThreadDynamicComposite extends ScrolledComposite implements
|
||||
|
||||
}
|
||||
|
||||
private final Listener resizeListener = new Listener() {
|
||||
protected final Listener resizeListener = new Listener() {
|
||||
|
||||
@Override
|
||||
public void handleEvent(Event event) {
|
||||
@@ -726,13 +726,7 @@ public class MultipleThreadDynamicComposite extends ScrolledComposite implements
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
if (!isDisposed() && !getParent().isDisposed()) {
|
||||
int currentSize = getParent().getClientArea().height;
|
||||
if (getLastCompositeSize() != currentSize) {
|
||||
addComponents(true);
|
||||
refresh();
|
||||
}
|
||||
}
|
||||
handleResize();
|
||||
}
|
||||
|
||||
});
|
||||
@@ -740,6 +734,17 @@ public class MultipleThreadDynamicComposite extends ScrolledComposite implements
|
||||
}
|
||||
};
|
||||
|
||||
protected void handleResize() {
|
||||
if (!isDisposed() && !getParent().isDisposed()) {
|
||||
int currentSize = getParent().getClientArea().height;
|
||||
if (getLastCompositeSize() != currentSize) {
|
||||
addComponents(true);
|
||||
refresh();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for isCompactView.
|
||||
*
|
||||
|
||||
@@ -244,14 +244,13 @@ public class JavaProcessUtil {
|
||||
addNodeRelatedModules(node.getProcess(), modulesNeeded, node, forMR);
|
||||
// for children job
|
||||
if (withChildrens) {
|
||||
modulesNeeded.addAll(getChildrenModules(node, searchItems, withChildrens, forMR));
|
||||
modulesNeeded.addAll(getChildrenModules(node, searchItems, forMR));
|
||||
}
|
||||
|
||||
return new HashSet<ModuleNeeded>(modulesNeeded);
|
||||
}
|
||||
|
||||
static List<ModuleNeeded> getChildrenModules(final INode node, Set<ProcessItem> searchItems, boolean withChildrens,
|
||||
boolean forMR) {
|
||||
static List<ModuleNeeded> getChildrenModules(final INode node, Set<ProcessItem> searchItems, boolean forMR) {
|
||||
List<ModuleNeeded> modulesNeeded = new ArrayList<ModuleNeeded>();
|
||||
if (node.getComponent().getName().equals("tRunJob")) { //$NON-NLS-1$
|
||||
IElementParameter processIdparam = node.getElementParameter("PROCESS_TYPE_PROCESS"); //$NON-NLS-1$
|
||||
@@ -267,16 +266,16 @@ public class JavaProcessUtil {
|
||||
|
||||
String context = (String) node.getElementParameter("PROCESS_TYPE_CONTEXT").getValue(); //$NON-NLS-1$
|
||||
if (processItem != null && !searchItems.contains(processItem)) {
|
||||
boolean independent = getBooleanParamValue(node, "USE_INDEPENDENT_PROCESS") //$NON-NLS-1$
|
||||
boolean seperated = getBooleanParamValue(node, "USE_INDEPENDENT_PROCESS") //$NON-NLS-1$
|
||||
|| getBooleanParamValue(node, "USE_DYNAMIC_JOB"); //$NON-NLS-1$
|
||||
if (withChildrens || !independent) {
|
||||
if (!seperated) {
|
||||
// avoid dead loop of method call
|
||||
searchItems.add(processItem);
|
||||
JobInfo subJobInfo = new JobInfo(processItem, context);
|
||||
IDesignerCoreService service = CorePlugin.getDefault().getDesignerCoreService();
|
||||
IProcess child = service.getProcessFromItem(subJobInfo.getProcessItem());
|
||||
|
||||
getNeededModules(child, withChildrens, searchItems, modulesNeeded, forMR);
|
||||
getNeededModules(child, true, searchItems, modulesNeeded, forMR);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.designer.dbmap</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.designer.documentation</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.designer.filemultischemas</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.designer.fileoutputxml</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.designer.gefabstractmap</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.designer.hl7</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.designer.mapper.advanced</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.designer.mapper</artifactId>
|
||||
|
||||
@@ -63,8 +63,8 @@ public class JavaLanguage extends AbstractLanguage {
|
||||
/**
|
||||
* {0} and {1} must be replaced respectively by the table name and the column name.
|
||||
*/
|
||||
private static final String SUBST_PATTERN_FOR_REPLACE_LOCATION = PREFIX_TABLE_NAME_REGEXP + "(\\s*){0}(\\s*)" //$NON-NLS-1$
|
||||
+ SUFFIX_TABLE_NAME_REGEXP + "(\\s*)" + PREFIX_FIELD_NAME_REGEXP + "(\\s*){1}(\\s*)" + SUFFIX_FIELD_NAME_REGEXP; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
private static final String SUBST_PATTERN_FOR_REPLACE_LOCATION = PREFIX_TABLE_NAME_REGEXP + "(\\s*)\\b{0}\\b(\\s*)" //$NON-NLS-1$
|
||||
+ SUFFIX_TABLE_NAME_REGEXP + "(\\s*)" + PREFIX_FIELD_NAME_REGEXP + "(\\s*)\\b{1}\\b(\\s*)" + SUFFIX_FIELD_NAME_REGEXP; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
/**
|
||||
* {0} and {1} must be replaced respectively by the table name and the column name.
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.designer.maven.job</artifactId>
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
<includeBaseDirectory>false</includeBaseDirectory>
|
||||
<formats>
|
||||
<format>zip</format>
|
||||
<format>tar.gz</format>
|
||||
</formats>
|
||||
|
||||
<files>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.designer.publish.core</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.designer.rowgenerator</artifactId>
|
||||
|
||||
@@ -20,9 +20,13 @@ import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.regex.PatternSyntaxException;
|
||||
|
||||
import org.talend.commons.exception.ExceptionHandler;
|
||||
import org.talend.designer.rowgenerator.RowGeneratorComponent;
|
||||
import org.talend.designer.rowgenerator.managers.UIManager;
|
||||
import org.talend.designer.rowgenerator.ui.editor.MetadataColumnExt;
|
||||
import org.talend.utils.json.JSONArray;
|
||||
import org.talend.utils.json.JSONException;
|
||||
import org.talend.utils.json.JSONObject;
|
||||
|
||||
/**
|
||||
* class global comment. Detailled comment <br/>
|
||||
@@ -112,6 +116,35 @@ public class FunctionManagerExt extends FunctionManager {
|
||||
return arrayTalendFunctions2;
|
||||
}
|
||||
|
||||
public Function getFunctionFromColumn(MetadataColumnExt column) {
|
||||
Function function = null;
|
||||
String functionInfo = column.getFunctionInfo();
|
||||
if (functionInfo != null) {
|
||||
try {
|
||||
JSONObject functionObj = new JSONObject(functionInfo);
|
||||
String functionName = functionObj.getString(Function.NAME);
|
||||
int functionSize = 0;
|
||||
JSONArray parametersArray = functionObj.getJSONArray(Function.PARAMETERS);
|
||||
if (parametersArray != null) {
|
||||
functionSize = parametersArray.length();
|
||||
}
|
||||
List<Function> funcs = getFunctionsByType(column.getTalendType());
|
||||
for (Function func : funcs) {
|
||||
if (func.getName().equals(functionName) && func.getParameters().size() == functionSize) {
|
||||
function = func;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (function != null) {
|
||||
function = function.clone(parametersArray);
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
return function;
|
||||
}
|
||||
|
||||
public Function getFuntionFromArray(MetadataColumnExt bean, RowGeneratorComponent externalNode, int index) {
|
||||
String value = externalNode.getColumnValue(bean, index);
|
||||
List<Function> functions = getFunctionsByType(bean.getTalendType());
|
||||
|
||||
@@ -240,7 +240,11 @@ public class UIManager {
|
||||
List<Function> funs = functionManager.getFunctionsByType(ext.getTalendType());
|
||||
ext.setArrayFunctions(functionManager.getFunctionArrays(funs));
|
||||
if (!funs.isEmpty()) {
|
||||
ext.setFunction(functionManager.getFuntionFromArray(ext, externalNode, j));
|
||||
Function funtion = functionManager.getFunctionFromColumn(ext);
|
||||
if (funtion == null) {
|
||||
funtion = functionManager.getFuntionFromArray(ext, externalNode, j);
|
||||
}
|
||||
ext.setFunction(funtion);
|
||||
}
|
||||
exts.add(ext);
|
||||
}
|
||||
|
||||
@@ -14,10 +14,12 @@ package org.talend.designer.rowgenerator.ui.editor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.talend.commons.exception.ExceptionHandler;
|
||||
import org.talend.core.model.metadata.IMetadataColumn;
|
||||
import org.talend.core.model.metadata.MetadataColumn;
|
||||
import org.talend.designer.rowgenerator.data.Function;
|
||||
import org.talend.designer.rowgenerator.data.Parameter;
|
||||
import org.talend.utils.json.JSONException;
|
||||
|
||||
/**
|
||||
* qzhang class global comment. Detailled comment <br/>
|
||||
@@ -27,6 +29,8 @@ import org.talend.designer.rowgenerator.data.Parameter;
|
||||
*/
|
||||
public class MetadataColumnExt extends MetadataColumn {
|
||||
|
||||
public static final String FUNCTION_INFO = "FUNCTION_INFO"; //$NON-NLS-1$
|
||||
|
||||
private boolean isChanged;
|
||||
|
||||
/**
|
||||
@@ -51,9 +55,25 @@ public class MetadataColumnExt extends MetadataColumn {
|
||||
|
||||
public void setFunction(Function function) {
|
||||
this.function = function;
|
||||
updateFunctionInfo();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")//$NON-NLS-1$
|
||||
private void updateFunctionInfo() {
|
||||
if (function != null) {
|
||||
try {
|
||||
String serializedFunction = function.toSerialized();
|
||||
this.getAdditionalField().put(FUNCTION_INFO, serializedFunction);
|
||||
} catch (JSONException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public String getFunctionInfo() {
|
||||
return this.getAdditionalField().get(FUNCTION_INFO);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public String getParameter() {
|
||||
String currentPara = ""; //$NON-NLS-1$
|
||||
if (this.function != null) {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tdi-studio-se</artifactId>
|
||||
<version>6.2.1-SNAPSHOT</version>
|
||||
<version>6.2.1</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.designer.runprocess</artifactId>
|
||||
|
||||
@@ -127,4 +127,5 @@ WorkingSetConfigurationDialog_down_label=&Down
|
||||
ShellShSettingPreferencePage_Title=Shell scripts
|
||||
ShellBatSettingPreferencePage_Title=Bat scripts
|
||||
JavaProcessor.warn.codeFormatTimeout.title=Warning
|
||||
JavaProcessor.warn.codeFormatTimeout.message=Code Format action for source code is stopped by studio since it ran time out.\n\n You can configure the timeout in Window > Preference > Talend > Performance : Code Format timeout(seconds)
|
||||
JavaProcessor.warn.codeFormatTimeout.message=Code Format action for source code is stopped by studio since it ran time out.\n\n You can configure the timeout in Window > Preference > Talend > Performance : Code Format timeout(seconds)
|
||||
JavaCompilationParticipant.validateRoutine=Validate routines...
|
||||
@@ -430,16 +430,17 @@ public class DefaultRunProcessService implements IRunProcessService {
|
||||
String log4jStr = getTemplateStrFromPreferenceStore(Log4jPrefsConstants.LOG4J_CONTENT_NODE);
|
||||
if (log4jStr != null) {
|
||||
File ljFile = new File(log4jFile.getLocation().toOSString());
|
||||
// if (!ljFile.exists()) {
|
||||
FileOutputStream ljFileOutputStream = null;
|
||||
try {
|
||||
ljFile.getParentFile().mkdirs();
|
||||
ljFileOutputStream = new FileOutputStream(ljFile);
|
||||
ljFileOutputStream.write(log4jStr.getBytes());
|
||||
} finally {
|
||||
ljFileOutputStream.close();
|
||||
if (ljFileOutputStream != null) {
|
||||
ljFileOutputStream.close();
|
||||
}
|
||||
}
|
||||
resFolder.refreshLocal(IResource.DEPTH_ONE, null);
|
||||
// }
|
||||
}
|
||||
// }
|
||||
} catch (Exception e) {
|
||||
|
||||
@@ -30,9 +30,7 @@ import org.eclipse.core.runtime.jobs.ISchedulingRule;
|
||||
import org.eclipse.jdt.core.IJavaProject;
|
||||
import org.eclipse.ui.IStartup;
|
||||
import org.talend.commons.exception.ExceptionHandler;
|
||||
import org.talend.commons.exception.PersistenceException;
|
||||
import org.talend.commons.utils.generation.JavaUtils;
|
||||
import org.talend.core.CorePlugin;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.runtime.process.ITalendProcessJavaProject;
|
||||
import org.talend.designer.maven.model.TalendMavenConstants;
|
||||
@@ -49,12 +47,14 @@ public class DeleteAllJobWhenStartUp implements IStartup {
|
||||
|
||||
public static boolean executed;
|
||||
|
||||
private boolean startUnderPluginModel;
|
||||
|
||||
public void startup(boolean pluginModel) {
|
||||
startUnderPluginModel = pluginModel;
|
||||
public void startup() {
|
||||
earlyStartup();
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public void startup(boolean pluginModel) {
|
||||
startup();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
@@ -63,10 +63,6 @@ public class DeleteAllJobWhenStartUp implements IStartup {
|
||||
*/
|
||||
@Override
|
||||
public void earlyStartup() {
|
||||
|
||||
if (!startUnderPluginModel && !CorePlugin.getDefault().getRepositoryService().isRCPMode()) {
|
||||
return;
|
||||
}
|
||||
if (!GlobalServiceRegister.getDefault().isServiceRegistered(IRunProcessService.class)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -143,10 +143,11 @@ public class JobErrorsChecker {
|
||||
}
|
||||
// check the item has compile error when export job
|
||||
boolean ret = false;
|
||||
String message = null;
|
||||
IMarker[] markers = sourceFile.findMarkers(IMarker.PROBLEM, true, IResource.DEPTH_ONE);
|
||||
for (IMarker marker : markers) {
|
||||
Integer lineNr = (Integer) marker.getAttribute(IMarker.LINE_NUMBER);
|
||||
String message = (String) marker.getAttribute(IMarker.MESSAGE);
|
||||
message = (String) marker.getAttribute(IMarker.MESSAGE);
|
||||
Integer severity = (Integer) marker.getAttribute(IMarker.SEVERITY);
|
||||
Integer start = (Integer) marker.getAttribute(IMarker.CHAR_START);
|
||||
Integer end = (Integer) marker.getAttribute(IMarker.CHAR_END);
|
||||
@@ -164,11 +165,11 @@ public class JobErrorsChecker {
|
||||
if (isJob) {
|
||||
throw new ProcessorException(Messages.getString("JobErrorsChecker_compile_errors") + '\n' + //$NON-NLS-1$
|
||||
Messages.getString("JobErrorsChecker_compile_error_content", item.getProperty() //$NON-NLS-1$
|
||||
.getLabel()));
|
||||
.getLabel()) + '\n' + message);
|
||||
} else {
|
||||
throw new ProcessorException(Messages.getString("CamelJobErrorsChecker_compile_errors") + '\n' + //$NON-NLS-1$
|
||||
Messages.getString("CamelJobErrorsChecker_compile_error_content", item.getProperty() //$NON-NLS-1$
|
||||
.getLabel()));
|
||||
.getLabel()) + '\n' + message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -529,7 +529,7 @@ public class RunProcessContext {
|
||||
final IProgressMonitor progressMonitor = new EventLoopProgressMonitor(monitor);
|
||||
|
||||
progressMonitor.beginTask(Messages.getString("ProcessComposite.buildTask"), IProgressMonitor.UNKNOWN); //$NON-NLS-1$
|
||||
try {
|
||||
|
||||
testPort();
|
||||
// findNewStatsPort();
|
||||
if (monitorPerf || monitorTrace) {
|
||||
@@ -557,10 +557,23 @@ public class RunProcessContext {
|
||||
final String log4jRuntimeLevel = getLog4jRuntimeLevel();
|
||||
processor.setContext(context);
|
||||
((IEclipseProcessor) processor).setTargetExecutionConfig(getSelectedTargetExecutionConfig());
|
||||
|
||||
ProcessorUtilities.generateCode(processor, process, context,
|
||||
try {
|
||||
ProcessorUtilities.generateCode(processor, process, context,
|
||||
getStatisticsPort() != IProcessor.NO_STATISTICS, getTracesPort() != IProcessor.NO_TRACES
|
||||
&& hasConnectionTrace(), true, progressMonitor);
|
||||
} catch (Throwable e) {
|
||||
// catch any Exception or Error to kill the process,
|
||||
// see bug 0003567
|
||||
running = true;
|
||||
ExceptionHandler.process(e);
|
||||
addErrorMessage(e);
|
||||
kill();
|
||||
} finally {
|
||||
progressMonitor.done();
|
||||
// System.out.println("exitValue:" +
|
||||
// ps.exitValue());
|
||||
}
|
||||
|
||||
final boolean[] refreshUiAndWait = new boolean[1];
|
||||
refreshUiAndWait[0] = true;
|
||||
final Display display = shell.getDisplay();
|
||||
@@ -640,18 +653,7 @@ public class RunProcessContext {
|
||||
|
||||
}
|
||||
|
||||
} catch (Throwable e) {
|
||||
// catch any Exception or Error to kill the process,
|
||||
// see bug 0003567
|
||||
running = true;
|
||||
ExceptionHandler.process(e);
|
||||
addErrorMessage(e);
|
||||
kill();
|
||||
} finally {
|
||||
progressMonitor.done();
|
||||
// System.out.println("exitValue:" +
|
||||
// ps.exitValue());
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
} catch (InvocationTargetException e1) {
|
||||
|
||||
@@ -16,6 +16,10 @@ import java.util.List;
|
||||
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.core.runtime.IStatus;
|
||||
import org.eclipse.core.runtime.Status;
|
||||
import org.eclipse.core.runtime.jobs.Job;
|
||||
import org.eclipse.jdt.core.IJavaProject;
|
||||
import org.eclipse.jdt.core.compiler.BuildContext;
|
||||
import org.eclipse.jdt.core.compiler.CompilationParticipant;
|
||||
@@ -36,6 +40,7 @@ import org.talend.designer.codegen.ITalendSynchronizer;
|
||||
import org.talend.designer.codegen.model.CodeGeneratorEmittersPoolFactory;
|
||||
import org.talend.designer.core.ui.views.problems.Problems;
|
||||
import org.talend.designer.runprocess.IRunProcessService;
|
||||
import org.talend.designer.runprocess.i18n.Messages;
|
||||
import org.talend.repository.model.IProxyRepositoryFactory;
|
||||
|
||||
/**
|
||||
@@ -58,46 +63,60 @@ public class JavaCompilationParticipant extends CompilationParticipant {
|
||||
* [])
|
||||
*/
|
||||
@Override
|
||||
public void processAnnotations(BuildContext[] files) {
|
||||
public void processAnnotations(final BuildContext[] files) {
|
||||
|
||||
boolean routineToUpdate = false;
|
||||
super.processAnnotations(files);
|
||||
|
||||
List<IRepositoryViewObject> routineObjectList = null;
|
||||
for (BuildContext context : files) {
|
||||
Job routineJob = new Job(Messages.getString("JavaCompilationParticipant.validateRoutine")) { //$NON-NLS-1$
|
||||
|
||||
String filePath = (context.getFile().getProjectRelativePath()).toString();
|
||||
@Override
|
||||
protected IStatus run(IProgressMonitor monitor) {
|
||||
boolean routineToUpdate = false;
|
||||
List<IRepositoryViewObject> routineObjectList = null;
|
||||
for (BuildContext context : files) {
|
||||
|
||||
if (isRoutineFile(filePath)) {
|
||||
if (!routineToUpdate) {
|
||||
IProxyRepositoryFactory factory = CorePlugin.getDefault().getProxyRepositoryFactory();
|
||||
String filePath = (context.getFile().getProjectRelativePath()).toString();
|
||||
|
||||
try {
|
||||
if (isRoutineFile(filePath)) {
|
||||
if (!routineToUpdate) {
|
||||
IProxyRepositoryFactory factory = CorePlugin.getDefault().getProxyRepositoryFactory();
|
||||
|
||||
routineObjectList = factory.getAll(ERepositoryObjectType.ROUTINES, false);
|
||||
} catch (PersistenceException e) {
|
||||
ExceptionHandler.process(e);
|
||||
try {
|
||||
|
||||
routineObjectList = factory.getAll(ERepositoryObjectType.ROUTINES, false);
|
||||
} catch (PersistenceException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
updateProblems(routineObjectList, filePath);
|
||||
routineToUpdate = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
updateProblems(routineObjectList, filePath);
|
||||
routineToUpdate = true;
|
||||
|
||||
if (routineToUpdate && !CommonsPlugin.isHeadless()) {
|
||||
Display.getDefault().asyncExec(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
Problems.refreshProblemTreeView();
|
||||
} catch (Exception e) {
|
||||
// ignore any exception here, as there is no impact if refresh or not.
|
||||
// but if don't ignore, exception could be thrown if refresh is done too early.
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return Status.OK_STATUS;
|
||||
}
|
||||
}
|
||||
|
||||
if (routineToUpdate && !CommonsPlugin.isHeadless()) {
|
||||
Display.getDefault().asyncExec(new Runnable() {
|
||||
};
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
Problems.refreshProblemTreeView();
|
||||
} catch (Exception e) {
|
||||
// ignore any exception here, as there is no impact if refresh or not.
|
||||
// but if don't ignore, exception could be thrown if refresh is done too early.
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
routineJob.setUser(false);
|
||||
routineJob.setRule(null);
|
||||
routineJob.schedule();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -117,6 +117,7 @@ import org.talend.core.model.utils.JavaResourcesHelper;
|
||||
import org.talend.core.prefs.ITalendCorePrefConstants;
|
||||
import org.talend.core.runtime.process.ITalendProcessJavaProject;
|
||||
import org.talend.core.runtime.process.LastGenerationInfo;
|
||||
import org.talend.core.runtime.process.TalendProcessOptionConstants;
|
||||
import org.talend.core.ui.services.IRulesProviderService;
|
||||
import org.talend.core.utils.BitwiseOptionUtils;
|
||||
import org.talend.designer.codegen.ICodeGenerator;
|
||||
@@ -455,21 +456,13 @@ public class JavaProcessor extends AbstractJavaProcessor implements IJavaBreakpo
|
||||
for (IResource resource : javaCodeFolder.members()) {
|
||||
if ("java".equals(resource.getFileExtension())) {//$NON-NLS-1$
|
||||
if (processSourceFileName != null && processSourceFileName.equals(resource.getName())) {
|
||||
((IFile) resource).setContents(new ByteArrayInputStream(new byte[0]), IResource.KEEP_HISTORY,
|
||||
((IFile) resource).setContents(new ByteArrayInputStream(new byte[0]), true, false,
|
||||
null);
|
||||
} else {
|
||||
try {
|
||||
org.talend.commons.utils.io.FilesUtils.removeExistedResources(null, resource, true, true);
|
||||
} catch (Exception e) {
|
||||
throw new ProcessorException(e);
|
||||
}
|
||||
resource.delete(true, null);
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
org.talend.commons.utils.io.FilesUtils.removeExistedResources(null, resource, true, true);
|
||||
} catch (Exception e) {
|
||||
throw new ProcessorException(e);
|
||||
}
|
||||
resource.delete(true, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -514,8 +507,8 @@ public class JavaProcessor extends AbstractJavaProcessor implements IJavaBreakpo
|
||||
* boolean, boolean)
|
||||
*/
|
||||
@Override
|
||||
public void generateCode(boolean statistics, boolean trace, boolean javaProperties) throws ProcessorException {
|
||||
super.generateCode(statistics, trace, javaProperties);
|
||||
public void generateCode(boolean statistics, boolean trace, boolean javaProperties, int option) throws ProcessorException {
|
||||
super.generateCode(statistics, trace, javaProperties, option);
|
||||
try {
|
||||
// hywang modified for 6484
|
||||
String currentJavaProject = ProjectManager.getInstance().getProject(property).getTechnicalLabel();
|
||||
@@ -579,96 +572,9 @@ public class JavaProcessor extends AbstractJavaProcessor implements IJavaBreakpo
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
|
||||
// format the code before save the file.
|
||||
final String toFormat = processCode;
|
||||
writeCodesToFile(toFormat, "1-beforeFormat");//$NON-NLS-1$
|
||||
// fix for 21320
|
||||
final Job job = new Job("t") { //$NON-NLS-1$
|
||||
|
||||
private Thread workThread;
|
||||
|
||||
@Override
|
||||
protected IStatus run(IProgressMonitor monitor) {
|
||||
monitor.beginTask("Format code", IProgressMonitor.UNKNOWN); //$NON-NLS-1$
|
||||
FutureTask<Boolean> ft = new FutureTask<Boolean>(new Callable<Boolean>() {
|
||||
|
||||
@Override
|
||||
public Boolean call() throws Exception {
|
||||
formatedCode = formatCode(toFormat);
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
});
|
||||
Boolean isSucceed = null;
|
||||
try {
|
||||
workThread = new Thread(ft);
|
||||
workThread.start();
|
||||
isSucceed = ft.get();
|
||||
} catch (Throwable e) {
|
||||
if (!monitor.isCanceled()) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
if (isSucceed == Boolean.TRUE && !monitor.isCanceled()) {
|
||||
writeCodesToFile(formatedCode, "2-afterFormat");//$NON-NLS-1$
|
||||
}
|
||||
monitor.done();
|
||||
return Status.OK_STATUS;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void canceling() {
|
||||
try {
|
||||
super.canceling();
|
||||
if (workThread != null) {
|
||||
workThread.stop();
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
// should catch the ThreadDeath, in case to crash Studio
|
||||
}
|
||||
}
|
||||
};
|
||||
long time1 = System.currentTimeMillis();
|
||||
|
||||
job.setSystem(true);
|
||||
job.schedule();
|
||||
boolean f = true;
|
||||
long timeout = 1000 * DesignerPlugin.getDefault().getPreferenceStore()
|
||||
.getInt(ITalendCorePrefConstants.PERFORMANCE_JAVA_PROCESS_CODE_FORMATE_TIMEOUT);
|
||||
if (timeout <= 0) {
|
||||
timeout = 30000;
|
||||
if (!BitwiseOptionUtils.containOption(option, TalendProcessOptionConstants.GENERATE_WITHOUT_FORMAT)) {
|
||||
processCode = doFormat(processCode);
|
||||
}
|
||||
while (f) {
|
||||
long time2 = System.currentTimeMillis();
|
||||
if (time2 - time1 > timeout) {
|
||||
if (job.getResult() == null || !job.getResult().isOK()) {
|
||||
f = false;
|
||||
job.cancel();
|
||||
if (!CommonsPlugin.isHeadless()) {
|
||||
Display.getDefault().asyncExec(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
MessageDialog.openWarning(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
|
||||
Messages.getString("JavaProcessor.warn.codeFormatTimeout.title"), //$NON-NLS-1$
|
||||
Messages.getString("JavaProcessor.warn.codeFormatTimeout.message")); //$NON-NLS-1$
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
processCode = formatedCode;
|
||||
f = false;
|
||||
}
|
||||
} else {
|
||||
if (job.getState() != Job.RUNNING) {
|
||||
if (job.getResult() != null && job.getResult().isOK()) {
|
||||
processCode = formatedCode;
|
||||
f = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
formatedCode = null;
|
||||
|
||||
// see feature 4610:option to see byte length of each code method
|
||||
processCode = computeMethodSizeIfNeeded(processCode);
|
||||
@@ -753,6 +659,100 @@ public class JavaProcessor extends AbstractJavaProcessor implements IJavaBreakpo
|
||||
}
|
||||
}
|
||||
|
||||
private String doFormat(String processCode) {
|
||||
// format the code before save the file.
|
||||
final String toFormat = processCode;
|
||||
writeCodesToFile(toFormat, "1-beforeFormat");//$NON-NLS-1$
|
||||
// fix for 21320
|
||||
final Job job = new Job("t") { //$NON-NLS-1$
|
||||
|
||||
private Thread workThread;
|
||||
|
||||
@Override
|
||||
protected IStatus run(IProgressMonitor monitor) {
|
||||
monitor.beginTask("Format code", IProgressMonitor.UNKNOWN); //$NON-NLS-1$
|
||||
FutureTask<Boolean> ft = new FutureTask<Boolean>(new Callable<Boolean>() {
|
||||
|
||||
@Override
|
||||
public Boolean call() throws Exception {
|
||||
formatedCode = formatCode(toFormat);
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
});
|
||||
Boolean isSucceed = null;
|
||||
try {
|
||||
workThread = new Thread(ft);
|
||||
workThread.start();
|
||||
isSucceed = ft.get();
|
||||
} catch (Throwable e) {
|
||||
if (!monitor.isCanceled()) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
if (isSucceed == Boolean.TRUE && !monitor.isCanceled()) {
|
||||
writeCodesToFile(formatedCode, "2-afterFormat");//$NON-NLS-1$
|
||||
}
|
||||
monitor.done();
|
||||
return Status.OK_STATUS;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void canceling() {
|
||||
try {
|
||||
super.canceling();
|
||||
if (workThread != null) {
|
||||
workThread.stop();
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
// should catch the ThreadDeath, in case to crash Studio
|
||||
}
|
||||
}
|
||||
};
|
||||
long time1 = System.currentTimeMillis();
|
||||
|
||||
job.setSystem(true);
|
||||
job.schedule();
|
||||
boolean f = true;
|
||||
long timeout = 1000 * DesignerPlugin.getDefault().getPreferenceStore()
|
||||
.getInt(ITalendCorePrefConstants.PERFORMANCE_JAVA_PROCESS_CODE_FORMATE_TIMEOUT);
|
||||
if (timeout <= 0) {
|
||||
timeout = 30000;
|
||||
}
|
||||
while (f) {
|
||||
long time2 = System.currentTimeMillis();
|
||||
if (time2 - time1 > timeout) {
|
||||
if (job.getResult() == null || !job.getResult().isOK()) {
|
||||
f = false;
|
||||
job.cancel();
|
||||
if (!CommonsPlugin.isHeadless()) {
|
||||
Display.getDefault().asyncExec(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
MessageDialog.openWarning(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
|
||||
Messages.getString("JavaProcessor.warn.codeFormatTimeout.title"), //$NON-NLS-1$
|
||||
Messages.getString("JavaProcessor.warn.codeFormatTimeout.message")); //$NON-NLS-1$
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
processCode = formatedCode;
|
||||
f = false;
|
||||
}
|
||||
} else {
|
||||
if (job.getState() != Job.RUNNING) {
|
||||
if (job.getResult() != null && job.getResult().isOK()) {
|
||||
processCode = formatedCode;
|
||||
f = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
formatedCode = null;
|
||||
return processCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* DOC nrousseau Comment method "formatCode".
|
||||
*
|
||||
@@ -763,8 +763,9 @@ public class JavaProcessor extends AbstractJavaProcessor implements IJavaBreakpo
|
||||
*/
|
||||
@SuppressWarnings({ "unchecked" })
|
||||
private String formatCode(String processCode) {
|
||||
// if export, won't format too.
|
||||
// we cannot make calls to Ui in headless mode
|
||||
if (CommonsPlugin.isHeadless()) {
|
||||
if (ProcessorUtilities.isExportConfig() || CommonsPlugin.isHeadless()) {
|
||||
return processCode; // nothing to do
|
||||
}
|
||||
final IDocument document = new Document(processCode);
|
||||
@@ -1578,8 +1579,8 @@ public class JavaProcessor extends AbstractJavaProcessor implements IJavaBreakpo
|
||||
if (null != uniqueName && null != wsdlContent && !wsdlContent.trim().isEmpty()) {
|
||||
|
||||
// configure decoding and uncompressing
|
||||
InputStream wsdlStream = new BufferedInputStream(
|
||||
new InflaterInputStream(new Base64InputStream(new ByteArrayInputStream(wsdlContent.getBytes()))));
|
||||
InputStream wsdlStream = new BufferedInputStream(new InflaterInputStream(new Base64InputStream(
|
||||
new ByteArrayInputStream(wsdlContent.getBytes()))));
|
||||
|
||||
if (!wsdlsPackageFolder.exists()) {
|
||||
wsdlsPackageFolder.create(true, true, null);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user