Compare commits
38 Commits
codegen_ba
...
patch/5.6.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b07356abbc | ||
|
|
a8b74ff7c4 | ||
|
|
cf68bcbf60 | ||
|
|
e056a04c45 | ||
|
|
0418ab9a11 | ||
|
|
4b1efc9807 | ||
|
|
7a65fb5567 | ||
|
|
ec0386351e | ||
|
|
d57261d72a | ||
|
|
0cbaae18b5 | ||
|
|
1988d96e28 | ||
|
|
40513495da | ||
|
|
067a307829 | ||
|
|
8abd62b836 | ||
|
|
0935844d99 | ||
|
|
3cd5ba25f7 | ||
|
|
a2dbc1e49f | ||
|
|
8ee6062cab | ||
|
|
53ae623548 | ||
|
|
d42ff63cc1 | ||
|
|
625537b46b | ||
|
|
fa67de1575 | ||
|
|
10d1675541 | ||
|
|
89d57a88fe | ||
|
|
ca7da04bf1 | ||
|
|
cde2076b9c | ||
|
|
cbd8e38b4a | ||
|
|
c6ecfa1714 | ||
|
|
7f14a4cf1b | ||
|
|
04a7b6d2de | ||
|
|
50fbbb6cb2 | ||
|
|
a5a928e33f | ||
|
|
2900b474e4 | ||
|
|
d23810bab2 | ||
|
|
77d0cf119d | ||
|
|
adfb6724cb | ||
|
|
f8f1aefc14 | ||
|
|
f49fa77655 |
@@ -57,19 +57,11 @@
|
||||
%>
|
||||
TalendThreadPool mtp_<%=iterateConn.getTarget().getUniqueName() %> = new TalendThreadPool(<%=ElementParameterParser.getValue(iterateConn,"__NUMBER_PARALLEL__") %>);
|
||||
|
||||
<%
|
||||
if(!hasParallelIterate){
|
||||
hasParallelIterate = true;
|
||||
%>
|
||||
final Object[] lockWrite_<%=iterateNodeName%> = new Object[0];
|
||||
globalMap.put("lockWrite_<%=iterateNodeName%>", new Object[0]);
|
||||
int threadIdCounter_<%=iterateNodeName%> =0;
|
||||
<%
|
||||
}
|
||||
%>
|
||||
|
||||
<%
|
||||
}
|
||||
%>
|
||||
int NB_ITERATE_<%=iterateNodeName %> = 0; //for statistics
|
||||
<%
|
||||
continue;
|
||||
|
||||
@@ -112,7 +112,6 @@
|
||||
}
|
||||
|
||||
<%=node.getUniqueName() %>Thread bt_<%=node.getUniqueName() %> = new <%=node.getUniqueName() %>Thread(globalMap<%=schemaInstanceDeclaration %>,threadIdCounter_<%=node.getUniqueName()%>++);
|
||||
bt_<%=node.getUniqueName()%>.assignLock(lockWrite_<%=node.getUniqueName()%>);
|
||||
mtp_<%=node.getUniqueName() %>.execute(bt_<%=node.getUniqueName() %>);
|
||||
|
||||
<%
|
||||
|
||||
@@ -888,7 +888,6 @@ public class CodeGenerator implements ICodeGenerator {
|
||||
CodeGeneratorArgument argument = new CodeGeneratorArgument();
|
||||
argument.setNode(node);
|
||||
argument.setAllMainSubTreeConnections(subProcess.getAllMainSubTreeConnections());
|
||||
argument.setSubTreeContainsParallelIterate(subProcess.subTreeContainsParallelIterate());
|
||||
argument.setCodePart(part);
|
||||
argument.setStatistics(statistics);
|
||||
argument.setTrace(trace);
|
||||
|
||||
@@ -60,6 +60,7 @@ public class CodeGeneratorArgument {
|
||||
|
||||
private int pauseTime;
|
||||
|
||||
@Deprecated
|
||||
private boolean subTreeContainsParallelIterate;
|
||||
|
||||
/**
|
||||
@@ -277,10 +278,15 @@ public class CodeGeneratorArgument {
|
||||
this.subTree = subTree;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
/*
|
||||
* use org.talend.core.model.process.AbstractNode.getParallelIterator()
|
||||
*/
|
||||
public boolean subTreeContainsParallelIterate() {
|
||||
return subTreeContainsParallelIterate;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public void setSubTreeContainsParallelIterate(boolean subTreeContainsParallelIterate) {
|
||||
this.subTreeContainsParallelIterate = subTreeContainsParallelIterate;
|
||||
}
|
||||
|
||||
@@ -22,7 +22,6 @@ import java.util.Map;
|
||||
|
||||
import org.talend.core.model.process.AbstractNode;
|
||||
import org.talend.core.model.process.EConnectionType;
|
||||
import org.talend.core.model.process.ElementParameterParser;
|
||||
import org.talend.core.model.process.IConnection;
|
||||
import org.talend.core.model.process.IConnectionCategory;
|
||||
import org.talend.core.model.process.INode;
|
||||
@@ -61,6 +60,7 @@ public class NodesSubTree {
|
||||
|
||||
List<IConnection> allMainSubTreeConnections = null;
|
||||
|
||||
@Deprecated
|
||||
boolean subTreeContainsParallelIterate = false;
|
||||
|
||||
List<INode> mergeBranchStarts;
|
||||
@@ -280,10 +280,6 @@ public class NodesSubTree {
|
||||
if (connection.getLineStyle().hasConnectionCategory(IConnectionCategory.MAIN)) {
|
||||
if (!connection.getLineStyle().hasConnectionCategory(IConnectionCategory.USE_ITERATE)) {
|
||||
allMainSubTreeConnections.add(connection);
|
||||
} else {
|
||||
if (Boolean.TRUE.toString().equals(ElementParameterParser.getValue(connection, "__ENABLE_PARALLEL__"))) { //$NON-NLS-1$
|
||||
subTreeContainsParallelIterate = true;
|
||||
}
|
||||
}
|
||||
if (DEBUG) {
|
||||
System.out.print(" -> "); //$NON-NLS-1$
|
||||
@@ -537,6 +533,10 @@ public class NodesSubTree {
|
||||
this.allMainSubTreeConnections = allMainSubTreeConnections;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
/*
|
||||
* use org.talend.core.model.process.AbstractNode.getParallelIterator()
|
||||
*/
|
||||
public boolean subTreeContainsParallelIterate() {
|
||||
return subTreeContainsParallelIterate;
|
||||
}
|
||||
|
||||
5
main/plugins/org.talend.designer.components.libs/libs_src/mdm_transaction/.gitignore
vendored
Normal file
5
main/plugins/org.talend.designer.components.libs/libs_src/mdm_transaction/.gitignore
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
# IntelliJ IDEA
|
||||
.idea/
|
||||
*.ipr
|
||||
*.iml
|
||||
*.iws
|
||||
@@ -1,86 +0,0 @@
|
||||
package com.talend.mdm.transaction.client;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.commons.httpclient.HttpClient;
|
||||
import org.apache.commons.httpclient.HttpException;
|
||||
import org.apache.commons.httpclient.HttpMethod;
|
||||
import org.apache.commons.httpclient.UsernamePasswordCredentials;
|
||||
import org.apache.commons.httpclient.auth.AuthScope;
|
||||
import org.apache.commons.httpclient.methods.DeleteMethod;
|
||||
import org.apache.commons.httpclient.methods.PostMethod;
|
||||
|
||||
public class MDMTransaction {
|
||||
|
||||
private String url;
|
||||
private String id;
|
||||
private String username;
|
||||
private String password;
|
||||
|
||||
public void commit() throws IOException {
|
||||
HttpClient client = new HttpClient();
|
||||
client.getState().setCredentials(AuthScope.ANY,
|
||||
new UsernamePasswordCredentials(username, password));
|
||||
|
||||
HttpMethod method = new PostMethod(url + "/" + id);
|
||||
method.setDoAuthentication(true);
|
||||
try {
|
||||
client.executeMethod(method);
|
||||
} catch (HttpException e) {
|
||||
throw e;
|
||||
} catch (IOException e) {
|
||||
throw e;
|
||||
} finally {
|
||||
method.releaseConnection();
|
||||
}
|
||||
|
||||
int statuscode = method.getStatusCode();
|
||||
if (statuscode >= 400) {
|
||||
throw new MDMTransactionException("Commit failed. The commit operation has returned the code " + statuscode + ".");
|
||||
}
|
||||
}
|
||||
|
||||
public void rollback() throws IOException {
|
||||
HttpClient client = new HttpClient();
|
||||
client.getState().setCredentials(AuthScope.ANY,
|
||||
new UsernamePasswordCredentials(username, password));
|
||||
|
||||
HttpMethod method = new DeleteMethod(url + "/" + id);
|
||||
method.setDoAuthentication(true);
|
||||
try {
|
||||
client.executeMethod(method);
|
||||
} catch (HttpException e) {
|
||||
throw e;
|
||||
} catch (IOException e) {
|
||||
throw e;
|
||||
} finally {
|
||||
method.releaseConnection();
|
||||
}
|
||||
|
||||
int statuscode = method.getStatusCode();
|
||||
if (statuscode >= 400) {
|
||||
throw new MDMTransactionException("Rollback failed. The rollback operation has returned the code " + statuscode + ".");
|
||||
}
|
||||
}
|
||||
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,75 +0,0 @@
|
||||
package com.talend.mdm.transaction.client;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.commons.httpclient.HttpClient;
|
||||
import org.apache.commons.httpclient.HttpException;
|
||||
import org.apache.commons.httpclient.UsernamePasswordCredentials;
|
||||
import org.apache.commons.httpclient.auth.AuthScope;
|
||||
import org.apache.commons.httpclient.methods.PutMethod;
|
||||
|
||||
public class MDMTransactionClient {
|
||||
|
||||
public static MDMTransaction newTransaction(String url, String username, String password) throws IOException {
|
||||
HttpClient client = new HttpClient();
|
||||
client.getState().setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(username, password));
|
||||
|
||||
PutMethod put = new PutMethod(url);
|
||||
put.setDoAuthentication(true);
|
||||
String tid = "";
|
||||
try {
|
||||
client.executeMethod(put);
|
||||
tid = put.getResponseBodyAsString();
|
||||
} catch (HttpException e) {
|
||||
throw e;
|
||||
} catch (IOException e) {
|
||||
throw e;
|
||||
} finally {
|
||||
put.releaseConnection();
|
||||
}
|
||||
|
||||
MDMTransaction result = new MDMTransaction();
|
||||
result.setUrl(url);
|
||||
result.setId(tid);
|
||||
result.setUsername(username);
|
||||
result.setPassword(password);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public static String getMDMTransactionURL(String url) {
|
||||
if(url == null || "".equals(url)) {
|
||||
return "";
|
||||
}
|
||||
|
||||
int count = 3;
|
||||
int i=0;
|
||||
for(;i<url.length();i++) {
|
||||
char c = url.charAt(i);
|
||||
if('/' == c) {
|
||||
count--;
|
||||
}
|
||||
if(count == 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
String result = url.substring(0, i);
|
||||
result += "/datamanager/services/transactions";
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws IOException {
|
||||
MDMTransaction mt = MDMTransactionClient.newTransaction("http://localhost:8080/datamanager/services/transactions", "administrator", "administrator");
|
||||
mt.commit();
|
||||
|
||||
MDMTransaction mt1 = MDMTransactionClient.newTransaction("http://localhost:8080/datamanager/services/transactions", "administrator", "administrator");
|
||||
mt1.rollback();
|
||||
|
||||
String url = "http://localhost:8080/talend/TalendPort";
|
||||
String mdmurl = MDMTransactionClient.getMDMTransactionURL(url);
|
||||
System.out.println(mdmurl);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.talend</groupId>
|
||||
<artifactId>mdm_transaction</artifactId>
|
||||
<name>mdm_transaction</name>
|
||||
<version>1</version>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>commons-codec</groupId>
|
||||
<artifactId>commons-codec</artifactId>
|
||||
<version>1.7</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-logging</groupId>
|
||||
<artifactId>commons-logging</artifactId>
|
||||
<version>1.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-httpclient</groupId>
|
||||
<artifactId>commons-httpclient</artifactId>
|
||||
<version>3.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>${project.name}</finalName>
|
||||
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>${basedir}/src/main/java</directory>
|
||||
</resource>
|
||||
</resources>
|
||||
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>2.3.2</version>
|
||||
<configuration>
|
||||
<source>1.6</source>
|
||||
<target>1.6</target>
|
||||
<encoding>UTF-8</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
||||
</build>
|
||||
</project>
|
||||
@@ -0,0 +1,109 @@
|
||||
package com.talend.mdm.transaction.client;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.commons.httpclient.HttpClient;
|
||||
import org.apache.commons.httpclient.HttpException;
|
||||
import org.apache.commons.httpclient.HttpMethod;
|
||||
import org.apache.commons.httpclient.UsernamePasswordCredentials;
|
||||
import org.apache.commons.httpclient.auth.AuthScope;
|
||||
import org.apache.commons.httpclient.methods.DeleteMethod;
|
||||
import org.apache.commons.httpclient.methods.PostMethod;
|
||||
|
||||
public class MDMTransaction {
|
||||
|
||||
public static final String JVM_STICKY_SESSION = "sticky_session"; //$NON-NLS-1$
|
||||
public static final String DEFAULT_STICKY_SESSION = "JSESSIONID"; //$NON-NLS-1$
|
||||
|
||||
private String url;
|
||||
private String id;
|
||||
private String username;
|
||||
private String password;
|
||||
private String sessionId;
|
||||
|
||||
public void commit() throws IOException {
|
||||
HttpClient client = new HttpClient();
|
||||
client.getState().setCredentials(AuthScope.ANY,
|
||||
new UsernamePasswordCredentials(username, password));
|
||||
client.getParams().setAuthenticationPreemptive(true);
|
||||
|
||||
HttpMethod method = new PostMethod(url + "/" + id);
|
||||
method.setDoAuthentication(true);
|
||||
try {
|
||||
method.setRequestHeader("Cookie", getStickySession() + "=" + sessionId); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
client.executeMethod(method);
|
||||
} catch (HttpException e) {
|
||||
throw e;
|
||||
} catch (IOException e) {
|
||||
throw e;
|
||||
} finally {
|
||||
method.releaseConnection();
|
||||
}
|
||||
|
||||
int statuscode = method.getStatusCode();
|
||||
if (statuscode >= 400) {
|
||||
throw new MDMTransactionException("Commit failed. The commit operation has returned the code " + statuscode + ".");
|
||||
}
|
||||
}
|
||||
|
||||
public void rollback() throws IOException {
|
||||
HttpClient client = new HttpClient();
|
||||
client.getState().setCredentials(AuthScope.ANY,
|
||||
new UsernamePasswordCredentials(username, password));
|
||||
client.getParams().setAuthenticationPreemptive(true);
|
||||
|
||||
HttpMethod method = new DeleteMethod(url + "/" + id);
|
||||
method.setDoAuthentication(true);
|
||||
try {
|
||||
method.setRequestHeader("Cookie", getStickySession() + "=" + sessionId); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
client.executeMethod(method);
|
||||
} catch (HttpException e) {
|
||||
throw e;
|
||||
} catch (IOException e) {
|
||||
throw e;
|
||||
} finally {
|
||||
method.releaseConnection();
|
||||
}
|
||||
|
||||
int statuscode = method.getStatusCode();
|
||||
if (statuscode >= 400) {
|
||||
throw new MDMTransactionException("Rollback failed. The rollback operation has returned the code " + statuscode + ".");
|
||||
}
|
||||
}
|
||||
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public String getSessionId() {
|
||||
return sessionId;
|
||||
}
|
||||
|
||||
public void setSessionId(String sessionId) {
|
||||
this.sessionId = sessionId;
|
||||
}
|
||||
|
||||
public static String getStickySession() {
|
||||
String stickySession = System.getProperty(JVM_STICKY_SESSION);
|
||||
if(stickySession == null) {
|
||||
stickySession = DEFAULT_STICKY_SESSION;
|
||||
}
|
||||
return stickySession;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
package com.talend.mdm.transaction.client;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.commons.httpclient.Header;
|
||||
import org.apache.commons.httpclient.HttpClient;
|
||||
import org.apache.commons.httpclient.HttpException;
|
||||
import org.apache.commons.httpclient.HttpMethod;
|
||||
import org.apache.commons.httpclient.UsernamePasswordCredentials;
|
||||
import org.apache.commons.httpclient.auth.AuthScope;
|
||||
import org.apache.commons.httpclient.methods.GetMethod;
|
||||
import org.apache.commons.httpclient.methods.PutMethod;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
public class MDMTransactionClient {
|
||||
|
||||
private static final Log LOG = LogFactory.getLog(MDMTransactionClient.class);
|
||||
|
||||
public static MDMTransaction newTransaction(String url, String username, String password) throws IOException {
|
||||
HttpClient client = new HttpClient();
|
||||
client.getState().setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(username, password));
|
||||
client.getParams().setAuthenticationPreemptive(true);
|
||||
|
||||
PutMethod put = new PutMethod(url);
|
||||
put.setDoAuthentication(true);
|
||||
String tid;
|
||||
String sessionID;
|
||||
try {
|
||||
client.executeMethod(put);
|
||||
tid = put.getResponseBodyAsString();
|
||||
sessionID = parseSessionID(put);
|
||||
} catch (HttpException e) {
|
||||
throw e;
|
||||
} catch (IOException e) {
|
||||
throw e;
|
||||
} finally {
|
||||
put.releaseConnection();
|
||||
}
|
||||
|
||||
MDMTransaction result = new MDMTransaction();
|
||||
result.setUrl(url);
|
||||
result.setId(tid);
|
||||
result.setUsername(username);
|
||||
result.setPassword(password);
|
||||
result.setSessionId(sessionID);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public static String getSessionID(String url, String username, String password) throws IOException {
|
||||
HttpClient client = new HttpClient();
|
||||
client.getState().setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(username, password));
|
||||
client.getParams().setAuthenticationPreemptive(true);
|
||||
GetMethod get = new GetMethod(url);
|
||||
get.setDoAuthentication(true);
|
||||
String sessionID;
|
||||
try {
|
||||
client.executeMethod(get);
|
||||
sessionID = parseSessionID(get);
|
||||
} catch (HttpException e) {
|
||||
throw e;
|
||||
} catch (IOException e) {
|
||||
throw e;
|
||||
} finally {
|
||||
get.releaseConnection();
|
||||
}
|
||||
return sessionID;
|
||||
}
|
||||
|
||||
private static String parseSessionID(HttpMethod method) {
|
||||
String sessionID = null;
|
||||
String stickySession = MDMTransaction.getStickySession();
|
||||
Header[] setCookie = method.getResponseHeaders("Set-Cookie"); //$NON-NLS-1$
|
||||
for(Header header : setCookie) {
|
||||
String headerValue = header.getValue();
|
||||
if(headerValue.startsWith(stickySession + "=")) { //$NON-NLS-1$
|
||||
int beginIndex = (stickySession + "=").length(); //$NON-NLS-1$
|
||||
int endIndex = headerValue.indexOf(";", beginIndex); //$NON-NLS-1$
|
||||
sessionID = headerValue.substring(beginIndex, endIndex);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(sessionID == null) {
|
||||
if(LOG.isDebugEnabled()) {
|
||||
LOG.warn("Cookie for sticky session not found!"); //$NON-NLS-1$
|
||||
}
|
||||
sessionID = ""; //$NON-NLS-1$
|
||||
}
|
||||
return sessionID;
|
||||
}
|
||||
|
||||
public static String getMDMTransactionURL(String url) {
|
||||
if(url == null || "".equals(url)) {
|
||||
return "";
|
||||
}
|
||||
|
||||
int count = 3;
|
||||
int i=0;
|
||||
for(;i<url.length();i++) {
|
||||
char c = url.charAt(i);
|
||||
if('/' == c) {
|
||||
count--;
|
||||
}
|
||||
if(count == 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
String result = url.substring(0, i);
|
||||
result += "/datamanager/services/transactions"; //$NON-NLS-1$
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@SuppressWarnings("nls")
|
||||
public static void main(String[] args) throws IOException {
|
||||
String sessionID = MDMTransactionClient.getSessionID("http://localhost:8000/datamanager/services/transactions", "administrator", "administrator");
|
||||
System.out.println(sessionID);
|
||||
|
||||
MDMTransaction mt = MDMTransactionClient.newTransaction("http://localhost:8000/datamanager/services/transactions", "administrator", "administrator");
|
||||
mt.commit();
|
||||
|
||||
MDMTransaction mt1 = MDMTransactionClient.newTransaction("http://localhost:8000/datamanager/services/transactions", "administrator", "administrator");
|
||||
mt1.rollback();
|
||||
|
||||
String url = "http://localhost:8000/talend/TalendPort";
|
||||
String mdmurl = MDMTransactionClient.getMDMTransactionURL(url);
|
||||
System.out.println(mdmurl);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -95,8 +95,8 @@
|
||||
boolean isAllRows = "ALL_ROWS".equals(matchingModeStr);
|
||||
|
||||
boolean includeParallelComps = false;
|
||||
List<? extends INode> listPartitions= node.getProcess().getNodesOfType("tPartitioner");
|
||||
if (listPartitions!=null && listPartitions.size() > 0 ) {
|
||||
INode collectorNode = validTarget.getDesignSubjobStartNode();
|
||||
if ("tCollector".equals(collectorNode.getComponent().getName())) {
|
||||
includeParallelComps = true;
|
||||
}
|
||||
%>
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
org.talend.designer.codegen.config.CodeGeneratorArgument
|
||||
org.talend.core.model.process.ElementParameterParser
|
||||
java.util.List
|
||||
org.talend.core.model.process.EConnectionType
|
||||
org.talend.core.model.process.IHashableInputConnections
|
||||
org.talend.core.model.process.IHashConfiguration
|
||||
org.talend.core.model.process.IDataConnection
|
||||
@@ -49,12 +50,12 @@
|
||||
}
|
||||
}
|
||||
memoryStorage = !(hashConfiguration != null && hashConfiguration.isPersistent() || bSortOnDisk);
|
||||
}
|
||||
|
||||
boolean includeParallelComps = false;
|
||||
List<? extends INode> listPartitions= node.getProcess().getNodesOfType("tPartitioner");
|
||||
if (listPartitions!=null && listPartitions.size() > 0 ) {
|
||||
INode partitionNode = validTarget.getDesignSubjobStartNode();
|
||||
if ("tCollector".equals(partitionNode.getComponent().getName())) {
|
||||
includeParallelComps = true;
|
||||
partitionNode = partitionNode.getIncomingConnections(EConnectionType.STARTS).get(0).getSource();
|
||||
}
|
||||
%>
|
||||
tHash_Lookup_<%=connectionName%>.endPut();
|
||||
@@ -62,7 +63,7 @@ tHash_Lookup_<%=connectionName%>.endPut();
|
||||
if (includeParallelComps && memoryStorage && !isOneOfReloadLookupMode) {
|
||||
%>
|
||||
java.util.List<java.util.concurrent.ConcurrentHashMap<String,Object>> mapsList_<%=cid%> =
|
||||
(java.util.List<java.util.concurrent.ConcurrentHashMap<String,Object>>)globalMap.get("THREAD_MAPS_"+jobName);
|
||||
(java.util.List<java.util.concurrent.ConcurrentHashMap<String,Object>>)globalMap.get("THREAD_MAPS_<%=partitionNode.getUniqueName()%>_"+jobName);
|
||||
if (mapsList_<%=cid%> != null) {
|
||||
|
||||
|
||||
@@ -101,6 +102,8 @@ java.util.List<java.util.concurrent.ConcurrentHashMap<String,Object>> mapsList_<
|
||||
<%
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
%>
|
||||
|
||||
@@ -13,6 +13,7 @@ imports="
|
||||
java.util.List
|
||||
org.talend.core.model.process.IProcess
|
||||
org.talend.core.model.process.IElementParameter
|
||||
org.talend.core.model.process.AbstractNode
|
||||
"
|
||||
%>
|
||||
<%@ include file="../templates/Log4j/Log4jFileUtil.javajet"%>
|
||||
@@ -456,9 +457,9 @@ if(("false").equals(ElementParameterParser.getValue(node,"__CSV_OPTION__"))) {
|
||||
synchronized (multiThreadLockWrite) {
|
||||
<%
|
||||
}
|
||||
if (NodeUtil.subBranchContainsParallelIterate(node)) {
|
||||
if (((AbstractNode)node).getParallelIterator() != null) {
|
||||
%>
|
||||
synchronized (lockWrite) {
|
||||
synchronized ((Object[])globalMap.get("lockWrite_<%=((AbstractNode)node).getParallelIterator()%>")) {
|
||||
<%
|
||||
}
|
||||
if (isParallelize) {
|
||||
@@ -507,7 +508,7 @@ if(("false").equals(ElementParameterParser.getValue(node,"__CSV_OPTION__"))) {
|
||||
}
|
||||
<%
|
||||
}
|
||||
if (NodeUtil.subBranchContainsParallelIterate(node)) {
|
||||
if (((AbstractNode)node).getParallelIterator() != null) {
|
||||
%>
|
||||
}
|
||||
<%
|
||||
@@ -879,9 +880,9 @@ if(("false").equals(ElementParameterParser.getValue(node,"__CSV_OPTION__"))) {
|
||||
synchronized (multiThreadLockWrite) {
|
||||
<%
|
||||
}
|
||||
if (NodeUtil.subBranchContainsParallelIterate(node)) {
|
||||
if (((AbstractNode)node).getParallelIterator() != null) {
|
||||
%>
|
||||
synchronized (lockWrite) {
|
||||
synchronized ((Object[])globalMap.get("lockWrite_<%=((AbstractNode)node).getParallelIterator()%>")) {
|
||||
<%
|
||||
}
|
||||
if (isParallelize) {
|
||||
@@ -930,7 +931,7 @@ if(("false").equals(ElementParameterParser.getValue(node,"__CSV_OPTION__"))) {
|
||||
}
|
||||
<%
|
||||
}
|
||||
if (NodeUtil.subBranchContainsParallelIterate(node)) {
|
||||
if (((AbstractNode)node).getParallelIterator() != null) {
|
||||
%>
|
||||
}
|
||||
<%
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
java.util.List
|
||||
org.talend.core.model.process.IProcess
|
||||
org.talend.core.model.utils.NodeUtil
|
||||
org.talend.core.model.process.AbstractNode
|
||||
"
|
||||
%>
|
||||
<%@ include file="../templates/Log4j/Log4jFileUtil.javajet"%>
|
||||
@@ -44,9 +45,9 @@ if ((metadatas!=null)&&(metadatas.size()>0)) {
|
||||
synchronized (multiThreadLockWrite) {
|
||||
<%
|
||||
}
|
||||
if (NodeUtil.subBranchContainsParallelIterate(node)) {
|
||||
if (((AbstractNode)node).getParallelIterator() != null) {
|
||||
%>
|
||||
synchronized (lockWrite) {
|
||||
synchronized ((Object[])globalMap.get("lockWrite_<%=((AbstractNode)node).getParallelIterator()%>")) {
|
||||
<%
|
||||
}
|
||||
if (isParallelize) {
|
||||
@@ -139,7 +140,7 @@ if ((metadatas!=null)&&(metadatas.size()>0)) {
|
||||
}
|
||||
<%
|
||||
}
|
||||
if (NodeUtil.subBranchContainsParallelIterate(node)) {
|
||||
if (((AbstractNode)node).getParallelIterator() != null) {
|
||||
%>
|
||||
}
|
||||
<%
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
java.util.List
|
||||
org.talend.core.model.process.IProcess
|
||||
org.talend.core.model.utils.NodeUtil
|
||||
org.talend.core.model.process.AbstractNode
|
||||
"
|
||||
%>
|
||||
|
||||
@@ -43,9 +44,9 @@ if ((metadatas!=null)&&(metadatas.size()>0)) {
|
||||
synchronized (multiThreadLockWrite) {
|
||||
<%
|
||||
}
|
||||
if (NodeUtil.subBranchContainsParallelIterate(node)) {
|
||||
if (((AbstractNode)node).getParallelIterator() != null) {
|
||||
%>
|
||||
synchronized (lockWrite) {
|
||||
synchronized ((Object[])globalMap.get("lockWrite_<%=((AbstractNode)node).getParallelIterator()%>")) {
|
||||
<%
|
||||
}
|
||||
if (isParallelize) {
|
||||
@@ -140,7 +141,7 @@ if ((metadatas!=null)&&(metadatas.size()>0)) {
|
||||
}
|
||||
<%
|
||||
}
|
||||
if (NodeUtil.subBranchContainsParallelIterate(node)) {
|
||||
if (((AbstractNode)node).getParallelIterator() != null) {
|
||||
%>
|
||||
}
|
||||
<%
|
||||
|
||||
@@ -11,6 +11,7 @@ imports="
|
||||
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.AbstractNode
|
||||
"
|
||||
%>
|
||||
|
||||
@@ -81,9 +82,9 @@ if(("false").equals(ElementParameterParser.getValue(node,"__CSV_OPTION__"))) {
|
||||
synchronized (multiThreadLockWrite) {
|
||||
<%
|
||||
}
|
||||
if (NodeUtil.subBranchContainsParallelIterate(node)) {
|
||||
if (((AbstractNode)node).getParallelIterator() != null) {
|
||||
%>
|
||||
synchronized (lockWrite) {
|
||||
synchronized ((Object[])globalMap.get("lockWrite_<%=((AbstractNode)node).getParallelIterator()%>")) {
|
||||
<%
|
||||
}
|
||||
if (isParallelize) {
|
||||
@@ -136,7 +137,7 @@ if(("false").equals(ElementParameterParser.getValue(node,"__CSV_OPTION__"))) {
|
||||
}
|
||||
<%
|
||||
}
|
||||
if (NodeUtil.subBranchContainsParallelIterate(node)) {
|
||||
if (((AbstractNode)node).getParallelIterator() != null) {
|
||||
%>
|
||||
}
|
||||
<%
|
||||
@@ -227,9 +228,9 @@ if(("false").equals(ElementParameterParser.getValue(node,"__CSV_OPTION__"))) {
|
||||
synchronized (multiThreadLockWrite) {
|
||||
<%
|
||||
}
|
||||
if (NodeUtil.subBranchContainsParallelIterate(node)) {
|
||||
if (((AbstractNode)node).getParallelIterator() != null) {
|
||||
%>
|
||||
synchronized (lockWrite) {
|
||||
synchronized ((Object[])globalMap.get("lockWrite_<%=((AbstractNode)node).getParallelIterator()%>")) {
|
||||
<%
|
||||
}
|
||||
if (isParallelize) {
|
||||
@@ -349,7 +350,7 @@ if(("false").equals(ElementParameterParser.getValue(node,"__CSV_OPTION__"))) {
|
||||
}
|
||||
<%
|
||||
}
|
||||
if (NodeUtil.subBranchContainsParallelIterate(node)) {
|
||||
if (((AbstractNode)node).getParallelIterator() != null) {
|
||||
%>
|
||||
}
|
||||
<%
|
||||
@@ -426,9 +427,9 @@ if(("false").equals(ElementParameterParser.getValue(node,"__CSV_OPTION__"))) {
|
||||
synchronized (multiThreadLockWrite) {
|
||||
<%
|
||||
}
|
||||
if (NodeUtil.subBranchContainsParallelIterate(node)) {
|
||||
if (((AbstractNode)node).getParallelIterator() != null) {
|
||||
%>
|
||||
synchronized (lockWrite) {
|
||||
synchronized ((Object[])globalMap.get("lockWrite_<%=((AbstractNode)node).getParallelIterator()%>")) {
|
||||
<%
|
||||
}
|
||||
if (isParallelize) {
|
||||
@@ -497,7 +498,7 @@ if(("false").equals(ElementParameterParser.getValue(node,"__CSV_OPTION__"))) {
|
||||
}
|
||||
<%
|
||||
}
|
||||
if (NodeUtil.subBranchContainsParallelIterate(node)) {
|
||||
if (((AbstractNode)node).getParallelIterator() != null) {
|
||||
%>
|
||||
}
|
||||
<%
|
||||
@@ -585,9 +586,9 @@ if(("false").equals(ElementParameterParser.getValue(node,"__CSV_OPTION__"))) {
|
||||
synchronized (multiThreadLockWrite) {
|
||||
<%
|
||||
}
|
||||
if (NodeUtil.subBranchContainsParallelIterate(node)) {
|
||||
if (((AbstractNode)node).getParallelIterator() != null) {
|
||||
%>
|
||||
synchronized (lockWrite) {
|
||||
synchronized ((Object[])globalMap.get("lockWrite_<%=((AbstractNode)node).getParallelIterator()%>")) {
|
||||
<%
|
||||
}
|
||||
if (isParallelize) {
|
||||
@@ -746,7 +747,7 @@ if(("false").equals(ElementParameterParser.getValue(node,"__CSV_OPTION__"))) {
|
||||
}
|
||||
<%
|
||||
}
|
||||
if (NodeUtil.subBranchContainsParallelIterate(node)) {
|
||||
if (((AbstractNode)node).getParallelIterator() != null) {
|
||||
%>
|
||||
}
|
||||
<%
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
org.talend.core.model.process.ElementParameterParser
|
||||
java.util.List
|
||||
org.talend.core.model.utils.NodeUtil
|
||||
org.talend.core.model.process.AbstractNode
|
||||
"
|
||||
%>
|
||||
|
||||
@@ -34,9 +35,9 @@
|
||||
synchronized (multiThreadLockWrite) {
|
||||
<%
|
||||
}
|
||||
if (NodeUtil.subBranchContainsParallelIterate(node)) {
|
||||
if (((AbstractNode)node).getParallelIterator() != null) {
|
||||
%>
|
||||
synchronized (lockWrite) {
|
||||
synchronized ((Object[])globalMap.get("lockWrite_<%=((AbstractNode)node).getParallelIterator()%>")) {
|
||||
<%
|
||||
}
|
||||
if (isParallelize) {
|
||||
@@ -61,7 +62,7 @@
|
||||
}
|
||||
<%
|
||||
}
|
||||
if (NodeUtil.subBranchContainsParallelIterate(node)) {
|
||||
if (((AbstractNode)node).getParallelIterator() != null) {
|
||||
%>
|
||||
}
|
||||
<%
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
org.talend.core.model.utils.NodeUtil
|
||||
java.util.List
|
||||
java.util.Map
|
||||
org.talend.core.model.process.AbstractNode
|
||||
"
|
||||
%>
|
||||
|
||||
@@ -74,9 +75,9 @@ if ((metadatas!=null)&&(metadatas.size()>0)) {
|
||||
synchronized (multiThreadLockWrite) {
|
||||
<%
|
||||
}
|
||||
if (NodeUtil.subBranchContainsParallelIterate(node)) {
|
||||
if (((AbstractNode)node).getParallelIterator() != null) {
|
||||
%>
|
||||
synchronized (lockWrite) {
|
||||
synchronized ((Object[])globalMap.get("lockWrite_<%=((AbstractNode)node).getParallelIterator()%>")) {
|
||||
<%
|
||||
}
|
||||
if (isParallelize) {
|
||||
@@ -100,7 +101,7 @@ if ((metadatas!=null)&&(metadatas.size()>0)) {
|
||||
}
|
||||
<%
|
||||
}
|
||||
if (NodeUtil.subBranchContainsParallelIterate(node)) {
|
||||
if (((AbstractNode)node).getParallelIterator() != null) {
|
||||
%>
|
||||
}
|
||||
<%
|
||||
|
||||
@@ -87,6 +87,9 @@
|
||||
REPOSITORY_VALUE="SID" REQUIRED="true">
|
||||
<DEFAULT>""</DEFAULT>
|
||||
</PARAMETER>
|
||||
<PARAMETER NAME="DISTRIBUTION" FIELD="TEXT" NUM_ROW="14">
|
||||
<DEFAULT>""</DEFAULT>
|
||||
</PARAMETER>
|
||||
</PARAMETERS>
|
||||
|
||||
<ADVANCED_PARAMETERS>
|
||||
@@ -126,31 +129,32 @@
|
||||
<IMPORTS>
|
||||
<!-- MICROSOFT HD INSIGHT 3.1 -->
|
||||
<IMPORT NAME="talend-webhcat-launcher-1.0.0" MODULE="talend-webhcat-launcher-1.0.0.jar"
|
||||
REQUIRED_IF="USE_EXISTING_CONNECTION=='false'" />
|
||||
REQUIRED_IF="(USE_EXISTING_CONNECTION=='false') AND (DISTRIBUTION=='MICROSOFT_HD_INSIGHT')" />
|
||||
<IMPORT NAME="cxf-api-2.7.7" MODULE="cxf-api-2.7.7.jar"
|
||||
UrlPath="platform:/plugin/org.talend.libraries.apache.cxf/lib/cxf-api-2.7.7.jar"
|
||||
REQUIRED_IF="USE_EXISTING_CONNECTION=='false'" />
|
||||
REQUIRED_IF="(USE_EXISTING_CONNECTION=='false') AND (DISTRIBUTION=='MICROSOFT_HD_INSIGHT')" />
|
||||
<IMPORT NAME="cxf-rt-bindings-xml-2.7.7" MODULE="cxf-rt-bindings-xml-2.7.7.jar"
|
||||
UrlPath="platform:/plugin/org.talend.libraries.apache.cxf/lib/cxf-rt-bindings-xml-2.7.7.jar"
|
||||
REQUIRED_IF="USE_EXISTING_CONNECTION=='false'" />
|
||||
REQUIRED_IF="(USE_EXISTING_CONNECTION=='false') AND (DISTRIBUTION=='MICROSOFT_HD_INSIGHT')" />
|
||||
<IMPORT NAME="cxf-rt-core-2.7.7" MODULE="cxf-rt-core-2.7.7.jar"
|
||||
UrlPath="platform:/plugin/org.talend.libraries.apache.cxf/lib/cxf-rt-core-2.7.7.jar"
|
||||
REQUIRED_IF="USE_EXISTING_CONNECTION=='false'" />
|
||||
REQUIRED_IF="(USE_EXISTING_CONNECTION=='false') AND (DISTRIBUTION=='MICROSOFT_HD_INSIGHT')" />
|
||||
<IMPORT NAME="cxf-rt-frontend-jaxrs-2.7.7" MODULE="cxf-rt-frontend-jaxrs-2.7.7.jar"
|
||||
UrlPath="platform:/plugin/org.talend.libraries.apache.cxf/lib/cxf-rt-frontend-jaxrs-2.7.7.jar"
|
||||
REQUIRED_IF="USE_EXISTING_CONNECTION=='false'" />
|
||||
REQUIRED_IF="(USE_EXISTING_CONNECTION=='false') AND (DISTRIBUTION=='MICROSOFT_HD_INSIGHT')" />
|
||||
<IMPORT NAME="cxf-rt-transports-http-2.7.7" MODULE="cxf-rt-transports-http-2.7.7.jar"
|
||||
UrlPath="platform:/plugin/org.talend.libraries.apache.cxf/lib/cxf-rt-transports-http-2.7.7.jar"
|
||||
REQUIRED_IF="USE_EXISTING_CONNECTION=='false'" />
|
||||
REQUIRED_IF="(USE_EXISTING_CONNECTION=='false') AND (DISTRIBUTION=='MICROSOFT_HD_INSIGHT')" />
|
||||
<IMPORT NAME="json-simple" MODULE="json_simple-1.1.jar"
|
||||
UrlPath="platform:/plugin/org.talend.libraries.jackson/lib/json_simple-1.1.jar"
|
||||
REQUIRED_IF="USE_EXISTING_CONNECTION=='false'" />
|
||||
REQUIRED_IF="(USE_EXISTING_CONNECTION=='false') AND (DISTRIBUTION=='MICROSOFT_HD_INSIGHT')" />
|
||||
<IMPORT NAME="javax.ws.rs-api-2.0-m10" MODULE="javax.ws.rs-api-2.0-m10.jar"
|
||||
REQUIRED_IF="USE_EXISTING_CONNECTION=='false'" />
|
||||
REQUIRED_IF="(USE_EXISTING_CONNECTION=='false') AND (DISTRIBUTION=='MICROSOFT_HD_INSIGHT')" />
|
||||
<IMPORT NAME="WSDL4J-1_6_2" MODULE="wsdl4j-1.6.2.jar"
|
||||
BundleID="org.apache.servicemix.bundles.wsdl4j" REQUIRED="true" />
|
||||
BundleID="org.apache.servicemix.bundles.wsdl4j" REQUIRED="false"
|
||||
REQUIRED_IF="(USE_EXISTING_CONNECTION=='false') AND (DISTRIBUTION=='MICROSOFT_HD_INSIGHT')" />
|
||||
<IMPORT NAME="azure-storage-1.2.0" MODULE="azure-storage-1.2.0.jar"
|
||||
REQUIRED_IF="USE_EXISTING_CONNECTION=='false'" />
|
||||
REQUIRED_IF="(USE_EXISTING_CONNECTION=='false') AND (DISTRIBUTION=='MICROSOFT_HD_INSIGHT')" />
|
||||
<!-- #################### -->
|
||||
</IMPORTS>
|
||||
</CODEGENERATION>
|
||||
|
||||
Binary file not shown.
@@ -5,43 +5,58 @@ imports="
|
||||
org.talend.designer.codegen.config.CodeGeneratorArgument
|
||||
"
|
||||
%>
|
||||
<%
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode)codeGenArgument.getArgument();
|
||||
String cid = node.getUniqueName();
|
||||
|
||||
String mdmUrl = ElementParameterParser.getValue(node, "__MDMURL__");
|
||||
String username = ElementParameterParser.getValue(node, "__USERNAME__");
|
||||
|
||||
String version = ElementParameterParser.getValue(node, "__UNIVERSE__");
|
||||
String dataModule = ElementParameterParser.getValue(node, "__DATAMODEL__");
|
||||
String dataCluster = ElementParameterParser.getValue(node, "__DATACLUSTER__");
|
||||
boolean isStaging = "STAGING".equalsIgnoreCase(ElementParameterParser.getValue(node, "__CONTAINER_TYPE__"));
|
||||
String dataEntity = ElementParameterParser.getValue(node, "__DATACONCEPT__");
|
||||
String arraySize = ElementParameterParser.getValue(node,"__MASS_LEVEL__");
|
||||
|
||||
boolean validate = ("true").equals(ElementParameterParser.getValue(node,"__VALIDATE__"));
|
||||
boolean isGenerateId = ("true").equals(ElementParameterParser.getValue(node,"__GENERATE_ID__"));
|
||||
|
||||
boolean useTransaction = ("true").equals(ElementParameterParser.getValue(node,"__USE_TRANSACTION__"));
|
||||
String transactionProvider = ElementParameterParser.getValue(node,"__TRANSACTION_PROVIDER__");
|
||||
String mdmTransaction = "mdmTransaction_" + transactionProvider;
|
||||
|
||||
%>
|
||||
|
||||
<%
|
||||
String passwordFieldName = "__PASSWORD__";
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode)codeGenArgument.getArgument();
|
||||
String cid = node.getUniqueName();
|
||||
|
||||
String mdmUrl = ElementParameterParser.getValue(node, "__MDMURL__");
|
||||
String username = ElementParameterParser.getValue(node, "__USERNAME__");
|
||||
|
||||
String version = ElementParameterParser.getValue(node, "__UNIVERSE__");
|
||||
String dataModule = ElementParameterParser.getValue(node, "__DATAMODEL__");
|
||||
String dataCluster = ElementParameterParser.getValue(node, "__DATACLUSTER__");
|
||||
boolean isStaging = "STAGING".equalsIgnoreCase(ElementParameterParser.getValue(node, "__CONTAINER_TYPE__"));
|
||||
String dataEntity = ElementParameterParser.getValue(node, "__DATACONCEPT__");
|
||||
String arraySize = ElementParameterParser.getValue(node,"__MASS_LEVEL__");
|
||||
|
||||
boolean validate = ("true").equals(ElementParameterParser.getValue(node,"__VALIDATE__"));
|
||||
boolean isGenerateId = ("true").equals(ElementParameterParser.getValue(node,"__GENERATE_ID__"));
|
||||
|
||||
boolean useTransaction = ("true").equals(ElementParameterParser.getValue(node,"__USE_TRANSACTION__"));
|
||||
String connection = ElementParameterParser.getValue(node,"__TRANSACTION_PROVIDER__");
|
||||
String trans = "mdmTrans_" + connection;
|
||||
%>
|
||||
|
||||
<% String passwordFieldName = "__PASSWORD__"; %>
|
||||
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/password.javajet"%>
|
||||
|
||||
org.talend.mdm.bulkload.client.BulkloadClient bulkloadClient_<%=cid %> = new org.talend.mdm.bulkload.client.BulkloadClient(<%=mdmUrl%>, <%=username %>, decryptedPassword_<%=cid%>, <%=version==null || "".equals(version)? "null":version%>, <%=dataCluster %> + "<%=isStaging?"#STAGING":""%>", <%=dataEntity %>, <%=dataModule%>);
|
||||
<%if(useTransaction) {%>
|
||||
com.talend.mdm.transaction.client.MDMTransaction mdmTransaction_<%=cid%> = (com.talend.mdm.transaction.client.MDMTransaction)globalMap.get("<%=mdmTransaction%>");
|
||||
if(mdmTransaction_<%=cid%>!=null) {
|
||||
com.talend.mdm.transaction.client.MDMTransaction mdmTransaction_<%=cid%> = (com.talend.mdm.transaction.client.MDMTransaction)globalMap.get("<%=trans%>_" + Thread.currentThread().getThreadGroup().getName());
|
||||
if(mdmTransaction_<%=cid%> == null) {
|
||||
String murl_<%=cid%> = (String)globalMap.get("mdmUrl_<%=connection %>");
|
||||
String username_<%=cid%> = (String)globalMap.get("username_<%=connection %>");
|
||||
String password_<%=cid%> = (String)globalMap.get("password_<%=connection %>");
|
||||
String turl_<%=cid%> = com.talend.mdm.transaction.client.MDMTransactionClient.getMDMTransactionURL(murl_<%=cid %>);
|
||||
if((Boolean)globalMap.get("useClientTranId_<%=connection %>")) {
|
||||
String sessionID_<%=cid%> = com.talend.mdm.transaction.client.MDMTransactionClient.getSessionID(turl_<%=cid%>,username_<%=cid%>,password_<%=cid%>);
|
||||
mdmTransaction_<%=cid%> = new com.talend.mdm.transaction.client.MDMTransaction();
|
||||
mdmTransaction_<%=cid%>.setUrl(turl_<%=cid%>);
|
||||
mdmTransaction_<%=cid%>.setId("<%=cid%>_" + java.util.UUID.randomUUID());
|
||||
mdmTransaction_<%=cid%>.setUsername(username_<%=cid%>);
|
||||
mdmTransaction_<%=cid%>.setPassword(password_<%=cid%>);
|
||||
mdmTransaction_<%=cid%>.setSessionId(sessionID_<%=cid%>);
|
||||
} else {
|
||||
mdmTransaction_<%=cid%> = com.talend.mdm.transaction.client.MDMTransactionClient.newTransaction(turl_<%=cid%>,username_<%=cid%>,password_<%=cid%>);
|
||||
}
|
||||
globalMap.put("<%=trans%>_" + Thread.currentThread().getThreadGroup().getName(), mdmTransaction_<%=cid %>);
|
||||
}
|
||||
bulkloadClient_<%=cid %>.setSessionId(mdmTransaction_<%=cid%>.getSessionId());
|
||||
bulkloadClient_<%=cid %>.setTransactionId(mdmTransaction_<%=cid%>.getId());
|
||||
}
|
||||
<%}%>
|
||||
|
||||
bulkloadClient_<%=cid %>.startThreadCount();
|
||||
bulkloadClient_<%=cid %>.setOptions(new org.talend.mdm.bulkload.client.BulkloadOptions(<%=isGenerateId %>, <%=validate %>, <%=arraySize%>));
|
||||
int count_<%=cid%> = 0;
|
||||
|
||||
@@ -4,14 +4,16 @@ imports="
|
||||
org.talend.designer.codegen.config.CodeGeneratorArgument
|
||||
"
|
||||
%>
|
||||
|
||||
<%
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode)codeGenArgument.getArgument();
|
||||
String cid = node.getUniqueName();
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode)codeGenArgument.getArgument();
|
||||
String cid = node.getUniqueName();
|
||||
//for bug TDI-22445
|
||||
%>
|
||||
|
||||
if (inputStreamMerger_<%=cid%>!=null) {
|
||||
inputStreamMerger_<%=cid%>.close();
|
||||
inputStreamMerger_<%=cid%>.close();
|
||||
}
|
||||
bulkloadClient_<%=cid %>.waitForEndOfQueue();
|
||||
bulkloadClient_<%=cid %> = null;
|
||||
|
||||
@@ -29,6 +29,7 @@ if (count_<%=cid%> % <%=arraySize%> == 0) {
|
||||
if(inputStreamMerger_<%=cid%> != null)
|
||||
inputStreamMerger_<%=cid%>.close();
|
||||
inputStreamMerger_<%=cid%> = bulkloadClient_<%=cid %>.load();
|
||||
resourceMap.put("mdmBulkStream<%=cid %>", inputStreamMerger_<%=cid%>);
|
||||
}
|
||||
|
||||
if(<%=conn.getName()%>.<%=xmlField %>!=null){
|
||||
|
||||
@@ -3,21 +3,25 @@ imports="
|
||||
org.talend.core.model.process.INode
|
||||
org.talend.core.model.process.ElementParameterParser
|
||||
org.talend.designer.codegen.config.CodeGeneratorArgument
|
||||
"
|
||||
"
|
||||
%>
|
||||
|
||||
<%
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode)codeGenArgument.getArgument();
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode)codeGenArgument.getArgument();
|
||||
String cid = node.getUniqueName();
|
||||
|
||||
String cid = node.getUniqueName();
|
||||
|
||||
String connection = ElementParameterParser.getValue(node,"__CONNECTION__");
|
||||
|
||||
String conn = "xtentisWS_" + connection;
|
||||
String connection = ElementParameterParser.getValue(node,"__CONNECTION__");
|
||||
String conn = "xtentisWS_" + connection;
|
||||
%>
|
||||
org.talend.mdm.webservice.XtentisPort_PortType xtentisWS_<%=cid %> = (org.talend.mdm.webservice.XtentisPort_PortType)globalMap.get("<%=conn%>");
|
||||
if(xtentisWS_<%=cid %> != null)
|
||||
{
|
||||
|
||||
java.util.Iterator it_<%=cid %> = globalMap.keySet().iterator();
|
||||
while (it_<%=cid %>.hasNext()) {
|
||||
String key_<%=cid %> = it_<%=cid %>.next().toString();
|
||||
if (key_<%=cid %>.startsWith("<%=conn %>_")) {
|
||||
org.talend.mdm.webservice.XtentisPort_PortType xtentisWS_<%=cid %> = (org.talend.mdm.webservice.XtentisPort_PortType)globalMap.get(key_<%=cid %>);
|
||||
if(xtentisWS_<%=cid %> != null) {
|
||||
xtentisWS_<%=cid %>.logout(new org.talend.mdm.webservice.WSLogout());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,31 +3,28 @@ imports="
|
||||
org.talend.core.model.process.INode
|
||||
org.talend.core.model.process.ElementParameterParser
|
||||
org.talend.designer.codegen.config.CodeGeneratorArgument
|
||||
"
|
||||
"
|
||||
%>
|
||||
|
||||
<%
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode)codeGenArgument.getArgument();
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode)codeGenArgument.getArgument();
|
||||
String cid = node.getUniqueName();
|
||||
|
||||
String cid = node.getUniqueName();
|
||||
|
||||
String connection = ElementParameterParser.getValue(node, "__CONNECTION__");
|
||||
|
||||
boolean close = ("true").equals(ElementParameterParser.getValue(node,"__CLOSE__"));
|
||||
|
||||
String conn = "xtentisWS_" + connection;
|
||||
String mdmTransaction = "mdmTransaction_" + connection;
|
||||
String connection = ElementParameterParser.getValue(node, "__CONNECTION__");
|
||||
boolean close = ("true").equals(ElementParameterParser.getValue(node,"__CLOSE__"));
|
||||
String conn = "xtentisWS_" + connection;
|
||||
String trans = "mdmTrans_" + connection;
|
||||
%>
|
||||
|
||||
org.talend.mdm.webservice.XtentisPort_PortType conn_<%=cid%> = (org.talend.mdm.webservice.XtentisPort_PortType)globalMap.get("<%=conn%>");
|
||||
if(conn_<%=cid%> != null)
|
||||
{
|
||||
com.talend.mdm.transaction.client.MDMTransaction mdmTransaction_<%=cid%> = (com.talend.mdm.transaction.client.MDMTransaction)globalMap.get("<%=mdmTransaction%>");
|
||||
if(mdmTransaction_<%=cid%>!=null) {
|
||||
com.talend.mdm.transaction.client.MDMTransaction mdmTransaction_<%=cid%> = (com.talend.mdm.transaction.client.MDMTransaction)globalMap.get("<%=trans%>_" + Thread.currentThread().getThreadGroup().getName());
|
||||
if(mdmTransaction_<%=cid%> != null) {
|
||||
mdmTransaction_<%=cid%>.commit();
|
||||
}
|
||||
<% if(close){%>
|
||||
conn_<%=cid%>.logout(new org.talend.mdm.webservice.WSLogout());
|
||||
<% }%>
|
||||
}
|
||||
|
||||
<% if(close){%>
|
||||
org.talend.mdm.webservice.XtentisPort_PortType conn_<%=cid%> = (org.talend.mdm.webservice.XtentisPort_PortType)globalMap.get("<%=conn%>_" + Thread.currentThread().getThreadGroup().getName());
|
||||
if(conn_<%=cid%> != null) {
|
||||
conn_<%=cid%>.logout(new org.talend.mdm.webservice.WSLogout());
|
||||
}
|
||||
<% }%>
|
||||
|
||||
Binary file not shown.
@@ -3,7 +3,7 @@ imports="
|
||||
org.talend.core.model.process.INode
|
||||
org.talend.core.model.process.ElementParameterParser
|
||||
org.talend.designer.codegen.config.CodeGeneratorArgument
|
||||
"
|
||||
"
|
||||
%>
|
||||
|
||||
<%
|
||||
@@ -16,35 +16,29 @@ String username = ElementParameterParser.getValue(node, "__USERNAME__");
|
||||
|
||||
String universe = ElementParameterParser.getValue(node, "__UNIVERSE__");
|
||||
boolean useTransaction = "false".equals(ElementParameterParser.getValue(node, "__AUTO_COMMIT__"));
|
||||
boolean useClientTranId = "true".equals(ElementParameterParser.getValue(node, "__GEN_TRANSACTION_ID__"));
|
||||
%>
|
||||
|
||||
<%if(universe == null || ("").equals(universe.trim())){%>
|
||||
String username_<%=cid %> = <%=username %>;
|
||||
<%}else{%>
|
||||
String username_<%=cid %> = <%=universe%> + "/" + <%=username %>;
|
||||
<%}%>
|
||||
|
||||
<% String passwordFieldName = "__PASSWORD__"; %>
|
||||
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/password.javajet"%>
|
||||
|
||||
globalMap.put("mdmUrl_<%=cid %>", <%=mdmUrl %>);
|
||||
globalMap.put("username_<%=cid %>", username_<%=cid %>);
|
||||
globalMap.put("password_<%=cid %>", decryptedPassword_<%=cid %>);
|
||||
globalMap.put("useTransaction_<%=cid %>", <%=useTransaction %>);
|
||||
globalMap.put("useClientTranId_<%=cid %>", <%=useClientTranId %>);
|
||||
|
||||
org.talend.mdm.webservice.XtentisServiceLocator xtentisService_<%=cid %> = new org.talend.mdm.webservice.XtentisServiceLocator();
|
||||
xtentisService_<%=cid %>.setXtentisPortEndpointAddress(<%=mdmUrl %>);
|
||||
org.talend.mdm.webservice.XtentisPort_PortType xtentisWS_<%=cid %> = xtentisService_<%=cid %>.getXtentisPort();
|
||||
org.talend.mdm.webservice.XtentisBindingStub stub_<%=cid %> = (org.talend.mdm.webservice.XtentisBindingStub)xtentisWS_<%=cid %>;
|
||||
|
||||
// Authentification
|
||||
<%if(universe==null || ("").equals(universe.trim())){%>
|
||||
stub_<%=cid %>.setUsername(<%=username %>);
|
||||
<%}else{%>
|
||||
stub_<%=cid %>.setUsername(<%=universe%> + "/" + <%=username %>);
|
||||
<%}%>
|
||||
|
||||
<%
|
||||
String passwordFieldName = "__PASSWORD__";
|
||||
%>
|
||||
|
||||
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/password.javajet"%>
|
||||
|
||||
stub_<%=cid %>.setPassword(decryptedPassword_<%=cid%>);
|
||||
|
||||
<%if(useTransaction) {%>
|
||||
String turl_<%=cid%> = com.talend.mdm.transaction.client.MDMTransactionClient.getMDMTransactionURL(<%=mdmUrl %>);
|
||||
com.talend.mdm.transaction.client.MDMTransaction mdmTransaction_<%=cid%> = com.talend.mdm.transaction.client.MDMTransactionClient.newTransaction(turl_<%=cid%>,stub_<%=cid %>.getUsername(),stub_<%=cid %>.getPassword());
|
||||
stub_<%=cid %>.setHeader(new org.apache.axis.message.SOAPHeaderElement("http://www.talend.com/mdm", "transaction-id", mdmTransaction_<%=cid%>.getId()));
|
||||
globalMap.put("mdmTransaction_<%=cid %>", mdmTransaction_<%=cid%>);
|
||||
<%}%>
|
||||
|
||||
stub_<%=cid %>.ping(new org.talend.mdm.webservice.WSPing());<%//For TDI-26109%>
|
||||
|
||||
globalMap.put("xtentisWS_<%=cid %>", xtentisWS_<%=cid %>);
|
||||
stub_<%=cid %>.ping(new org.talend.mdm.webservice.WSPing());
|
||||
xtentisWS_<%=cid %>.logout(new org.talend.mdm.webservice.WSLogout());
|
||||
@@ -61,6 +61,15 @@
|
||||
<DEFAULT>true</DEFAULT>
|
||||
</PARAMETER>
|
||||
|
||||
<PARAMETER
|
||||
NAME="GEN_TRANSACTION_ID"
|
||||
FIELD="CHECK"
|
||||
NUM_ROW="40"
|
||||
SHOW_IF="AUTO_COMMIT=='false'"
|
||||
>
|
||||
<DEFAULT>false</DEFAULT>
|
||||
</PARAMETER>
|
||||
|
||||
</PARAMETERS>
|
||||
|
||||
<ADVANCED_PARAMETERS/>
|
||||
|
||||
@@ -7,3 +7,4 @@ HELP=org.talend.help.tMDMConnection
|
||||
LONG_NAME=Creates a connection to a MDM Server
|
||||
|
||||
AUTO_COMMIT.NAME=Auto Commit
|
||||
GEN_TRANSACTION_ID.NAME=Use client side transaction id
|
||||
@@ -5,23 +5,25 @@ imports="
|
||||
org.talend.designer.codegen.config.CodeGeneratorArgument
|
||||
"
|
||||
%>
|
||||
|
||||
<%
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode)codeGenArgument.getArgument();
|
||||
String cid = node.getUniqueName();
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode)codeGenArgument.getArgument();
|
||||
String cid = node.getUniqueName();
|
||||
|
||||
boolean useExistingConn = ("true").equals(ElementParameterParser.getValue(node,"__USE_EXISTING_CONNECTION__"));
|
||||
String connection = ElementParameterParser.getValue(node,"__CONNECTION__");
|
||||
String conn = "xtentisWS_" + connection;
|
||||
String mdmUrl = ElementParameterParser.getValue(node, "__MDMURL__");
|
||||
String username = ElementParameterParser.getValue(node, "__USERNAME__");
|
||||
|
||||
String universe = ElementParameterParser.getValue(node, "__UNIVERSE__");
|
||||
String dataModule = ElementParameterParser.getValue(node, "__CONCEPT__");
|
||||
String dataCluster = ElementParameterParser.getValue(node, "__DATACLUSTER__");
|
||||
boolean isStaging = "STAGING".equalsIgnoreCase(ElementParameterParser.getValue(node, "__CONTAINER_TYPE__"));
|
||||
boolean useExistingConn = ("true").equals(ElementParameterParser.getValue(node,"__USE_EXISTING_CONNECTION__"));
|
||||
String connection = ElementParameterParser.getValue(node,"__CONNECTION__");
|
||||
String conn = "xtentisWS_" + connection;
|
||||
String trans = "mdmTrans_" + connection;
|
||||
String mdmUrl = ElementParameterParser.getValue(node, "__MDMURL__");
|
||||
String username = ElementParameterParser.getValue(node, "__USERNAME__");
|
||||
|
||||
String universe = ElementParameterParser.getValue(node, "__UNIVERSE__");
|
||||
String dataModule = ElementParameterParser.getValue(node, "__CONCEPT__");
|
||||
String dataCluster = ElementParameterParser.getValue(node, "__DATACLUSTER__");
|
||||
boolean isStaging = "STAGING".equalsIgnoreCase(ElementParameterParser.getValue(node, "__CONTAINER_TYPE__"));
|
||||
%>
|
||||
|
||||
int nb_line_<%=cid %> = 0;
|
||||
<%if(!useExistingConn){%>
|
||||
org.talend.mdm.webservice.XtentisServiceLocator xtentisService_<%=cid %> = new org.talend.mdm.webservice.XtentisServiceLocator();
|
||||
@@ -29,21 +31,51 @@ int nb_line_<%=cid %> = 0;
|
||||
org.talend.mdm.webservice.XtentisPort_PortType xtentisWS_<%=cid %> = xtentisService_<%=cid %>.getXtentisPort();
|
||||
org.talend.mdm.webservice.XtentisBindingStub stub_<%=cid %> = (org.talend.mdm.webservice.XtentisBindingStub)xtentisWS_<%=cid %>;
|
||||
|
||||
// Authentification
|
||||
<%if(universe==null || ("").equals(universe.trim())){%>
|
||||
stub_<%=cid %>.setUsername(<%=username %>);
|
||||
<%}else{%>
|
||||
stub_<%=cid %>.setUsername(<%=universe%> + "/" + <%=username %>);
|
||||
<%}%>
|
||||
|
||||
<%
|
||||
String passwordFieldName = "__PASSWORD__";
|
||||
%>
|
||||
|
||||
<% String passwordFieldName = "__PASSWORD__"; %>
|
||||
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/password.javajet"%>
|
||||
|
||||
stub_<%=cid %>.setPassword(decryptedPassword_<%=cid%>);
|
||||
<%}else{%>
|
||||
org.talend.mdm.webservice.XtentisPort_PortType xtentisWS_<%=cid %> = (org.talend.mdm.webservice.XtentisPort_PortType)globalMap.get("<%=conn%>");
|
||||
org.talend.mdm.webservice.XtentisPort_PortType xtentisWS_<%=cid %> = (org.talend.mdm.webservice.XtentisPort_PortType)globalMap.get("<%=conn%>_" + Thread.currentThread().getThreadGroup().getName());
|
||||
if(xtentisWS_<%=cid %> == null) {
|
||||
String murl_<%=cid %> = (String)globalMap.get("mdmUrl_<%=connection %>");
|
||||
String username_<%=cid%> = (String)globalMap.get("username_<%=connection %>");
|
||||
String password_<%=cid%> = (String)globalMap.get("password_<%=connection %>");
|
||||
org.talend.mdm.webservice.XtentisServiceLocator xtentisService_<%=cid %> = new org.talend.mdm.webservice.XtentisServiceLocator();
|
||||
xtentisService_<%=cid %>.setXtentisPortEndpointAddress(murl_<%=cid %>);
|
||||
xtentisWS_<%=cid %> = xtentisService_<%=cid %>.getXtentisPort();
|
||||
org.talend.mdm.webservice.XtentisBindingStub stub_<%=cid %> = (org.talend.mdm.webservice.XtentisBindingStub)xtentisWS_<%=cid %>;
|
||||
stub_<%=cid %>.setUsername(username_<%=cid%>);
|
||||
stub_<%=cid %>.setPassword(password_<%=cid%>);
|
||||
if((Boolean)globalMap.get("useTransaction_<%=connection %>")) {
|
||||
String turl_<%=cid%> = com.talend.mdm.transaction.client.MDMTransactionClient.getMDMTransactionURL(murl_<%=cid %>);
|
||||
com.talend.mdm.transaction.client.MDMTransaction mdmTransaction_<%=cid%> = (com.talend.mdm.transaction.client.MDMTransaction)globalMap.get("<%=trans%>_" + Thread.currentThread().getThreadGroup().getName());
|
||||
if(mdmTransaction_<%=cid%> == null) {
|
||||
if((Boolean)globalMap.get("useClientTranId_<%=connection %>")) {
|
||||
String sessionID_<%=cid%> = com.talend.mdm.transaction.client.MDMTransactionClient.getSessionID(turl_<%=cid%>,username_<%=cid%>,password_<%=cid%>);
|
||||
mdmTransaction_<%=cid%> = new com.talend.mdm.transaction.client.MDMTransaction();
|
||||
mdmTransaction_<%=cid%>.setUrl(turl_<%=cid%>);
|
||||
mdmTransaction_<%=cid%>.setId("<%=cid%>_" + java.util.UUID.randomUUID());
|
||||
mdmTransaction_<%=cid%>.setUsername(username_<%=cid%>);
|
||||
mdmTransaction_<%=cid%>.setPassword(password_<%=cid%>);
|
||||
mdmTransaction_<%=cid%>.setSessionId(sessionID_<%=cid%>);
|
||||
} else {
|
||||
mdmTransaction_<%=cid%> = com.talend.mdm.transaction.client.MDMTransactionClient.newTransaction(turl_<%=cid%>,stub_<%=cid %>.getUsername(),stub_<%=cid %>.getPassword());
|
||||
}
|
||||
globalMap.put("<%=trans%>_" + Thread.currentThread().getThreadGroup().getName(), mdmTransaction_<%=cid %>);
|
||||
}
|
||||
stub_<%=cid %>.setHeader(new org.apache.axis.message.SOAPHeaderElement("http://www.talend.com/mdm", "transaction-id", mdmTransaction_<%=cid%>.getId()));
|
||||
stub_<%=cid %>._setProperty(org.apache.axis.client.Call.SESSION_MAINTAIN_PROPERTY, new Boolean(true));
|
||||
stub_<%=cid %>._setProperty(org.apache.axis.transport.http.HTTPConstants.HEADER_COOKIE, com.talend.mdm.transaction.client.MDMTransaction.getStickySession() + "=" + mdmTransaction_<%=cid%>.getSessionId());
|
||||
}
|
||||
stub_<%=cid %>.ping(new org.talend.mdm.webservice.WSPing());<%//For TDI-26109%>
|
||||
globalMap.put("<%=conn%>_" + Thread.currentThread().getThreadGroup().getName(), xtentisWS_<%=cid %>);
|
||||
}
|
||||
<%}%>
|
||||
org.talend.mdm.webservice.WSDataClusterPK dataCluster_<%=cid %> = new org.talend.mdm.webservice.WSDataClusterPK(<%=dataCluster %> + "<%=isStaging?"#STAGING":""%>");
|
||||
@@ -5,14 +5,15 @@ imports="
|
||||
org.talend.designer.codegen.config.CodeGeneratorArgument
|
||||
"
|
||||
%>
|
||||
|
||||
<%
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode)codeGenArgument.getArgument();
|
||||
String cid = node.getUniqueName();
|
||||
boolean useExistingConn = ("true").equals(ElementParameterParser.getValue(node,"__USE_EXISTING_CONNECTION__"));
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode)codeGenArgument.getArgument();
|
||||
String cid = node.getUniqueName();
|
||||
boolean useExistingConn = ("true").equals(ElementParameterParser.getValue(node,"__USE_EXISTING_CONNECTION__"));
|
||||
%>
|
||||
<%if(!useExistingConn){%>
|
||||
|
||||
<%if(!useExistingConn){%>
|
||||
stub_<%=cid %>.logout(new org.talend.mdm.webservice.WSLogout());
|
||||
<%}%>
|
||||
globalMap.put("<%=cid %>_NB_LINE",nb_line_<%=cid %>);
|
||||
|
||||
globalMap.put("<%=cid %>_NB_LINE",nb_line_<%=cid %>);
|
||||
@@ -10,6 +10,7 @@ imports="
|
||||
java.util.Map
|
||||
"
|
||||
%>
|
||||
|
||||
<%
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode)codeGenArgument.getArgument();
|
||||
|
||||
@@ -5,33 +5,36 @@ imports="
|
||||
org.talend.designer.codegen.config.CodeGeneratorArgument
|
||||
"
|
||||
%>
|
||||
|
||||
<%
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode)codeGenArgument.getArgument();
|
||||
String cid = node.getUniqueName();
|
||||
String destination = ElementParameterParser.getValue(node, "__DESTINATION__");
|
||||
if(destination!=null && !"".equals(destination)){
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode)codeGenArgument.getArgument();
|
||||
String cid = node.getUniqueName();
|
||||
String destination = ElementParameterParser.getValue(node, "__DESTINATION__");
|
||||
if(destination!=null && !"".equals(destination)){
|
||||
cid = destination;
|
||||
}
|
||||
}
|
||||
|
||||
boolean useExistingConn = ("true").equals(ElementParameterParser.getValue(node,"__USE_EXISTING_CONNECTION__"));
|
||||
String connection = ElementParameterParser.getValue(node,"__CONNECTION__");
|
||||
String conn = "xtentisWS_" + connection;
|
||||
String mdmUrl = ElementParameterParser.getValue(node, "__MDMURL__");
|
||||
String username = ElementParameterParser.getValue(node, "__USERNAME__");
|
||||
boolean useExistingConn = ("true").equals(ElementParameterParser.getValue(node,"__USE_EXISTING_CONNECTION__"));
|
||||
String connection = ElementParameterParser.getValue(node,"__CONNECTION__");
|
||||
String conn = "xtentisWS_" + connection;
|
||||
String trans = "mdmTrans_" + connection;
|
||||
String mdmUrl = ElementParameterParser.getValue(node, "__MDMURL__");
|
||||
String username = ElementParameterParser.getValue(node, "__USERNAME__");
|
||||
|
||||
String universe = ElementParameterParser.getValue(node, "__UNIVERSE__");
|
||||
String dataModule = ElementParameterParser.getValue(node, "__DATAMODEL__");
|
||||
String dataCluster = ElementParameterParser.getValue(node, "__DATACLUSTER__");
|
||||
boolean isStaging = "STAGING".equalsIgnoreCase(ElementParameterParser.getValue(node, "__CONTAINER_TYPE__"));
|
||||
String universe = ElementParameterParser.getValue(node, "__UNIVERSE__");
|
||||
String dataModule = ElementParameterParser.getValue(node, "__DATAMODEL__");
|
||||
String dataCluster = ElementParameterParser.getValue(node, "__DATACLUSTER__");
|
||||
boolean isStaging = "STAGING".equalsIgnoreCase(ElementParameterParser.getValue(node, "__CONTAINER_TYPE__"));
|
||||
boolean isProvisioning = "\"PROVISIONING\"".equalsIgnoreCase(dataCluster);
|
||||
|
||||
boolean withReport = ("true").equals(ElementParameterParser.getValue(node,"__WITHREPORT__"));
|
||||
boolean isMassInsert =("true").equals(ElementParameterParser.getValue(node,"__EXTENDINSERT__"));
|
||||
|
||||
boolean addTaskID = ("true").equals(ElementParameterParser.getValue(node,"__ADD_TASKID__"));
|
||||
boolean usePartialUpdate = ("true").equals(ElementParameterParser.getValue(node,"__USE_PARTIAL_UPDATE__"));
|
||||
boolean withReport = ("true").equals(ElementParameterParser.getValue(node,"__WITHREPORT__"));
|
||||
boolean isMassInsert =("true").equals(ElementParameterParser.getValue(node,"__EXTENDINSERT__"));
|
||||
|
||||
boolean addTaskID = ("true").equals(ElementParameterParser.getValue(node,"__ADD_TASKID__"));
|
||||
boolean usePartialUpdate = ("true").equals(ElementParameterParser.getValue(node,"__USE_PARTIAL_UPDATE__"));
|
||||
%>
|
||||
|
||||
int nb_line_<%=cid %> = 0;
|
||||
int nb_line_rejected_<%=cid%> = 0;
|
||||
<%if(!usePartialUpdate){%>
|
||||
@@ -83,15 +86,54 @@ int nb_line_rejected_<%=cid%> = 0;
|
||||
stub_<%=cid %>.setUsername(<%=universe%> + "/" + <%=username %>);
|
||||
<%}%>
|
||||
|
||||
<%
|
||||
String passwordFieldName = "__PASSWORD__";
|
||||
%>
|
||||
|
||||
<% String passwordFieldName = "__PASSWORD__"; %>
|
||||
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/password.javajet"%>
|
||||
|
||||
stub_<%=cid %>.setPassword(decryptedPassword_<%=cid%>);
|
||||
<%}else if(isProvisioning){%>
|
||||
String murl_<%=cid %> = (String)globalMap.get("mdmUrl_<%=connection %>");
|
||||
org.talend.mdm.webservice.XtentisServiceLocator xtentisService_<%=cid %> = new org.talend.mdm.webservice.XtentisServiceLocator();
|
||||
xtentisService_<%=cid %>.setXtentisPortEndpointAddress(murl_<%=cid %>);
|
||||
org.talend.mdm.webservice.XtentisPort_PortType xtentisWS_<%=cid %> = xtentisService_<%=cid %>.getXtentisPort();
|
||||
org.talend.mdm.webservice.XtentisBindingStub stub_<%=cid %> = (org.talend.mdm.webservice.XtentisBindingStub)xtentisWS_<%=cid %>;
|
||||
stub_<%=cid %>.setUsername((String)globalMap.get("username_<%=connection %>"));
|
||||
stub_<%=cid %>.setPassword((String)globalMap.get("password_<%=connection %>"));
|
||||
<%}else{%>
|
||||
org.talend.mdm.webservice.XtentisPort_PortType xtentisWS_<%=cid %> = (org.talend.mdm.webservice.XtentisPort_PortType)globalMap.get("<%=conn%>");
|
||||
org.talend.mdm.webservice.XtentisPort_PortType xtentisWS_<%=cid %> = (org.talend.mdm.webservice.XtentisPort_PortType)globalMap.get("<%=conn%>_" + Thread.currentThread().getThreadGroup().getName());
|
||||
if(xtentisWS_<%=cid %> == null) {
|
||||
String murl_<%=cid %> = (String)globalMap.get("mdmUrl_<%=connection %>");
|
||||
String username_<%=cid%> = (String)globalMap.get("username_<%=connection %>");
|
||||
String password_<%=cid%> = (String)globalMap.get("password_<%=connection %>");
|
||||
org.talend.mdm.webservice.XtentisServiceLocator xtentisService_<%=cid %> = new org.talend.mdm.webservice.XtentisServiceLocator();
|
||||
xtentisService_<%=cid %>.setXtentisPortEndpointAddress(murl_<%=cid %>);
|
||||
xtentisWS_<%=cid %> = xtentisService_<%=cid %>.getXtentisPort();
|
||||
org.talend.mdm.webservice.XtentisBindingStub stub_<%=cid %> = (org.talend.mdm.webservice.XtentisBindingStub)xtentisWS_<%=cid %>;
|
||||
stub_<%=cid %>.setUsername(username_<%=cid%>);
|
||||
stub_<%=cid %>.setPassword(password_<%=cid%>);
|
||||
if((Boolean)globalMap.get("useTransaction_<%=connection %>")) {
|
||||
String turl_<%=cid%> = com.talend.mdm.transaction.client.MDMTransactionClient.getMDMTransactionURL(murl_<%=cid %>);
|
||||
com.talend.mdm.transaction.client.MDMTransaction mdmTransaction_<%=cid%> = (com.talend.mdm.transaction.client.MDMTransaction)globalMap.get("<%=trans%>_" + Thread.currentThread().getThreadGroup().getName());
|
||||
if(mdmTransaction_<%=cid%> == null) {
|
||||
if((Boolean)globalMap.get("useClientTranId_<%=connection %>")) {
|
||||
String sessionID_<%=cid%> = com.talend.mdm.transaction.client.MDMTransactionClient.getSessionID(turl_<%=cid%>,username_<%=cid%>,password_<%=cid%>);
|
||||
mdmTransaction_<%=cid%> = new com.talend.mdm.transaction.client.MDMTransaction();
|
||||
mdmTransaction_<%=cid%>.setUrl(turl_<%=cid%>);
|
||||
mdmTransaction_<%=cid%>.setId("<%=cid%>_" + java.util.UUID.randomUUID());
|
||||
mdmTransaction_<%=cid%>.setUsername(username_<%=cid%>);
|
||||
mdmTransaction_<%=cid%>.setPassword(password_<%=cid%>);
|
||||
mdmTransaction_<%=cid%>.setSessionId(sessionID_<%=cid%>);
|
||||
} else {
|
||||
mdmTransaction_<%=cid%> = com.talend.mdm.transaction.client.MDMTransactionClient.newTransaction(turl_<%=cid%>,stub_<%=cid %>.getUsername(),stub_<%=cid %>.getPassword());
|
||||
}
|
||||
globalMap.put("<%=trans%>_" + Thread.currentThread().getThreadGroup().getName(), mdmTransaction_<%=cid %>);
|
||||
}
|
||||
stub_<%=cid %>.setHeader(new org.apache.axis.message.SOAPHeaderElement("http://www.talend.com/mdm", "transaction-id", mdmTransaction_<%=cid%>.getId()));
|
||||
stub_<%=cid %>._setProperty(org.apache.axis.client.Call.SESSION_MAINTAIN_PROPERTY, new Boolean(true));
|
||||
stub_<%=cid %>._setProperty(org.apache.axis.transport.http.HTTPConstants.HEADER_COOKIE, com.talend.mdm.transaction.client.MDMTransaction.getStickySession() + "=" + mdmTransaction_<%=cid%>.getSessionId());
|
||||
}
|
||||
stub_<%=cid %>.ping(new org.talend.mdm.webservice.WSPing());<%//For TDI-26109%>
|
||||
globalMap.put("<%=conn%>_" + Thread.currentThread().getThreadGroup().getName(), xtentisWS_<%=cid %>);
|
||||
}
|
||||
<%}%>
|
||||
|
||||
org.talend.mdm.webservice.WSDataClusterPK dataCluster_<%=cid %> = new org.talend.mdm.webservice.WSDataClusterPK(<%=dataCluster %> + "<%=isStaging?"#STAGING":""%>");
|
||||
|
||||
@@ -5,24 +5,25 @@ imports="
|
||||
org.talend.designer.codegen.config.CodeGeneratorArgument
|
||||
"
|
||||
%>
|
||||
|
||||
<%
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode)codeGenArgument.getArgument();
|
||||
String cid = node.getUniqueName();
|
||||
String destination = ElementParameterParser.getValue(node, "__DESTINATION__");
|
||||
if(destination!=null && !"".equals(destination)){
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode)codeGenArgument.getArgument();
|
||||
String cid = node.getUniqueName();
|
||||
String destination = ElementParameterParser.getValue(node, "__DESTINATION__");
|
||||
if(destination!=null && !"".equals(destination)){
|
||||
cid = destination;
|
||||
}
|
||||
boolean useExistingConn = ("true").equals(ElementParameterParser.getValue(node,"__USE_EXISTING_CONNECTION__"));
|
||||
}
|
||||
boolean useExistingConn = ("true").equals(ElementParameterParser.getValue(node,"__USE_EXISTING_CONNECTION__"));
|
||||
|
||||
boolean isMassInsert =("true").equals(ElementParameterParser.getValue(node,"__EXTENDINSERT__"));
|
||||
boolean withReport = ("true").equals(ElementParameterParser.getValue(node,"__WITHREPORT__"));
|
||||
boolean isMassInsert =("true").equals(ElementParameterParser.getValue(node,"__EXTENDINSERT__"));
|
||||
boolean withReport = ("true").equals(ElementParameterParser.getValue(node,"__WITHREPORT__"));
|
||||
|
||||
boolean isStaging = "STAGING".equalsIgnoreCase(ElementParameterParser.getValue(node, "__CONTAINER_TYPE__"));
|
||||
boolean isStaging = "STAGING".equalsIgnoreCase(ElementParameterParser.getValue(node, "__CONTAINER_TYPE__"));
|
||||
|
||||
boolean addTaskID = ("true").equals(ElementParameterParser.getValue(node,"__ADD_TASKID__"));
|
||||
String taskID = ElementParameterParser.getValue(node,"__TASKID__");
|
||||
boolean usePartialUpdate = ("true").equals(ElementParameterParser.getValue(node,"__USE_PARTIAL_UPDATE__"));
|
||||
boolean addTaskID = ("true").equals(ElementParameterParser.getValue(node,"__ADD_TASKID__"));
|
||||
String taskID = ElementParameterParser.getValue(node,"__TASKID__");
|
||||
boolean usePartialUpdate = ("true").equals(ElementParameterParser.getValue(node,"__USE_PARTIAL_UPDATE__"));
|
||||
%>
|
||||
|
||||
<%
|
||||
@@ -54,10 +55,10 @@ if(!usePartialUpdate){
|
||||
}
|
||||
}
|
||||
}%>
|
||||
<%if(!useExistingConn){%>
|
||||
|
||||
<%if(!useExistingConn){%>
|
||||
stub_<%=cid %>.logout(new org.talend.mdm.webservice.WSLogout());
|
||||
<%}%>
|
||||
|
||||
globalMap.put("<%=cid %>_NB_LINE",nb_line_<%=cid %>);
|
||||
globalMap.put("<%=cid %>_NB_LINE_REJECTED",nb_line_rejected_<%=cid%>);
|
||||
<%}%>
|
||||
|
||||
globalMap.put("<%=cid %>_NB_LINE",nb_line_<%=cid %>);
|
||||
globalMap.put("<%=cid %>_NB_LINE_REJECTED",nb_line_rejected_<%=cid%>);
|
||||
@@ -1,5 +1,5 @@
|
||||
<%@ jet
|
||||
imports="
|
||||
imports="
|
||||
org.talend.core.model.process.INode
|
||||
org.talend.core.model.process.ElementParameterParser
|
||||
org.talend.core.model.metadata.IMetadataTable
|
||||
@@ -12,6 +12,7 @@
|
||||
java.util.Map
|
||||
"
|
||||
%>
|
||||
|
||||
<%
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode)codeGenArgument.getArgument();
|
||||
@@ -133,7 +134,15 @@ if (metadatas != null && metadatas.size()>0) {
|
||||
|
||||
try {
|
||||
<%if(usePartialUpdate){ // partial%>
|
||||
org.talend.mdm.webservice.WSPartialPutItem wsPartialPutItem_<%=cid%> = new org.talend.mdm.webservice.WSPartialPutItem(input_<%=cid %>,<%=dataCluster %>,<%=pivot%>,<%=dataModule %>,<%=key.equals("")?null:key%>,<%=position.equals("")?null:position%>,<%=overwrite%>,<%= true==isStaging?false:withReport%>);
|
||||
<%
|
||||
String stagingString = "";
|
||||
if(isStaging){
|
||||
stagingString = dataCluster + " + \"#STAGING\"";
|
||||
} else {
|
||||
stagingString = dataCluster;
|
||||
}
|
||||
%>
|
||||
org.talend.mdm.webservice.WSPartialPutItem wsPartialPutItem_<%=cid%> = new org.talend.mdm.webservice.WSPartialPutItem(input_<%=cid %>,<%=stagingString %>,<%=pivot%>,<%=dataModule %>,<%=key.equals("")?null:key%>,<%=position.equals("")?null:position%>,<%=overwrite%>,<%= true==isStaging?false:withReport%>, <%=sourceName %>);
|
||||
wspk_<%=cid %> = xtentisWS_<%=cid %>.partialPutItem(wsPartialPutItem_<%=cid%>);
|
||||
|
||||
<%
|
||||
@@ -177,7 +186,6 @@ if (metadatas != null && metadatas.size()>0) {
|
||||
}
|
||||
|
||||
if (outConnName !=null && !isMassInsert && keysReturn.size() > 0) {
|
||||
|
||||
for (int i = 0; i < keysReturn.size(); i++){
|
||||
Map<String,String> map = keysReturn.get(i);
|
||||
%>
|
||||
@@ -186,7 +194,6 @@ if (metadatas != null && metadatas.size()>0) {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
if (isMassInsert) {
|
||||
%>
|
||||
<%if(addTaskID){%>
|
||||
@@ -222,6 +229,9 @@ if (metadatas != null && metadatas.size()>0) {
|
||||
%>
|
||||
<%}//end partial%>
|
||||
} catch (java.lang.Exception e) {
|
||||
<%if (!usePartialUpdate && isMassInsert) {%>
|
||||
miList_<%=cid %>.clear();
|
||||
<%}%>
|
||||
<%if (dieOnError) {%>
|
||||
throw(e);
|
||||
<%} else {
|
||||
|
||||
@@ -11,6 +11,7 @@ imports="
|
||||
java.util.Map
|
||||
"
|
||||
%>
|
||||
|
||||
<%
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode)codeGenArgument.getArgument();
|
||||
@@ -40,6 +41,7 @@ if ((metadatas != null) && (metadatas.size() > 0)) {//1
|
||||
boolean useExistingConn = ("true").equals(ElementParameterParser.getValue(node,"__USE_EXISTING_CONNECTION__"));
|
||||
String connection = ElementParameterParser.getValue(node,"__CONNECTION__");
|
||||
String conn = "xtentisWS_" + connection;
|
||||
String trans = "mdmTrans_" + connection;
|
||||
String mdmUrl = ElementParameterParser.getValue(node, "__MDMURL__");
|
||||
String username = ElementParameterParser.getValue(node, "__USERNAME__");
|
||||
|
||||
@@ -67,6 +69,7 @@ if ((metadatas != null) && (metadatas.size() > 0)) {//1
|
||||
limit = "0";
|
||||
}
|
||||
%>
|
||||
|
||||
int nb_line_<%=cid %> = 0;
|
||||
<%if(!useExistingConn){%>
|
||||
org.talend.mdm.webservice.XtentisServiceLocator xtentisService_<%=cid %> = new org.talend.mdm.webservice.XtentisServiceLocator();
|
||||
@@ -74,22 +77,52 @@ if ((metadatas != null) && (metadatas.size() > 0)) {//1
|
||||
org.talend.mdm.webservice.XtentisPort_PortType xtentisWS_<%=cid %> = xtentisService_<%=cid %>.getXtentisPort();
|
||||
org.talend.mdm.webservice.XtentisBindingStub stub_<%=cid %> = (org.talend.mdm.webservice.XtentisBindingStub)xtentisWS_<%=cid %>;
|
||||
|
||||
// Authentification
|
||||
<%if(universe==null || ("").equals(universe.trim())){%>
|
||||
stub_<%=cid %>.setUsername(<%=username %>);
|
||||
<%}else{%>
|
||||
stub_<%=cid %>.setUsername(<%=universe%> + "/" + <%=username %>);
|
||||
<%}%>
|
||||
|
||||
<%
|
||||
String passwordFieldName = "__PASSWORD__";
|
||||
%>
|
||||
|
||||
<% String passwordFieldName = "__PASSWORD__"; %>
|
||||
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/password.javajet"%>
|
||||
|
||||
stub_<%=cid %>.setPassword(decryptedPassword_<%=cid%>);
|
||||
<%}else{%>
|
||||
org.talend.mdm.webservice.XtentisPort_PortType xtentisWS_<%=cid %> = (org.talend.mdm.webservice.XtentisPort_PortType)globalMap.get("<%=conn%>");
|
||||
org.talend.mdm.webservice.XtentisPort_PortType xtentisWS_<%=cid %> = (org.talend.mdm.webservice.XtentisPort_PortType)globalMap.get("<%=conn%>_" + Thread.currentThread().getThreadGroup().getName());
|
||||
if(xtentisWS_<%=cid %> == null) {
|
||||
String murl_<%=cid %> = (String)globalMap.get("mdmUrl_<%=connection %>");
|
||||
String username_<%=cid%> = (String)globalMap.get("username_<%=connection %>");
|
||||
String password_<%=cid%> = (String)globalMap.get("password_<%=connection %>");
|
||||
org.talend.mdm.webservice.XtentisServiceLocator xtentisService_<%=cid %> = new org.talend.mdm.webservice.XtentisServiceLocator();
|
||||
xtentisService_<%=cid %>.setXtentisPortEndpointAddress(murl_<%=cid %>);
|
||||
xtentisWS_<%=cid %> = xtentisService_<%=cid %>.getXtentisPort();
|
||||
org.talend.mdm.webservice.XtentisBindingStub stub_<%=cid %> = (org.talend.mdm.webservice.XtentisBindingStub)xtentisWS_<%=cid %>;
|
||||
stub_<%=cid %>.setUsername(username_<%=cid%>);
|
||||
stub_<%=cid %>.setPassword(password_<%=cid%>);
|
||||
if((Boolean)globalMap.get("useTransaction_<%=connection %>")) {
|
||||
String turl_<%=cid%> = com.talend.mdm.transaction.client.MDMTransactionClient.getMDMTransactionURL(murl_<%=cid %>);
|
||||
com.talend.mdm.transaction.client.MDMTransaction mdmTransaction_<%=cid%> = (com.talend.mdm.transaction.client.MDMTransaction)globalMap.get("<%=trans%>_" + Thread.currentThread().getThreadGroup().getName());
|
||||
if(mdmTransaction_<%=cid%> == null) {
|
||||
if((Boolean)globalMap.get("useClientTranId_<%=connection %>")) {
|
||||
String sessionID_<%=cid%> = com.talend.mdm.transaction.client.MDMTransactionClient.getSessionID(turl_<%=cid%>,username_<%=cid%>,password_<%=cid%>);
|
||||
mdmTransaction_<%=cid%> = new com.talend.mdm.transaction.client.MDMTransaction();
|
||||
mdmTransaction_<%=cid%>.setUrl(turl_<%=cid%>);
|
||||
mdmTransaction_<%=cid%>.setId("<%=cid%>_" + java.util.UUID.randomUUID());
|
||||
mdmTransaction_<%=cid%>.setUsername(username_<%=cid%>);
|
||||
mdmTransaction_<%=cid%>.setPassword(password_<%=cid%>);
|
||||
mdmTransaction_<%=cid%>.setSessionId(sessionID_<%=cid%>);
|
||||
} else {
|
||||
mdmTransaction_<%=cid%> = com.talend.mdm.transaction.client.MDMTransactionClient.newTransaction(turl_<%=cid%>,stub_<%=cid %>.getUsername(),stub_<%=cid %>.getPassword());
|
||||
}
|
||||
globalMap.put("<%=trans%>_" + Thread.currentThread().getThreadGroup().getName(), mdmTransaction_<%=cid %>);
|
||||
}
|
||||
stub_<%=cid %>.setHeader(new org.apache.axis.message.SOAPHeaderElement("http://www.talend.com/mdm", "transaction-id", mdmTransaction_<%=cid%>.getId()));
|
||||
stub_<%=cid %>._setProperty(org.apache.axis.client.Call.SESSION_MAINTAIN_PROPERTY, new Boolean(true));
|
||||
stub_<%=cid %>._setProperty(org.apache.axis.transport.http.HTTPConstants.HEADER_COOKIE, com.talend.mdm.transaction.client.MDMTransaction.getStickySession() + "=" + mdmTransaction_<%=cid%>.getSessionId());
|
||||
}
|
||||
stub_<%=cid %>.ping(new org.talend.mdm.webservice.WSPing());<%//For TDI-26109%>
|
||||
globalMap.put("<%=conn%>_" + Thread.currentThread().getThreadGroup().getName(), xtentisWS_<%=cid %>);
|
||||
}
|
||||
<%}%>
|
||||
|
||||
org.talend.mdm.webservice.WSDataClusterPK dataCluster_<%=cid %> = new org.talend.mdm.webservice.WSDataClusterPK(<%=dataCluster %> + "<%=isStaging?"#STAGING":""%>");
|
||||
@@ -106,8 +139,7 @@ if ((metadatas != null) && (metadatas.size() > 0)) {//1
|
||||
}
|
||||
%>
|
||||
};
|
||||
org.talend.mdm.webservice.WSGetItem wsitem_<%=cid %> =
|
||||
new org.talend.mdm.webservice.WSGetItem(new org.talend.mdm.webservice.WSItemPK(dataCluster_<%=cid %>,<%=concept %>,ids_<%=cid %>));
|
||||
org.talend.mdm.webservice.WSGetItem wsitem_<%=cid %> = new org.talend.mdm.webservice.WSGetItem(new org.talend.mdm.webservice.WSItemPK(dataCluster_<%=cid %>,<%=concept %>,ids_<%=cid %>));
|
||||
String <%=outgoingConn.getName() %>_xml = "";
|
||||
try {
|
||||
org.talend.mdm.webservice.WSItem item_<%=cid %>=xtentisWS_<%=cid %>.getItem(wsitem_<%=cid %>);
|
||||
@@ -176,7 +208,7 @@ if ((metadatas != null) && (metadatas.size() > 0)) {//1
|
||||
int readRecordsSize_<%=cid%> = limit_<%=cid%> == -1 ? recordsPerPage_<%=cid%> : (recordsPerPage_<%=cid%> == -1 ? limit_<%=cid%> : (recordsPerPage_<%=cid%> > limit_<%=cid%> ? limit_<%=cid%>
|
||||
: recordsPerPage_<%=cid%>));
|
||||
|
||||
org.talend.mdm.webservice.WSGetItems getitems_<%=cid %>=null;
|
||||
org.talend.mdm.webservice.WSGetItems getitems_<%=cid %> = null;
|
||||
|
||||
boolean continueFlag_<%=cid%> = true;
|
||||
int totalCount_<%=cid%> = -1;<%//For TDI-26039%>
|
||||
|
||||
@@ -10,17 +10,18 @@ imports="
|
||||
java.util.List
|
||||
"
|
||||
%>
|
||||
|
||||
<%
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode)codeGenArgument.getArgument();
|
||||
String cid = node.getUniqueName();
|
||||
String destination = ElementParameterParser.getValue(node, "__DESTINATION__");
|
||||
String dieOnErrorStr = ElementParameterParser.getValue(node, "__DIE_ON_ERROR__");
|
||||
boolean dieOnError = (dieOnErrorStr!=null&&!("").equals(dieOnErrorStr))?("true").equals(dieOnErrorStr):false;
|
||||
if(destination!=null && !"".equals(destination)){
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode)codeGenArgument.getArgument();
|
||||
String cid = node.getUniqueName();
|
||||
String destination = ElementParameterParser.getValue(node, "__DESTINATION__");
|
||||
String dieOnErrorStr = ElementParameterParser.getValue(node, "__DIE_ON_ERROR__");
|
||||
boolean dieOnError = (dieOnErrorStr!=null&&!("").equals(dieOnErrorStr))?("true").equals(dieOnErrorStr):false;
|
||||
if(destination!=null && !"".equals(destination)){
|
||||
cid = destination;
|
||||
}
|
||||
boolean useExistingConn = ("true").equals(ElementParameterParser.getValue(node,"__USE_EXISTING_CONNECTION__"));
|
||||
}
|
||||
boolean useExistingConn = ("true").equals(ElementParameterParser.getValue(node,"__USE_EXISTING_CONNECTION__"));
|
||||
|
||||
List<IMetadataTable> metadatas = node.getMetadataList();
|
||||
if ((metadatas != null) && (metadatas.size() > 0)) {
|
||||
@@ -63,5 +64,3 @@ if ((metadatas != null) && (metadatas.size() > 0)) {
|
||||
}
|
||||
}
|
||||
%>
|
||||
|
||||
|
||||
@@ -3,32 +3,28 @@ imports="
|
||||
org.talend.core.model.process.INode
|
||||
org.talend.core.model.process.ElementParameterParser
|
||||
org.talend.designer.codegen.config.CodeGeneratorArgument
|
||||
"
|
||||
"
|
||||
%>
|
||||
|
||||
<%
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode)codeGenArgument.getArgument();
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode)codeGenArgument.getArgument();
|
||||
String cid = node.getUniqueName();
|
||||
|
||||
String cid = node.getUniqueName();
|
||||
|
||||
String connection = ElementParameterParser.getValue(node, "__CONNECTION__");
|
||||
|
||||
boolean close = ("true").equals(ElementParameterParser.getValue(node,"__CLOSE__"));
|
||||
|
||||
String conn = "xtentisWS_" + connection;
|
||||
String mdmTransaction = "mdmTransaction_" + connection;
|
||||
String connection = ElementParameterParser.getValue(node, "__CONNECTION__");
|
||||
boolean close = ("true").equals(ElementParameterParser.getValue(node,"__CLOSE__"));
|
||||
String conn = "xtentisWS_" + connection;
|
||||
String trans = "mdmTrans_" + connection;
|
||||
%>
|
||||
|
||||
org.talend.mdm.webservice.XtentisPort_PortType conn_<%=cid%> = (org.talend.mdm.webservice.XtentisPort_PortType)globalMap.get("<%=conn%>");
|
||||
if(conn_<%=cid%> != null)
|
||||
{
|
||||
com.talend.mdm.transaction.client.MDMTransaction mdmTransaction_<%=cid%> = (com.talend.mdm.transaction.client.MDMTransaction)globalMap.get("<%=mdmTransaction%>");
|
||||
if(mdmTransaction_<%=cid%>!=null) {
|
||||
com.talend.mdm.transaction.client.MDMTransaction mdmTransaction_<%=cid%> = (com.talend.mdm.transaction.client.MDMTransaction)globalMap.get("<%=trans%>_" + Thread.currentThread().getThreadGroup().getName());
|
||||
if(mdmTransaction_<%=cid%> != null) {
|
||||
mdmTransaction_<%=cid%>.rollback();
|
||||
}
|
||||
<% if(close){%>
|
||||
conn_<%=cid%>.logout(new org.talend.mdm.webservice.WSLogout());
|
||||
<% }%>
|
||||
}
|
||||
|
||||
<% if(close){%>
|
||||
org.talend.mdm.webservice.XtentisPort_PortType conn_<%=cid%> = (org.talend.mdm.webservice.XtentisPort_PortType)globalMap.get("<%=conn%>_" + Thread.currentThread().getThreadGroup().getName());
|
||||
if(conn_<%=cid%> != null) {
|
||||
conn_<%=cid%>.logout(new org.talend.mdm.webservice.WSLogout());
|
||||
}
|
||||
<% }%>
|
||||
|
||||
@@ -7,26 +7,29 @@ imports="
|
||||
java.util.Map
|
||||
"
|
||||
%>
|
||||
|
||||
<%
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode)codeGenArgument.getArgument();
|
||||
String cid = node.getUniqueName();
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode)codeGenArgument.getArgument();
|
||||
String cid = node.getUniqueName();
|
||||
|
||||
boolean useExistingConn = ("true").equals(ElementParameterParser.getValue(node,"__USE_EXISTING_CONNECTION__"));
|
||||
String connection = ElementParameterParser.getValue(node,"__CONNECTION__");
|
||||
String conn = "xtentisWS_" + connection;
|
||||
String mdmUrl = ElementParameterParser.getValue(node, "__MDMURL__");
|
||||
String username = ElementParameterParser.getValue(node, "__USERNAME__");
|
||||
boolean useExistingConn = ("true").equals(ElementParameterParser.getValue(node,"__USE_EXISTING_CONNECTION__"));
|
||||
String connection = ElementParameterParser.getValue(node,"__CONNECTION__");
|
||||
String conn = "xtentisWS_" + connection;
|
||||
String trans = "mdmTrans_" + connection;
|
||||
String mdmUrl = ElementParameterParser.getValue(node, "__MDMURL__");
|
||||
String username = ElementParameterParser.getValue(node, "__USERNAME__");
|
||||
|
||||
String universe = ElementParameterParser.getValue(node, "__UNIVERSE__");
|
||||
String entity = ElementParameterParser.getValue(node, "__ENTITY__");
|
||||
String keyField = ElementParameterParser.getValue(node, "__KEYFIELD__");
|
||||
String universe = ElementParameterParser.getValue(node, "__UNIVERSE__");
|
||||
String entity = ElementParameterParser.getValue(node, "__ENTITY__");
|
||||
String keyField = ElementParameterParser.getValue(node, "__KEYFIELD__");
|
||||
|
||||
String dataCluster = ElementParameterParser.getValue(node, "__DATACLUSTER__");
|
||||
boolean isStaging = "STAGING".equalsIgnoreCase(ElementParameterParser.getValue(node, "__CONTAINER_TYPE__"));
|
||||
String dataCluster = ElementParameterParser.getValue(node, "__DATACLUSTER__");
|
||||
boolean isStaging = "STAGING".equalsIgnoreCase(ElementParameterParser.getValue(node, "__CONTAINER_TYPE__"));
|
||||
|
||||
List<Map<String, String>> ids = (List<Map<String,String>>)ElementParameterParser.getObjectValue(node, "__IDS__");
|
||||
List<Map<String, String>> ids = (List<Map<String,String>>)ElementParameterParser.getObjectValue(node, "__IDS__");
|
||||
%>
|
||||
|
||||
int nb_line_<%=cid %> = 0;
|
||||
<%if(!useExistingConn){%>
|
||||
org.talend.mdm.webservice.XtentisServiceLocator xtentisService_<%=cid %> = new org.talend.mdm.webservice.XtentisServiceLocator();
|
||||
@@ -34,22 +37,52 @@ int nb_line_<%=cid %> = 0;
|
||||
org.talend.mdm.webservice.XtentisPort_PortType xtentisWS_<%=cid %> = xtentisService_<%=cid %>.getXtentisPort();
|
||||
org.talend.mdm.webservice.XtentisBindingStub stub_<%=cid %> = (org.talend.mdm.webservice.XtentisBindingStub)xtentisWS_<%=cid %>;
|
||||
|
||||
// Authentification
|
||||
<%if(universe==null || ("").equals(universe.trim())){%>
|
||||
stub_<%=cid %>.setUsername(<%=username %>);
|
||||
<%}else{%>
|
||||
stub_<%=cid %>.setUsername(<%=universe%> + "/" + <%=username %>);
|
||||
<%}%>
|
||||
|
||||
<%
|
||||
String passwordFieldName = "__PASSWORD__";
|
||||
%>
|
||||
|
||||
<% String passwordFieldName = "__PASSWORD__"; %>
|
||||
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/password.javajet"%>
|
||||
|
||||
stub_<%=cid %>.setPassword(decryptedPassword_<%=cid%>);
|
||||
<%}else{%>
|
||||
org.talend.mdm.webservice.XtentisPort_PortType xtentisWS_<%=cid %> = (org.talend.mdm.webservice.XtentisPort_PortType)globalMap.get("<%=conn%>");
|
||||
org.talend.mdm.webservice.XtentisPort_PortType xtentisWS_<%=cid %> = (org.talend.mdm.webservice.XtentisPort_PortType)globalMap.get("<%=conn%>_" + Thread.currentThread().getThreadGroup().getName());
|
||||
if(xtentisWS_<%=cid %> == null) {
|
||||
String murl_<%=cid %> = (String)globalMap.get("mdmUrl_<%=connection %>");
|
||||
String username_<%=cid%> = (String)globalMap.get("username_<%=connection %>");
|
||||
String password_<%=cid%> = (String)globalMap.get("password_<%=connection %>");
|
||||
org.talend.mdm.webservice.XtentisServiceLocator xtentisService_<%=cid %> = new org.talend.mdm.webservice.XtentisServiceLocator();
|
||||
xtentisService_<%=cid %>.setXtentisPortEndpointAddress(murl_<%=cid %>);
|
||||
xtentisWS_<%=cid %> = xtentisService_<%=cid %>.getXtentisPort();
|
||||
org.talend.mdm.webservice.XtentisBindingStub stub_<%=cid %> = (org.talend.mdm.webservice.XtentisBindingStub)xtentisWS_<%=cid %>;
|
||||
stub_<%=cid %>.setUsername(username_<%=cid%>);
|
||||
stub_<%=cid %>.setPassword(password_<%=cid%>);
|
||||
if((Boolean)globalMap.get("useTransaction_<%=connection %>")) {
|
||||
String turl_<%=cid%> = com.talend.mdm.transaction.client.MDMTransactionClient.getMDMTransactionURL(murl_<%=cid %>);
|
||||
com.talend.mdm.transaction.client.MDMTransaction mdmTransaction_<%=cid%> = (com.talend.mdm.transaction.client.MDMTransaction)globalMap.get("<%=trans%>_" + Thread.currentThread().getThreadGroup().getName());
|
||||
if(mdmTransaction_<%=cid%> == null) {
|
||||
if((Boolean)globalMap.get("useClientTranId_<%=connection %>")) {
|
||||
String sessionID_<%=cid%> = com.talend.mdm.transaction.client.MDMTransactionClient.getSessionID(turl_<%=cid%>,username_<%=cid%>,password_<%=cid%>);
|
||||
mdmTransaction_<%=cid%> = new com.talend.mdm.transaction.client.MDMTransaction();
|
||||
mdmTransaction_<%=cid%>.setUrl(turl_<%=cid%>);
|
||||
mdmTransaction_<%=cid%>.setId("<%=cid%>_" + java.util.UUID.randomUUID());
|
||||
mdmTransaction_<%=cid%>.setUsername(username_<%=cid%>);
|
||||
mdmTransaction_<%=cid%>.setPassword(password_<%=cid%>);
|
||||
mdmTransaction_<%=cid%>.setSessionId(sessionID_<%=cid%>);
|
||||
} else {
|
||||
mdmTransaction_<%=cid%> = com.talend.mdm.transaction.client.MDMTransactionClient.newTransaction(turl_<%=cid%>,stub_<%=cid %>.getUsername(),stub_<%=cid %>.getPassword());
|
||||
}
|
||||
globalMap.put("<%=trans%>_" + Thread.currentThread().getThreadGroup().getName(), mdmTransaction_<%=cid %>);
|
||||
}
|
||||
stub_<%=cid %>.setHeader(new org.apache.axis.message.SOAPHeaderElement("http://www.talend.com/mdm", "transaction-id", mdmTransaction_<%=cid%>.getId()));
|
||||
stub_<%=cid %>._setProperty(org.apache.axis.client.Call.SESSION_MAINTAIN_PROPERTY, new Boolean(true));
|
||||
stub_<%=cid %>._setProperty(org.apache.axis.transport.http.HTTPConstants.HEADER_COOKIE, com.talend.mdm.transaction.client.MDMTransaction.getStickySession() + "=" + mdmTransaction_<%=cid%>.getSessionId());
|
||||
}
|
||||
stub_<%=cid %>.ping(new org.talend.mdm.webservice.WSPing());<%//For TDI-26109%>
|
||||
globalMap.put("<%=conn%>_" + Thread.currentThread().getThreadGroup().getName(), xtentisWS_<%=cid %>);
|
||||
}
|
||||
<%}%>
|
||||
|
||||
org.talend.mdm.webservice.WSDataClusterPK dataCluster_<%=cid %> = new org.talend.mdm.webservice.WSDataClusterPK(<%=dataCluster %> + "<%=isStaging?"#STAGING":""%>");
|
||||
|
||||
@@ -5,55 +5,83 @@ imports="
|
||||
org.talend.designer.codegen.config.CodeGeneratorArgument
|
||||
"
|
||||
%>
|
||||
|
||||
<%
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode)codeGenArgument.getArgument();
|
||||
String cid = node.getUniqueName();
|
||||
boolean useExistingConn = ("true").equals(ElementParameterParser.getValue(node,"__USE_EXISTING_CONNECTION__"));
|
||||
String connection = ElementParameterParser.getValue(node,"__CONNECTION__");
|
||||
String conn = "xtentisWS_" + connection;
|
||||
String mdmUrl = ElementParameterParser.getValue(node, "__MDMURL__");
|
||||
String username = ElementParameterParser.getValue(node, "__USERNAME__");
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode)codeGenArgument.getArgument();
|
||||
String cid = node.getUniqueName();
|
||||
boolean useExistingConn = ("true").equals(ElementParameterParser.getValue(node,"__USE_EXISTING_CONNECTION__"));
|
||||
String connection = ElementParameterParser.getValue(node,"__CONNECTION__");
|
||||
String conn = "xtentisWS_" + connection;
|
||||
String trans = "mdmTrans_" + connection;
|
||||
String mdmUrl = ElementParameterParser.getValue(node, "__MDMURL__");
|
||||
String username = ElementParameterParser.getValue(node, "__USERNAME__");
|
||||
|
||||
String universe = ElementParameterParser.getValue(node, "__UNIVERSE__");
|
||||
String dataCluster = ElementParameterParser.getValue(node, "__DATACLUSTER__");
|
||||
boolean isStaging = "STAGING".equalsIgnoreCase(ElementParameterParser.getValue(node, "__CONTAINER_TYPE__"));
|
||||
String spName = ElementParameterParser.getValue(node, "__SPNAME__");
|
||||
String universe = ElementParameterParser.getValue(node, "__UNIVERSE__");
|
||||
String dataCluster = ElementParameterParser.getValue(node, "__DATACLUSTER__");
|
||||
boolean isStaging = "STAGING".equalsIgnoreCase(ElementParameterParser.getValue(node, "__CONTAINER_TYPE__"));
|
||||
String spName = ElementParameterParser.getValue(node, "__SPNAME__");
|
||||
%>
|
||||
int nb_line_<%=cid %> = 0;
|
||||
|
||||
<%if(!useExistingConn){%>
|
||||
int nb_line_<%=cid %> = 0;
|
||||
<%if(!useExistingConn){%>
|
||||
org.talend.mdm.webservice.XtentisServiceLocator xtentisService_<%=cid %> = new org.talend.mdm.webservice.XtentisServiceLocator();
|
||||
xtentisService_<%=cid %>.setXtentisPortEndpointAddress(<%=mdmUrl %>);
|
||||
org.talend.mdm.webservice.XtentisPort_PortType xtentisWS_<%=cid %> = xtentisService_<%=cid %>.getXtentisPort();
|
||||
org.talend.mdm.webservice.XtentisBindingStub stub_<%=cid %> = (org.talend.mdm.webservice.XtentisBindingStub)xtentisWS_<%=cid %>;
|
||||
|
||||
// Authentification
|
||||
<%if(universe==null || ("").equals(universe.trim())){%>
|
||||
stub_<%=cid %>.setUsername(<%=username %>);
|
||||
<%}else{%>
|
||||
stub_<%=cid %>.setUsername(<%=universe%> + "/" + <%=username %>);
|
||||
<%}%>
|
||||
|
||||
<%
|
||||
String passwordFieldName = "__PASSWORD__";
|
||||
%>
|
||||
|
||||
<% String passwordFieldName = "__PASSWORD__"; %>
|
||||
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/password.javajet"%>
|
||||
|
||||
stub_<%=cid %>.setPassword(decryptedPassword_<%=cid%>);
|
||||
<%
|
||||
}else{
|
||||
%>
|
||||
org.talend.mdm.webservice.XtentisPort_PortType xtentisWS_<%=cid %> = (org.talend.mdm.webservice.XtentisPort_PortType)globalMap.get("<%=conn%>");
|
||||
<%
|
||||
<%}else{%>
|
||||
org.talend.mdm.webservice.XtentisPort_PortType xtentisWS_<%=cid %> = (org.talend.mdm.webservice.XtentisPort_PortType)globalMap.get("<%=conn%>_" + Thread.currentThread().getThreadGroup().getName());
|
||||
if(xtentisWS_<%=cid %> == null) {
|
||||
String murl_<%=cid %> = (String)globalMap.get("mdmUrl_<%=connection %>");
|
||||
String username_<%=cid%> = (String)globalMap.get("username_<%=connection %>");
|
||||
String password_<%=cid%> = (String)globalMap.get("password_<%=connection %>");
|
||||
org.talend.mdm.webservice.XtentisServiceLocator xtentisService_<%=cid %> = new org.talend.mdm.webservice.XtentisServiceLocator();
|
||||
xtentisService_<%=cid %>.setXtentisPortEndpointAddress(murl_<%=cid %>);
|
||||
xtentisWS_<%=cid %> = xtentisService_<%=cid %>.getXtentisPort();
|
||||
org.talend.mdm.webservice.XtentisBindingStub stub_<%=cid %> = (org.talend.mdm.webservice.XtentisBindingStub)xtentisWS_<%=cid %>;
|
||||
stub_<%=cid %>.setUsername(username_<%=cid%>);
|
||||
stub_<%=cid %>.setPassword(password_<%=cid%>);
|
||||
if((Boolean)globalMap.get("useTransaction_<%=connection %>")) {
|
||||
String turl_<%=cid%> = com.talend.mdm.transaction.client.MDMTransactionClient.getMDMTransactionURL(murl_<%=cid %>);
|
||||
com.talend.mdm.transaction.client.MDMTransaction mdmTransaction_<%=cid%> = (com.talend.mdm.transaction.client.MDMTransaction)globalMap.get("<%=trans%>_" + Thread.currentThread().getThreadGroup().getName());
|
||||
if(mdmTransaction_<%=cid%> == null) {
|
||||
if((Boolean)globalMap.get("useClientTranId_<%=connection %>")) {
|
||||
String sessionID_<%=cid%> = com.talend.mdm.transaction.client.MDMTransactionClient.getSessionID(turl_<%=cid%>,username_<%=cid%>,password_<%=cid%>);
|
||||
mdmTransaction_<%=cid%> = new com.talend.mdm.transaction.client.MDMTransaction();
|
||||
mdmTransaction_<%=cid%>.setUrl(turl_<%=cid%>);
|
||||
mdmTransaction_<%=cid%>.setId("<%=cid%>_" + java.util.UUID.randomUUID());
|
||||
mdmTransaction_<%=cid%>.setUsername(username_<%=cid%>);
|
||||
mdmTransaction_<%=cid%>.setPassword(password_<%=cid%>);
|
||||
mdmTransaction_<%=cid%>.setSessionId(sessionID_<%=cid%>);
|
||||
} else {
|
||||
mdmTransaction_<%=cid%> = com.talend.mdm.transaction.client.MDMTransactionClient.newTransaction(turl_<%=cid%>,stub_<%=cid %>.getUsername(),stub_<%=cid %>.getPassword());
|
||||
}
|
||||
%>
|
||||
globalMap.put("<%=trans%>_" + Thread.currentThread().getThreadGroup().getName(), mdmTransaction_<%=cid %>);
|
||||
}
|
||||
stub_<%=cid %>.setHeader(new org.apache.axis.message.SOAPHeaderElement("http://www.talend.com/mdm", "transaction-id", mdmTransaction_<%=cid%>.getId()));
|
||||
stub_<%=cid %>._setProperty(org.apache.axis.client.Call.SESSION_MAINTAIN_PROPERTY, new Boolean(true));
|
||||
stub_<%=cid %>._setProperty(org.apache.axis.transport.http.HTTPConstants.HEADER_COOKIE, com.talend.mdm.transaction.client.MDMTransaction.getStickySession() + "=" + mdmTransaction_<%=cid%>.getSessionId());
|
||||
}
|
||||
stub_<%=cid %>.ping(new org.talend.mdm.webservice.WSPing());<%//For TDI-26109%>
|
||||
globalMap.put("<%=conn%>_" + Thread.currentThread().getThreadGroup().getName(), xtentisWS_<%=cid %>);
|
||||
}
|
||||
<%}%>
|
||||
|
||||
org.talend.mdm.webservice.WSDataClusterPK dataCluster_<%=cid %> = new org.talend.mdm.webservice.WSDataClusterPK(<%=dataCluster %> + "<%=isStaging?"#STAGING":""%>");
|
||||
org.talend.mdm.webservice.WSDataClusterPK dataCluster_<%=cid %> = new org.talend.mdm.webservice.WSDataClusterPK(<%=dataCluster %> + "<%=isStaging?"#STAGING":""%>");
|
||||
|
||||
org.talend.mdm.webservice.WSExecuteStoredProcedure wsExeProc_<%=cid %> = new org.talend.mdm.webservice.WSExecuteStoredProcedure();
|
||||
wsExeProc_<%=cid %>.setWsDataClusterPK(dataCluster_<%=cid %>);
|
||||
org.talend.mdm.webservice.WSStoredProcedurePK wsStoredProcPK_<%=cid %> = new org.talend.mdm.webservice.WSStoredProcedurePK();
|
||||
wsStoredProcPK_<%=cid %>.setPk(<%=spName %>);
|
||||
wsExeProc_<%=cid %>.setWsStoredProcedurePK(wsStoredProcPK_<%=cid %>);
|
||||
org.talend.mdm.webservice.WSExecuteStoredProcedure wsExeProc_<%=cid %> = new org.talend.mdm.webservice.WSExecuteStoredProcedure();
|
||||
wsExeProc_<%=cid %>.setWsDataClusterPK(dataCluster_<%=cid %>);
|
||||
org.talend.mdm.webservice.WSStoredProcedurePK wsStoredProcPK_<%=cid %> = new org.talend.mdm.webservice.WSStoredProcedurePK();
|
||||
wsStoredProcPK_<%=cid %>.setPk(<%=spName %>);
|
||||
wsExeProc_<%=cid %>.setWsStoredProcedurePK(wsStoredProcPK_<%=cid %>);
|
||||
@@ -5,16 +5,16 @@ imports="
|
||||
org.talend.designer.codegen.config.CodeGeneratorArgument
|
||||
"
|
||||
%>
|
||||
<%
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode)codeGenArgument.getArgument();
|
||||
String cid = node.getUniqueName();
|
||||
boolean useExistingConn = ("true").equals(ElementParameterParser.getValue(node,"__USE_EXISTING_CONNECTION__"));
|
||||
|
||||
if(!useExistingConn){
|
||||
<%
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode)codeGenArgument.getArgument();
|
||||
String cid = node.getUniqueName();
|
||||
boolean useExistingConn = ("true").equals(ElementParameterParser.getValue(node,"__USE_EXISTING_CONNECTION__"));
|
||||
|
||||
if(!useExistingConn){
|
||||
%>
|
||||
stub_<%=cid %>.logout(new org.talend.mdm.webservice.WSLogout());
|
||||
<%
|
||||
}
|
||||
}
|
||||
%>
|
||||
|
||||
|
||||
@@ -11,19 +11,20 @@ imports="
|
||||
java.util.Map
|
||||
"
|
||||
%>
|
||||
|
||||
<%
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode)codeGenArgument.getArgument();
|
||||
String cid = node.getUniqueName();
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode)codeGenArgument.getArgument();
|
||||
String cid = node.getUniqueName();
|
||||
|
||||
String spName = ElementParameterParser.getValue(node, "__SPNAME__");
|
||||
String spName = ElementParameterParser.getValue(node, "__SPNAME__");
|
||||
|
||||
List<Map<String, String>> spArgs = (List<Map<String,String>>)ElementParameterParser.getObjectValue(node, "__SP_ARGS__");
|
||||
List<Map<String, String>> spArgs = (List<Map<String,String>>)ElementParameterParser.getObjectValue(node, "__SP_ARGS__");
|
||||
|
||||
List<? extends IConnection> inConnections = node.getIncomingConnections();
|
||||
IConnection inConnection = null;
|
||||
IMetadataTable metadata = null;
|
||||
if (inConnections != null) {
|
||||
List<? extends IConnection> inConnections = node.getIncomingConnections();
|
||||
IConnection inConnection = null;
|
||||
IMetadataTable metadata = null;
|
||||
if (inConnections != null) {
|
||||
for (int i = 0; i < inConnections.size(); i++) {
|
||||
IConnection connection = inConnections.get(i);
|
||||
if (connection.getLineStyle().hasConnectionCategory(IConnectionCategory.DATA)) {
|
||||
@@ -32,10 +33,10 @@ imports="
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
List<? extends IConnection> outgoingConns = node.getOutgoingSortedConnections();
|
||||
if(inConnection!=null){
|
||||
List<? extends IConnection> outgoingConns = node.getOutgoingSortedConnections();
|
||||
if(inConnection!=null){
|
||||
if(spArgs.size()>0){
|
||||
%>
|
||||
wsExeProc_<%=cid %>.setParameters(new String[]{
|
||||
@@ -57,9 +58,9 @@ imports="
|
||||
});
|
||||
<%
|
||||
}
|
||||
}
|
||||
// if output columns are defined
|
||||
if (outgoingConns != null && outgoingConns.size() > 0){
|
||||
}
|
||||
// if output columns are defined
|
||||
if (outgoingConns != null && outgoingConns.size() > 0){
|
||||
IConnection outgoingConn = outgoingConns.get(0);
|
||||
String outputCol = null;
|
||||
if(outgoingConn.getLineStyle().hasConnectionCategory(IConnectionCategory.DATA)) { // start 1
|
||||
@@ -72,11 +73,9 @@ imports="
|
||||
xtentisWS_<%=cid %>.executeStoredProcedure(wsExeProc_<%=cid %>);
|
||||
<%
|
||||
}
|
||||
} else {
|
||||
} else {
|
||||
%>
|
||||
xtentisWS_<%=cid %>.executeStoredProcedure(wsExeProc_<%=cid %>);
|
||||
<%
|
||||
}
|
||||
}
|
||||
%>
|
||||
|
||||
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
java.util.List
|
||||
"
|
||||
%>
|
||||
|
||||
<%
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
|
||||
INode node = (INode)codeGenArgument.getArgument();
|
||||
|
||||
String cid = node.getUniqueName();
|
||||
%>
|
||||
|
||||
<%
|
||||
List<IMetadataTable> metadatas = node.getMetadataList();
|
||||
|
||||
|
||||
@@ -5,23 +5,20 @@ imports="
|
||||
org.talend.core.model.process.IConnection
|
||||
org.talend.core.model.process.INode
|
||||
org.talend.designer.codegen.config.CodeGeneratorArgument
|
||||
|
||||
java.util.List;
|
||||
"
|
||||
"
|
||||
%>
|
||||
|
||||
<%
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode)codeGenArgument.getArgument();
|
||||
String cid = node.getUniqueName();
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode)codeGenArgument.getArgument();
|
||||
String cid = node.getUniqueName();
|
||||
|
||||
List<IMetadataTable> metadatas = node.getMetadataList();
|
||||
if ((metadatas != null) && (metadatas.size() > 0)) {
|
||||
List<IMetadataTable> metadatas = node.getMetadataList();
|
||||
if ((metadatas != null) && (metadatas.size() > 0)) {
|
||||
IMetadataTable metadata = metadatas.get(0);
|
||||
if (metadata != null) {
|
||||
|
||||
String incomingName = "";
|
||||
|
||||
List<? extends IConnection> inputConns = node.getIncomingConnections(EConnectionType.FLOW_MAIN);
|
||||
if ((inputConns!=null)&&(inputConns.size()>0)) {
|
||||
IConnection incomingConn = inputConns.get(0);
|
||||
@@ -31,8 +28,7 @@ imports="
|
||||
}
|
||||
%>
|
||||
MDMOutputMessage = <%=incomingName %>.MDM_Message;
|
||||
|
||||
<%
|
||||
}
|
||||
}
|
||||
%>
|
||||
}
|
||||
%>
|
||||
@@ -11,10 +11,11 @@ imports="
|
||||
java.util.Map
|
||||
"
|
||||
%>
|
||||
|
||||
<%
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode)codeGenArgument.getArgument();
|
||||
String cid = node.getUniqueName();
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode)codeGenArgument.getArgument();
|
||||
String cid = node.getUniqueName();
|
||||
|
||||
List<IMetadataTable> metadatas = node.getMetadataList();
|
||||
if ((metadatas != null) && (metadatas.size() > 0)) {
|
||||
@@ -34,6 +35,7 @@ if ((metadatas != null) && (metadatas.size() > 0)) {
|
||||
boolean useExistingConn = ("true").equals(ElementParameterParser.getValue(node,"__USE_EXISTING_CONNECTION__"));
|
||||
String connection = ElementParameterParser.getValue(node,"__CONNECTION__");
|
||||
String conn = "xtentisWS_" + connection;
|
||||
String trans = "mdmTrans_" + connection;
|
||||
String mdmUrl = ElementParameterParser.getValue(node, "__MDMURL__");
|
||||
String username = ElementParameterParser.getValue(node, "__USERNAME__");
|
||||
|
||||
@@ -63,6 +65,7 @@ if ((metadatas != null) && (metadatas.size() > 0)) {
|
||||
limit = "-1";
|
||||
}
|
||||
%>
|
||||
|
||||
int nb_line_<%=cid %> = 0;
|
||||
<%if(!useExistingConn){%>
|
||||
org.talend.mdm.webservice.XtentisServiceLocator xtentisService_<%=cid %> = new org.talend.mdm.webservice.XtentisServiceLocator();
|
||||
@@ -70,22 +73,52 @@ if ((metadatas != null) && (metadatas.size() > 0)) {
|
||||
org.talend.mdm.webservice.XtentisPort_PortType xtentisWS_<%=cid %> = xtentisService_<%=cid %>.getXtentisPort();
|
||||
org.talend.mdm.webservice.XtentisBindingStub stub_<%=cid %> = (org.talend.mdm.webservice.XtentisBindingStub)xtentisWS_<%=cid %>;
|
||||
|
||||
// Authentification
|
||||
<%if(universe==null || ("").equals(universe.trim())){%>
|
||||
stub_<%=cid %>.setUsername(<%=username %>);
|
||||
<%}else{%>
|
||||
stub_<%=cid %>.setUsername(<%=universe%> + "/" + <%=username %>);
|
||||
<%}%>
|
||||
|
||||
<%
|
||||
String passwordFieldName = "__PASSWORD__";
|
||||
%>
|
||||
|
||||
<% String passwordFieldName = "__PASSWORD__"; %>
|
||||
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/password.javajet"%>
|
||||
|
||||
stub_<%=cid %>.setPassword(decryptedPassword_<%=cid%>);
|
||||
<%}else{%>
|
||||
org.talend.mdm.webservice.XtentisPort_PortType xtentisWS_<%=cid %> = (org.talend.mdm.webservice.XtentisPort_PortType)globalMap.get("<%=conn%>");
|
||||
org.talend.mdm.webservice.XtentisPort_PortType xtentisWS_<%=cid %> = (org.talend.mdm.webservice.XtentisPort_PortType)globalMap.get("<%=conn%>_" + Thread.currentThread().getThreadGroup().getName());
|
||||
if(xtentisWS_<%=cid %> == null) {
|
||||
String murl_<%=cid %> = (String)globalMap.get("mdmUrl_<%=connection %>");
|
||||
String username_<%=cid%> = (String)globalMap.get("username_<%=connection %>");
|
||||
String password_<%=cid%> = (String)globalMap.get("password_<%=connection %>");
|
||||
org.talend.mdm.webservice.XtentisServiceLocator xtentisService_<%=cid %> = new org.talend.mdm.webservice.XtentisServiceLocator();
|
||||
xtentisService_<%=cid %>.setXtentisPortEndpointAddress(murl_<%=cid %>);
|
||||
xtentisWS_<%=cid %> = xtentisService_<%=cid %>.getXtentisPort();
|
||||
org.talend.mdm.webservice.XtentisBindingStub stub_<%=cid %> = (org.talend.mdm.webservice.XtentisBindingStub)xtentisWS_<%=cid %>;
|
||||
stub_<%=cid %>.setUsername(username_<%=cid%>);
|
||||
stub_<%=cid %>.setPassword(password_<%=cid%>);
|
||||
if((Boolean)globalMap.get("useTransaction_<%=connection %>")) {
|
||||
String turl_<%=cid%> = com.talend.mdm.transaction.client.MDMTransactionClient.getMDMTransactionURL(murl_<%=cid %>);
|
||||
com.talend.mdm.transaction.client.MDMTransaction mdmTransaction_<%=cid%> = (com.talend.mdm.transaction.client.MDMTransaction)globalMap.get("<%=trans%>_" + Thread.currentThread().getThreadGroup().getName());
|
||||
if(mdmTransaction_<%=cid%> == null) {
|
||||
if((Boolean)globalMap.get("useClientTranId_<%=connection %>")) {
|
||||
String sessionID_<%=cid%> = com.talend.mdm.transaction.client.MDMTransactionClient.getSessionID(turl_<%=cid%>,username_<%=cid%>,password_<%=cid%>);
|
||||
mdmTransaction_<%=cid%> = new com.talend.mdm.transaction.client.MDMTransaction();
|
||||
mdmTransaction_<%=cid%>.setUrl(turl_<%=cid%>);
|
||||
mdmTransaction_<%=cid%>.setId("<%=cid%>_" + java.util.UUID.randomUUID());
|
||||
mdmTransaction_<%=cid%>.setUsername(username_<%=cid%>);
|
||||
mdmTransaction_<%=cid%>.setPassword(password_<%=cid%>);
|
||||
mdmTransaction_<%=cid%>.setSessionId(sessionID_<%=cid%>);
|
||||
} else {
|
||||
mdmTransaction_<%=cid%> = com.talend.mdm.transaction.client.MDMTransactionClient.newTransaction(turl_<%=cid%>,stub_<%=cid %>.getUsername(),stub_<%=cid %>.getPassword());
|
||||
}
|
||||
globalMap.put("<%=trans%>_" + Thread.currentThread().getThreadGroup().getName(), mdmTransaction_<%=cid %>);
|
||||
}
|
||||
stub_<%=cid %>.setHeader(new org.apache.axis.message.SOAPHeaderElement("http://www.talend.com/mdm", "transaction-id", mdmTransaction_<%=cid%>.getId()));
|
||||
stub_<%=cid %>._setProperty(org.apache.axis.client.Call.SESSION_MAINTAIN_PROPERTY, new Boolean(true));
|
||||
stub_<%=cid %>._setProperty(org.apache.axis.transport.http.HTTPConstants.HEADER_COOKIE, com.talend.mdm.transaction.client.MDMTransaction.getStickySession() + "=" + mdmTransaction_<%=cid%>.getSessionId());
|
||||
}
|
||||
stub_<%=cid %>.ping(new org.talend.mdm.webservice.WSPing());<%//For TDI-26109%>
|
||||
globalMap.put("<%=conn%>_" + Thread.currentThread().getThreadGroup().getName(), xtentisWS_<%=cid %>);
|
||||
}
|
||||
<%}%>
|
||||
|
||||
org.talend.mdm.webservice.WSDataClusterPK dataCluster_<%=cid %> = new org.talend.mdm.webservice.WSDataClusterPK(<%=dataCluster %> + "<%=isStaging?"#STAGING":""%>");
|
||||
@@ -152,7 +185,6 @@ if ((metadatas != null) && (metadatas.size() > 0)) {
|
||||
wsViewSearch_<%=cid%> = new org.talend.mdm.webservice.WSViewSearch();
|
||||
wsViewSearch_<%=cid%>.setWsDataClusterPK(dataCluster_<%=cid%>);
|
||||
wsViewSearch_<%=cid%>.setWsViewPK(new org.talend.mdm.webservice.WSViewPK(<%=viewName%>));
|
||||
|
||||
wsViewSearch_<%=cid%>.setSpellTreshold(<%=spellThrehold%>);
|
||||
wsViewSearch_<%=cid%>.setSkip(skip_<%=cid%> + retrievedCount_<%=cid%>);
|
||||
wsViewSearch_<%=cid%>.setMaxItems(readRecordsSize_<%=cid%>);
|
||||
|
||||
@@ -10,11 +10,12 @@ imports="
|
||||
java.util.List
|
||||
"
|
||||
%>
|
||||
|
||||
<%
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode)codeGenArgument.getArgument();
|
||||
String cid = node.getUniqueName();
|
||||
boolean useExistingConn = ("true").equals(ElementParameterParser.getValue(node,"__USE_EXISTING_CONNECTION__"));
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode)codeGenArgument.getArgument();
|
||||
String cid = node.getUniqueName();
|
||||
boolean useExistingConn = ("true").equals(ElementParameterParser.getValue(node,"__USE_EXISTING_CONNECTION__"));
|
||||
|
||||
List<IMetadataTable> metadatas = node.getMetadataList();
|
||||
if ((metadatas != null) && (metadatas.size() > 0)) {
|
||||
@@ -44,5 +45,3 @@ if ((metadatas != null) && (metadatas.size() > 0)) {
|
||||
}
|
||||
}
|
||||
%>
|
||||
|
||||
|
||||
@@ -9,35 +9,39 @@ imports="
|
||||
org.talend.core.model.utils.NodeUtil
|
||||
"
|
||||
%>
|
||||
|
||||
<%
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode)codeGenArgument.getArgument();
|
||||
String cid = node.getUniqueName();
|
||||
String virtualcid = cid;
|
||||
String destination = ElementParameterParser.getValue(node, "__DESTINATION__");
|
||||
if(destination!=null && !"".equals(destination)){
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode)codeGenArgument.getArgument();
|
||||
String cid = node.getUniqueName();
|
||||
String virtualcid = cid;
|
||||
String destination = ElementParameterParser.getValue(node, "__DESTINATION__");
|
||||
if(destination!=null && !"".equals(destination)){
|
||||
cid = destination;
|
||||
}
|
||||
}
|
||||
|
||||
boolean useExistingConn = ("true").equals(ElementParameterParser.getValue(node,"__USE_EXISTING_CONNECTION__"));
|
||||
String connection = ElementParameterParser.getValue(node,"__CONNECTION__");
|
||||
String conn = "xtentisWS_" + connection;
|
||||
String mdmUrl = ElementParameterParser.getValue(node, "__MDMURL__");
|
||||
String username = ElementParameterParser.getValue(node, "__USERNAME__");
|
||||
boolean useExistingConn = ("true").equals(ElementParameterParser.getValue(node,"__USE_EXISTING_CONNECTION__"));
|
||||
String connection = ElementParameterParser.getValue(node,"__CONNECTION__");
|
||||
String conn = "xtentisWS_" + connection;
|
||||
String trans = "mdmTrans_" + connection;
|
||||
String mdmUrl = ElementParameterParser.getValue(node, "__MDMURL__");
|
||||
String username = ElementParameterParser.getValue(node, "__USERNAME__");
|
||||
|
||||
String universe = ElementParameterParser.getValue(node, "__UNIVERSE__");
|
||||
String dataModule = ElementParameterParser.getValue(node, "__DATAMODEL__");
|
||||
String dataCluster = ElementParameterParser.getValue(node, "__DATACLUSTER__");
|
||||
boolean isStaging = "STAGING".equalsIgnoreCase(ElementParameterParser.getValue(node, "__CONTAINER_TYPE__"));
|
||||
String universe = ElementParameterParser.getValue(node, "__UNIVERSE__");
|
||||
String dataModule = ElementParameterParser.getValue(node, "__DATAMODEL__");
|
||||
String dataCluster = ElementParameterParser.getValue(node, "__DATACLUSTER__");
|
||||
boolean isStaging = "STAGING".equalsIgnoreCase(ElementParameterParser.getValue(node, "__CONTAINER_TYPE__"));
|
||||
boolean isProvisioning = "\"PROVISIONING\"".equalsIgnoreCase(dataCluster);
|
||||
|
||||
boolean withReport = ("true").equals(ElementParameterParser.getValue(node,"__WITHREPORT__"));
|
||||
boolean isMassInsert =("true").equals(ElementParameterParser.getValue(node,"__EXTENDINSERT__"));
|
||||
boolean withReport = ("true").equals(ElementParameterParser.getValue(node,"__WITHREPORT__"));
|
||||
boolean isMassInsert =("true").equals(ElementParameterParser.getValue(node,"__EXTENDINSERT__"));
|
||||
|
||||
boolean addTaskID = ("true").equals(ElementParameterParser.getValue(node,"__ADD_TASKID__"));
|
||||
boolean usePartialUpdate = ("true").equals(ElementParameterParser.getValue(node,"__USE_PARTIAL_UPDATE__"));
|
||||
boolean addTaskID = ("true").equals(ElementParameterParser.getValue(node,"__ADD_TASKID__"));
|
||||
boolean usePartialUpdate = ("true").equals(ElementParameterParser.getValue(node,"__USE_PARTIAL_UPDATE__"));
|
||||
|
||||
boolean storeFlow = ("true").equals(ElementParameterParser.getValue(node, "__STORE_FLOW__"));
|
||||
boolean storeFlow = ("true").equals(ElementParameterParser.getValue(node, "__STORE_FLOW__"));
|
||||
%>
|
||||
|
||||
int nb_line_<%=cid %> = 0;
|
||||
int nb_line_rejected_<%=cid%> = 0;
|
||||
<%if(!usePartialUpdate){%>
|
||||
@@ -89,15 +93,54 @@ int nb_line_rejected_<%=cid%> = 0;
|
||||
stub_<%=cid %>.setUsername(<%=universe%> + "/" + <%=username %>);
|
||||
<%}%>
|
||||
|
||||
<%
|
||||
String passwordFieldName = "__PASSWORD__";
|
||||
%>
|
||||
|
||||
<% String passwordFieldName = "__PASSWORD__"; %>
|
||||
<%@ include file="@{org.talend.designer.components.localprovider}/components/templates/password.javajet"%>
|
||||
|
||||
stub_<%=cid %>.setPassword(decryptedPassword_<%=cid%>);
|
||||
<%}else if(isProvisioning){%>
|
||||
String murl_<%=cid %> = (String)globalMap.get("mdmUrl_<%=connection %>");
|
||||
org.talend.mdm.webservice.XtentisServiceLocator xtentisService_<%=cid %> = new org.talend.mdm.webservice.XtentisServiceLocator();
|
||||
xtentisService_<%=cid %>.setXtentisPortEndpointAddress(murl_<%=cid %>);
|
||||
org.talend.mdm.webservice.XtentisPort_PortType xtentisWS_<%=cid %> = xtentisService_<%=cid %>.getXtentisPort();
|
||||
org.talend.mdm.webservice.XtentisBindingStub stub_<%=cid %> = (org.talend.mdm.webservice.XtentisBindingStub)xtentisWS_<%=cid %>;
|
||||
stub_<%=cid %>.setUsername((String)globalMap.get("username_<%=connection %>"));
|
||||
stub_<%=cid %>.setPassword((String)globalMap.get("password_<%=connection %>"));
|
||||
<%}else{%>
|
||||
org.talend.mdm.webservice.XtentisPort_PortType xtentisWS_<%=cid %> = (org.talend.mdm.webservice.XtentisPort_PortType)globalMap.get("<%=conn%>");
|
||||
org.talend.mdm.webservice.XtentisPort_PortType xtentisWS_<%=cid %> = (org.talend.mdm.webservice.XtentisPort_PortType)globalMap.get("<%=conn%>_" + Thread.currentThread().getThreadGroup().getName());
|
||||
if(xtentisWS_<%=cid %> == null) {
|
||||
String murl_<%=cid %> = (String)globalMap.get("mdmUrl_<%=connection %>");
|
||||
String username_<%=cid%> = (String)globalMap.get("username_<%=connection %>");
|
||||
String password_<%=cid%> = (String)globalMap.get("password_<%=connection %>");
|
||||
org.talend.mdm.webservice.XtentisServiceLocator xtentisService_<%=cid %> = new org.talend.mdm.webservice.XtentisServiceLocator();
|
||||
xtentisService_<%=cid %>.setXtentisPortEndpointAddress(murl_<%=cid %>);
|
||||
xtentisWS_<%=cid %> = xtentisService_<%=cid %>.getXtentisPort();
|
||||
org.talend.mdm.webservice.XtentisBindingStub stub_<%=cid %> = (org.talend.mdm.webservice.XtentisBindingStub)xtentisWS_<%=cid %>;
|
||||
stub_<%=cid %>.setUsername(username_<%=cid%>);
|
||||
stub_<%=cid %>.setPassword(password_<%=cid%>);
|
||||
if((Boolean)globalMap.get("useTransaction_<%=connection %>")) {
|
||||
String turl_<%=cid%> = com.talend.mdm.transaction.client.MDMTransactionClient.getMDMTransactionURL(murl_<%=cid %>);
|
||||
com.talend.mdm.transaction.client.MDMTransaction mdmTransaction_<%=cid%> = (com.talend.mdm.transaction.client.MDMTransaction)globalMap.get("<%=trans%>_" + Thread.currentThread().getThreadGroup().getName());
|
||||
if(mdmTransaction_<%=cid%> == null) {
|
||||
if((Boolean)globalMap.get("useClientTranId_<%=connection %>")) {
|
||||
String sessionID_<%=cid%> = com.talend.mdm.transaction.client.MDMTransactionClient.getSessionID(turl_<%=cid%>,username_<%=cid%>,password_<%=cid%>);
|
||||
mdmTransaction_<%=cid%> = new com.talend.mdm.transaction.client.MDMTransaction();
|
||||
mdmTransaction_<%=cid%>.setUrl(turl_<%=cid%>);
|
||||
mdmTransaction_<%=cid%>.setId("<%=cid%>_" + java.util.UUID.randomUUID());
|
||||
mdmTransaction_<%=cid%>.setUsername(username_<%=cid%>);
|
||||
mdmTransaction_<%=cid%>.setPassword(password_<%=cid%>);
|
||||
mdmTransaction_<%=cid%>.setSessionId(sessionID_<%=cid%>);
|
||||
} else {
|
||||
mdmTransaction_<%=cid%> = com.talend.mdm.transaction.client.MDMTransactionClient.newTransaction(turl_<%=cid%>,stub_<%=cid %>.getUsername(),stub_<%=cid %>.getPassword());
|
||||
}
|
||||
globalMap.put("<%=trans%>_" + Thread.currentThread().getThreadGroup().getName(), mdmTransaction_<%=cid %>);
|
||||
}
|
||||
stub_<%=cid %>.setHeader(new org.apache.axis.message.SOAPHeaderElement("http://www.talend.com/mdm", "transaction-id", mdmTransaction_<%=cid%>.getId()));
|
||||
stub_<%=cid %>._setProperty(org.apache.axis.client.Call.SESSION_MAINTAIN_PROPERTY, new Boolean(true));
|
||||
stub_<%=cid %>._setProperty(org.apache.axis.transport.http.HTTPConstants.HEADER_COOKIE, com.talend.mdm.transaction.client.MDMTransaction.getStickySession() + "=" + mdmTransaction_<%=cid%>.getSessionId());
|
||||
}
|
||||
stub_<%=cid %>.ping(new org.talend.mdm.webservice.WSPing());<%//For TDI-26109%>
|
||||
globalMap.put("<%=conn%>_" + Thread.currentThread().getThreadGroup().getName(), xtentisWS_<%=cid %>);
|
||||
}
|
||||
<%}%>
|
||||
|
||||
org.talend.mdm.webservice.WSDataClusterPK dataCluster_<%=cid %> = new org.talend.mdm.webservice.WSDataClusterPK(<%=dataCluster %> + "<%=isStaging?"#STAGING":""%>");
|
||||
@@ -117,7 +160,7 @@ if(startNode != null){
|
||||
startNodeCid = startNode.getUniqueName();
|
||||
}
|
||||
IConnection nextMergeConn = NodeUtil.getNextMergeConnection(node);
|
||||
if(nextMergeConn != null && nextMergeConn.getInputId()>1 && startNodeCid != null){
|
||||
if(nextMergeConn != null && nextMergeConn.getInputId()>1 && startNodeCid != null) {
|
||||
%>
|
||||
java.util.Queue<String> queue_<%=cid%> = new java.util.concurrent.ConcurrentLinkedQueue<String>();
|
||||
<%
|
||||
|
||||
@@ -9,26 +9,24 @@ imports="
|
||||
org.talend.core.model.utils.NodeUtil
|
||||
"
|
||||
%>
|
||||
|
||||
<%
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode)codeGenArgument.getArgument();
|
||||
String cid = node.getUniqueName();
|
||||
String virtualcid = cid;
|
||||
String destination = ElementParameterParser.getValue(node, "__DESTINATION__");
|
||||
if(destination!=null && !"".equals(destination)){
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode)codeGenArgument.getArgument();
|
||||
String cid = node.getUniqueName();
|
||||
String virtualcid = cid;
|
||||
String destination = ElementParameterParser.getValue(node, "__DESTINATION__");
|
||||
if(destination!=null && !"".equals(destination)){
|
||||
cid = destination;
|
||||
}
|
||||
}
|
||||
|
||||
boolean isStaging = "STAGING".equalsIgnoreCase(ElementParameterParser.getValue(node, "__CONTAINER_TYPE__"));
|
||||
|
||||
boolean useExistingConn = ("true").equals(ElementParameterParser.getValue(node,"__USE_EXISTING_CONNECTION__"));
|
||||
|
||||
boolean isMassInsert =("true").equals(ElementParameterParser.getValue(node,"__EXTENDINSERT__"));
|
||||
boolean withReport = ("true").equals(ElementParameterParser.getValue(node,"__WITHREPORT__"));
|
||||
|
||||
boolean addTaskID = ("true").equals(ElementParameterParser.getValue(node,"__ADD_TASKID__"));
|
||||
String taskID = ElementParameterParser.getValue(node,"__TASKID__");
|
||||
boolean usePartialUpdate = ("true").equals(ElementParameterParser.getValue(node,"__USE_PARTIAL_UPDATE__"));
|
||||
boolean isStaging = "STAGING".equalsIgnoreCase(ElementParameterParser.getValue(node, "__CONTAINER_TYPE__"));
|
||||
boolean useExistingConn = ("true").equals(ElementParameterParser.getValue(node,"__USE_EXISTING_CONNECTION__"));
|
||||
boolean isMassInsert =("true").equals(ElementParameterParser.getValue(node,"__EXTENDINSERT__"));
|
||||
boolean withReport = ("true").equals(ElementParameterParser.getValue(node,"__WITHREPORT__"));
|
||||
boolean addTaskID = ("true").equals(ElementParameterParser.getValue(node,"__ADD_TASKID__"));
|
||||
String taskID = ElementParameterParser.getValue(node,"__TASKID__");
|
||||
boolean usePartialUpdate = ("true").equals(ElementParameterParser.getValue(node,"__USE_PARTIAL_UPDATE__"));
|
||||
%>
|
||||
}
|
||||
}
|
||||
@@ -93,10 +91,10 @@ if(!usePartialUpdate){
|
||||
}
|
||||
}
|
||||
}%>
|
||||
<%if(!useExistingConn){%>
|
||||
|
||||
<%if(!useExistingConn){%>
|
||||
stub_<%=cid %>.logout(new org.talend.mdm.webservice.WSLogout());
|
||||
<%}%>
|
||||
|
||||
globalMap.put("<%=cid %>_NB_LINE",nb_line_<%=cid %>);
|
||||
globalMap.put("<%=cid %>_NB_LINE_REJECTED",nb_line_rejected_<%=cid%>);
|
||||
<%}%>
|
||||
|
||||
globalMap.put("<%=cid %>_NB_LINE",nb_line_<%=cid %>);
|
||||
globalMap.put("<%=cid %>_NB_LINE_REJECTED",nb_line_rejected_<%=cid%>);
|
||||
@@ -1,5 +1,5 @@
|
||||
<%@ jet
|
||||
imports="
|
||||
imports="
|
||||
org.talend.core.model.process.INode
|
||||
org.talend.core.model.process.ElementParameterParser
|
||||
org.talend.core.model.metadata.IMetadataTable
|
||||
@@ -13,6 +13,7 @@
|
||||
java.util.Map
|
||||
"
|
||||
%>
|
||||
|
||||
<%
|
||||
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
|
||||
INode node = (INode)codeGenArgument.getArgument();
|
||||
@@ -71,8 +72,6 @@ if (metadatas != null && metadatas.size()>0) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
String outConnName = null;
|
||||
List<? extends IConnection> outgoingConns = node.getOutgoingSortedConnections();
|
||||
List<IMetadataColumn> outputColumnList = null;
|
||||
@@ -159,7 +158,15 @@ if (metadatas != null && metadatas.size()>0) {
|
||||
|
||||
try {
|
||||
<%if(usePartialUpdate){ // partial%>
|
||||
org.talend.mdm.webservice.WSPartialPutItem wsPartialPutItem_<%=cid%> = new org.talend.mdm.webservice.WSPartialPutItem(input_<%=cid %>,<%=dataCluster %>,<%=pivot%>,<%=dataModule %>,<%=key.equals("")?null:key%>,<%=position.equals("")?null:position%>,<%=overwrite%>,<%= true==isStaging?false:withReport%>);
|
||||
<%
|
||||
String stagingString = "";
|
||||
if(isStaging){
|
||||
stagingString = dataCluster + " + \"#STAGING\"";
|
||||
} else {
|
||||
stagingString = dataCluster;
|
||||
}
|
||||
%>
|
||||
org.talend.mdm.webservice.WSPartialPutItem wsPartialPutItem_<%=cid%> = new org.talend.mdm.webservice.WSPartialPutItem(input_<%=cid %>,<%=stagingString %>,<%=pivot%>,<%=dataModule %>,<%=key.equals("")?null:key%>,<%=position.equals("")?null:position%>,<%=overwrite%>,<%= true==isStaging?false:withReport%>, <%=sourceName %>);
|
||||
wspk_<%=cid %> = xtentisWS_<%=cid %>.partialPutItem(wsPartialPutItem_<%=cid%>);
|
||||
|
||||
<%
|
||||
@@ -248,6 +255,9 @@ if (metadatas != null && metadatas.size()>0) {
|
||||
%>
|
||||
<%}//end partial%>
|
||||
} catch (java.lang.Exception e) {
|
||||
<%if (!usePartialUpdate && isMassInsert) {%>
|
||||
miList_<%=cid %>.clear();
|
||||
<%}%>
|
||||
<%if (dieOnError) {%>
|
||||
throw(e);
|
||||
<%} else {
|
||||
|
||||
@@ -642,13 +642,6 @@
|
||||
uripath="platform:/plugin/org.talend.libraries.hadoop.hdp.2.0/lib/datanucleus-rdbms-3.2.1.jar">
|
||||
</libraryNeeded>
|
||||
|
||||
<libraryNeeded
|
||||
context="plugin:org.talend.libraries.jdbc.h2"
|
||||
id="h2-1.3.160.jar"
|
||||
name="h2-1.3.160.jar"
|
||||
uripath="platform:/plugin/org.talend.libraries.jdbc.h2/lib/h2-1.3.160.jar">
|
||||
</libraryNeeded>
|
||||
|
||||
<libraryNeeded
|
||||
context="plugin:org.talend.libraries.jdbc.derby"
|
||||
id="derby-10.4.2.0.jar"
|
||||
|
||||
@@ -464,6 +464,7 @@ Node.onlyOneDynamicPerSchema=There should be only one Dynamic type in one schema
|
||||
Node.output=outputs\:(
|
||||
Node.outputNeedInputLink=If this component has output, there must be an input link to propagate the data.
|
||||
Node.parameterEmpty=Parameter ({0}) is empty but is required.
|
||||
Node.parameterWrong=The value of Parameter ({0}) is not exist.
|
||||
Node.parameterNotExist=Parameter ({0}) has a value ({1}) that doesn't exist anymore.
|
||||
Node.PatterErrorMessage=A value must be set for Date Pattern
|
||||
Node.QueryLosed=XPath query lost
|
||||
@@ -711,6 +712,8 @@ PerformancePreferencePage.RepositoryPreferencePage.RefreshCreated=Refresh when c
|
||||
PerformancePreferencePage.RepositoryPreferencePage.ReferenceProjectMerged=Merge the reference project
|
||||
PerformancePreferencePage.RepositoryPreferencePage.RefreshManually=Refresh Manually
|
||||
PerformancePreferencePage.RepositoryPreferencePage.RefreshSaved=Refresh when saving an item
|
||||
PerformancePreferencePage.autoCheckField=Auto check of svn to detect the update
|
||||
PerformancePreferencePage.autoCheckTime=Detect update in each (seconds)
|
||||
|
||||
CamelPerformancePreferencePage.display.deactiveRepositoryUpdate=Deactivate auto detect/update after a modification in the repository
|
||||
CamelPerformancePreferencePage.propertyCodeCheck=Check the property fields when generating code (disable will make the components properties faster)
|
||||
|
||||
@@ -47,6 +47,7 @@ import org.talend.core.model.process.AbstractNode;
|
||||
import org.talend.core.model.process.EComponentCategory;
|
||||
import org.talend.core.model.process.EConnectionType;
|
||||
import org.talend.core.model.process.EParameterFieldType;
|
||||
import org.talend.core.model.process.ElementParameterParser;
|
||||
import org.talend.core.model.process.IConnection;
|
||||
import org.talend.core.model.process.IConnectionCategory;
|
||||
import org.talend.core.model.process.IElement;
|
||||
@@ -880,7 +881,9 @@ public class DataProcess implements IGeneratingProcess {
|
||||
}
|
||||
|
||||
// propagate metadataLists for output component. only apply to multi-input virtual component
|
||||
if (multipleComponentManager.isSetConnector() && multipleComponentManager.getOutputName().equals(curItem.getName())) {
|
||||
boolean isSAPBapi = graphicalNode.getComponent() != null && "tSAPBapi".equals(graphicalNode.getComponent().getName());//$NON-NLS-1$
|
||||
if (multipleComponentManager.isSetConnector()
|
||||
&& (multipleComponentManager.getOutputName().equals(curItem.getName()) || isSAPBapi)) {
|
||||
// deactivate dummy component
|
||||
if (curNode.getComponentName().equals("tDummyRow")) {// or use //$NON-NLS-1$
|
||||
// "!multipleComponentManager.existsLinkTo()"
|
||||
@@ -1772,6 +1775,19 @@ public class DataProcess implements IGeneratingProcess {
|
||||
dataNodeList.add(0, preStaLogConNode);
|
||||
}
|
||||
|
||||
// tag all the components after Iterator(Parallel)
|
||||
// !iterator with parallel shouldn't work on merge!
|
||||
for (INode node : dataNodeList) {
|
||||
if (node.isSubProcessStart() && node.isActivate()) {
|
||||
tagComponentAfterParallelIterator(node);
|
||||
}
|
||||
}
|
||||
for (INode node : dataNodeList) {
|
||||
if (node.isSubProcessStart() && node.isActivate()) {
|
||||
tagSubProcessAfterParallelIterator(node);
|
||||
}
|
||||
}
|
||||
|
||||
checkRefList = null;
|
||||
checkMultipleMap = null;
|
||||
checktUniteMap = null;
|
||||
@@ -1783,6 +1799,50 @@ public class DataProcess implements IGeneratingProcess {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* DOC bchen Comment method "tagSubProcessAfterParallelIterator".
|
||||
*
|
||||
* @param node
|
||||
*/
|
||||
private void tagSubProcessAfterParallelIterator(INode node) {
|
||||
if (node.getIncomingConnections() != null && node.getIncomingConnections().size() != 0) {
|
||||
IConnection connection = node.getIncomingConnections().get(0);
|
||||
if (connection.getLineStyle().equals(EConnectionType.ON_COMPONENT_OK)
|
||||
|| connection.getLineStyle().equals(EConnectionType.ON_COMPONENT_ERROR)
|
||||
|| connection.getLineStyle().equals(EConnectionType.ON_SUBJOB_OK)
|
||||
|| connection.getLineStyle().equals(EConnectionType.ON_SUBJOB_ERROR)
|
||||
|| connection.getLineStyle().equals(EConnectionType.RUN_IF)) {// add if you think it should be count
|
||||
// for parallel Iterator
|
||||
if (((AbstractNode) connection.getSource()).getParallelIterator() != null) {
|
||||
((AbstractNode) node).setParallelIterator(((AbstractNode) connection.getSource()).getParallelIterator());
|
||||
tagComponentAfterParallelIterator(node);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* DOC bchen Comment method "tagComponentAfterParallelIterator".
|
||||
*
|
||||
* @param node
|
||||
*/
|
||||
private void tagComponentAfterParallelIterator(INode node) {
|
||||
for (IConnection connection : node.getOutgoingSortedConnections()) {
|
||||
if (connection.getTarget().isActivate()) {
|
||||
|
||||
if (connection.getLineStyle().hasConnectionCategory(IConnectionCategory.MAIN | IConnectionCategory.USE_ITERATE)) {
|
||||
if (((AbstractNode) node).getParallelIterator() != null) {
|
||||
((AbstractNode) connection.getTarget()).setParallelIterator(((AbstractNode) node).getParallelIterator());
|
||||
} else if (connection.getLineStyle().equals(EConnectionType.ITERATE)
|
||||
&& Boolean.TRUE.toString().equals(ElementParameterParser.getValue(connection, "__ENABLE_PARALLEL__"))) {
|
||||
((AbstractNode) connection.getTarget()).setParallelIterator(connection.getTarget().getUniqueName());
|
||||
}
|
||||
tagComponentAfterParallelIterator(connection.getTarget());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void checkPigLoadComponent() {
|
||||
// if (PluginChecker.isPigudfPluginLoaded()) {
|
||||
// for (INode dataNode : dataNodeList) {
|
||||
@@ -2546,7 +2606,8 @@ public class DataProcess implements IGeneratingProcess {
|
||||
}
|
||||
}
|
||||
for (IConnection connection : node.getOutgoingConnections()) {
|
||||
if(connection.getLineStyle() == EConnectionType.ON_SUBJOB_OK || connection.getLineStyle() == EConnectionType.ON_SUBJOB_ERROR) {
|
||||
if (connection.getLineStyle() == EConnectionType.ON_SUBJOB_OK
|
||||
|| connection.getLineStyle() == EConnectionType.ON_SUBJOB_ERROR) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -641,7 +641,7 @@ public class JobSettingsManager {
|
||||
final String schemaCondition = JobSettingsConstants
|
||||
.addBrackets(dbTypeName
|
||||
+ " =='OCLE' or " + dbTypeName //$NON-NLS-1$
|
||||
+ " =='POSTGRESQL' or " + dbTypeName + " =='POSTGRESPLUS' or " + dbTypeName + " =='OCLE_OCI' or " + dbTypeName + " =='MSSQL' or " + dbTypeName + " =='INFORMIX' or " + dbTypeName + " =='IBM_DB2' or " + dbTypeName + " =='SYBASE'"); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$//$NON-NLS-4$//$NON-NLS-5$
|
||||
+ " =='POSTGRESQL' or " + dbTypeName + " =='POSTGRESPLUS' or " + dbTypeName + " =='OCLE_OCI' or " + dbTypeName + " =='MSSQL' or " + dbTypeName + " =='INFORMIX' or " + dbTypeName + " =='IBM_DB2' or " + dbTypeName + " =='SYBASE'"); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$//$NON-NLS-4$//$NON-NLS-5$//$NON-NLS-6$//$NON-NLS-7$
|
||||
param.setShowIf(schemaCondition + " and " + dbCondition); //$NON-NLS-1$
|
||||
param.setGroup(IMPLICIT_GROUP);
|
||||
paramList.add(param);
|
||||
|
||||
@@ -337,7 +337,7 @@ public abstract class AbstractMultiPageTalendEditor extends MultiPageEditorPart
|
||||
return;
|
||||
}
|
||||
Property property = processEditorInput.getItem().getProperty();
|
||||
if (!CollectionUtils.isEqualCollection(propertyInformation, property.getInformations())) {
|
||||
if (propertyInformation != null && !CollectionUtils.isEqualCollection(propertyInformation, property.getInformations())) {
|
||||
Problems.computePropertyMaxInformationLevel(property, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,7 +88,6 @@ public class ActiveProcessTracker implements IPartListener {
|
||||
if (testedPart instanceof AbstractMultiPageTalendEditor) {
|
||||
AbstractMultiPageTalendEditor mpte = (AbstractMultiPageTalendEditor) testedPart;
|
||||
mpte.setName();
|
||||
Contexts.setTitle(mpte.getTitle());
|
||||
IProcess2 process = mpte.getTalendEditor().getProcess();
|
||||
return process;
|
||||
} else {
|
||||
@@ -127,6 +126,7 @@ public class ActiveProcessTracker implements IPartListener {
|
||||
if (process != null && currentProcess != process) {
|
||||
changedProcess = true;
|
||||
currentProcess = process;
|
||||
Contexts.setTitle(process.getLabel());
|
||||
setContextsView(process);
|
||||
// setStatsAndLogsView(process);
|
||||
JobSettings.switchToCurJobSettingsView();
|
||||
|
||||
@@ -16,9 +16,15 @@ import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.core.resources.IResource;
|
||||
import org.eclipse.core.resources.IWorkspace;
|
||||
import org.eclipse.core.resources.IWorkspaceRunnable;
|
||||
import org.eclipse.core.resources.IncrementalProjectBuilder;
|
||||
import org.eclipse.core.resources.ResourcesPlugin;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.core.runtime.IStatus;
|
||||
import org.eclipse.core.runtime.Status;
|
||||
import org.eclipse.core.runtime.jobs.ISchedulingRule;
|
||||
import org.eclipse.emf.common.notify.Notification;
|
||||
import org.eclipse.emf.common.notify.impl.AdapterImpl;
|
||||
import org.eclipse.emf.common.util.EList;
|
||||
@@ -51,16 +57,19 @@ import org.talend.commons.ui.runtime.image.ImageProvider;
|
||||
import org.talend.commons.utils.VersionUtils;
|
||||
import org.talend.core.CorePlugin;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.model.general.Project;
|
||||
import org.talend.core.model.properties.ByteArray;
|
||||
import org.talend.core.model.properties.FileItem;
|
||||
import org.talend.core.model.properties.Information;
|
||||
import org.talend.core.model.properties.Item;
|
||||
import org.talend.core.model.properties.Property;
|
||||
import org.talend.core.model.properties.RoutineItem;
|
||||
import org.talend.core.model.repository.ERepositoryObjectType;
|
||||
import org.talend.core.model.repository.Folder;
|
||||
import org.talend.core.model.repository.IRepositoryViewObject;
|
||||
import org.talend.core.model.utils.RepositoryManagerHelper;
|
||||
import org.talend.core.repository.model.ProxyRepositoryFactory;
|
||||
import org.talend.core.runtime.CoreRuntimePlugin;
|
||||
import org.talend.core.ui.ILastVersionChecker;
|
||||
import org.talend.core.ui.IUIRefresher;
|
||||
import org.talend.core.ui.branding.IBrandingService;
|
||||
@@ -70,6 +79,7 @@ import org.talend.designer.core.ui.action.SaveAsRoutineAction;
|
||||
import org.talend.designer.core.ui.action.SaveAsSQLPatternAction;
|
||||
import org.talend.designer.core.ui.views.problems.Problems;
|
||||
import org.talend.designer.core.utils.DesignerColorUtils;
|
||||
import org.talend.repository.ProjectManager;
|
||||
import org.talend.repository.RepositoryWorkUnit;
|
||||
import org.talend.repository.editor.RepositoryEditorInput;
|
||||
import org.talend.repository.model.ERepositoryStatus;
|
||||
@@ -280,6 +290,27 @@ public class StandAloneTalendJavaEditor extends CompilationUnitEditor implements
|
||||
|
||||
}
|
||||
|
||||
public void resetItem() throws PersistenceException {
|
||||
if (item.getProperty().eResource() == null || item.eResource() == null) {
|
||||
IRepositoryService service = CoreRuntimePlugin.getInstance().getRepositoryService();
|
||||
IProxyRepositoryFactory factory = service.getProxyRepositoryFactory();
|
||||
//
|
||||
// Property updated = factory.getUptodateProperty(getItem().getProperty());
|
||||
Property updatedProperty = null;
|
||||
try {
|
||||
factory.initialize();
|
||||
IRepositoryViewObject repositoryViewObject = factory.getLastVersion(new Project(ProjectManager.getInstance()
|
||||
.getProject(item.getProperty().getItem())), item.getProperty().getId());
|
||||
if (repositoryViewObject != null) {
|
||||
updatedProperty = repositoryViewObject.getProperty();
|
||||
item = (FileItem) updatedProperty.getItem();
|
||||
}
|
||||
} catch (PersistenceException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doSave(final IProgressMonitor monitor) {
|
||||
IRepositoryService service = CorePlugin.getDefault().getRepositoryService();
|
||||
@@ -306,6 +337,7 @@ public class StandAloneTalendJavaEditor extends CompilationUnitEditor implements
|
||||
super.doSave(monitor);
|
||||
|
||||
try {
|
||||
resetItem();
|
||||
ByteArray byteArray = item.getContent();
|
||||
byteArray.setInnerContentFromFile(((FileEditorInput) getEditorInput()).getFile());
|
||||
try {
|
||||
@@ -324,7 +356,10 @@ public class StandAloneTalendJavaEditor extends CompilationUnitEditor implements
|
||||
refreshJobAndSave(repFactory);
|
||||
}
|
||||
};
|
||||
repositoryWorkUnit.setAvoidSvnUpdate(true);
|
||||
repositoryWorkUnit.setAvoidUnloadResources(true);
|
||||
repFactory.executeRepositoryWorkUnit(repositoryWorkUnit);
|
||||
repositoryWorkUnit.throwPersistenceExceptionIfAny();
|
||||
|
||||
// for bug 11930: Unable to save Routines.* in db project
|
||||
|
||||
@@ -338,13 +373,47 @@ public class StandAloneTalendJavaEditor extends CompilationUnitEditor implements
|
||||
|
||||
}
|
||||
|
||||
private void refreshJobAndSave(final IProxyRepositoryFactory repFactory) {
|
||||
private void refreshJobAndSave(final IProxyRepositoryFactory repFactory) throws PersistenceException {
|
||||
|
||||
final IWorkspaceRunnable op = new IWorkspaceRunnable() {
|
||||
|
||||
@Override
|
||||
public void run(IProgressMonitor monitor) throws CoreException {
|
||||
try {
|
||||
// cause it to update MaxInformationLevel
|
||||
repFactory.save(item);
|
||||
} catch (Exception e) {
|
||||
} catch (PersistenceException e) {
|
||||
throw new CoreException(new Status(IStatus.ERROR, DesignerPlugin.ID, "Save Routine failed!", e));
|
||||
}
|
||||
// update editor image
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
IRunnableWithProgress iRunnableWithProgress = new IRunnableWithProgress() {
|
||||
|
||||
@Override
|
||||
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
|
||||
IWorkspace workspace = ResourcesPlugin.getWorkspace();
|
||||
try {
|
||||
ISchedulingRule schedulingRule = workspace.getRoot();
|
||||
// the update the project files need to be done in the workspace runnable to avoid all
|
||||
// notification
|
||||
// of changes before the end of the modifications.
|
||||
workspace.run(op, schedulingRule, IWorkspace.AVOID_UPDATE, monitor);
|
||||
} catch (CoreException e) {
|
||||
throw new InvocationTargetException(e);
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
try {
|
||||
PlatformUI.getWorkbench().getProgressService().run(false, false, iRunnableWithProgress);
|
||||
} catch (InvocationTargetException e) {
|
||||
throw new PersistenceException(e);
|
||||
} catch (InterruptedException e) {
|
||||
throw new PersistenceException(e);
|
||||
}
|
||||
|
||||
setTitleImage(getTitleImage());
|
||||
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ import org.eclipse.ui.PlatformUI;
|
||||
import org.talend.core.model.components.EComponentType;
|
||||
import org.talend.core.model.process.IElementParameter;
|
||||
import org.talend.core.model.process.IGraphicalNode;
|
||||
import org.talend.core.model.process.INode;
|
||||
import org.talend.core.model.update.IUpdateItemType;
|
||||
import org.talend.core.model.update.UpdateManagerHelper;
|
||||
import org.talend.core.model.update.extension.UpdateManagerProviderDetector;
|
||||
@@ -27,6 +28,7 @@ import org.talend.designer.core.i18n.Messages;
|
||||
import org.talend.designer.core.model.components.EParameterName;
|
||||
import org.talend.designer.core.model.process.AbstractProcessProvider;
|
||||
import org.talend.designer.core.ui.editor.nodecontainer.NodeContainer;
|
||||
import org.talend.designer.core.ui.editor.nodes.Node;
|
||||
import org.talend.designer.core.ui.editor.process.Process;
|
||||
import org.talend.designer.core.ui.views.problems.Problems;
|
||||
|
||||
@@ -93,6 +95,7 @@ public class CreateNodeContainerCommand extends CreateCommand {
|
||||
process.checkStartNodes();
|
||||
|
||||
nodeContainer.getNode().checkAndRefreshNode();
|
||||
refreshRelatedNodes();
|
||||
// update joblet context.
|
||||
// AbstractProcessProvider provider =
|
||||
// AbstractProcessProvider.findProcessProviderFromPID(nodeContainer.getNode()
|
||||
@@ -117,6 +120,21 @@ public class CreateNodeContainerCommand extends CreateCommand {
|
||||
}
|
||||
}
|
||||
|
||||
private void refreshRelatedNodes() {
|
||||
Node node = nodeContainer.getNode();
|
||||
for (INode inode : this.process.getGraphicalNodes()) {
|
||||
if (inode.getUniqueName().equals(node.getUniqueName())) {
|
||||
continue;
|
||||
}
|
||||
if (inode.getElementParameter("CONNECTION") != null) {
|
||||
IElementParameter para = inode.getElementParameter("CONNECTION");
|
||||
if (para.getFilter() != null && para.getFilter().equals(node.getComponent().getName())) {
|
||||
((Node) inode).checkAndRefreshNode();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void undo() {
|
||||
this.process.removeNodeContainer(this.nodeContainer);
|
||||
|
||||
@@ -477,13 +477,17 @@ public class NodesPasteCommand extends Command {
|
||||
Map<String, Object> newMap = new HashMap<String, Object>();
|
||||
newMap.putAll(map);
|
||||
// rename schemas
|
||||
if (EParameterName.SCHEMAS.name().equals(param.getName()) && !oldMetaToNewMeta.isEmpty()) {
|
||||
if (!oldMetaToNewMeta.isEmpty()) {
|
||||
boolean isSAPBapiInputSchema = "MAPPING_INPUT".equals(param.getName()) //$NON-NLS-1$
|
||||
&& "tSAPBapi".equals(copiedNode.getComponent().getName()); //$NON-NLS-1$
|
||||
if (EParameterName.SCHEMAS.name().equals(param.getName()) || isSAPBapiInputSchema) {
|
||||
String newSchemaName = oldMetaToNewMeta.get(pastedNode.getUniqueName() + ":"
|
||||
+ map.get(EParameterName.SCHEMA.getName()));
|
||||
if (newSchemaName != null) {
|
||||
newMap.put(EParameterName.SCHEMA.getName(), newSchemaName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
newValues.add(newMap);
|
||||
}
|
||||
|
||||
@@ -245,7 +245,7 @@ public class JobletUtil {
|
||||
}
|
||||
|
||||
nodePart.setModel(cloneNode);
|
||||
cloneNode.setLabel(node.getLabel());
|
||||
|
||||
// if (lock == null) {
|
||||
// cloneNode.setReadOnly(true);
|
||||
// } else {
|
||||
@@ -380,7 +380,8 @@ public class JobletUtil {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cloneNode.setLabel(node.getLabel());
|
||||
cloneNode.setPropertyValue(EParameterName.LABEL.getName(), node.getLabel());
|
||||
return cloneNode;
|
||||
}
|
||||
|
||||
|
||||
@@ -65,6 +65,7 @@ import org.talend.core.model.process.Element;
|
||||
import org.talend.core.model.process.ElementParameterParser;
|
||||
import org.talend.core.model.process.IConnection;
|
||||
import org.talend.core.model.process.IConnectionCategory;
|
||||
import org.talend.core.model.process.IElement;
|
||||
import org.talend.core.model.process.IElementParameter;
|
||||
import org.talend.core.model.process.IExternalData;
|
||||
import org.talend.core.model.process.IExternalNode;
|
||||
@@ -102,6 +103,7 @@ import org.talend.designer.core.ui.ActiveProcessTracker;
|
||||
import org.talend.designer.core.ui.editor.AbstractTalendEditor;
|
||||
import org.talend.designer.core.ui.editor.cmd.ChangeMetadataCommand;
|
||||
import org.talend.designer.core.ui.editor.cmd.ConnectionCreateCommand;
|
||||
import org.talend.designer.core.ui.editor.cmd.PropertyChangeCommand;
|
||||
import org.talend.designer.core.ui.editor.connections.Connection;
|
||||
import org.talend.designer.core.ui.editor.jobletcontainer.JobletContainer;
|
||||
import org.talend.designer.core.ui.editor.nodecontainer.NodeContainer;
|
||||
@@ -2716,6 +2718,44 @@ public class Node extends Element implements IGraphicalNode {
|
||||
}
|
||||
}
|
||||
break;
|
||||
case COMPONENT_LIST:
|
||||
if (param != null) {
|
||||
String errorMessage = Messages.getString("Node.parameterEmpty", param.getDisplayName()); //$NON-NLS-1$
|
||||
if (isUseExistedConnetion(this)) {
|
||||
List<INode> list = (List<INode>) this.getProcess().getNodesOfType(param.getFilter());
|
||||
if (list == null || list.size() == 0 || list.isEmpty()) {
|
||||
Problems.add(ProblemStatus.ERROR, this, errorMessage);
|
||||
} else {
|
||||
List<INode> nodeList = new ArrayList<INode>();
|
||||
for (INode datanode : list) {
|
||||
if (!datanode.isVirtualGenerateNode()) {
|
||||
nodeList.add(datanode);
|
||||
}
|
||||
}
|
||||
if (nodeList.size() == 0 || nodeList.isEmpty()) {
|
||||
Problems.add(ProblemStatus.ERROR, this, errorMessage);
|
||||
break;
|
||||
}
|
||||
boolean foundValue = false;
|
||||
for (INode datanode : nodeList) {
|
||||
if (datanode.getUniqueName().equals(param.getValue())) {
|
||||
foundValue = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
errorMessage = Messages.getString("Node.parameterWrong", param.getDisplayName()); //$NON-NLS-1$
|
||||
if (!foundValue) {
|
||||
Problems.add(ProblemStatus.ERROR, this, errorMessage);
|
||||
PropertyChangeCommand changeCommand = new PropertyChangeCommand(this, param.getName(),
|
||||
nodeList.get(0).getUniqueName());
|
||||
if (this.getCommandStack() != null) {
|
||||
this.getCommandStack().execute(changeCommand);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (param.getValue() != null && !(param.getValue() instanceof String)) {
|
||||
break;
|
||||
@@ -2765,6 +2805,19 @@ public class Node extends Element implements IGraphicalNode {
|
||||
|
||||
}
|
||||
|
||||
public boolean isUseExistedConnetion(IElement currentElem) {
|
||||
IElementParameter param = currentElem.getElementParameter("USE_EXISTING_CONNECTION"); //$NON-NLS-1$
|
||||
if (param != null) {
|
||||
Object value = param.getValue();
|
||||
if (value instanceof Boolean) {
|
||||
return (Boolean) value;
|
||||
} else if (value instanceof String) {
|
||||
return Boolean.parseBoolean((String) value);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private List<String> getColumnLabels(IMetadataTable metadataTable) {
|
||||
List<String> columnLabels = new ArrayList<String>();
|
||||
if (metadataTable == null) {
|
||||
|
||||
@@ -151,6 +151,7 @@ import org.talend.designer.core.ui.editor.nodecontainer.NodeContainer;
|
||||
import org.talend.designer.core.ui.editor.nodes.Node;
|
||||
import org.talend.designer.core.ui.editor.notes.Note;
|
||||
import org.talend.designer.core.ui.editor.properties.controllers.ColumnListController;
|
||||
import org.talend.designer.core.ui.editor.properties.controllers.ComponentListController;
|
||||
import org.talend.designer.core.ui.editor.properties.controllers.ConnectionListController;
|
||||
import org.talend.designer.core.ui.editor.subjobcontainer.SubjobContainer;
|
||||
import org.talend.designer.core.ui.preferences.TalendDesignerPrefConstants;
|
||||
@@ -182,6 +183,11 @@ import org.talend.repository.ui.utils.Log4jPrefsSettingManager;
|
||||
*/
|
||||
public class Process extends Element implements IProcess2, IGEFProcess, ILastVersionChecker {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final String PROCESS_SCREENSHOT_KEY = "process"; //$NON-NLS-1$
|
||||
|
||||
protected List<INode> nodes = new ArrayList<INode>();
|
||||
|
||||
protected List<Element> elem = new ArrayList<Element>();
|
||||
@@ -1364,7 +1370,22 @@ public class Process extends Element implements IProcess2, IGEFProcess, ILastVer
|
||||
*/
|
||||
processType.setDefaultContext(contextManager.getDefaultContext().getName());
|
||||
if (getScreenshot() != null) {
|
||||
processType.getScreenshots().put("process", getScreenshot());
|
||||
processType.getScreenshots().put(PROCESS_SCREENSHOT_KEY, getScreenshot());
|
||||
// fix a bug (TUP-2278) of synch between inner process item and newly created process item during save, this
|
||||
// is very dirty but inherent to the current archi.
|
||||
// copy all the screenshot items appart from the "process" one that is already handled here.
|
||||
if (property != null && (property.getItem() != null) && (property.getItem() instanceof ProcessItem)) {
|
||||
ProcessItem pi = (ProcessItem) property.getItem();
|
||||
ProcessType pt = pi.getProcess();
|
||||
if (pt != null) {
|
||||
EMap delegateScreenshots = pt.getScreenshots();
|
||||
for (Object objkey : delegateScreenshots.keySet()) {
|
||||
if (!PROCESS_SCREENSHOT_KEY.equals(objkey)) {
|
||||
processType.getScreenshots().put(objkey, delegateScreenshots.get(objkey));
|
||||
}// else keep looking
|
||||
}
|
||||
}// else no process available so ignor
|
||||
}// else not a type we can handle so ignor
|
||||
}
|
||||
setScreenshot(null); // once be saved, set the screenshot to null to free memory
|
||||
contextManager.saveToEmf(processType.getContext());
|
||||
@@ -1758,6 +1779,7 @@ public class Process extends Element implements IProcess2, IGEFProcess, ILastVer
|
||||
loadSubjobs(processType);
|
||||
|
||||
initExternalComponents();
|
||||
initJobletComponents();
|
||||
setActivate(true);
|
||||
checkStartNodes();
|
||||
// (bug 5365)
|
||||
@@ -1867,6 +1889,22 @@ public class Process extends Element implements IProcess2, IGEFProcess, ILastVer
|
||||
}
|
||||
}
|
||||
|
||||
private void initJobletComponents() {
|
||||
for (INode node : nodes) {
|
||||
if ((node instanceof Node) && ((Node) node).isJoblet()) {
|
||||
List<? extends IElementParameter> parametersWithChildrens = node.getElementParametersWithChildrens();
|
||||
for (IElementParameter param : parametersWithChildrens) {
|
||||
if (param.getFieldType() == EParameterFieldType.COMPONENT_LIST) {
|
||||
if (param.getValue() == null || ((String) param.getValue()).length() <= 0) {
|
||||
ComponentListController.updateComponentList(node, param);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// private void checkProjectsettingParameters() {
|
||||
// boolean statsLog = (Boolean) this.getElementParameter(EParameterName.STATANDLOG_USE_PROJECT_SETTINGS.getName())
|
||||
// .getValue();
|
||||
|
||||
@@ -43,6 +43,7 @@ import org.eclipse.swt.widgets.Control;
|
||||
import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.PluginChecker;
|
||||
import org.talend.core.model.metadata.IMetadataTable;
|
||||
import org.talend.core.model.process.EParameterFieldType;
|
||||
import org.talend.core.model.process.IConnection;
|
||||
import org.talend.core.model.process.IElement;
|
||||
@@ -320,6 +321,30 @@ public class ConnectionListController extends AbstractElementPropertySectionCont
|
||||
}
|
||||
}
|
||||
if (connectionName.equals(oldConnectionName)) {
|
||||
if (elem instanceof INode) {
|
||||
INode node = (INode) elem;
|
||||
if (node.getComponent() != null && "tSAPBapi".equals(node.getComponent().getName())) {
|
||||
// if SCHEMA_TYPE is renamed,rename the corresponding metadata table
|
||||
// name and connection meta name
|
||||
List<IMetadataTable> metadataList = node.getMetadataList();
|
||||
for (IMetadataTable metadataTable : metadataList) {
|
||||
if (metadataTable.getTableName() != null
|
||||
&& metadataTable.getTableName().equals(oldConnectionName)) {
|
||||
metadataTable.setTableName(newConnectionName);
|
||||
break;
|
||||
}
|
||||
}
|
||||
List<? extends IConnection> outgoingConnections = node.getOutgoingConnections();
|
||||
for (IConnection connection : outgoingConnections) {
|
||||
if (connection.getMetaName() != null
|
||||
&& connection.getMetaName().equals(oldConnectionName)) {
|
||||
connection.setMetaName(newConnectionName);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
curLine.put(param.getName(), newConnectionName);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,6 @@ package org.talend.designer.core.ui.editor.properties.controllers;
|
||||
import java.beans.PropertyChangeEvent;
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
|
||||
@@ -48,7 +47,8 @@ import org.talend.commons.ui.runtime.exception.ExceptionHandler;
|
||||
import org.talend.commons.ui.runtime.image.ImageProvider;
|
||||
import org.talend.commons.utils.io.FilesUtils;
|
||||
import org.talend.core.CorePlugin;
|
||||
import org.talend.core.model.general.ModuleNeeded;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.ILibraryManagerService;
|
||||
import org.talend.core.model.process.EParameterFieldType;
|
||||
import org.talend.core.model.process.IElementParameter;
|
||||
import org.talend.core.model.process.IExternalNode;
|
||||
@@ -61,7 +61,6 @@ import org.talend.designer.core.ui.dialog.BrmsDialog;
|
||||
import org.talend.designer.core.ui.dialog.IBrmsExtension;
|
||||
import org.talend.designer.core.ui.editor.cmd.PropertyChangeCommand;
|
||||
import org.talend.designer.core.ui.editor.nodes.Node;
|
||||
import org.talend.librariesmanager.model.ModulesNeededProvider;
|
||||
|
||||
/**
|
||||
* DOC yzhang class global comment. Detailled comment <br/>
|
||||
@@ -319,14 +318,14 @@ public class ModuleListController extends AbstractElementPropertySectionControll
|
||||
}
|
||||
|
||||
public static void updateModuleList(Node node) {
|
||||
List<ModuleNeeded> moduleNeededList = ModulesNeededProvider.getModulesNeeded();
|
||||
ILibraryManagerService repositoryBundleService = (ILibraryManagerService) GlobalServiceRegister.getDefault().getService(
|
||||
ILibraryManagerService.class);
|
||||
Set<String> existLibraries = repositoryBundleService.list();
|
||||
Set<String> moduleNameList = new TreeSet<String>();
|
||||
Set<String> moduleValueList = new TreeSet<String>();
|
||||
for (ModuleNeeded module : moduleNeededList) {
|
||||
|
||||
String moduleName = module.getModuleName();
|
||||
moduleNameList.add(moduleName);
|
||||
moduleValueList.add(TalendTextUtils.addQuotes(moduleName));
|
||||
for (String lib : existLibraries) {
|
||||
moduleNameList.add(lib);
|
||||
moduleValueList.add(TalendTextUtils.addQuotes(lib));
|
||||
}
|
||||
Comparator<String> comprarator = new IgnoreCaseComparator();
|
||||
String[] moduleNameArray = moduleNameList.toArray(new String[0]);
|
||||
|
||||
@@ -22,6 +22,7 @@ import org.eclipse.ui.IWorkbench;
|
||||
import org.eclipse.ui.IWorkbenchPreferencePage;
|
||||
import org.talend.commons.ui.swt.preferences.CheckBoxFieldEditor;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.PluginChecker;
|
||||
import org.talend.core.prefs.ITalendCorePrefConstants;
|
||||
import org.talend.core.ui.branding.IBrandingService;
|
||||
import org.talend.designer.core.DesignerPlugin;
|
||||
@@ -83,6 +84,7 @@ public class PerformancePreferencePage extends FieldEditorPreferencePage impleme
|
||||
|
||||
addField(dbConnTimeoutActive);
|
||||
addField(dbConnTimeout);
|
||||
addSVNInforAutoCheckFiled();
|
||||
} else {
|
||||
addField(new BooleanFieldEditor(ITalendCorePrefConstants.DEACTIVE_REPOSITORY_UPDATE,
|
||||
Messages.getString("PerformancePreferencePage.display.deactiveRepositoryUpdate"),//$NON-NLS-1$
|
||||
@@ -127,15 +129,46 @@ public class PerformancePreferencePage extends FieldEditorPreferencePage impleme
|
||||
// addField(new BooleanFieldEditor(ITalendCorePrefConstants.ADD_SYSTEM_ROUTINES, Messages
|
||||
// .getString("PerformancePreferencePage.addAllSystemRoutines"),//$NON-NLS-1$
|
||||
// getFieldEditorParent()));
|
||||
addSVNInforAutoCheckFiled();
|
||||
}
|
||||
}
|
||||
|
||||
private void addSVNInforAutoCheckFiled() {
|
||||
if (PluginChecker.isSVNProviderPluginLoaded()) {
|
||||
final CheckBoxFieldEditor autoCheckField = new CheckBoxFieldEditor(
|
||||
ITalendCorePrefConstants.SVN_UPDATE_INFO_AUTO_CHECK,
|
||||
Messages.getString("PerformancePreferencePage.autoCheckField"), getFieldEditorParent()); //$NON-NLS-1$
|
||||
addField(autoCheckField);
|
||||
final IntegerFieldEditor autoCheckTime = new IntegerFieldEditor(
|
||||
ITalendCorePrefConstants.SVN_UPDATE_INFO_AUTO_CHECK_TIME_INTERVAL,
|
||||
Messages.getString("PerformancePreferencePage.autoCheckTime"), //$NON-NLS-1$
|
||||
getFieldEditorParent());
|
||||
autoCheckTime.setValidRange(1, 30);
|
||||
autoCheckTime.setEnabled(getPreferenceStore().getBoolean(ITalendCorePrefConstants.SVN_UPDATE_INFO_AUTO_CHECK),
|
||||
getFieldEditorParent());
|
||||
addField(autoCheckTime);
|
||||
autoCheckField.getButton().addSelectionListener(new SelectionAdapter() {
|
||||
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
if (autoCheckField.getButton().getSelection()) {
|
||||
autoCheckTime.setEnabled(true, getFieldEditorParent());
|
||||
} else {
|
||||
autoCheckTime.setEnabled(false, getFieldEditorParent());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
|
||||
*/
|
||||
|
||||
@Override
|
||||
public void init(IWorkbench workbench) {
|
||||
}
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ import org.talend.commons.exception.ExceptionHandler;
|
||||
import org.talend.commons.ui.runtime.CommonUIPlugin;
|
||||
import org.talend.commons.ui.swt.colorstyledtext.ColorManager;
|
||||
import org.talend.core.CorePlugin;
|
||||
import org.talend.core.PluginChecker;
|
||||
import org.talend.core.language.ECodeLanguage;
|
||||
import org.talend.core.model.metadata.types.JavaTypesManager;
|
||||
import org.talend.core.model.repository.IRepositoryPrefConstants;
|
||||
@@ -165,9 +166,12 @@ public class PreferenceInitializer extends AbstractPreferenceInitializer {
|
||||
store.setDefault(IRepositoryPrefConstants.USE_EXPORT_SAVE, false);
|
||||
store.setDefault(IRepositoryPrefConstants.ADD_CLASSPATH_JAR, false);
|
||||
|
||||
store.setDefault(
|
||||
TalendDesignerPrefConstants.NOT_SHOW_WARNING_WHEN_DELETE_LINK_WITH_JOBLETTRIGGERLINKCOMPONENT,
|
||||
false);
|
||||
store.setDefault(TalendDesignerPrefConstants.NOT_SHOW_WARNING_WHEN_DELETE_LINK_WITH_JOBLETTRIGGERLINKCOMPONENT, false);
|
||||
|
||||
if (PluginChecker.isSVNProviderPluginLoaded()) {
|
||||
store.setDefault(ITalendCorePrefConstants.SVN_UPDATE_INFO_AUTO_CHECK, true);
|
||||
store.setDefault(ITalendCorePrefConstants.SVN_UPDATE_INFO_AUTO_CHECK_TIME_INTERVAL, 1);
|
||||
}
|
||||
|
||||
if (!CommonUIPlugin.isFullyHeadless()) {
|
||||
Display display = Display.getDefault();
|
||||
@@ -175,7 +179,7 @@ public class PreferenceInitializer extends AbstractPreferenceInitializer {
|
||||
display = Display.getCurrent();
|
||||
}
|
||||
if (display != null) {
|
||||
display.syncExec(new Runnable() {
|
||||
display.asyncExec(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
@@ -123,7 +123,7 @@ public class ProjectSettingManager extends Utils {
|
||||
Element elem = (Element) pro.getInitialContextLoad();
|
||||
if (elem == null) {
|
||||
elem = new ImplicitContextLoadElement();
|
||||
ProjectSettingManager.createImplicitContextLoadParameters((ImplicitContextLoadElement) elem);
|
||||
ProjectSettingManager.createImplicitContextLoadParameters(elem);
|
||||
pro.setInitialContextLoad(elem);
|
||||
}
|
||||
return elem;
|
||||
@@ -151,7 +151,7 @@ public class ProjectSettingManager extends Utils {
|
||||
Element elem = (Element) pro.getStatsAndLog();
|
||||
if (elem == null) {
|
||||
elem = new StatsAndLogsElement();
|
||||
StatsAndLogsHelper.createStatsAndLogsParameters((StatsAndLogsElement) elem);
|
||||
StatsAndLogsHelper.createStatsAndLogsParameters(elem);
|
||||
pro.setStatsAndLog(elem);
|
||||
}
|
||||
return elem;
|
||||
@@ -177,7 +177,7 @@ public class ProjectSettingManager extends Utils {
|
||||
createStatsAndLogsElement(pro);
|
||||
ParametersType stats = pro.getEmfProject().getStatAndLogsSettings().getParameters();
|
||||
// load the project settings to process
|
||||
ElementParameter2ParameterType.loadElementParameters(process, stats, EParameterName.PROPERTY_TYPE.getName() + ":" //$NON-NLS-N$
|
||||
ElementParameter2ParameterType.loadElementParameters(process, stats, EParameterName.PROPERTY_TYPE.getName() + ":"
|
||||
+ EParameterName.PROPERTY_TYPE.getName());
|
||||
// change repository item
|
||||
// TODO
|
||||
@@ -263,8 +263,9 @@ public class ProjectSettingManager extends Utils {
|
||||
* @param pItem
|
||||
*/
|
||||
public static void defaultUseProjectSetting(org.talend.designer.core.ui.editor.process.Process process) {
|
||||
if (process == null)
|
||||
if (process == null) {
|
||||
return;
|
||||
}
|
||||
ImplicitContextSettings implicit = ProjectManager.getInstance().getCurrentProject().getEmfProject()
|
||||
.getImplicitContextSettings();
|
||||
Boolean bImplicit = false;
|
||||
@@ -463,7 +464,7 @@ public class ProjectSettingManager extends Utils {
|
||||
param.setListItemsValue(new String[] {});
|
||||
param.setValue(preferenceStore.getString(getPreferenceName(EParameterName.REPOSITORY_PROPERTY_TYPE)// +
|
||||
// CONNECTION_ITEM_LABEL
|
||||
)); //$NON-NLS-1$
|
||||
));
|
||||
param.setCategory(EComponentCategory.EXTRA);
|
||||
param.setFieldType(EParameterFieldType.TECHNICAL);
|
||||
param.setShow(false);
|
||||
@@ -514,7 +515,7 @@ public class ProjectSettingManager extends Utils {
|
||||
// host
|
||||
param = new ElementParameter(elem);
|
||||
param.setName(JobSettingsConstants.getExtraParameterName(EParameterName.HOST.getName()));
|
||||
param.setValue(addQuotes(preferenceStore.getString(getPreferenceName(EParameterName.HOST)))); //$NON-NLS-1$
|
||||
param.setValue(addQuotes(preferenceStore.getString(getPreferenceName(EParameterName.HOST))));
|
||||
param.setDisplayName(EParameterName.HOST.getDisplayName());
|
||||
param.setFieldType(EParameterFieldType.TEXT);
|
||||
param.setCategory(EComponentCategory.EXTRA);
|
||||
@@ -529,7 +530,7 @@ public class ProjectSettingManager extends Utils {
|
||||
// port
|
||||
param = new ElementParameter(elem);
|
||||
param.setName(JobSettingsConstants.getExtraParameterName(EParameterName.PORT.getName()));
|
||||
param.setValue(addQuotes(preferenceStore.getString(getPreferenceName(EParameterName.PORT)))); //$NON-NLS-1$
|
||||
param.setValue(addQuotes(preferenceStore.getString(getPreferenceName(EParameterName.PORT))));
|
||||
param.setDisplayName(EParameterName.PORT.getDisplayName());
|
||||
param.setFieldType(EParameterFieldType.TEXT);
|
||||
param.setCategory(EComponentCategory.EXTRA);
|
||||
@@ -544,7 +545,7 @@ public class ProjectSettingManager extends Utils {
|
||||
// dbName
|
||||
param = new ElementParameter(elem);
|
||||
param.setName(JobSettingsConstants.getExtraParameterName(EParameterName.DBNAME.getName()));
|
||||
param.setValue(addQuotes(preferenceStore.getString(getPreferenceName(EParameterName.DBNAME)))); //$NON-NLS-1$
|
||||
param.setValue(addQuotes(preferenceStore.getString(getPreferenceName(EParameterName.DBNAME))));
|
||||
param.setDisplayName(EParameterName.DBNAME.getDisplayName());
|
||||
param.setFieldType(EParameterFieldType.TEXT);
|
||||
param.setCategory(EComponentCategory.EXTRA);
|
||||
@@ -575,7 +576,7 @@ public class ProjectSettingManager extends Utils {
|
||||
// additional parameters
|
||||
param = new ElementParameter(elem);
|
||||
param.setName(JobSettingsConstants.getExtraParameterName(EParameterName.PROPERTIES.getName()));
|
||||
param.setValue(addQuotes(preferenceStore.getString(getPreferenceName(EParameterName.PROPERTIES)))); //$NON-NLS-1$
|
||||
param.setValue(addQuotes(preferenceStore.getString(getPreferenceName(EParameterName.PROPERTIES))));
|
||||
param.setDisplayName(EParameterName.PROPERTIES.getDisplayName());
|
||||
param.setFieldType(EParameterFieldType.TEXT);
|
||||
param.setCategory(EComponentCategory.EXTRA);
|
||||
@@ -592,7 +593,7 @@ public class ProjectSettingManager extends Utils {
|
||||
// schema
|
||||
param = new ElementParameter(elem);
|
||||
param.setName(JobSettingsConstants.getExtraParameterName(EParameterName.SCHEMA_DB.getName()));
|
||||
param.setValue(addQuotes(preferenceStore.getString(getPreferenceName(EParameterName.SCHEMA_DB)))); //$NON-NLS-1$
|
||||
param.setValue(addQuotes(preferenceStore.getString(getPreferenceName(EParameterName.SCHEMA_DB))));
|
||||
param.setDisplayName(EParameterName.SCHEMA_DB.getDisplayName());
|
||||
param.setFieldType(EParameterFieldType.TEXT);
|
||||
param.setCategory(EComponentCategory.EXTRA);
|
||||
@@ -600,7 +601,7 @@ public class ProjectSettingManager extends Utils {
|
||||
param.setRepositoryValue("SCHEMA"); //$NON-NLS-1$
|
||||
final String schemaCondition = JobSettingsConstants
|
||||
.addBrackets(dbTypeName
|
||||
+ " =='OCLE' or " + dbTypeName + " =='OCLE_OCI' or " + dbTypeName + " =='POSTGRESQL' or " + dbTypeName + " =='POSTGRESPLUS' or " + dbTypeName + " =='MSSQL' or " + dbTypeName + " =='INFORMIX'"); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$//$NON-NLS-4$//$NON-NLS-5$//$NON-NLS-6$
|
||||
+ " =='OCLE' or " + dbTypeName + " =='OCLE_OCI' or " + dbTypeName + " =='POSTGRESQL' or " + dbTypeName + " =='POSTGRESPLUS' or " + dbTypeName + " =='MSSQL' or " + dbTypeName + " =='INFORMIX' or " + dbTypeName + " =='IBM_DB2' or " + dbTypeName + " =='SYBASE'"); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$//$NON-NLS-4$//$NON-NLS-5$//$NON-NLS-6$//$NON-NLS-7$//$NON-NLS-8$
|
||||
param.setShowIf(schemaCondition + " and " + dbCondition); //$NON-NLS-1$
|
||||
param.setGroup(IMPLICIT_GROUP);
|
||||
paramList.add(param);
|
||||
@@ -608,7 +609,7 @@ public class ProjectSettingManager extends Utils {
|
||||
// username
|
||||
param = new ElementParameter(elem);
|
||||
param.setName(JobSettingsConstants.getExtraParameterName(EParameterName.USER.getName()));
|
||||
param.setValue(addQuotes(preferenceStore.getString(getPreferenceName(EParameterName.USER)))); //$NON-NLS-1$
|
||||
param.setValue(addQuotes(preferenceStore.getString(getPreferenceName(EParameterName.USER))));
|
||||
param.setDisplayName(EParameterName.USER.getDisplayName());
|
||||
param.setFieldType(EParameterFieldType.TEXT);
|
||||
param.setCategory(EComponentCategory.EXTRA);
|
||||
@@ -623,7 +624,7 @@ public class ProjectSettingManager extends Utils {
|
||||
// password
|
||||
param = new ElementParameter(elem);
|
||||
param.setName(JobSettingsConstants.getExtraParameterName(EParameterName.PASS.getName()));
|
||||
param.setValue(addQuotes(preferenceStore.getString(getPreferenceName(EParameterName.PASS)))); //$NON-NLS-1$
|
||||
param.setValue(addQuotes(preferenceStore.getString(getPreferenceName(EParameterName.PASS))));
|
||||
param.setDisplayName(EParameterName.PASS.getDisplayName());
|
||||
param.setFieldType(EParameterFieldType.PASSWORD);
|
||||
param.setCategory(EComponentCategory.EXTRA);
|
||||
@@ -651,7 +652,7 @@ public class ProjectSettingManager extends Utils {
|
||||
// table
|
||||
param = new ElementParameter(elem);
|
||||
param.setName(JobSettingsConstants.getExtraParameterName(EParameterName.DBTABLE.getName()));
|
||||
param.setValue(addQuotes(preferenceStore.getString(getPreferenceName(EParameterName.DBTABLE)))); //$NON-NLS-1$
|
||||
param.setValue(addQuotes(preferenceStore.getString(getPreferenceName(EParameterName.DBTABLE))));
|
||||
param.setDisplayName(EParameterName.DBTABLE.getDisplayName());
|
||||
param.setFieldType(EParameterFieldType.DBTABLE);
|
||||
param.setCategory(EComponentCategory.EXTRA);
|
||||
|
||||
@@ -232,8 +232,8 @@ public class StatsAndLogsHelper extends Utils {
|
||||
|
||||
// stats log encoding
|
||||
ElementParameter encodingParam = new ElementParameter(elem);
|
||||
encodingParam.setName(EParameterName.ENCODING.getName()); //$NON-NLS-1$
|
||||
encodingParam.setDisplayName(EParameterName.ENCODING.getDisplayName());//$NON-NLS-1$
|
||||
encodingParam.setName(EParameterName.ENCODING.getName());
|
||||
encodingParam.setDisplayName(EParameterName.ENCODING.getDisplayName());
|
||||
encodingParam.setCategory(EComponentCategory.STATSANDLOGS);
|
||||
encodingParam.setFieldType(EParameterFieldType.ENCODING_TYPE);
|
||||
encodingParam
|
||||
@@ -368,7 +368,7 @@ public class StatsAndLogsHelper extends Utils {
|
||||
// ProjectSettingManager
|
||||
// .
|
||||
// CONNECTION_ITEM_LABEL
|
||||
)); //$NON-NLS-1$
|
||||
));
|
||||
param.setShow(false);
|
||||
param.setRequired(true);
|
||||
// paramList.add(param);
|
||||
@@ -540,7 +540,7 @@ public class StatsAndLogsHelper extends Utils {
|
||||
param.setCategory(EComponentCategory.STATSANDLOGS);
|
||||
param.setNumRow(54);
|
||||
param.setRepositoryValue("SCHEMA"); //$NON-NLS-1$
|
||||
param.setShowIf("(DB_TYPE=='OCLE' or DB_TYPE=='OCLE_OCI' or DB_TYPE=='POSTGRESQL' or DB_TYPE=='POSTGRESPLUS' or DB_TYPE=='MSSQL' or DB_TYPE=='INFORMIX') and (ON_DATABASE_FLAG == 'true') and (ON_STATCATCHER_FLAG == 'true' or ON_LOGCATCHER_FLAG == 'true' or ON_METERCATCHER_FLAG == 'true')"); //$NON-NLS-1$
|
||||
param.setShowIf("(DB_TYPE=='OCLE' or DB_TYPE=='OCLE_OCI' or DB_TYPE=='POSTGRESQL' or DB_TYPE=='POSTGRESPLUS' or DB_TYPE=='MSSQL' or DB_TYPE=='INFORMIX' or DB_TYPE=='IBM_DB2' or DB_TYPE=='SYBASE') and (ON_DATABASE_FLAG == 'true') and (ON_STATCATCHER_FLAG == 'true' or ON_LOGCATCHER_FLAG == 'true' or ON_METERCATCHER_FLAG == 'true')"); //$NON-NLS-1$
|
||||
paramList.add(param);
|
||||
|
||||
// username
|
||||
@@ -603,7 +603,7 @@ public class StatsAndLogsHelper extends Utils {
|
||||
|
||||
// Metter table
|
||||
param = new ElementParameter(elem);
|
||||
param.setName(EParameterName.TABLE_METER.getName()); //$NON-NLS-1$
|
||||
param.setName(EParameterName.TABLE_METER.getName());
|
||||
param.setValue(addQuotes(preferenceStore.getString(languagePrefix + EParameterName.TABLE_METER.getName())));
|
||||
param.setDisplayName(EParameterName.TABLE_METER.getDisplayName());
|
||||
param.setFieldType(EParameterFieldType.DBTABLE);
|
||||
@@ -615,6 +615,7 @@ public class StatsAndLogsHelper extends Utils {
|
||||
|
||||
private final static class IgnoreCaseComparator implements Comparator<String> {
|
||||
|
||||
@Override
|
||||
public int compare(String o1, String o2) {
|
||||
return o1.compareToIgnoreCase(o2);
|
||||
}
|
||||
|
||||
@@ -12,21 +12,17 @@
|
||||
// ============================================================================
|
||||
package org.talend.designer.mapper.ui.visualmap.zone.toolbar;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.SelectionEvent;
|
||||
import org.eclipse.swt.events.SelectionListener;
|
||||
import org.eclipse.swt.graphics.Image;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Event;
|
||||
import org.eclipse.swt.widgets.Listener;
|
||||
import org.eclipse.swt.widgets.ToolItem;
|
||||
import org.talend.commons.ui.runtime.image.EImage;
|
||||
import org.talend.core.model.process.IElementParameter;
|
||||
import org.talend.designer.abstractmap.AbstractMapComponent;
|
||||
import org.talend.designer.mapper.i18n.Messages;
|
||||
import org.talend.designer.mapper.managers.MapperManager;
|
||||
import org.talend.designer.mapper.ui.image.ImageInfo;
|
||||
import org.talend.designer.mapper.ui.image.ImageProviderMapper;
|
||||
import org.talend.designer.mapper.ui.visualmap.table.DataMapTableView;
|
||||
import org.talend.designer.mapper.ui.visualmap.zone.Zone;
|
||||
|
||||
/**
|
||||
@@ -133,48 +129,32 @@ public class ToolbarOutputZone extends ToolbarZone {
|
||||
guessItem.addListener(SWT.Selection, new Listener() {
|
||||
|
||||
public void handleEvent(Event event) {
|
||||
List<DataMapTableView> outputsTablesView = getMapperManager().getUiManager().getOutputsTablesView();
|
||||
for (DataMapTableView dataMapTableView : outputsTablesView) {
|
||||
dataMapTableView.notifyFocusLost();
|
||||
}
|
||||
getMapperManager().mapAutomaticallly();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
// dieOnError.addSelectionListener(new SelectionListener() {
|
||||
//
|
||||
// public void widgetDefaultSelected(SelectionEvent e) {
|
||||
// }
|
||||
//
|
||||
// public void widgetSelected(SelectionEvent e) {
|
||||
// Image image = null;
|
||||
// if (dieOnError.getSelection()) {
|
||||
// image = ImageProviderMapper.getImage(ImageInfo.CHECKED_ICON);
|
||||
// getMapperManager().removeRejectOutput();
|
||||
// } else {
|
||||
// image = ImageProviderMapper.getImage(ImageInfo.UNCHECKED_ICON);
|
||||
// if (!getMapperManager().hasRejectOutput(getMapperManager().getOutputTables())) {
|
||||
// getMapperManager().addRejectOutput();
|
||||
// }
|
||||
// }
|
||||
// dieOnError.setImage(image);
|
||||
// getMapperManager().setDieOnError(dieOnError.getSelection());
|
||||
// getMapperManager().setDieOnErrorValueChanged(true);
|
||||
// }
|
||||
//
|
||||
// });
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMinimizeTooltipText() {
|
||||
return MINIMIZE_TOOLTIP;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRestoreTooltipText() {
|
||||
return RESTORE_TOOLTIP;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMoveUpTooltipText() {
|
||||
return MOVE_UP_TOOLTIP;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMoveDownTooltipText() {
|
||||
return MOVE_DOWN_TOOLTIP;
|
||||
}
|
||||
|
||||
@@ -12,13 +12,22 @@
|
||||
// ============================================================================
|
||||
package org.talend.designer.publish.core.models;
|
||||
|
||||
import java.io.StringWriter;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.lang.StringEscapeUtils;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.transform.OutputKeys;
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
import javax.xml.transform.dom.DOMSource;
|
||||
import javax.xml.transform.stream.StreamResult;
|
||||
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
public class FeaturesModel extends BaseModel {
|
||||
|
||||
@@ -34,7 +43,7 @@ public class FeaturesModel extends BaseModel {
|
||||
|
||||
private String configName;
|
||||
|
||||
private Collection<String> subFeatures = new HashSet<String>();
|
||||
private Collection<FeatureModel> subFeatures = new HashSet<FeatureModel>();
|
||||
|
||||
private Collection<BundleModel> subBundles = new HashSet<BundleModel>();
|
||||
|
||||
@@ -51,13 +60,7 @@ public class FeaturesModel extends BaseModel {
|
||||
}
|
||||
|
||||
public void addFeature(FeatureModel feature) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("<feature version='");
|
||||
sb.append(feature.getVersion());
|
||||
sb.append("\'>");
|
||||
sb.append(feature.getArtifactId());
|
||||
sb.append("</feature>");
|
||||
subFeatures.add(sb.toString());
|
||||
subFeatures.add(feature);
|
||||
}
|
||||
|
||||
public boolean addBundle(BundleModel model) {
|
||||
@@ -90,87 +93,100 @@ public class FeaturesModel extends BaseModel {
|
||||
}
|
||||
|
||||
private static String toBundleString(BundleModel model) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("<bundle>mvn:");
|
||||
StringBuilder sb = new StringBuilder("mvn:");
|
||||
sb.append(model.getGroupId());
|
||||
sb.append('/');
|
||||
sb.append(model.getArtifactId());
|
||||
sb.append('/');
|
||||
sb.append(model.getVersion());
|
||||
sb.append("</bundle>");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
StringBuilder sb = new StringBuilder("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
|
||||
sb.append("<features name=\"").append(getArtifactId()).append("\" xmlns=\"http://karaf.apache.org/xmlns/features/v1.0.0\">\n");
|
||||
sb.append("\t<feature name=\"");
|
||||
sb.append(getArtifactId());
|
||||
sb.append("\" version=\"");
|
||||
sb.append(getVersion());
|
||||
sb.append("\">\n");
|
||||
try {
|
||||
return internalGetContent();
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private String internalGetContent() throws Exception {
|
||||
Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
|
||||
|
||||
Element features = document.createElement("features");
|
||||
features.setAttribute("xmlns", "http://karaf.apache.org/xmlns/features/v1.0.0");
|
||||
features.setAttribute("name", getArtifactId());
|
||||
document.appendChild(features);
|
||||
|
||||
Element feature = document.createElement("feature");
|
||||
feature.setAttribute("name", getArtifactId());
|
||||
feature.setAttribute("version", getVersion());
|
||||
features.appendChild(feature);
|
||||
|
||||
// add sub features
|
||||
for (String s : subFeatures) {
|
||||
sb.append("\t\t");
|
||||
sb.append(s);
|
||||
sb.append("\n");
|
||||
for (FeatureModel fm : subFeatures) {
|
||||
Element subFeature = document.createElement("feature");
|
||||
if (null != fm.getVersion() && !fm.getVersion().isEmpty()) {
|
||||
subFeature.setAttribute("version", fm.getVersion());
|
||||
}
|
||||
subFeature.appendChild(document.createTextNode(fm.getArtifactId()));
|
||||
feature.appendChild(subFeature);
|
||||
}
|
||||
|
||||
// add sub bundles
|
||||
for (BundleModel s : subBundles) {
|
||||
sb.append("\t\t");
|
||||
sb.append(toBundleString(s));
|
||||
sb.append("\n");
|
||||
for (BundleModel bm : subBundles) {
|
||||
Element bundle = document.createElement("bundle");
|
||||
bundle.appendChild(document.createTextNode(toBundleString(bm)));
|
||||
feature.appendChild(bundle);
|
||||
}
|
||||
|
||||
if (null == contexts || contexts.isEmpty()) {
|
||||
// add config
|
||||
sb.append("\t\t<config name=\"");
|
||||
sb.append(configName);
|
||||
sb.append("\">\n");
|
||||
sb.append("\t\t\ttalendcontext=\"");
|
||||
Element config = document.createElement("config");
|
||||
config.setAttribute("name", configName);
|
||||
StringBuilder sb = new StringBuilder("talendcontext=\"");
|
||||
for (int i = 0; i < contextList.length; i++) {
|
||||
if (i != 0) {
|
||||
sb.append(',');
|
||||
}
|
||||
sb.append(StringEscapeUtils.escapeXml(contextList[i]));
|
||||
sb.append(contextList[i]);
|
||||
}
|
||||
sb.append("\"\n");
|
||||
sb.append("\t\t</config>\n");
|
||||
sb.append('"');
|
||||
config.appendChild(document.createTextNode(sb.toString()));
|
||||
feature.appendChild(config);
|
||||
} else {
|
||||
// add contexts config
|
||||
for (Map.Entry<String, Map<String, String>> context : contexts.entrySet()) {
|
||||
sb.append("\t\t<config name=\"");
|
||||
sb.append(name).append(".talendcontext.").append(StringEscapeUtils.escapeXml(context.getKey()));
|
||||
sb.append("\">\n");
|
||||
Element config = document.createElement("config");
|
||||
config.setAttribute("name", name +".talendcontext."+ context.getKey());
|
||||
StringBuilder sb = new StringBuilder("\n");
|
||||
for (Map.Entry<String, String> property : context.getValue().entrySet()) {
|
||||
sb.append("\t\t\t");
|
||||
sb.append(StringEscapeUtils.escapeXml(property.getKey()));
|
||||
sb.append(property.getKey());
|
||||
sb.append('=');
|
||||
sb.append(StringEscapeUtils.escapeXml(property.getValue()));
|
||||
sb.append("\n");
|
||||
sb.append(property.getValue());
|
||||
sb.append('\n');
|
||||
}
|
||||
sb.append("\t\t</config>\n");
|
||||
config.appendChild(document.createTextNode(sb.toString()));
|
||||
feature.appendChild(config);
|
||||
}
|
||||
}
|
||||
|
||||
sb.append("\t</feature>\n");
|
||||
sb.append("</features>");
|
||||
|
||||
return sb.toString();
|
||||
Transformer transformer = TransformerFactory.newInstance().newTransformer();
|
||||
DOMSource source = new DOMSource(document);
|
||||
StringWriter writer = new StringWriter();
|
||||
StreamResult result = new StreamResult(writer);
|
||||
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
|
||||
transformer.transform(source, result);
|
||||
return writer.toString();
|
||||
}
|
||||
|
||||
// public static void main(String[] args) {
|
||||
// FeaturesModel featureModel = new FeaturesModel("aaa",
|
||||
// "CustomService", "1.0.0");
|
||||
// FeaturesModel featureModel = new FeaturesModel("aaa", "CustomService", "1.0.0");
|
||||
// featureModel.addBundle(new BundleModel("talend", "job-control-bundle", "1.0"));
|
||||
// featureModel.addBundle(new BundleModel("talend", "ProviderJob", "1.0"));
|
||||
// featureModel.addBundle(new BundleModel("talend", "ESBProvider2", "1.0"));
|
||||
// featureModel.addFeature(new FeatureModel("custom-feature", "2.0"));
|
||||
// featureModel.setConfigName("aa.bb");
|
||||
// featureModel
|
||||
// .setContextList(new String[] { "Default", "Product", "Dev" });
|
||||
// featureModel.setContexts(java.util.Collections.singletonMap("name", java.util.Collections.singletonMap("key", "開始")));
|
||||
// System.out.println(featureModel.getContent());
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
@@ -87,7 +87,12 @@ public class JSONDragAndDropHandler extends AbstractDragAndDropServiceHandler {
|
||||
return connection.getJSONFilePath();
|
||||
} else {
|
||||
Path p = new Path(connection.getJSONFilePath());
|
||||
if (p.toFile().isFile()) {
|
||||
return TalendQuoteUtils.addQuotes(p.toPortableString());
|
||||
} else {
|
||||
return TalendQuoteUtils.addQuotes(p.toString());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if (value.equals("OUT_FILE_PATH")) {
|
||||
@@ -98,7 +103,12 @@ public class JSONDragAndDropHandler extends AbstractDragAndDropServiceHandler {
|
||||
return connection.getOutputFilePath();
|
||||
} else {
|
||||
Path p = new Path(connection.getOutputFilePath());
|
||||
if (p.toFile().isFile()) {
|
||||
return TalendQuoteUtils.addQuotes(p.toPortableString());
|
||||
} else {
|
||||
return TalendQuoteUtils.addQuotes(p.toString());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if (value.equals("LIMIT")) { //$NON-NLS-1$
|
||||
|
||||
@@ -358,7 +358,12 @@ public class JSONFileOutputStep1Form extends AbstractJSONFileStepForm {
|
||||
} else {
|
||||
xsdPathChanged = false;
|
||||
}
|
||||
if (Path.fromOSString(jsonFilePath.getText()).toFile().isFile()) {
|
||||
getConnection().setJSONFilePath(PathUtils.getPortablePath(jsonFilePath.getText()));
|
||||
} else {
|
||||
getConnection().setJSONFilePath(jsonFilePath.getText());
|
||||
}
|
||||
|
||||
// updateConnection(text);
|
||||
|
||||
StringBuilder fileContent = new StringBuilder();
|
||||
|
||||
@@ -33,6 +33,7 @@ import org.apache.oro.text.regex.Perl5Compiler;
|
||||
import org.apache.oro.text.regex.Perl5Matcher;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.runtime.IStatus;
|
||||
import org.eclipse.core.runtime.Path;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.FocusEvent;
|
||||
import org.eclipse.swt.events.FocusListener;
|
||||
@@ -171,8 +172,8 @@ public class JSONFileStep1Form extends AbstractJSONFileStepForm {
|
||||
jsonFilePath = TalendQuoteUtils.removeQuotes(ConnectionContextHelper.getOriginalValue(contextType,
|
||||
fileFieldJSON.getText()));
|
||||
}
|
||||
if (!new File(jsonFilePath).exists() && getConnection().getFileContent() != null
|
||||
&& getConnection().getFileContent().length > 0) {
|
||||
File file = new File(jsonFilePath);
|
||||
if (!file.exists() && getConnection().getFileContent() != null && getConnection().getFileContent().length > 0) {
|
||||
initFileContent();
|
||||
jsonFilePath = tempJSONXsdPath;
|
||||
}
|
||||
@@ -447,6 +448,11 @@ public class JSONFileStep1Form extends AbstractJSONFileStepForm {
|
||||
}
|
||||
// getConnection().setJSONFilePath(PathUtils.getPortablePath(JSONXsdFilePath.getText()));
|
||||
File file = new File(text);
|
||||
if (file.isDirectory()) {
|
||||
valid = false;
|
||||
checkFieldsValue();
|
||||
return;
|
||||
}
|
||||
// if (file.exists()) {
|
||||
// if (file.exists()) {
|
||||
String tempxml = JSONUtil.changeJsonToXml(text);
|
||||
@@ -472,7 +478,11 @@ public class JSONFileStep1Form extends AbstractJSONFileStepForm {
|
||||
} else {
|
||||
xsdPathChanged = false;
|
||||
}
|
||||
if (Path.fromOSString(jsonPath).toFile().isFile()) {
|
||||
getConnection().setJSONFilePath(PathUtils.getPortablePath(jsonPath));
|
||||
} else {
|
||||
getConnection().setJSONFilePath(jsonPath);
|
||||
}
|
||||
|
||||
JSONWizard wizard = ((JSONWizard) getPage().getWizard());
|
||||
wizard.setTreeRootNode(treeNode);
|
||||
@@ -604,6 +614,12 @@ public class JSONFileStep1Form extends AbstractJSONFileStepForm {
|
||||
updateStatus(IStatus.ERROR, ""); //$NON-NLS-1$
|
||||
return false;
|
||||
}
|
||||
File file = new File(jsonFilePathText);
|
||||
if (file.isFile() && !file.exists()) {
|
||||
valid = false;
|
||||
} else if (file.isDirectory()) {
|
||||
valid = false;
|
||||
}
|
||||
if (!valid) {
|
||||
if (isContextMode()) {
|
||||
ContextType contextType = ConnectionContextHelper.getContextTypeForContextMode(connectionItem.getConnection());
|
||||
|
||||
@@ -19,6 +19,7 @@ import java.io.FileNotFoundException;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
|
||||
import org.apache.commons.io.IOUtils;
|
||||
@@ -133,18 +134,37 @@ public class JSONUtil {
|
||||
java.io.ByteArrayOutputStream outStream = new java.io.ByteArrayOutputStream();
|
||||
InputStream inStream = null;
|
||||
File file = new File(jsonPath);
|
||||
|
||||
// String filename = file.getName().replaceAll("\\.", "_");
|
||||
// filename = "tempTest";
|
||||
boolean isFromUrl = false;
|
||||
try {
|
||||
boolean illegalURL = false;
|
||||
InputStream input = null;
|
||||
if (file.exists()) {
|
||||
input = new FileInputStream(file);
|
||||
|
||||
if (file.exists()) {
|
||||
if (file.isDirectory()) {
|
||||
return "";
|
||||
}
|
||||
try {
|
||||
input = new FileInputStream(file);
|
||||
} catch (FileNotFoundException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
} else {
|
||||
isFromUrl = true;
|
||||
try {
|
||||
input = new URL(jsonPath).openStream();
|
||||
} catch (MalformedURLException e) {
|
||||
illegalURL = true;
|
||||
} catch (IOException e) {
|
||||
illegalURL = true;
|
||||
}
|
||||
if (illegalURL) {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
String jsonStr = IOUtils.toString(input);
|
||||
|
||||
convertJSON.setJsonString(jsonStr);
|
||||
@@ -172,10 +192,6 @@ public class JSONUtil {
|
||||
if (isFromUrl) {
|
||||
tempJSONXsdPath = temPath;
|
||||
}
|
||||
} catch (FileNotFoundException e1) {
|
||||
ExceptionHandler.process(e1);
|
||||
} catch (IOException e1) {
|
||||
ExceptionHandler.process(e1);
|
||||
} catch (java.lang.Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
} finally {
|
||||
|
||||
@@ -490,7 +490,7 @@
|
||||
<importItemsProvider
|
||||
id="org.talend.repository.view.di.importProvider.context"
|
||||
name="Context importer"
|
||||
priority="NORMAL">
|
||||
priority="HIGH">
|
||||
<importItemsHandler
|
||||
class="org.talend.repository.view.di.viewer.handlers.ContextImportHandler">
|
||||
<parameter
|
||||
|
||||
@@ -2311,6 +2311,15 @@
|
||||
name="Set tStoreResult associated tPigLoad"
|
||||
description="The tPigStoreResult is now linked to a tPigLoad, we need to set the option for old jobs"
|
||||
version="5.6.1">
|
||||
</projecttask>
|
||||
<projecttask
|
||||
beforeLogon="false"
|
||||
breaks="5.6.1"
|
||||
class="org.talend.repository.model.migration.UpdateJobletContextInJobMigrationTask"
|
||||
description="Update Joblet context in jobs"
|
||||
id="org.talend.repository.model.migration.UpdateJobletContextInJobMigrationTask"
|
||||
name="UpdateJobletContextInJobMigrationTask"
|
||||
version="5.6.1">
|
||||
</projecttask>
|
||||
</extension>
|
||||
|
||||
|
||||
@@ -147,18 +147,20 @@ public class ExportItemUtil {
|
||||
* @param progressMonitor, to show the progress during export
|
||||
* @throws Exception in case of problem
|
||||
*/
|
||||
public void exportItems(File destination, Collection<Item> items, boolean exportAllVersions, IProgressMonitor progressMonitor)
|
||||
throws Exception {
|
||||
public void exportItems(File destination, final Collection<Item> items, List<String> folders, boolean exportAllVersions,
|
||||
IProgressMonitor progressMonitor) throws Exception {
|
||||
|
||||
// bug 11301 :export 0 items
|
||||
if (items == null) {
|
||||
items = new ArrayList<Item>();
|
||||
Collection<Item> workItems = items;
|
||||
if (workItems == null) {
|
||||
workItems = new ArrayList<Item>();
|
||||
}
|
||||
|
||||
Collection<Item> otherVersions = new ArrayList<Item>();
|
||||
// get all versions of the exported items if wanted
|
||||
if (exportAllVersions) {
|
||||
otherVersions = getOtherVersions(items);
|
||||
items.addAll(otherVersions);
|
||||
otherVersions = getOtherVersions(workItems);
|
||||
workItems.addAll(otherVersions);
|
||||
otherVersions.clear();
|
||||
}// else keep current items version only
|
||||
try {
|
||||
@@ -188,7 +190,7 @@ public class ExportItemUtil {
|
||||
|
||||
try {
|
||||
if (exporter != null) {
|
||||
toExport = exportItems2(items, tmpDirectory, true, progressMonitor);
|
||||
toExport = exportItems2(workItems, tmpDirectory, true, progressMonitor);
|
||||
|
||||
// in case of .tar.gz we remove extension twice
|
||||
// IPath rootPath = new Path(destination.getName()).removeFileExtension().removeFileExtension();
|
||||
@@ -197,8 +199,43 @@ public class ExportItemUtil {
|
||||
// exporter.write(file.getAbsolutePath(), rootPath.append(path).toString());
|
||||
exporter.write(file.getAbsolutePath(), path.toString());
|
||||
}
|
||||
if (folders != null) {
|
||||
// filter folders that already created
|
||||
List<String> toRemove = new ArrayList<String>();
|
||||
for (String folderPath : folders) {
|
||||
for (IPath resourcePath : toExport.values()) {
|
||||
if (resourcePath.toPortableString().contains(folderPath)) {
|
||||
toRemove.add(folderPath);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
folders.removeAll(toRemove);
|
||||
for (String folderPath : folders) {
|
||||
exporter.writeFolder(folderPath);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
toExport = exportItems2(items, destination, true, progressMonitor);
|
||||
toExport = exportItems2(workItems, destination, true, progressMonitor);
|
||||
if (folders != null) {
|
||||
// filter folders that already created
|
||||
List<String> toRemove = new ArrayList<String>();
|
||||
for (String folderPath : folders) {
|
||||
for (IPath resourcePath : toExport.values()) {
|
||||
if (resourcePath.toPortableString().contains(folderPath)) {
|
||||
toRemove.add(folderPath);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
folders.removeAll(toRemove);
|
||||
for (String folderPath : folders) {
|
||||
IPath fullPath = new Path(destination.getAbsolutePath());
|
||||
fullPath = fullPath.append(folderPath);
|
||||
FilesUtils.createFoldersIfNotExists(fullPath.toPortableString(), false);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw e;
|
||||
@@ -217,6 +254,21 @@ public class ExportItemUtil {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* export the sected TOS model elements to the destination
|
||||
*
|
||||
* @param destination zip file or folder to store the exported elements
|
||||
* @param items, the items to be exported
|
||||
* @param exportAllVersions whether all the versions are export or only the selected once
|
||||
* @param progressMonitor, to show the progress during export
|
||||
* @throws Exception in case of problem
|
||||
*/
|
||||
public void exportItems(File destination, final Collection<Item> items, boolean exportAllVersions,
|
||||
IProgressMonitor progressMonitor) throws Exception {
|
||||
exportItems(destination, items, null, exportAllVersions, progressMonitor);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -30,6 +30,7 @@ import org.talend.core.model.properties.JobletProcessItem;
|
||||
import org.talend.core.model.properties.ProcessItem;
|
||||
import org.talend.core.model.repository.ERepositoryObjectType;
|
||||
import org.talend.core.repository.model.ProxyRepositoryFactory;
|
||||
import org.talend.cwm.helper.ConnectionHelper;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.ContextParameterType;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.ContextType;
|
||||
|
||||
@@ -102,13 +103,13 @@ public class EncryptDbPasswordMigrationTask extends AbstractItemMigrationTask {
|
||||
}
|
||||
|
||||
private void encryptPassword(DatabaseConnection dbConn) throws Exception {
|
||||
String password = PasswordEncryptUtil.encryptPassword(dbConn.getPassword());
|
||||
String password = PasswordEncryptUtil.encryptPassword(ConnectionHelper.getCleanPassword(dbConn.getPassword()));
|
||||
dbConn.setPassword(password);
|
||||
}
|
||||
|
||||
private void encryptPassword(ContextParameterType param) throws Exception {
|
||||
// before migration task, the value should be raw. so keep it.
|
||||
String password = PasswordEncryptUtil.encryptPassword(param.getValue());
|
||||
String password = PasswordEncryptUtil.encryptPassword(ConnectionHelper.getCleanPassword(param.getValue()));
|
||||
param.setValue(password);
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ import org.talend.core.model.properties.DatabaseConnectionItem;
|
||||
import org.talend.core.model.properties.Item;
|
||||
import org.talend.core.model.repository.ERepositoryObjectType;
|
||||
import org.talend.core.repository.model.ProxyRepositoryFactory;
|
||||
import org.talend.cwm.helper.ConnectionHelper;
|
||||
|
||||
/**
|
||||
* DOC zli class global comment. Detailled comment For
|
||||
@@ -67,7 +68,7 @@ public class EncryptDbPasswordforItemFileMigrationTask extends AbstractItemMigra
|
||||
}
|
||||
|
||||
public void encryptPassword(DatabaseConnection dbConn) throws Exception {
|
||||
String password = PasswordEncryptUtil.encryptPassword(dbConn.getPassword());
|
||||
String password = PasswordEncryptUtil.encryptPassword(ConnectionHelper.getCleanPassword(dbConn.getPassword()));
|
||||
dbConn.setPassword(password);
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ import org.talend.core.model.properties.FTPConnectionItem;
|
||||
import org.talend.core.model.properties.Item;
|
||||
import org.talend.core.model.repository.ERepositoryObjectType;
|
||||
import org.talend.core.repository.model.ProxyRepositoryFactory;
|
||||
import org.talend.cwm.helper.ConnectionHelper;
|
||||
|
||||
/**
|
||||
* created by hcyi on Jul 8, 2014 Detailled comment
|
||||
@@ -63,25 +64,26 @@ public class EncryptPassword4FTPItemFileMigrationTask extends AbstractItemMigrat
|
||||
public boolean encryptPassword(FTPConnection ftpConn) throws Exception {
|
||||
boolean modified = false;
|
||||
if (ftpConn.getPassword() != null) {
|
||||
String password = PasswordEncryptUtil.encryptPassword(ftpConn.getPassword());
|
||||
String password = PasswordEncryptUtil.encryptPassword(ConnectionHelper.getCleanPassword(ftpConn.getPassword()));
|
||||
ftpConn.setPassword(password + PasswordEncryptUtil.ENCRYPT_KEY);
|
||||
modified = true;
|
||||
}
|
||||
|
||||
if (ftpConn.getPassphrase() != null) {
|
||||
String password = PasswordEncryptUtil.encryptPassword(ftpConn.getPassphrase());
|
||||
String password = PasswordEncryptUtil.encryptPassword(ConnectionHelper.getCleanPassword(ftpConn.getPassphrase()));
|
||||
ftpConn.setPassphrase(password + PasswordEncryptUtil.ENCRYPT_KEY);
|
||||
modified = true;
|
||||
}
|
||||
|
||||
if (ftpConn.getKeystorePassword() != null) {
|
||||
String password = PasswordEncryptUtil.encryptPassword(ftpConn.getKeystorePassword());
|
||||
String password = PasswordEncryptUtil
|
||||
.encryptPassword(ConnectionHelper.getCleanPassword(ftpConn.getKeystorePassword()));
|
||||
ftpConn.setKeystorePassword(password + PasswordEncryptUtil.ENCRYPT_KEY);
|
||||
modified = true;
|
||||
}
|
||||
|
||||
if (ftpConn.getProxypassword() != null) {
|
||||
String password = PasswordEncryptUtil.encryptPassword(ftpConn.getProxypassword());
|
||||
String password = PasswordEncryptUtil.encryptPassword(ConnectionHelper.getCleanPassword(ftpConn.getProxypassword()));
|
||||
ftpConn.setProxypassword(password + PasswordEncryptUtil.ENCRYPT_KEY);
|
||||
modified = true;
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ import org.talend.core.model.properties.JobletProcessItem;
|
||||
import org.talend.core.model.properties.ProcessItem;
|
||||
import org.talend.core.model.repository.ERepositoryObjectType;
|
||||
import org.talend.core.repository.model.ProxyRepositoryFactory;
|
||||
import org.talend.cwm.helper.ConnectionHelper;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.ElementParameterType;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.NodeType;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.ProcessType;
|
||||
@@ -125,7 +126,8 @@ public class EncryptPasswordInComponentsMigrationTask extends AbstractItemMigrat
|
||||
}
|
||||
|
||||
if (!encrypted) {
|
||||
param.setValue(PasswordEncryptUtil.encryptPassword(param.getValue())
|
||||
param.setValue(
|
||||
PasswordEncryptUtil.encryptPassword(ConnectionHelper.getCleanPassword(param.getValue()))
|
||||
+ PasswordEncryptUtil.ENCRYPT_KEY);
|
||||
modified = true;
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ import org.talend.core.model.properties.JobletProcessItem;
|
||||
import org.talend.core.model.properties.ProcessItem;
|
||||
import org.talend.core.model.repository.ERepositoryObjectType;
|
||||
import org.talend.core.repository.model.ProxyRepositoryFactory;
|
||||
import org.talend.cwm.helper.ConnectionHelper;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.ElementParameterType;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.ProcessType;
|
||||
|
||||
@@ -127,7 +128,8 @@ public class EncryptPasswordInJobSettingsMigrationTask extends AbstractItemMigra
|
||||
}
|
||||
|
||||
if (!encrypted) {
|
||||
param.setValue(PasswordEncryptUtil.encryptPassword(param.getValue()) + PasswordEncryptUtil.ENCRYPT_KEY);
|
||||
param.setValue(PasswordEncryptUtil.encryptPassword(ConnectionHelper.getCleanPassword(param.getValue()))
|
||||
+ PasswordEncryptUtil.ENCRYPT_KEY);
|
||||
modified = true;
|
||||
}
|
||||
return modified;
|
||||
|
||||
@@ -24,6 +24,7 @@ import org.talend.core.model.general.Project;
|
||||
import org.talend.core.model.properties.ImplicitContextSettings;
|
||||
import org.talend.core.model.properties.Item;
|
||||
import org.talend.core.model.properties.StatAndLogsSettings;
|
||||
import org.talend.cwm.helper.ConnectionHelper;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.ElementParameterType;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.ParametersType;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.impl.ElementParameterTypeImpl;
|
||||
@@ -144,7 +145,8 @@ public class EncryptPasswordInProjectSettingsMigrationTask extends AbstractMigra
|
||||
}
|
||||
|
||||
if (!encrypted) {
|
||||
param.setValue(PasswordEncryptUtil.encryptPassword(param.getValue()) + PasswordEncryptUtil.ENCRYPT_KEY);
|
||||
param.setValue(PasswordEncryptUtil.encryptPassword(ConnectionHelper.getCleanPassword(param.getValue()))
|
||||
+ PasswordEncryptUtil.ENCRYPT_KEY);
|
||||
modified = true;
|
||||
}
|
||||
return modified;
|
||||
|
||||
@@ -53,16 +53,18 @@ public class UnifyPasswordEncryption4ContextMigrationTask extends UnifyPasswordE
|
||||
List<ContextParameterType> paramTypes = type.getContextParameter();
|
||||
if (paramTypes != null) {
|
||||
for (ContextParameterType param : paramTypes) {
|
||||
try {
|
||||
String value = param.getValue();
|
||||
if (value != null && PasswordEncryptUtil.isPasswordType(param.getType())) {
|
||||
String rawPassword = PasswordEncryptUtil.decryptPassword(value);
|
||||
value = cleanPassword(value);
|
||||
String rawPassword;
|
||||
try {
|
||||
rawPassword = PasswordEncryptUtil.decryptPassword(value);
|
||||
param.setRawValue(rawPassword);
|
||||
modify = true;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
return ExecutionResult.FAILURE;
|
||||
param.setRawValue(value);
|
||||
modify = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,6 @@ import org.talend.core.model.metadata.builder.connection.DatabaseConnection;
|
||||
import org.talend.core.model.properties.DatabaseConnectionItem;
|
||||
import org.talend.core.model.properties.Item;
|
||||
import org.talend.core.model.repository.ERepositoryObjectType;
|
||||
import org.talend.cwm.helper.ConnectionHelper;
|
||||
|
||||
/**
|
||||
* created by ggu on Aug 21, 2014 Detailled comment
|
||||
@@ -52,12 +51,11 @@ public class UnifyPasswordEncryption4DBConnectionMigrationTask extends UnifyPass
|
||||
if (!dbConn.isContextMode()) {
|
||||
String pass = dbConn.getPassword();
|
||||
String rawPass = null;
|
||||
pass = cleanPassword(pass);
|
||||
try {
|
||||
rawPass = PasswordEncryptUtil.decryptPassword(pass);
|
||||
} catch (Exception e) {
|
||||
// MOD xqliu 2010-07-07 bug 13826
|
||||
rawPass = ConnectionHelper.getDecryptPassword(pass);
|
||||
// ~ 13826
|
||||
rawPass = pass;
|
||||
}
|
||||
// decrypt the old password.
|
||||
dbConn.setRawPassword(rawPass);
|
||||
|
||||
@@ -17,6 +17,7 @@ import java.util.GregorianCalendar;
|
||||
|
||||
import org.talend.core.model.migration.AbstractItemMigrationTask;
|
||||
import org.talend.core.repository.model.ProxyRepositoryFactory;
|
||||
import org.talend.cwm.helper.ConnectionHelper;
|
||||
|
||||
/**
|
||||
* created by ggu on Aug 21, 2014 Detailled comment
|
||||
@@ -37,4 +38,8 @@ public abstract class UnifyPasswordEncryption4ItemMigrationTask extends Abstract
|
||||
return gc.getTime();
|
||||
}
|
||||
|
||||
protected String cleanPassword(String password) {
|
||||
return ConnectionHelper.getCleanPassword(password);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -108,7 +108,9 @@ public class UnifyPasswordEncryption4ParametersInJobMigrationTask extends UnifyP
|
||||
if (paramTypes != null) {
|
||||
for (ContextParameterType param : paramTypes) {
|
||||
String value = param.getValue();
|
||||
if (value != null && PasswordEncryptUtil.isPasswordType(param.getType())) {
|
||||
if (value != null && (PasswordEncryptUtil.isPasswordType(param.getType())
|
||||
|| PasswordEncryptUtil.isPasswordField(param.getName()))) {
|
||||
value = cleanPassword(value);
|
||||
try {
|
||||
String rawPassword = PasswordEncryptUtil.decryptPassword(value);
|
||||
param.setRawValue(rawPassword);
|
||||
@@ -182,6 +184,7 @@ public class UnifyPasswordEncryption4ParametersInJobMigrationTask extends UnifyP
|
||||
@SuppressWarnings("deprecation")
|
||||
private boolean reencryptValueIfNeeded(ElementParameterType param) throws Exception {
|
||||
String value = param.getValue();
|
||||
value = cleanPassword(value);
|
||||
int index = value.lastIndexOf(PasswordEncryptUtil.ENCRYPT_KEY);
|
||||
if (index != -1) {
|
||||
value = new StringBuilder(value).replace(index, index + PasswordEncryptUtil.ENCRYPT_KEY.length(), "").toString(); //$NON-NLS-1$
|
||||
|
||||
@@ -25,6 +25,7 @@ import org.talend.core.model.process.EParameterFieldType;
|
||||
import org.talend.core.model.properties.ImplicitContextSettings;
|
||||
import org.talend.core.model.properties.StatAndLogsSettings;
|
||||
import org.talend.core.repository.model.ProxyRepositoryFactory;
|
||||
import org.talend.cwm.helper.ConnectionHelper;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.ElementParameterType;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.ParametersType;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.impl.ElementParameterTypeImpl;
|
||||
@@ -109,6 +110,7 @@ public class UnifyPasswordEncryption4ProjectSettingsMigrationTask extends Abstra
|
||||
|
||||
private boolean reencryptValueIfNeeded(ElementParameterType param) throws Exception {
|
||||
String value = param.getValue();
|
||||
value = ConnectionHelper.getCleanPassword(value);
|
||||
int index = value.lastIndexOf(PasswordEncryptUtil.ENCRYPT_KEY);
|
||||
if (index != -1) {
|
||||
value = new StringBuilder(value).replace(index, index + PasswordEncryptUtil.ENCRYPT_KEY.length(), "").toString(); //$NON-NLS-1$
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
package org.talend.repository.model.migration;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.GregorianCalendar;
|
||||
import java.util.List;
|
||||
|
||||
import org.talend.commons.exception.ExceptionHandler;
|
||||
import org.talend.commons.exception.PersistenceException;
|
||||
import org.talend.core.model.migration.AbstractItemMigrationTask;
|
||||
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.repository.model.ProxyRepositoryFactory;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.ContextParameterType;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.ContextType;
|
||||
|
||||
public class UpdateJobletContextInJobMigrationTask extends AbstractItemMigrationTask {
|
||||
|
||||
@Override
|
||||
public Date getOrder() {
|
||||
GregorianCalendar gc = new GregorianCalendar(2016, 5, 17, 16, 0, 0);
|
||||
return gc.getTime();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExecutionResult execute(Item item) {
|
||||
if (item instanceof ProcessItem) {
|
||||
ProcessItem processItem = (ProcessItem) item;
|
||||
List<ContextType> contexts = processItem.getProcess().getContext();
|
||||
if (contexts.size() > 1) {
|
||||
boolean isModified = false;
|
||||
for (ContextType context1 : contexts) {
|
||||
List<ContextParameterType> params1 = context1.getContextParameter();
|
||||
for (ContextParameterType param1 : params1) {
|
||||
String id = param1.getRepositoryContextId();
|
||||
if (id != null) {
|
||||
for (ContextType context2 : contexts) {
|
||||
if (context2 != context1) {
|
||||
List<ContextParameterType> params2 = context2.getContextParameter();
|
||||
for (ContextParameterType param2 : params2) {
|
||||
if (param2.getName().equals(param1.getName())
|
||||
&& param2.getRepositoryContextId() == null) {
|
||||
param2.setRepositoryContextId(id);
|
||||
isModified = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isModified) {
|
||||
try {
|
||||
ProxyRepositoryFactory.getInstance().save(item, true);
|
||||
} catch (PersistenceException e) {
|
||||
ExceptionHandler.process(e);
|
||||
return ExecutionResult.FAILURE;
|
||||
}
|
||||
return ExecutionResult.SUCCESS_NO_ALERT;
|
||||
}
|
||||
}
|
||||
}
|
||||
return ExecutionResult.NOTHING_TO_DO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ERepositoryObjectType> getTypes() {
|
||||
List<ERepositoryObjectType> allTypes = new ArrayList<ERepositoryObjectType>();
|
||||
if (ERepositoryObjectType.PROCESS != null) {
|
||||
allTypes.add(ERepositoryObjectType.PROCESS);
|
||||
}
|
||||
if (ERepositoryObjectType.PROCESS_MR != null) {
|
||||
allTypes.add(ERepositoryObjectType.PROCESS_MR);
|
||||
}
|
||||
if (ERepositoryObjectType.PROCESS_STORM != null) {
|
||||
allTypes.add(ERepositoryObjectType.PROCESS_STORM);
|
||||
}
|
||||
return allTypes;
|
||||
}
|
||||
}
|
||||
@@ -23,6 +23,7 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.eclipse.core.resources.ResourcesPlugin;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.core.runtime.NullProgressMonitor;
|
||||
import org.eclipse.core.runtime.Path;
|
||||
@@ -76,6 +77,7 @@ import org.talend.core.model.properties.Item;
|
||||
import org.talend.core.model.properties.Project;
|
||||
import org.talend.core.model.properties.Property;
|
||||
import org.talend.core.model.repository.ERepositoryObjectType;
|
||||
import org.talend.core.model.repository.Folder;
|
||||
import org.talend.core.model.repository.IExtendedRepositoryNodeHandler;
|
||||
import org.talend.core.model.repository.IRepositoryReviewFilter;
|
||||
import org.talend.core.model.repository.IRepositoryViewObject;
|
||||
@@ -91,6 +93,7 @@ import org.talend.repository.model.IRepositoryNode.ENodeType;
|
||||
import org.talend.repository.model.ProjectRepositoryNode;
|
||||
import org.talend.repository.model.RepositoryNode;
|
||||
import org.talend.repository.model.RepositoryNodeUtilities;
|
||||
import org.talend.repository.model.nodes.IProjectRepositoryNode;
|
||||
import org.talend.repository.viewer.ui.provider.INavigatorContentServiceProvider;
|
||||
import org.talend.repository.viewer.ui.provider.RepoCommonViewerProvider;
|
||||
|
||||
@@ -1025,6 +1028,28 @@ public class ExportItemWizardPage extends WizardPage {
|
||||
selectedItems.add(object.getProperty().getItem());
|
||||
}
|
||||
}
|
||||
List<String> folders = new ArrayList<String>();
|
||||
for (Object obj : filteredCheckboxTree.getViewer().getCheckedElements()) {
|
||||
if (obj instanceof RepositoryNode) {
|
||||
RepositoryNode repositoryNode = (RepositoryNode) obj;
|
||||
if (repositoryNode.getType() == ENodeType.SIMPLE_FOLDER && repositoryNode.getObject() instanceof Folder) {
|
||||
Folder folder = (Folder) repositoryNode.getObject();
|
||||
ERepositoryObjectType contentType = repositoryNode.getContentType();
|
||||
IProjectRepositoryNode root = repositoryNode.getRoot();
|
||||
if (root != null && root.getProject() != null) {
|
||||
IPath path = new Path(root.getProject().getTechnicalLabel());
|
||||
path = path.append(contentType.getFolder());
|
||||
String folderPath = folder.getPath();
|
||||
if (folderPath != null && !"".equals(folderPath)) {
|
||||
path = path.append(folderPath);
|
||||
}
|
||||
path = path.append(folder.getLabel());
|
||||
folders.add(path.toPortableString() + "/");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
ExportItemUtil exportItemUtil = new ExportItemUtil();
|
||||
if (itemFromArchiveRadio.getSelection()) {
|
||||
@@ -1037,7 +1062,7 @@ public class ExportItemWizardPage extends WizardPage {
|
||||
}
|
||||
|
||||
// MOD sgandon 31/03/2010 bug 12229: moved getAllVersion into ExportItemUtil.exportitems() method.
|
||||
exportItemUtil.exportItems(new File(lastPath), selectedItems, true, new NullProgressMonitor());
|
||||
exportItemUtil.exportItems(new File(lastPath), selectedItems, folders, true, new NullProgressMonitor());
|
||||
|
||||
} catch (Exception e) {
|
||||
MessageBoxExceptionHandler.process(e);
|
||||
|
||||
@@ -332,13 +332,8 @@ public class RepositoryReviewDialog extends Dialog {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
|
||||
*/
|
||||
@Override
|
||||
protected Control createDialogArea(Composite parent) {
|
||||
protected Control createDialogArea(Composite parent, String specifiedPId) {
|
||||
|
||||
Composite container = (Composite) super.createDialogArea(parent);
|
||||
TimeMeasure.step(RepositoryReviewDialog.class.getSimpleName(), "before createDialogArea..."); //$NON-NLS-1$
|
||||
GridData data = (GridData) container.getLayoutData();
|
||||
@@ -354,7 +349,7 @@ public class RepositoryReviewDialog extends Dialog {
|
||||
viewContainer.setLayout(new GridLayout());
|
||||
viewContainer.setLayoutData(new GridData(GridData.FILL_BOTH));
|
||||
|
||||
repositoryTreeViewer = RepoCommonViewerProvider.NORMAL.createViewer(viewContainer);
|
||||
repositoryTreeViewer = RepoCommonViewerProvider.NORMAL.createViewer(viewContainer, specifiedPId);
|
||||
|
||||
TimeMeasure.step(RepositoryReviewDialog.class.getSimpleName(), "finshed createViewer"); //$NON-NLS-1$
|
||||
|
||||
@@ -420,6 +415,16 @@ public class RepositoryReviewDialog extends Dialog {
|
||||
return container;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
|
||||
*/
|
||||
@Override
|
||||
protected Control createDialogArea(Composite parent) {
|
||||
return createDialogArea(parent, null);
|
||||
}
|
||||
|
||||
public void addFilter(ViewerFilter filter) {
|
||||
if (filter != null) {
|
||||
getRepositoryTreeViewer().addFilter(filter);
|
||||
|
||||
@@ -60,6 +60,7 @@ import org.talend.commons.exception.BusinessException;
|
||||
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.commons.utils.system.EclipseCommandLine;
|
||||
import org.talend.commons.utils.system.EnvironmentUtils;
|
||||
import org.talend.core.CorePlugin;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
@@ -67,6 +68,7 @@ import org.talend.core.model.general.ConnectionBean;
|
||||
import org.talend.core.model.general.Project;
|
||||
import org.talend.core.repository.model.ProxyRepositoryFactory;
|
||||
import org.talend.core.ui.branding.IBrandingService;
|
||||
import org.talend.core.ui.workspace.ChooseWorkspaceData;
|
||||
import org.talend.repository.i18n.Messages;
|
||||
import org.talend.repository.ui.ERepositoryImages;
|
||||
import org.talend.repository.ui.actions.importproject.ImportDemoProjectAction;
|
||||
@@ -690,7 +692,15 @@ public class TOSLoginComposite extends Composite {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
LoginComposite.isRestart = true;
|
||||
perReader.saveLastConnectionBean(loginComposite.getConnection());
|
||||
ConnectionBean connection = loginComposite.getConnection();
|
||||
perReader.saveLastConnectionBean(connection);
|
||||
// update the restart command line to specify the workspace to launch
|
||||
// if relaunch, should delete the "disableLoginDialog" argument in eclipse data for bug TDI-19214
|
||||
EclipseCommandLine.updateOrCreateExitDataPropertyWithCommand("-data", connection.getWorkSpace(), false); //$NON-NLS-1$
|
||||
// store the workspace in the eclipse history so that it is rememebered on next studio launch
|
||||
ChooseWorkspaceData workspaceData = new ChooseWorkspaceData(""); //$NON-NLS-1$
|
||||
workspaceData.workspaceSelected(connection.getWorkSpace());
|
||||
workspaceData.writePersistedData();
|
||||
dialog.okPressed();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -201,6 +201,7 @@ public class JavaJobExportReArchieveCreator {
|
||||
if (libFolder != null) {
|
||||
File[] files = libFolder.listFiles(new FilenameFilter() {
|
||||
|
||||
@Override
|
||||
public boolean accept(File dir, String name) {
|
||||
return name.toLowerCase().endsWith(FileConstants.JAR_FILE_SUFFIX)
|
||||
|| name.toLowerCase().endsWith(FileConstants.ZIP_FILE_SUFFIX) ? true : false;
|
||||
@@ -221,6 +222,7 @@ public class JavaJobExportReArchieveCreator {
|
||||
if (drlFolder != null) {
|
||||
File[] files = drlFolder.listFiles(new FilenameFilter() {
|
||||
|
||||
@Override
|
||||
public boolean accept(File dir, String name) {
|
||||
return name.toLowerCase().endsWith(".drl") //$NON-NLS-1$
|
||||
? true
|
||||
@@ -240,6 +242,7 @@ public class JavaJobExportReArchieveCreator {
|
||||
if (xlsFolder != null) {
|
||||
File[] files = xlsFolder.listFiles(new FilenameFilter() {
|
||||
|
||||
@Override
|
||||
public boolean accept(File dir, String name) {
|
||||
return name.toLowerCase().endsWith(".xls") //$NON-NLS-1$
|
||||
? true
|
||||
@@ -257,6 +260,7 @@ public class JavaJobExportReArchieveCreator {
|
||||
private String[] getJobFolderJarFilenames() {
|
||||
File[] files = jobFolder.listFiles(new FilenameFilter() {
|
||||
|
||||
@Override
|
||||
public boolean accept(File dir, String name) {
|
||||
return name.toLowerCase().endsWith(FileConstants.JAR_FILE_SUFFIX)
|
||||
|| name.toLowerCase().endsWith(FileConstants.ZIP_FILE_SUFFIX) ? true : false;
|
||||
@@ -316,8 +320,18 @@ public class JavaJobExportReArchieveCreator {
|
||||
if (needjars != null) {
|
||||
for (String needjar : needjars) {
|
||||
if (".".equals(needjar)) {
|
||||
continue;
|
||||
}
|
||||
boolean found = false;
|
||||
for (String jobJar : fs) {
|
||||
if (jobJar != null && jobJar.equals(needjar)) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (found) {
|
||||
continue;
|
||||
}
|
||||
sb.append(needjar + " ");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,12 +13,15 @@
|
||||
package org.talend.repository.ui.wizards.exportjob.scriptsmanager.esb;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import org.talend.core.model.properties.ProcessItem;
|
||||
import org.talend.designer.runprocess.IProcessor;
|
||||
import org.talend.designer.runprocess.ProcessorException;
|
||||
import org.talend.repository.documentation.ExportFileResource;
|
||||
|
||||
import aQute.bnd.osgi.Analyzer;
|
||||
@@ -33,12 +36,18 @@ import aQute.bnd.osgi.Analyzer;
|
||||
*/
|
||||
public class RouteUsedJobManager extends JobJavaScriptOSGIForESBManager {
|
||||
|
||||
private static final String DLL = ".dll";
|
||||
private static final String OSGI_OS = System.getProperty("osgi.os");
|
||||
private static final String OSGI_ARCH = System.getProperty("osgi.arch");
|
||||
|
||||
private String routeName;
|
||||
private String bundleName;
|
||||
private String routeVersion;
|
||||
private String groupId;
|
||||
private String artifactId;
|
||||
private String artifactVersion;
|
||||
private List<URL> dllLibraries = new java.util.ArrayList<URL>();
|
||||
|
||||
|
||||
public RouteUsedJobManager(Map<ExportChoice, Object> exportChoiceMap) {
|
||||
super(exportChoiceMap, null, null, IProcessor.NO_STATISTICS, IProcessor.NO_TRACES);
|
||||
@@ -84,9 +93,32 @@ public class RouteUsedJobManager extends JobJavaScriptOSGIForESBManager {
|
||||
extraParams.put("artifactVersion", artifactVersion);
|
||||
appendExportServiceParams(analyzer, extraParams);
|
||||
|
||||
// TESB-15680: Add bundle manifest using the Bundle-NativeCode header
|
||||
appendBundleNativeCodeForDll(analyzer, libResource);
|
||||
|
||||
return analyzer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add Bundle-NativeCode in Manifest
|
||||
*/
|
||||
private void appendBundleNativeCodeForDll(Analyzer analyzer, ExportFileResource libResource) {
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (URL url : libResource.getResourcesByRelativePath("")) {
|
||||
String path = url.toString();
|
||||
if (path.endsWith(DLL)) {
|
||||
dllLibraries.add(url);
|
||||
sb.append(path.substring(path.lastIndexOf('/') + 1, path.length())).append(';').append("osname=").append(OSGI_OS)
|
||||
.append(';').append("processor=").append(OSGI_ARCH).append(',');
|
||||
}
|
||||
}
|
||||
if (sb.length() > 0) {
|
||||
sb.setLength(sb.length() - 1);
|
||||
analyzer.setProperty(Analyzer.BUNDLE_NATIVECODE, sb.toString());
|
||||
}
|
||||
}
|
||||
|
||||
private void appendExportServiceParams(Analyzer analyzer, Map<String, String> extraParams) {
|
||||
if (!extraParams.isEmpty()) {
|
||||
StringBuilder sb = new StringBuilder(analyzer.getProperty(Analyzer.EXPORT_SERVICE));
|
||||
@@ -100,4 +132,22 @@ public class RouteUsedJobManager extends JobJavaScriptOSGIForESBManager {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Add DLLs in root path
|
||||
*
|
||||
* @see
|
||||
* org.talend.repository.ui.wizards.exportjob.scriptsmanager.esb.JobJavaScriptOSGIForESBManager#getExportResources
|
||||
* (org.talend.repository.documentation.ExportFileResource[], java.lang.String[])
|
||||
*/
|
||||
@Override
|
||||
public List<ExportFileResource> getExportResources(ExportFileResource[] processes, String... codeOptions)
|
||||
throws ProcessorException {
|
||||
List<ExportFileResource> list = super.getExportResources(processes, codeOptions);
|
||||
if (dllLibraries.size() > 0) {
|
||||
ExportFileResource dllResource = new ExportFileResource(null, ""); //$NON-NLS-1$;
|
||||
dllResource.addResources(dllLibraries);
|
||||
list.add(dllResource);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user