Compare commits
31 Commits
patch/6.2.
...
6.2.1-temp
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
87cdb99e1c | ||
|
|
257de029cc | ||
|
|
0b782891c1 | ||
|
|
a913118af5 | ||
|
|
cd705075ea | ||
|
|
ec6aa5ab06 | ||
|
|
423f53f552 | ||
|
|
30ef6fc468 | ||
|
|
ed42bb5219 | ||
|
|
ed5dbe18fa | ||
|
|
6a527e75fe | ||
|
|
6cde2ae7d7 | ||
|
|
feeafd4903 | ||
|
|
d9da03b602 | ||
|
|
746ace2b5e | ||
|
|
b73c932d4d | ||
|
|
d3173d80a5 | ||
|
|
097fbee0be | ||
|
|
7deff74377 | ||
|
|
e5e4b7a51d | ||
|
|
2dd0069b6c | ||
|
|
1ed0c7f097 | ||
|
|
cf641aedc5 | ||
|
|
a88465f325 | ||
|
|
f6e06eb32b | ||
|
|
52b21db1d1 | ||
|
|
084fac454e | ||
|
|
a55eafdf22 | ||
|
|
538a77015b | ||
|
|
ddee810392 | ||
|
|
273ed94100 |
@@ -65,6 +65,8 @@ List<Component.CodegenPropInfo> propsToProcess = component.getCodegenPropInfos(c
|
||||
(<%= componentProps.getClass().getName()%>) def_<%=cid %>.createRuntimeProperties();
|
||||
<%
|
||||
|
||||
int schemaIndex = 0;
|
||||
|
||||
for (Component.CodegenPropInfo propInfo : propsToProcess) { // propInfo
|
||||
List<NamedThing> properties = propInfo.props.getProperties();
|
||||
for (NamedThing prop : properties) { // property
|
||||
@@ -116,9 +118,59 @@ for (Component.CodegenPropInfo propInfo : propsToProcess) { // propInfo
|
||||
<%=property.getType()%>.<%=property.getValue()%>);
|
||||
<%
|
||||
} else if (property instanceof org.talend.daikon.properties.property.SchemaProperty) {
|
||||
String schemaValue = component.getCodegenValue(property, property.getStringValue());
|
||||
String[] splits = schemaValue.split("(?=\\\\\"name\\\\\":)");
|
||||
%>
|
||||
|
||||
class SchemaSettingTool_<%=cid%>_<%=++schemaIndex%> {
|
||||
|
||||
String getSchemaValue() {
|
||||
<%
|
||||
if((splits == null) || (splits.length < 2)) {
|
||||
%>
|
||||
return <%=schemaValue%>;
|
||||
<%
|
||||
} else {
|
||||
%>
|
||||
StringBuilder s = new StringBuilder();
|
||||
<%
|
||||
for(int i=0; i<splits.length; i++) {
|
||||
String currentSplit = splits[i];
|
||||
if(i == 0) {
|
||||
%>
|
||||
a(<%=currentSplit%>",s);
|
||||
<%
|
||||
continue;
|
||||
}
|
||||
|
||||
if(i == (splits.length - 1)) {
|
||||
%>
|
||||
a("<%=currentSplit%>,s);
|
||||
<%
|
||||
continue;
|
||||
}
|
||||
|
||||
%>
|
||||
a("<%=currentSplit%>",s);
|
||||
<%
|
||||
}
|
||||
%>
|
||||
return s.toString();
|
||||
<%
|
||||
}
|
||||
%>
|
||||
}
|
||||
|
||||
void a(String part, StringBuilder strB) {
|
||||
strB.append(part);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
SchemaSettingTool_<%=cid%>_<%=schemaIndex%> sst_<%=cid%>_<%=schemaIndex%> = new SchemaSettingTool_<%=cid%>_<%=schemaIndex%>();
|
||||
|
||||
props_<%=cid %><%=propInfo.fieldName%>.setValue("<%=property.getName()%>",
|
||||
new org.apache.avro.Schema.Parser().parse(<%=component.getCodegenValue(property, property.getStringValue())%>));
|
||||
new org.apache.avro.Schema.Parser().parse(sst_<%=cid%>_<%=schemaIndex%>.getSchemaValue()));
|
||||
<%
|
||||
} else if (!(value instanceof String) || !((String)value).equals("")) { // if
|
||||
%>
|
||||
|
||||
@@ -304,6 +304,13 @@ public <%=JavaTypesManager.getTypeToGenerate(ctxParam.getType(),true)%> get<%=Ch
|
||||
if(isRunInMultiThread || NodeUtil.containsMultiThreadComponent(process)){
|
||||
%>
|
||||
private final java.util.Map<String, Object> globalMap = java.util.Collections.synchronizedMap(new java.util.HashMap<String, Object>());
|
||||
<%
|
||||
if(ProcessUtils.isTestContainer(process)) {
|
||||
%>
|
||||
private final static java.util.Map<String, Object> junitGlobalMap = java.util.Collections.synchronizedMap(new java.util.HashMap<String, Object>());
|
||||
<%
|
||||
}
|
||||
%>
|
||||
<%
|
||||
} else {
|
||||
%>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.talend.mdm.transaction.client;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.httpclient.HttpClient;
|
||||
import org.apache.commons.httpclient.HttpException;
|
||||
@@ -10,98 +11,96 @@ import org.apache.commons.httpclient.auth.AuthScope;
|
||||
import org.apache.commons.httpclient.methods.DeleteMethod;
|
||||
import org.apache.commons.httpclient.methods.PostMethod;
|
||||
|
||||
@SuppressWarnings("nls")
|
||||
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 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));
|
||||
private String id;
|
||||
|
||||
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();
|
||||
}
|
||||
private String username;
|
||||
|
||||
int statuscode = method.getStatusCode();
|
||||
if (statuscode >= 400) {
|
||||
throw new MDMTransactionException("Commit failed. The commit operation has returned the code " + statuscode + ".");
|
||||
}
|
||||
}
|
||||
private String password;
|
||||
|
||||
public void rollback() throws IOException {
|
||||
HttpClient client = new HttpClient();
|
||||
client.getState().setCredentials(AuthScope.ANY,
|
||||
new UsernamePasswordCredentials(username, password));
|
||||
private List<String> cookies;
|
||||
|
||||
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();
|
||||
}
|
||||
public void commit() throws IOException {
|
||||
HttpClient client = new HttpClient();
|
||||
client.getState().setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(username, password));
|
||||
|
||||
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;
|
||||
HttpMethod method = new PostMethod(url + "/" + id);
|
||||
method.setDoAuthentication(true);
|
||||
try {
|
||||
for (String cookie : cookies) {
|
||||
method.addRequestHeader("Cookie", cookie);
|
||||
}
|
||||
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 + ".");
|
||||
}
|
||||
return stickySession;
|
||||
}
|
||||
|
||||
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 {
|
||||
for (String cookie : cookies) {
|
||||
method.addRequestHeader("Cookie", cookie);
|
||||
}
|
||||
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 List<String> getCookies() {
|
||||
return cookies;
|
||||
}
|
||||
|
||||
public void setCookies(List<String> cookies) {
|
||||
this.cookies = cookies;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.talend.mdm.transaction.client;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.httpclient.Header;
|
||||
import org.apache.commons.httpclient.HttpClient;
|
||||
@@ -10,13 +12,10 @@ 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;
|
||||
|
||||
@SuppressWarnings("nls")
|
||||
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));
|
||||
@@ -25,11 +24,11 @@ public class MDMTransactionClient {
|
||||
PutMethod put = new PutMethod(url);
|
||||
put.setDoAuthentication(true);
|
||||
String tid;
|
||||
String sessionID;
|
||||
List<String> cookies;
|
||||
try {
|
||||
client.executeMethod(put);
|
||||
tid = put.getResponseBodyAsString();
|
||||
sessionID = parseSessionID(put);
|
||||
cookies = parseCookies(put);
|
||||
} catch (HttpException e) {
|
||||
throw e;
|
||||
} catch (IOException e) {
|
||||
@@ -43,30 +42,30 @@ public class MDMTransactionClient {
|
||||
result.setId(tid);
|
||||
result.setUsername(username);
|
||||
result.setPassword(password);
|
||||
result.setSessionId(sessionID);
|
||||
result.setCookies(cookies);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public static String getMDMTransactionURL(String url, boolean isNewServer) {
|
||||
if(url == null || "".equals(url)) {
|
||||
if (url == null || "".equals(url)) {
|
||||
return "";
|
||||
}
|
||||
|
||||
int count = 3;
|
||||
int i=0;
|
||||
for(;i<url.length();i++) {
|
||||
int i = 0;
|
||||
for (; i < url.length(); i++) {
|
||||
char c = url.charAt(i);
|
||||
if('/' == c) {
|
||||
if ('/' == c) {
|
||||
count--;
|
||||
}
|
||||
if(count == 0) {
|
||||
if (count == 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
String result = url.substring(0, i);
|
||||
if(isNewServer){
|
||||
if (isNewServer) {
|
||||
result += "/talendmdm/services/rest/transactions";
|
||||
} else {
|
||||
result += "/datamanager/services/transactions";
|
||||
@@ -75,17 +74,17 @@ public class MDMTransactionClient {
|
||||
return result;
|
||||
}
|
||||
|
||||
public static String getSessionID(String url, String username, String password) throws IOException {
|
||||
public static List<String> getCookies(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;
|
||||
List<String> cookies;
|
||||
try {
|
||||
client.executeMethod(get);
|
||||
sessionID = parseSessionID(get);
|
||||
cookies = parseCookies(get);
|
||||
} catch (HttpException e) {
|
||||
throw e;
|
||||
} catch (IOException e) {
|
||||
@@ -93,44 +92,16 @@ public class MDMTransactionClient {
|
||||
} finally {
|
||||
get.releaseConnection();
|
||||
}
|
||||
return sessionID;
|
||||
return cookies;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
private static List<String> parseCookies(HttpMethod method) {
|
||||
List<String> cookies = new ArrayList<String>();
|
||||
Header[] setCookie = method.getResponseHeaders("Set-Cookie");
|
||||
for (Header header : setCookie) {
|
||||
cookies.add(header.getValue());
|
||||
}
|
||||
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 void main(String[] args) throws IOException {
|
||||
String sessionID = MDMTransactionClient.getSessionID("http://localhost:8621/talendmdm/services/rest/transactions", "administrator", "administrator");
|
||||
System.out.println(sessionID);
|
||||
|
||||
MDMTransaction mt = MDMTransactionClient.newTransaction("http://localhost:8180/talendmdm/services/rest/transactions", "administrator", "administrator");
|
||||
mt.commit();
|
||||
|
||||
MDMTransaction mt1 = MDMTransactionClient.newTransaction("http://localhost:8180/talendmdm/services/rest/transactions", "administrator", "administrator");
|
||||
mt1.rollback();
|
||||
|
||||
String url = "http://localhost:8180/talend/TalendPort";
|
||||
String mdmurl = MDMTransactionClient.getMDMTransactionURL(url, true);
|
||||
System.out.println(mdmurl);
|
||||
return cookies;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -36,33 +36,50 @@ String trans = "mdmTrans_" + connection;
|
||||
org.talend.mdm.bulkload.client.BulkloadClient bulkloadClient_<%=cid %> = new org.talend.mdm.bulkload.client.BulkloadClient(<%=mdmUrl %>, <%=username %>, decryptedPassword_<%=cid %>, null, <%=dataCluster %> + "<%=isStaging?"#STAGING":""%>", <%=dataEntity %>, <%=dataModule %>);
|
||||
|
||||
<%if(useTransaction) {%>
|
||||
String transKey_<%=cid %> = "<%=trans%>_" + Thread.currentThread().getThreadGroup().getName();
|
||||
com.talend.mdm.transaction.client.MDMTransaction mdmTransaction_<%=cid %> = (com.talend.mdm.transaction.client.MDMTransaction)globalMap.get(transKey_<%=cid %>);
|
||||
if(mdmTransaction_<%=cid %> == null) {
|
||||
String murl_<%=cid %> = (String)globalMap.get("mdmUrl_<%=connection %>");
|
||||
if(murl_<%=cid %>.endsWith("?wsdl")) {
|
||||
murl_<%=cid %> = murl_<%=cid %>.substring(0, murl_<%=cid %>.length() - 5);
|
||||
if(globalMap.get("useTransaction_<%=connection %>") != null && (Boolean)globalMap.get("useTransaction_<%=connection %>")) {
|
||||
String transKey_<%=cid %> = "<%=trans%>_" + Thread.currentThread().getThreadGroup().getName();
|
||||
com.talend.mdm.transaction.client.MDMTransaction mdmTransaction_<%=cid %> = (com.talend.mdm.transaction.client.MDMTransaction)globalMap.get(transKey_<%=cid %>);
|
||||
if(mdmTransaction_<%=cid %> == null) {
|
||||
Boolean transInitStart_<%=cid%> = false;
|
||||
synchronized(globalMap){
|
||||
if(globalMap.containsKey(transKey_<%=cid %> + "_initStart")){
|
||||
transInitStart_<%=cid%> = true;
|
||||
}else{
|
||||
globalMap.put(transKey_<%=cid %> + "_initStart", true);
|
||||
}
|
||||
}
|
||||
if(transInitStart_<%=cid%> == false){
|
||||
String murl_<%=cid %> = (String)globalMap.get("mdmUrl_<%=connection %>");
|
||||
if(murl_<%=cid %>.endsWith("?wsdl")) {
|
||||
murl_<%=cid %> = murl_<%=cid %>.substring(0, murl_<%=cid %>.length() - 5);
|
||||
}
|
||||
String turl_<%=cid %> = com.talend.mdm.transaction.client.MDMTransactionClient.getMDMTransactionURL(murl_<%=cid %>, true);
|
||||
String username_<%=cid %> = (String)globalMap.get("username_<%=connection %>");
|
||||
String password_<%=cid %> = (String)globalMap.get("password_<%=connection %>");
|
||||
if((Boolean)globalMap.get("useClientTranId_<%=connection %>")){
|
||||
List<String> cookies_<%=cid%> = com.talend.mdm.transaction.client.MDMTransactionClient.getCookies(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 %>.setCookies(cookies_<%=cid%>);
|
||||
}else{
|
||||
<% logUtil.debug("\"Attempt to get a remote transaction from url: \" + murl_" + cid);%>
|
||||
mdmTransaction_<%=cid %> = com.talend.mdm.transaction.client.MDMTransactionClient.newTransaction(turl_<%=cid %>,username_<%=cid %>,password_<%=cid %>);
|
||||
}
|
||||
}else{
|
||||
while(mdmTransaction_<%=cid %> == null){
|
||||
Thread.sleep(10);
|
||||
mdmTransaction_<%=cid %> = (com.talend.mdm.transaction.client.MDMTransaction)globalMap.get(transKey_<%=cid %>);
|
||||
}
|
||||
}
|
||||
globalMap.put(transKey_<%=cid %>, mdmTransaction_<%=cid %>);
|
||||
<% logUtil.debug("\"Got transaction successfully with key=\" + transKey_" + cid);%>
|
||||
}
|
||||
String turl_<%=cid %> = com.talend.mdm.transaction.client.MDMTransactionClient.getMDMTransactionURL(murl_<%=cid %>, true);
|
||||
String username_<%=cid %> = (String)globalMap.get("username_<%=connection %>");
|
||||
String password_<%=cid %> = (String)globalMap.get("password_<%=connection %>");
|
||||
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 {
|
||||
<% logUtil.debug("\"Attempt to get a remote transaction from url: \" + murl_" + cid);%>
|
||||
mdmTransaction_<%=cid %> = com.talend.mdm.transaction.client.MDMTransactionClient.newTransaction(turl_<%=cid %>,username_<%=cid %>,password_<%=cid %>);
|
||||
}
|
||||
globalMap.put(transKey_<%=cid %>, mdmTransaction_<%=cid %>);
|
||||
<% logUtil.debug("\"Got transaction successfully with key=\" + transKey_" + cid);%>
|
||||
bulkloadClient_<%=cid %>.setTransactionId(mdmTransaction_<%=cid %>.getId());
|
||||
bulkloadClient_<%=cid %>.setCookies(mdmTransaction_<%=cid%>.getCookies());
|
||||
}
|
||||
bulkloadClient_<%=cid %>.setTransactionId(mdmTransaction_<%=cid %>.getId());
|
||||
bulkloadClient_<%=cid %>.setSessionId(mdmTransaction_<%=cid%>.getSessionId());
|
||||
<%}%>
|
||||
|
||||
bulkloadClient_<%=cid %>.startThreadCount();
|
||||
|
||||
Binary file not shown.
@@ -70,18 +70,34 @@ int nb_line_<%=cid %> = 0;
|
||||
String turl_<%=cid %> = com.talend.mdm.transaction.client.MDMTransactionClient.getMDMTransactionURL(murl_<%=cid %>, true);
|
||||
com.talend.mdm.transaction.client.MDMTransaction mdmTransaction_<%=cid %> = (com.talend.mdm.transaction.client.MDMTransaction)globalMap.get(transKey_<%=cid %>);
|
||||
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{
|
||||
<% logUtil.debug("\"Attempt to get a remote transaction from url: \" + murl_" + cid);%>
|
||||
mdmTransaction_<%=cid %> = com.talend.mdm.transaction.client.MDMTransactionClient.newTransaction(turl_<%=cid %>,username_<%=cid %>,password_<%=cid %>);
|
||||
Boolean transInitStart_<%=cid%> = false;
|
||||
synchronized(globalMap){
|
||||
if(globalMap.containsKey(transKey_<%=cid %> + "_initStart")){
|
||||
transInitStart_<%=cid%> = true;
|
||||
}else{
|
||||
globalMap.put(transKey_<%=cid %> + "_initStart", true);
|
||||
}
|
||||
}
|
||||
if(transInitStart_<%=cid%> == false){
|
||||
if((Boolean)globalMap.get("useClientTranId_<%=connection %>")){
|
||||
List<String> cookies_<%=cid%> = com.talend.mdm.transaction.client.MDMTransactionClient.getCookies(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 %>.setCookies(cookies_<%=cid%>);
|
||||
}else{
|
||||
<% logUtil.debug("\"Attempt to get a remote transaction from url: \" + murl_" + cid);%>
|
||||
mdmTransaction_<%=cid %> = com.talend.mdm.transaction.client.MDMTransactionClient.newTransaction(turl_<%=cid %>,username_<%=cid %>,password_<%=cid %>);
|
||||
}
|
||||
}else{
|
||||
while(mdmTransaction_<%=cid %> == null){
|
||||
Thread.sleep(10);
|
||||
mdmTransaction_<%=cid %> = (com.talend.mdm.transaction.client.MDMTransaction)globalMap.get(transKey_<%=cid %>);
|
||||
}
|
||||
}
|
||||
|
||||
java.util.List<org.apache.cxf.headers.Header> soapHeaders_<%=cid %> = new java.util.ArrayList<org.apache.cxf.headers.Header>();
|
||||
javax.xml.namespace.QName qName_<%=cid %> = new javax.xml.namespace.QName("http://www.talend.com/mdm", "transaction-id");
|
||||
org.apache.cxf.databinding.DataBinding dataBinding_<%=cid %> = new org.apache.cxf.jaxb.JAXBDataBinding(String.class);
|
||||
@@ -89,8 +105,7 @@ int nb_line_<%=cid %> = 0;
|
||||
context_<%=cid %>.put(org.apache.cxf.headers.Header.HEADER_LIST, soapHeaders_<%=cid %>);
|
||||
|
||||
java.util.Map<String, java.util.List<String>> httpHeaders_<%=cid %> = new java.util.HashMap<String, java.util.List<String>>();
|
||||
String cookie_<%=cid %> = com.talend.mdm.transaction.client.MDMTransaction.getStickySession() + "=" + mdmTransaction_<%=cid%>.getSessionId();
|
||||
httpHeaders_<%=cid %>.put("Cookie", java.util.Arrays.asList(cookie_<%=cid %>));
|
||||
httpHeaders_<%=cid %>.put("Cookie", mdmTransaction_<%=cid %>.getCookies());
|
||||
context_<%=cid %>.put(org.apache.cxf.message.Message.PROTOCOL_HEADERS, httpHeaders_<%=cid %>);
|
||||
|
||||
globalMap.put(transKey_<%=cid %>, mdmTransaction_<%=cid %>);
|
||||
|
||||
@@ -138,18 +138,34 @@ int nb_line_rejected_<%=cid %> = 0;
|
||||
String turl_<%=cid %> = com.talend.mdm.transaction.client.MDMTransactionClient.getMDMTransactionURL(murl_<%=cid %>, true);
|
||||
com.talend.mdm.transaction.client.MDMTransaction mdmTransaction_<%=cid %> = (com.talend.mdm.transaction.client.MDMTransaction)globalMap.get(transKey_<%=cid %>);
|
||||
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{
|
||||
<% logUtil.debug("\"Attempt to get a remote transaction from url: \" + murl_" + cid);%>
|
||||
mdmTransaction_<%=cid %> = com.talend.mdm.transaction.client.MDMTransactionClient.newTransaction(turl_<%=cid %>,username_<%=cid %>,password_<%=cid %>);
|
||||
Boolean transInitStart_<%=cid%> = false;
|
||||
synchronized(globalMap){
|
||||
if(globalMap.containsKey(transKey_<%=cid %> + "_initStart")){
|
||||
transInitStart_<%=cid%> = true;
|
||||
}else{
|
||||
globalMap.put(transKey_<%=cid %> + "_initStart", true);
|
||||
}
|
||||
}
|
||||
if(transInitStart_<%=cid%> == false){
|
||||
if((Boolean)globalMap.get("useClientTranId_<%=connection %>")){
|
||||
List<String> cookies_<%=cid%> = com.talend.mdm.transaction.client.MDMTransactionClient.getCookies(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 %>.setCookies(cookies_<%=cid%>);
|
||||
}else{
|
||||
<% logUtil.debug("\"Attempt to get a remote transaction from url: \" + murl_" + cid);%>
|
||||
mdmTransaction_<%=cid %> = com.talend.mdm.transaction.client.MDMTransactionClient.newTransaction(turl_<%=cid %>,username_<%=cid %>,password_<%=cid %>);
|
||||
}
|
||||
}else{
|
||||
while(mdmTransaction_<%=cid %> == null){
|
||||
Thread.sleep(10);
|
||||
mdmTransaction_<%=cid %> = (com.talend.mdm.transaction.client.MDMTransaction)globalMap.get(transKey_<%=cid %>);
|
||||
}
|
||||
}
|
||||
|
||||
java.util.List<org.apache.cxf.headers.Header> soapHeaders_<%=cid %> = new java.util.ArrayList<org.apache.cxf.headers.Header>();
|
||||
javax.xml.namespace.QName qName_<%=cid %> = new javax.xml.namespace.QName("http://www.talend.com/mdm", "transaction-id");
|
||||
org.apache.cxf.databinding.DataBinding dataBinding_<%=cid %> = new org.apache.cxf.jaxb.JAXBDataBinding(String.class);
|
||||
@@ -157,8 +173,7 @@ int nb_line_rejected_<%=cid %> = 0;
|
||||
context_<%=cid %>.put(org.apache.cxf.headers.Header.HEADER_LIST, soapHeaders_<%=cid %>);
|
||||
|
||||
java.util.Map<String, java.util.List<String>> httpHeaders_<%=cid %> = new java.util.HashMap<String, java.util.List<String>>();
|
||||
String cookie_<%=cid %> = com.talend.mdm.transaction.client.MDMTransaction.getStickySession() + "=" + mdmTransaction_<%=cid%>.getSessionId();
|
||||
httpHeaders_<%=cid %>.put("Cookie", java.util.Arrays.asList(cookie_<%=cid %>));
|
||||
httpHeaders_<%=cid %>.put("Cookie", mdmTransaction_<%=cid %>.getCookies());
|
||||
context_<%=cid %>.put(org.apache.cxf.message.Message.PROTOCOL_HEADERS, httpHeaders_<%=cid %>);
|
||||
|
||||
globalMap.put(transKey_<%=cid %>, mdmTransaction_<%=cid %>);
|
||||
|
||||
@@ -113,18 +113,34 @@ if ((metadatas != null) && (metadatas.size() > 0)) {//1
|
||||
String turl_<%=cid %> = com.talend.mdm.transaction.client.MDMTransactionClient.getMDMTransactionURL(murl_<%=cid %>, true);
|
||||
com.talend.mdm.transaction.client.MDMTransaction mdmTransaction_<%=cid %> = (com.talend.mdm.transaction.client.MDMTransaction)globalMap.get(transKey_<%=cid %>);
|
||||
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{
|
||||
<% logUtil.debug("\"Attempt to get a remote transaction from url: \" + murl_" + cid);%>
|
||||
mdmTransaction_<%=cid %> = com.talend.mdm.transaction.client.MDMTransactionClient.newTransaction(turl_<%=cid %>,username_<%=cid %>,password_<%=cid %>);
|
||||
Boolean transInitStart_<%=cid%> = false;
|
||||
synchronized(globalMap){
|
||||
if(globalMap.containsKey(transKey_<%=cid %> + "_initStart")){
|
||||
transInitStart_<%=cid%> = true;
|
||||
}else{
|
||||
globalMap.put(transKey_<%=cid %> + "_initStart", true);
|
||||
}
|
||||
}
|
||||
if(transInitStart_<%=cid%> == false){
|
||||
if((Boolean)globalMap.get("useClientTranId_<%=connection %>")){
|
||||
List<String> cookies_<%=cid%> = com.talend.mdm.transaction.client.MDMTransactionClient.getCookies(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 %>.setCookies(cookies_<%=cid%>);
|
||||
}else{
|
||||
<% logUtil.debug("\"Attempt to get a remote transaction from url: \" + murl_" + cid);%>
|
||||
mdmTransaction_<%=cid %> = com.talend.mdm.transaction.client.MDMTransactionClient.newTransaction(turl_<%=cid %>,username_<%=cid %>,password_<%=cid %>);
|
||||
}
|
||||
}else{
|
||||
while(mdmTransaction_<%=cid %> == null){
|
||||
Thread.sleep(10);
|
||||
mdmTransaction_<%=cid %> = (com.talend.mdm.transaction.client.MDMTransaction)globalMap.get(transKey_<%=cid %>);
|
||||
}
|
||||
}
|
||||
|
||||
java.util.List<org.apache.cxf.headers.Header> soapHeaders_<%=cid %> = new java.util.ArrayList<org.apache.cxf.headers.Header>();
|
||||
javax.xml.namespace.QName qName_<%=cid %> = new javax.xml.namespace.QName("http://www.talend.com/mdm", "transaction-id");
|
||||
org.apache.cxf.databinding.DataBinding dataBinding_<%=cid %> = new org.apache.cxf.jaxb.JAXBDataBinding(String.class);
|
||||
@@ -132,8 +148,7 @@ if ((metadatas != null) && (metadatas.size() > 0)) {//1
|
||||
context_<%=cid %>.put(org.apache.cxf.headers.Header.HEADER_LIST, soapHeaders_<%=cid %>);
|
||||
|
||||
java.util.Map<String, java.util.List<String>> httpHeaders_<%=cid %> = new java.util.HashMap<String, java.util.List<String>>();
|
||||
String cookie_<%=cid %> = com.talend.mdm.transaction.client.MDMTransaction.getStickySession() + "=" + mdmTransaction_<%=cid%>.getSessionId();
|
||||
httpHeaders_<%=cid %>.put("Cookie", java.util.Arrays.asList(cookie_<%=cid %>));
|
||||
httpHeaders_<%=cid %>.put("Cookie", mdmTransaction_<%=cid %>.getCookies());
|
||||
context_<%=cid %>.put(org.apache.cxf.message.Message.PROTOCOL_HEADERS, httpHeaders_<%=cid %>);
|
||||
|
||||
globalMap.put(transKey_<%=cid %>, mdmTransaction_<%=cid %>);
|
||||
|
||||
@@ -75,18 +75,34 @@ int nb_line_<%=cid %> = 0;
|
||||
String turl_<%=cid %> = com.talend.mdm.transaction.client.MDMTransactionClient.getMDMTransactionURL(murl_<%=cid %>, true);
|
||||
com.talend.mdm.transaction.client.MDMTransaction mdmTransaction_<%=cid %> = (com.talend.mdm.transaction.client.MDMTransaction)globalMap.get(transKey_<%=cid %>);
|
||||
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{
|
||||
<% logUtil.debug("\"Attempt to get a remote transaction from url: \" + murl_" + cid);%>
|
||||
mdmTransaction_<%=cid %> = com.talend.mdm.transaction.client.MDMTransactionClient.newTransaction(turl_<%=cid %>,username_<%=cid %>,password_<%=cid %>);
|
||||
Boolean transInitStart_<%=cid%> = false;
|
||||
synchronized(globalMap){
|
||||
if(globalMap.containsKey(transKey_<%=cid %> + "_initStart")){
|
||||
transInitStart_<%=cid%> = true;
|
||||
}else{
|
||||
globalMap.put(transKey_<%=cid %> + "_initStart", true);
|
||||
}
|
||||
}
|
||||
if(transInitStart_<%=cid%> == false){
|
||||
if((Boolean)globalMap.get("useClientTranId_<%=connection %>")){
|
||||
List<String> cookies_<%=cid%> = com.talend.mdm.transaction.client.MDMTransactionClient.getCookies(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 %>.setCookies(cookies_<%=cid%>);
|
||||
}else{
|
||||
<% logUtil.debug("\"Attempt to get a remote transaction from url: \" + murl_" + cid);%>
|
||||
mdmTransaction_<%=cid %> = com.talend.mdm.transaction.client.MDMTransactionClient.newTransaction(turl_<%=cid %>,username_<%=cid %>,password_<%=cid %>);
|
||||
}
|
||||
}else{
|
||||
while(mdmTransaction_<%=cid %> == null){
|
||||
Thread.sleep(10);
|
||||
mdmTransaction_<%=cid %> = (com.talend.mdm.transaction.client.MDMTransaction)globalMap.get(transKey_<%=cid %>);
|
||||
}
|
||||
}
|
||||
|
||||
java.util.List<org.apache.cxf.headers.Header> soapHeaders_<%=cid %> = new java.util.ArrayList<org.apache.cxf.headers.Header>();
|
||||
javax.xml.namespace.QName qName_<%=cid %> = new javax.xml.namespace.QName("http://www.talend.com/mdm", "transaction-id");
|
||||
org.apache.cxf.databinding.DataBinding dataBinding_<%=cid %> = new org.apache.cxf.jaxb.JAXBDataBinding(String.class);
|
||||
@@ -94,8 +110,7 @@ int nb_line_<%=cid %> = 0;
|
||||
context_<%=cid %>.put(org.apache.cxf.headers.Header.HEADER_LIST, soapHeaders_<%=cid %>);
|
||||
|
||||
java.util.Map<String, java.util.List<String>> httpHeaders_<%=cid %> = new java.util.HashMap<String, java.util.List<String>>();
|
||||
String cookie_<%=cid %> = com.talend.mdm.transaction.client.MDMTransaction.getStickySession() + "=" + mdmTransaction_<%=cid%>.getSessionId();
|
||||
httpHeaders_<%=cid %>.put("Cookie", java.util.Arrays.asList(cookie_<%=cid %>));
|
||||
httpHeaders_<%=cid %>.put("Cookie", mdmTransaction_<%=cid %>.getCookies());
|
||||
context_<%=cid %>.put(org.apache.cxf.message.Message.PROTOCOL_HEADERS, httpHeaders_<%=cid %>);
|
||||
|
||||
globalMap.put(transKey_<%=cid %>, mdmTransaction_<%=cid %>);
|
||||
|
||||
@@ -68,18 +68,34 @@ int nb_line_<%=cid %> = 0;
|
||||
String turl_<%=cid %> = com.talend.mdm.transaction.client.MDMTransactionClient.getMDMTransactionURL(murl_<%=cid %>, true);
|
||||
com.talend.mdm.transaction.client.MDMTransaction mdmTransaction_<%=cid %> = (com.talend.mdm.transaction.client.MDMTransaction)globalMap.get(transKey_<%=cid %>);
|
||||
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{
|
||||
<% logUtil.debug("\"Attempt to get a remote transaction from url: \" + murl_" + cid);%>
|
||||
mdmTransaction_<%=cid %> = com.talend.mdm.transaction.client.MDMTransactionClient.newTransaction(turl_<%=cid %>,username_<%=cid %>,password_<%=cid %>);
|
||||
Boolean transInitStart_<%=cid%> = false;
|
||||
synchronized(globalMap){
|
||||
if(globalMap.containsKey(transKey_<%=cid %> + "_initStart")){
|
||||
transInitStart_<%=cid%> = true;
|
||||
}else{
|
||||
globalMap.put(transKey_<%=cid %> + "_initStart", true);
|
||||
}
|
||||
}
|
||||
if(transInitStart_<%=cid%> == false){
|
||||
if((Boolean)globalMap.get("useClientTranId_<%=connection %>")){
|
||||
List<String> cookies_<%=cid%> = com.talend.mdm.transaction.client.MDMTransactionClient.getCookies(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 %>.setCookies(cookies_<%=cid%>);
|
||||
}else{
|
||||
<% logUtil.debug("\"Attempt to get a remote transaction from url: \" + murl_" + cid);%>
|
||||
mdmTransaction_<%=cid %> = com.talend.mdm.transaction.client.MDMTransactionClient.newTransaction(turl_<%=cid %>,username_<%=cid %>,password_<%=cid %>);
|
||||
}
|
||||
}else{
|
||||
while(mdmTransaction_<%=cid %> == null){
|
||||
Thread.sleep(10);
|
||||
mdmTransaction_<%=cid %> = (com.talend.mdm.transaction.client.MDMTransaction)globalMap.get(transKey_<%=cid %>);
|
||||
}
|
||||
}
|
||||
|
||||
java.util.List<org.apache.cxf.headers.Header> soapHeaders_<%=cid %> = new java.util.ArrayList<org.apache.cxf.headers.Header>();
|
||||
javax.xml.namespace.QName qName_<%=cid %> = new javax.xml.namespace.QName("http://www.talend.com/mdm", "transaction-id");
|
||||
org.apache.cxf.databinding.DataBinding dataBinding_<%=cid %> = new org.apache.cxf.jaxb.JAXBDataBinding(String.class);
|
||||
@@ -87,8 +103,7 @@ int nb_line_<%=cid %> = 0;
|
||||
context_<%=cid %>.put(org.apache.cxf.headers.Header.HEADER_LIST, soapHeaders_<%=cid %>);
|
||||
|
||||
java.util.Map<String, java.util.List<String>> httpHeaders_<%=cid %> = new java.util.HashMap<String, java.util.List<String>>();
|
||||
String cookie_<%=cid %> = com.talend.mdm.transaction.client.MDMTransaction.getStickySession() + "=" + mdmTransaction_<%=cid%>.getSessionId();
|
||||
httpHeaders_<%=cid %>.put("Cookie", java.util.Arrays.asList(cookie_<%=cid %>));
|
||||
httpHeaders_<%=cid %>.put("Cookie", mdmTransaction_<%=cid %>.getCookies());
|
||||
context_<%=cid %>.put(org.apache.cxf.message.Message.PROTOCOL_HEADERS, httpHeaders_<%=cid %>);
|
||||
|
||||
globalMap.put(transKey_<%=cid %>, mdmTransaction_<%=cid %>);
|
||||
|
||||
@@ -111,18 +111,34 @@ if ((metadatas != null) && (metadatas.size() > 0)) {
|
||||
String turl_<%=cid %> = com.talend.mdm.transaction.client.MDMTransactionClient.getMDMTransactionURL(murl_<%=cid %>, true);
|
||||
com.talend.mdm.transaction.client.MDMTransaction mdmTransaction_<%=cid %> = (com.talend.mdm.transaction.client.MDMTransaction)globalMap.get(transKey_<%=cid %>);
|
||||
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{
|
||||
<% logUtil.debug("\"Attempt to get a remote transaction from url: \" + murl_" + cid);%>
|
||||
mdmTransaction_<%=cid %> = com.talend.mdm.transaction.client.MDMTransactionClient.newTransaction(turl_<%=cid %>,username_<%=cid %>,password_<%=cid %>);
|
||||
Boolean transInitStart_<%=cid%> = false;
|
||||
synchronized(globalMap){
|
||||
if(globalMap.containsKey(transKey_<%=cid %> + "_initStart")){
|
||||
transInitStart_<%=cid%> = true;
|
||||
}else{
|
||||
globalMap.put(transKey_<%=cid %> + "_initStart", true);
|
||||
}
|
||||
}
|
||||
if(transInitStart_<%=cid%> == false){
|
||||
if((Boolean)globalMap.get("useClientTranId_<%=connection %>")){
|
||||
List<String> cookies_<%=cid%> = com.talend.mdm.transaction.client.MDMTransactionClient.getCookies(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 %>.setCookies(cookies_<%=cid%>);
|
||||
}else{
|
||||
<% logUtil.debug("\"Attempt to get a remote transaction from url: \" + murl_" + cid);%>
|
||||
mdmTransaction_<%=cid %> = com.talend.mdm.transaction.client.MDMTransactionClient.newTransaction(turl_<%=cid %>,username_<%=cid %>,password_<%=cid %>);
|
||||
}
|
||||
}else{
|
||||
while(mdmTransaction_<%=cid %> == null){
|
||||
Thread.sleep(10);
|
||||
mdmTransaction_<%=cid %> = (com.talend.mdm.transaction.client.MDMTransaction)globalMap.get(transKey_<%=cid %>);
|
||||
}
|
||||
}
|
||||
|
||||
java.util.List<org.apache.cxf.headers.Header> soapHeaders_<%=cid %> = new java.util.ArrayList<org.apache.cxf.headers.Header>();
|
||||
javax.xml.namespace.QName qName_<%=cid %> = new javax.xml.namespace.QName("http://www.talend.com/mdm", "transaction-id");
|
||||
org.apache.cxf.databinding.DataBinding dataBinding_<%=cid %> = new org.apache.cxf.jaxb.JAXBDataBinding(String.class);
|
||||
@@ -130,8 +146,7 @@ if ((metadatas != null) && (metadatas.size() > 0)) {
|
||||
context_<%=cid %>.put(org.apache.cxf.headers.Header.HEADER_LIST, soapHeaders_<%=cid %>);
|
||||
|
||||
java.util.Map<String, java.util.List<String>> httpHeaders_<%=cid %> = new java.util.HashMap<String, java.util.List<String>>();
|
||||
String cookie_<%=cid %> = com.talend.mdm.transaction.client.MDMTransaction.getStickySession() + "=" + mdmTransaction_<%=cid%>.getSessionId();
|
||||
httpHeaders_<%=cid %>.put("Cookie", java.util.Arrays.asList(cookie_<%=cid %>));
|
||||
httpHeaders_<%=cid %>.put("Cookie", mdmTransaction_<%=cid %>.getCookies());
|
||||
context_<%=cid %>.put(org.apache.cxf.message.Message.PROTOCOL_HEADERS, httpHeaders_<%=cid %>);
|
||||
|
||||
globalMap.put(transKey_<%=cid %>, mdmTransaction_<%=cid %>);
|
||||
|
||||
@@ -142,18 +142,34 @@ int nb_line_rejected_<%=cid %> = 0;
|
||||
String turl_<%=cid %> = com.talend.mdm.transaction.client.MDMTransactionClient.getMDMTransactionURL(murl_<%=cid %>, true);
|
||||
com.talend.mdm.transaction.client.MDMTransaction mdmTransaction_<%=cid %> = (com.talend.mdm.transaction.client.MDMTransaction)globalMap.get(transKey_<%=cid %>);
|
||||
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{
|
||||
<% logUtil.debug("\"Attempt to get a remote transaction from url: \" + murl_" + cid);%>
|
||||
mdmTransaction_<%=cid %> = com.talend.mdm.transaction.client.MDMTransactionClient.newTransaction(turl_<%=cid %>,username_<%=cid %>,password_<%=cid %>);
|
||||
Boolean transInitStart_<%=cid%> = false;
|
||||
synchronized(globalMap){
|
||||
if(globalMap.containsKey(transKey_<%=cid %> + "_initStart")){
|
||||
transInitStart_<%=cid%> = true;
|
||||
}else{
|
||||
globalMap.put(transKey_<%=cid %> + "_initStart", true);
|
||||
}
|
||||
}
|
||||
if(transInitStart_<%=cid%> == false){
|
||||
if((Boolean)globalMap.get("useClientTranId_<%=connection %>")){
|
||||
List<String> cookies_<%=cid%> = com.talend.mdm.transaction.client.MDMTransactionClient.getCookies(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 %>.setCookies(cookies_<%=cid%>);
|
||||
}else{
|
||||
<% logUtil.debug("\"Attempt to get a remote transaction from url: \" + murl_" + cid);%>
|
||||
mdmTransaction_<%=cid %> = com.talend.mdm.transaction.client.MDMTransactionClient.newTransaction(turl_<%=cid %>,username_<%=cid %>,password_<%=cid %>);
|
||||
}
|
||||
}else{
|
||||
while(mdmTransaction_<%=cid %> == null){
|
||||
Thread.sleep(10);
|
||||
mdmTransaction_<%=cid %> = (com.talend.mdm.transaction.client.MDMTransaction)globalMap.get(transKey_<%=cid %>);
|
||||
}
|
||||
}
|
||||
|
||||
java.util.List<org.apache.cxf.headers.Header> soapHeaders_<%=cid %> = new java.util.ArrayList<org.apache.cxf.headers.Header>();
|
||||
javax.xml.namespace.QName qName_<%=cid %> = new javax.xml.namespace.QName("http://www.talend.com/mdm", "transaction-id");
|
||||
org.apache.cxf.databinding.DataBinding dataBinding_<%=cid %> = new org.apache.cxf.jaxb.JAXBDataBinding(String.class);
|
||||
@@ -161,8 +177,7 @@ int nb_line_rejected_<%=cid %> = 0;
|
||||
context_<%=cid %>.put(org.apache.cxf.headers.Header.HEADER_LIST, soapHeaders_<%=cid %>);
|
||||
|
||||
java.util.Map<String, java.util.List<String>> httpHeaders_<%=cid %> = new java.util.HashMap<String, java.util.List<String>>();
|
||||
String cookie_<%=cid %> = com.talend.mdm.transaction.client.MDMTransaction.getStickySession() + "=" + mdmTransaction_<%=cid%>.getSessionId();
|
||||
httpHeaders_<%=cid %>.put("Cookie", java.util.Arrays.asList(cookie_<%=cid %>));
|
||||
httpHeaders_<%=cid %>.put("Cookie", mdmTransaction_<%=cid %>.getCookies());
|
||||
context_<%=cid %>.put(org.apache.cxf.message.Message.PROTOCOL_HEADERS, httpHeaders_<%=cid %>);
|
||||
|
||||
globalMap.put(transKey_<%=cid %>, mdmTransaction_<%=cid %>);
|
||||
|
||||
@@ -114,6 +114,11 @@
|
||||
name="widget.type.file"
|
||||
widgetType="widget.type.file">
|
||||
</Mapping>
|
||||
<Mapping
|
||||
mapFieldType="DIRECTORY"
|
||||
name="widget.type.directory"
|
||||
widgetType="widget.type.directory">
|
||||
</Mapping>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.talend.designer.core.generators">
|
||||
|
||||
@@ -31,6 +31,7 @@ import org.talend.commons.exception.BusinessException;
|
||||
import org.talend.components.api.component.ComponentDefinition;
|
||||
import org.talend.components.api.component.ComponentImageType;
|
||||
import org.talend.components.api.component.Connector;
|
||||
import org.talend.components.api.component.OutputComponentDefinition;
|
||||
import org.talend.components.api.component.PropertyPathConnector;
|
||||
import org.talend.components.api.component.VirtualComponentDefinition;
|
||||
import org.talend.components.api.properties.ComponentProperties;
|
||||
@@ -942,6 +943,18 @@ public class Component extends AbstractBasicComponent {
|
||||
addStandardType(listConnector, EConnectionType.ON_COMPONENT_ERROR, parentNode);
|
||||
addStandardType(listConnector, EConnectionType.ON_SUBJOB_OK, parentNode);
|
||||
addStandardType(listConnector, EConnectionType.ON_SUBJOB_ERROR, parentNode);
|
||||
|
||||
// 1.Any component can have outgoing iterate connector
|
||||
// 2.Only standalone and input components can have incoming iterate connector
|
||||
// 3.No transformer component was created in 6.2, so ignore this situation
|
||||
boolean isOutputComponent = componentDefinition instanceof OutputComponentDefinition || componentDefinition instanceof VirtualComponentDefinition;
|
||||
INodeConnector iterateConnector = addStandardType(listConnector, EConnectionType.ITERATE, parentNode);
|
||||
iterateConnector.setMaxLinkOutput(-1);
|
||||
if (isOutputComponent) {
|
||||
iterateConnector.setMaxLinkInput(0);
|
||||
} else {
|
||||
iterateConnector.setMaxLinkInput(1);
|
||||
}
|
||||
|
||||
for (int i = 0; i < EConnectionType.values().length; i++) {
|
||||
EConnectionType currentType = EConnectionType.values()[i];
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
tSalesforceConnection=tSalesforceConnection
|
||||
tSalesforceConnection.loginType=LOGIN_TYPE
|
||||
tSalesforceConnection.endpoint=ENDPOINT
|
||||
tSalesforceConnection.apiVersion=API_VERSION
|
||||
tSalesforceConnection.oauth.clientId=OAUTH_CLIENT_ID
|
||||
tSalesforceConnection.oauth.clientSecret=OAUTH_CLIENT_SECRET
|
||||
tSalesforceConnection.oauth.callbackHost=OAUTH_CALLBACK_HOST
|
||||
@@ -14,7 +15,9 @@ tSalesforceConnection.userPassword.securityKey=
|
||||
tSalesforceConnection.bulkConnection=BULK_CONNECTION
|
||||
tSalesforceConnection.needCompression=NEED_COMPRESSION
|
||||
tSalesforceConnection.httpTraceMessage=HTTP_TRACEMESSAGE
|
||||
tSalesforceConnection.httpChunked=USE_HTTP_CHUNKED
|
||||
tSalesforceConnection.httpChunked=USE_HTTP_CHUNKED
|
||||
tSalesforceConnection.reuseSession=USE_SAVE_SESSION
|
||||
tSalesforceConnection.sessionDirectory=SESSION_DIRECTORY
|
||||
tSalesforceConnection.clientId=CLIENT_ID
|
||||
tSalesforceConnection.timeout=TIMEOUT
|
||||
tSalesforceConnection.proxy.useProxy=USE_PROXY
|
||||
@@ -29,6 +32,7 @@ tSalesforceInput=tSalesforceInput
|
||||
tSalesforceInput.connection.referencedComponent=CONNECTION
|
||||
tSalesforceInput.connection.loginType=LOGIN_TYPE
|
||||
tSalesforceInput.connection.endpoint=ENDPOINT
|
||||
tSalesforceInput.connection.apiVersion=API_VERSION
|
||||
tSalesforceInput.connection.oauth.clientId=OAUTH_CLIENT_ID
|
||||
tSalesforceInput.connection.oauth.clientSecret=OAUTH_CLIENT_SECRET
|
||||
tSalesforceInput.connection.oauth.callbackHost=OAUTH_CALLBACK_HOST
|
||||
@@ -51,6 +55,8 @@ tSalesforceInput.connection.bulkConnection=CONNECTION
|
||||
tSalesforceInput.connection.needCompression=NEED_COMPRESSION
|
||||
tSalesforceInput.connection.httpTraceMessage=HTTP_TRACEMESSAGE
|
||||
tSalesforceInput.connection.httpChunked=USE_HTTP_CHUNKED
|
||||
tSalesforceInput.connection.reuseSession=USE_SAVE_SESSION
|
||||
tSalesforceInput.connection.sessionDirectory=SESSION_DIRECTORY
|
||||
tSalesforceInput.connection.clientId=CLIENT_ID
|
||||
tSalesforceInput.connection.timeout=TIMEOUT
|
||||
tSalesforceInput.connection.proxy.useProxy=USE_PROXY
|
||||
@@ -68,6 +74,7 @@ tSalesforceOutput=tSalesforceOutput
|
||||
tSalesforceOutput.connection.referencedComponent=CONNECTION
|
||||
tSalesforceOutput.connection.loginType=LOGIN_TYPE
|
||||
tSalesforceOutput.connection.endpoint=ENDPOINT
|
||||
tSalesforceOutput.connection.apiVersion=API_VERSION
|
||||
tSalesforceOutput.connection.oauth.clientId=OAUTH_CLIENT_ID
|
||||
tSalesforceOutput.connection.oauth.clientSecret=OAUTH_CLIENT_SECRET
|
||||
tSalesforceOutput.connection.oauth.callbackHost=OAUTH_CALLBACK_HOST
|
||||
@@ -87,6 +94,8 @@ tSalesforceOutput.connection.bulkConnection=CONNECTION
|
||||
tSalesforceOutput.connection.needCompression=NEED_COMPRESSION
|
||||
tSalesforceOutput.connection.httpTraceMessage=HTTP_TRACEMESSAGE
|
||||
tSalesforceOutput.connection.httpChunked=USE_HTTP_CHUNKED
|
||||
tSalesforceOutput.connection.reuseSession=USE_SAVE_SESSION
|
||||
tSalesforceOutput.connection.sessionDirectory=SESSION_DIRECTORY
|
||||
tSalesforceOutput.connection.clientId=CLIENT_ID
|
||||
tSalesforceOutput.connection.timeout=TIMEOUT
|
||||
tSalesforceOutput.connection.proxy.useProxy=USE_PROXY
|
||||
@@ -113,6 +122,7 @@ tSalesforceBulkExec=tSalesforceBulkExec
|
||||
tSalesforceBulkExec.connection.referencedComponent=CONNECTION
|
||||
tSalesforceBulkExec.connection.loginType=LOGIN_TYPE
|
||||
tSalesforceBulkExec.connection.endpoint=ENDPOINT
|
||||
tSalesforceBulkExec.connection.apiVersion=API_VERSION
|
||||
tSalesforceBulkExec.connection.oauth.clientId=OAUTH_CLIENT_ID
|
||||
tSalesforceBulkExec.connection.oauth.clientSecret=OAUTH_CLIENT_SECRET
|
||||
tSalesforceBulkExec.connection.oauth.callbackHost=OAUTH_CALLBACK_HOST
|
||||
@@ -157,6 +167,7 @@ tSalesforceGetDeleted=tSalesforceGetDeleted
|
||||
tSalesforceGetDeleted.connection.referencedComponent=CONNECTION
|
||||
tSalesforceGetDeleted.connection.loginType=LOGIN_TYPE
|
||||
tSalesforceGetDeleted.connection.endpoint=ENDPOINT
|
||||
tSalesforceGetDeleted.connection.apiVersion=API_VERSION
|
||||
tSalesforceGetDeleted.connection.oauth.clientId=OAUTH_CLIENT_ID
|
||||
tSalesforceGetDeleted.connection.oauth.clientSecret=OAUTH_CLIENT_SECRET
|
||||
tSalesforceGetDeleted.connection.oauth.callbackHost=OAUTH_CALLBACK_HOST
|
||||
@@ -174,6 +185,8 @@ tSalesforceGetDeleted.connection.bulkConnection=CONNECTION
|
||||
tSalesforceGetDeleted.connection.needCompression=NEED_COMPRESSION
|
||||
tSalesforceGetDeleted.connection.httpTraceMessage=HTTP_TRACEMESSAGE
|
||||
tSalesforceGetDeleted.connection.httpChunked=USE_HTTP_CHUNKED
|
||||
tSalesforceGetDeleted.connection.reuseSession=USE_SAVE_SESSION
|
||||
tSalesforceGetDeleted.connection.sessionDirectory=SESSION_DIRECTORY
|
||||
tSalesforceGetDeleted.connection.clientId=CLIENT_ID
|
||||
tSalesforceGetDeleted.connection.timeout=TIMEOUT
|
||||
tSalesforceGetDeleted.connection.proxy.useProxy=USE_PROXY
|
||||
@@ -188,6 +201,7 @@ tSalesforceGetUpdated=tSalesforceGetUpdated
|
||||
tSalesforceGetUpdated.connection.referencedComponent=CONNECTION
|
||||
tSalesforceGetUpdated.connection.loginType=LOGIN_TYPE
|
||||
tSalesforceGetUpdated.connection.endpoint=ENDPOINT
|
||||
tSalesforceGetUpdated.connection.apiVersion=API_VERSION
|
||||
tSalesforceGetUpdated.connection.oauth.clientId=OAUTH_CLIENT_ID
|
||||
tSalesforceGetUpdated.connection.oauth.clientSecret=OAUTH_CLIENT_SECRET
|
||||
tSalesforceGetUpdated.connection.oauth.callbackHost=OAUTH_CALLBACK_HOST
|
||||
@@ -205,6 +219,8 @@ tSalesforceGetUpdated.connection.bulkConnection=CONNECTION
|
||||
tSalesforceGetUpdated.connection.needCompression=NEED_COMPRESSION
|
||||
tSalesforceGetUpdated.connection.httpTraceMessage=HTTP_TRACEMESSAGE
|
||||
tSalesforceGetUpdated.connection.httpChunked=USE_HTTP_CHUNKED
|
||||
tSalesforceGetUpdated.connection.reuseSession=USE_SAVE_SESSION
|
||||
tSalesforceGetUpdated.connection.sessionDirectory=SESSION_DIRECTORY
|
||||
tSalesforceGetUpdated.connection.clientId=CLIENT_ID
|
||||
tSalesforceGetUpdated.connection.timeout=TIMEOUT
|
||||
tSalesforceGetUpdated.connection.proxy.useProxy=USE_PROXY
|
||||
@@ -219,6 +235,7 @@ tSalesforceOutputBulkExec=tSalesforceOutputBulkExec
|
||||
tSalesforceOutputBulkExec.connection.referencedComponent=CONNECTION
|
||||
tSalesforceOutputBulkExec.connection.loginType=LOGIN_TYPE
|
||||
tSalesforceOutputBulkExec.connection.endpoint=ENDPOINT
|
||||
tSalesforceOutputBulkExec.connection.apiVersion=API_VERSION
|
||||
tSalesforceOutputBulkExec.connection.oauth.clientId=OAUTH_CLIENT_ID
|
||||
tSalesforceOutputBulkExec.connection.oauth.clientSecret=OAUTH_CLIENT_SECRET
|
||||
tSalesforceOutputBulkExec.connection.oauth.callbackHost=OAUTH_CALLBACK_HOST
|
||||
@@ -265,6 +282,7 @@ tSalesforceGetServerTimestamp=tSalesforceGetServerTimestamp
|
||||
tSalesforceGetServerTimestamp.connection.referencedComponent=CONNECTION
|
||||
tSalesforceGetServerTimestamp.connection.loginType=LOGIN_TYPE
|
||||
tSalesforceGetServerTimestamp.connection.endpoint=ENDPOINT
|
||||
tSalesforceGetServerTimestamp.connection.apiVersion=API_VERSION
|
||||
tSalesforceGetServerTimestamp.connection.oauth.clientId=OAUTH_CLIENT_ID
|
||||
tSalesforceGetServerTimestamp.connection.oauth.clientSecret=OAUTH_CLIENT_SECRET
|
||||
tSalesforceGetServerTimestamp.connection.oauth.callbackHost=OAUTH_CALLBACK_HOST
|
||||
@@ -277,6 +295,8 @@ tSalesforceGetServerTimestamp.module.main.schema=SCHEMA
|
||||
tSalesforceGetServerTimestamp.module.main.schema.connector=FLOW->MAIN
|
||||
tSalesforceGetServerTimestamp.connection.needCompression=NEED_COMPRESSION
|
||||
tSalesforceGetServerTimestamp.connection.httpChunked=USE_HTTP_CHUNKED
|
||||
tSalesforceGetServerTimestamp.connection.reuseSession=USE_SAVE_SESSION
|
||||
tSalesforceGetServerTimestamp.connection.sessionDirectory=SESSION_DIRECTORY
|
||||
tSalesforceGetServerTimestamp.connection.clientId=CLIENT_ID
|
||||
tSalesforceGetServerTimestamp.connection.timeout=TIMEOUT
|
||||
tSalesforceGetServerTimestamp.connection.proxy.useProxy=USE_PROXY
|
||||
|
||||
@@ -588,13 +588,21 @@ public class ComponentsUtils {
|
||||
}
|
||||
|
||||
public static ComponentProperties getComponentPropertiesFromSerialized(String serialized, Connection connection) {
|
||||
return getComponentPropertiesFromSerialized(serialized, connection, true);
|
||||
}
|
||||
|
||||
public static ComponentProperties getComponentPropertiesFromSerialized(String serialized, Connection connection,
|
||||
boolean withEvaluator) {
|
||||
if (serialized != null) {
|
||||
SerializerDeserializer.Deserialized<ComponentProperties> fromSerialized = Properties.Helper.fromSerializedPersistent(serialized,
|
||||
ComponentProperties.class, new PostDeserializeSetup() {
|
||||
SerializerDeserializer.Deserialized<ComponentProperties> fromSerialized = Properties.Helper
|
||||
.fromSerializedPersistent(serialized, ComponentProperties.class, new PostDeserializeSetup() {
|
||||
|
||||
@Override
|
||||
public void setup(Object properties) {
|
||||
((Properties)properties).setValueEvaluator(new MetadataContextPropertyValueEvaluator(connection));
|
||||
if (withEvaluator) {
|
||||
((Properties) properties)
|
||||
.setValueEvaluator(new MetadataContextPropertyValueEvaluator(connection));
|
||||
}
|
||||
}
|
||||
});
|
||||
if (fromSerialized != null) {
|
||||
|
||||
@@ -226,4 +226,8 @@ public abstract class AbstractProcessProvider implements IReplaceNodeInProcess {
|
||||
AbstractProcessProvider.componentProcess = componentProcess;
|
||||
}
|
||||
|
||||
public boolean canHandleNode(INode node) {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -77,7 +77,8 @@ public class SetupProcessDependenciesRoutinesAction extends AContextualAction {
|
||||
} else if (ERepositoryObjectType.PROCESS_MR != null && node.getObjectType().equals(ERepositoryObjectType.PROCESS_MR)) {
|
||||
canWork = true;
|
||||
} else if (node.getObjectType() != ERepositoryObjectType.PROCESS
|
||||
&& node.getObjectType() != ERepositoryObjectType.JOBLET) {
|
||||
&& node.getObjectType() != ERepositoryObjectType.JOBLET
|
||||
&& node.getObjectType() != ERepositoryObjectType.PROCESS_ROUTE) {
|
||||
canWork = false;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -78,6 +78,7 @@ import org.talend.core.model.components.ComponentCategory;
|
||||
import org.talend.core.model.components.ComponentUtilities;
|
||||
import org.talend.core.model.components.IComponent;
|
||||
import org.talend.core.model.components.IComponentsService;
|
||||
import org.talend.core.model.general.Project;
|
||||
import org.talend.core.model.metadata.IEbcdicConstant;
|
||||
import org.talend.core.model.metadata.IHL7Constant;
|
||||
import org.talend.core.model.metadata.IMetadataTable;
|
||||
@@ -191,6 +192,7 @@ import org.talend.designer.core.ui.preferences.TalendDesignerPrefConstants;
|
||||
import org.talend.designer.core.utils.DesignerUtilities;
|
||||
import org.talend.designer.core.utils.ValidationRulesUtil;
|
||||
import org.talend.metadata.managment.ui.utils.ConnectionContextHelper;
|
||||
import org.talend.repository.ProjectManager;
|
||||
import org.talend.repository.RepositoryPlugin;
|
||||
import org.talend.repository.model.IProxyRepositoryFactory;
|
||||
import org.talend.repository.model.IRepositoryNode;
|
||||
@@ -626,7 +628,8 @@ public class TalendEditorDropTargetListener extends TemplateTransferDropTargetLi
|
||||
}
|
||||
|
||||
Item subItem = repositoryNode.getObject().getProperty().getItem();
|
||||
Item hadoopClusterItem = hadoopClusterService.getHadoopClusterBySubitemId(subItem.getProperty().getId());
|
||||
Item hadoopClusterItem = hadoopClusterService.getHadoopClusterBySubitemId(
|
||||
new Project(ProjectManager.getInstance().getProject(subItem)), subItem.getProperty().getId());
|
||||
String hadoopClusterId = hadoopClusterItem.getProperty().getId();
|
||||
|
||||
String propertyParamName = MR_PROPERTY_PREFIX + EParameterName.PROPERTY_TYPE.getName();
|
||||
|
||||
@@ -203,8 +203,11 @@ public class ComponentListController extends AbstractElementPropertySectionContr
|
||||
for (Node curNode : nodesToUpdate) {
|
||||
for (IElementParameter curParam : curNode.getElementParameters()) {
|
||||
if (curParam.getFieldType().equals(EParameterFieldType.COMPONENT_LIST)) {
|
||||
String value = (String)curParam.getValue();
|
||||
if (oldConnectionName.equals(curParam.getValue())) {
|
||||
curParam.setValue(newConnectionName);
|
||||
} else if (value != null && value.startsWith(oldConnectionName + "_")) {
|
||||
curParam.setValue(value.replaceFirst(oldConnectionName + "_", newConnectionName + "_"));
|
||||
}
|
||||
} else if (curParam.getFieldType().equals(EParameterFieldType.TABLE)) {
|
||||
final Object[] itemsValue = curParam.getListItemsValue();
|
||||
@@ -220,6 +223,8 @@ public class ComponentListController extends AbstractElementPropertySectionContr
|
||||
if (connectionName.equals(oldConnectionName)) {
|
||||
// note: change from "Integer" value stored to "String" value
|
||||
curLine.put(param.getName(), newConnectionName);
|
||||
}else if (connectionName != null && connectionName.startsWith(oldConnectionName + "_")) {
|
||||
curParam.setValue(connectionName.replaceFirst(oldConnectionName + "_", newConnectionName + "_"));
|
||||
}
|
||||
} else if (value instanceof String) {
|
||||
curLine.put(param.getName(), newConnectionName);
|
||||
|
||||
@@ -14,6 +14,7 @@ package org.talend.designer.core.ui.editor.properties.controllers;
|
||||
|
||||
import java.beans.PropertyChangeEvent;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.eclipse.core.runtime.Path;
|
||||
import org.eclipse.gef.commands.Command;
|
||||
import org.eclipse.jface.fieldassist.DecoratedField;
|
||||
@@ -45,9 +46,9 @@ import org.talend.designer.core.ui.editor.properties.controllers.creator.SelectA
|
||||
|
||||
/**
|
||||
* DOC yzhang class global comment. Detailled comment <br/>
|
||||
*
|
||||
*
|
||||
* $Id: talend-code-templates.xml 1 2006-09-29 17:06:40 +0000 (星期五, 29 九月 2006) nrousseau $
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class DirectoryController extends AbstractElementPropertySectionController {
|
||||
|
||||
@@ -55,7 +56,7 @@ public class DirectoryController extends AbstractElementPropertySectionControlle
|
||||
|
||||
/**
|
||||
* DOC yzhang DirectoryController constructor comment.
|
||||
*
|
||||
*
|
||||
* @param parameterBean
|
||||
*/
|
||||
public DirectoryController(IDynamicProperty dp) {
|
||||
@@ -65,7 +66,7 @@ public class DirectoryController extends AbstractElementPropertySectionControlle
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
*
|
||||
* @see java.beans.PropertyChangeListener#propertyChange(java.beans.PropertyChangeEvent)
|
||||
*/
|
||||
@Override
|
||||
@@ -75,7 +76,7 @@ public class DirectoryController extends AbstractElementPropertySectionControlle
|
||||
|
||||
/**
|
||||
* DOC yzhang Comment method "setCommand".
|
||||
*
|
||||
*
|
||||
* @param propertyName
|
||||
*/
|
||||
private Command createCommand(SelectionEvent event) {
|
||||
@@ -84,23 +85,20 @@ public class DirectoryController extends AbstractElementPropertySectionControlle
|
||||
String propertyName = (String) btn.getData(PARAMETER_NAME);
|
||||
Text dirPathText = (Text) hashCurControls.get(propertyName);
|
||||
String directory = dial.open();
|
||||
if (directory != null) {
|
||||
if (!directory.equals("")) { //$NON-NLS-1$
|
||||
if (!elem.getPropertyValue(propertyName).equals(directory)) {
|
||||
String portableValue = Path.fromOSString(directory).toPortableString();
|
||||
dirPathText.setText(TalendTextUtils.addQuotes(portableValue));
|
||||
return new PropertyChangeCommand(elem, propertyName, TalendTextUtils.addQuotes(portableValue));
|
||||
|
||||
}
|
||||
if (StringUtils.isNotBlank(directory) && !directory.equals(elem.getPropertyValue(propertyName))) {
|
||||
String portableValue = Path.fromOSString(directory).toPortableString();
|
||||
if (!isInWizard()) {
|
||||
portableValue = TalendTextUtils.addQuotes(portableValue);
|
||||
}
|
||||
dirPathText.setText(portableValue);
|
||||
return new PropertyChangeCommand(elem, propertyName, portableValue);
|
||||
}
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
*
|
||||
* @see org.talend.designer.core.ui.editor.properties2.editors.AbstractElementPropertySectionController#
|
||||
* createControl( org.eclipse.swt.widgets.Composite, org.talend.core.model.process.IElementParameter, int, int, int,
|
||||
* org.eclipse.swt.widgets.Control)
|
||||
@@ -202,10 +200,9 @@ public class DirectoryController extends AbstractElementPropertySectionControlle
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.talend.designer.core.ui.editor.properties.controllers.AbstractElementPropertySectionController#estimateRowSize
|
||||
* (org.eclipse.swt.widgets.Composite, org.talend.core.model.process.IElementParameter)
|
||||
*
|
||||
* @see org.talend.designer.core.ui.editor.properties.controllers.AbstractElementPropertySectionController#
|
||||
* estimateRowSize (org.eclipse.swt.widgets.Composite, org.talend.core.model.process.IElementParameter)
|
||||
*/
|
||||
@Override
|
||||
public int estimateRowSize(Composite subComposite, IElementParameter param) {
|
||||
|
||||
@@ -121,10 +121,14 @@ public class UpdateJobletNodeCommand extends Command {
|
||||
Node currentNode = getOriginalNodeFromProcess(node);
|
||||
boolean neesPro = needPropagate(currentNode);
|
||||
if (currentNode.isJoblet() || currentNode.isMapReduce()) {// maybe no need modify
|
||||
List<IElementParameter> tempList = new ArrayList<IElementParameter>(currentNode.getElementParameters());
|
||||
if (result.isNeedReloadJoblet()) {
|
||||
reloadNode(currentNode, newComponent);
|
||||
}
|
||||
if (currentNode.getNodeContainer() instanceof JobletContainer) {
|
||||
for(IElementParameter para : tempList){
|
||||
currentNode.getElementParameter(para.getName()).setValue(para.getValue());
|
||||
}
|
||||
((JobletContainer) currentNode.getNodeContainer()).updateJobletNodes(true);
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -516,6 +516,7 @@ public class JavaProcessUtil {
|
||||
if (var.equals(paramName)) {
|
||||
ModuleNeeded module = getModuleNeededForContextParam(contextPara);
|
||||
if (module != null && !modulesNeeded.contains(module)) {
|
||||
module.setDynamic(true);
|
||||
modulesNeeded.add(module);
|
||||
}
|
||||
}
|
||||
@@ -523,6 +524,7 @@ public class JavaProcessUtil {
|
||||
}
|
||||
} else {
|
||||
ModuleNeeded module = new ModuleNeeded(null, TalendTextUtils.removeQuotes(text), null, true);
|
||||
module.setDynamic(true);
|
||||
modulesNeeded.add(module);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,5 +119,82 @@ public class ExternalDbMapData implements IExternalData {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
final ExternalDbMapData other = (ExternalDbMapData) obj;
|
||||
if(this.inputTables.size() != other.inputTables.size()){
|
||||
return false;
|
||||
}
|
||||
if(this.outputTables.size() != other.outputTables.size()){
|
||||
return false;
|
||||
}
|
||||
if(this.varsTables.size() != other.varsTables.size()){
|
||||
return false;
|
||||
}
|
||||
|
||||
for(ExternalDbMapTable inTable:inputTables){
|
||||
boolean found = false;
|
||||
for(ExternalDbMapTable otherTable:other.inputTables){
|
||||
if(inTable.getName().equals(otherTable.getName())){
|
||||
found = true;
|
||||
if(!inTable.equals(otherTable)){
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(found == false){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
for(ExternalDbMapTable outTable:outputTables){
|
||||
boolean found = false;
|
||||
for(ExternalDbMapTable otherTable:other.outputTables){
|
||||
if(outTable.getName().equals(otherTable.getName())){
|
||||
found = true;
|
||||
if(!outTable.equals(otherTable)){
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(found == false){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
for(ExternalDbMapTable varTable:varsTables){
|
||||
boolean found = false;
|
||||
for(ExternalDbMapTable var:other.varsTables){
|
||||
if(varTable.getName().equals(var.getName())){
|
||||
found = true;
|
||||
if(!varTable.equals(var)){
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(found == false){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -127,5 +127,40 @@ public class ExternalDbMapEntry implements IExternalMapEntry, Serializable, Clon
|
||||
public Object clone() throws CloneNotSupportedException {
|
||||
return super.clone();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
final ExternalDbMapEntry other = (ExternalDbMapEntry) obj;
|
||||
if (this.expression == null) {
|
||||
if (other.expression != null)
|
||||
return false;
|
||||
} else if (!this.expression.equals(other.expression))
|
||||
return false;
|
||||
if (this.name == null) {
|
||||
if (other.name != null)
|
||||
return false;
|
||||
} else if (!this.name.equals(other.name))
|
||||
return false;
|
||||
if (this.isJoin() != other.isJoin())
|
||||
return false;
|
||||
if (this.operator == null) {
|
||||
if (other.operator != null)
|
||||
return false;
|
||||
} else if (!this.operator.equals(other.operator))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -194,5 +194,154 @@ public class ExternalDbMapTable extends AbstractExternalMapTable implements Seri
|
||||
}
|
||||
return cloned;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
final ExternalDbMapTable other = (ExternalDbMapTable) obj;
|
||||
|
||||
if (this.minimized != other.minimized) {
|
||||
return false;
|
||||
}
|
||||
if (this.name == null) {
|
||||
if (other.name != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this.name.equals(other.name)) {
|
||||
return false;
|
||||
}
|
||||
if (this.joinType == null) {
|
||||
if (other.joinType != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this.joinType.equals(other.joinType)) {
|
||||
return false;
|
||||
}
|
||||
if (this.alias == null) {
|
||||
if (other.alias != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this.alias.equals(other.alias)) {
|
||||
return false;
|
||||
}
|
||||
if (this.tableName == null) {
|
||||
if (other.tableName != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this.tableName.equals(other.tableName)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
List<ExternalDbMapEntry> this_customOtherConditionsEntries = null;
|
||||
if(this.customOtherConditionsEntries == null){
|
||||
this_customOtherConditionsEntries = new ArrayList<ExternalDbMapEntry>();
|
||||
}else{
|
||||
this_customOtherConditionsEntries = new ArrayList<ExternalDbMapEntry>(this.customOtherConditionsEntries);
|
||||
}
|
||||
List<ExternalDbMapEntry> this_metadataTableEntries = null;
|
||||
if(this.metadataTableEntries == null){
|
||||
this_metadataTableEntries = new ArrayList<ExternalDbMapEntry>();
|
||||
}else{
|
||||
this_metadataTableEntries = new ArrayList<ExternalDbMapEntry>(this.metadataTableEntries);
|
||||
}
|
||||
List<ExternalDbMapEntry> this_customWhereConditionsEntries = null;
|
||||
if(this.customWhereConditionsEntries == null){
|
||||
this_customWhereConditionsEntries = new ArrayList<ExternalDbMapEntry>();
|
||||
}else{
|
||||
this_customWhereConditionsEntries = new ArrayList<ExternalDbMapEntry>(this.customWhereConditionsEntries);
|
||||
}
|
||||
|
||||
List<ExternalDbMapEntry> other_customOtherConditionsEntries = null;
|
||||
if(other.customOtherConditionsEntries == null){
|
||||
other_customOtherConditionsEntries = new ArrayList<ExternalDbMapEntry>();
|
||||
}else{
|
||||
other_customOtherConditionsEntries = new ArrayList<ExternalDbMapEntry>(other.customOtherConditionsEntries);
|
||||
}
|
||||
List<ExternalDbMapEntry> other_metadataTableEntries = null;
|
||||
if(other.metadataTableEntries == null){
|
||||
other_metadataTableEntries = new ArrayList<ExternalDbMapEntry>();
|
||||
}else{
|
||||
other_metadataTableEntries = new ArrayList<ExternalDbMapEntry>(other.metadataTableEntries);
|
||||
}
|
||||
List<ExternalDbMapEntry> other_customWhereConditionsEntries = null;
|
||||
if(other.customWhereConditionsEntries == null){
|
||||
other_customWhereConditionsEntries = new ArrayList<ExternalDbMapEntry>();
|
||||
}else{
|
||||
other_customWhereConditionsEntries = new ArrayList<ExternalDbMapEntry>(other.customWhereConditionsEntries);
|
||||
}
|
||||
|
||||
if(this_customOtherConditionsEntries.size() != other_customOtherConditionsEntries.size()){
|
||||
return false;
|
||||
}
|
||||
for(ExternalDbMapEntry oriObj:this_customOtherConditionsEntries){
|
||||
boolean found = false;
|
||||
for(ExternalDbMapEntry otherObj:other_customOtherConditionsEntries){
|
||||
if(oriObj.getName().equals(otherObj.getName())){
|
||||
found = true;
|
||||
if(!oriObj.equals(otherObj)){
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(found == false){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if(this_customWhereConditionsEntries.size() != other_customWhereConditionsEntries.size()){
|
||||
return false;
|
||||
}
|
||||
for(ExternalDbMapEntry oriObj:this_customWhereConditionsEntries){
|
||||
boolean found = false;
|
||||
for(ExternalDbMapEntry otherObj:other_customWhereConditionsEntries){
|
||||
if(oriObj.getName().equals(otherObj.getName())){
|
||||
found = true;
|
||||
if(!oriObj.equals(otherObj)){
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(found == false){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if(this_metadataTableEntries.size() != other_metadataTableEntries.size()){
|
||||
return false;
|
||||
}
|
||||
for(ExternalDbMapEntry oriObj:this_metadataTableEntries){
|
||||
boolean found = false;
|
||||
for(ExternalDbMapEntry otherObj:other_metadataTableEntries){
|
||||
if(oriObj.getName().equals(otherObj.getName())){
|
||||
found = true;
|
||||
if(!oriObj.equals(otherObj)){
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(found == false){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -70,6 +70,10 @@ public abstract class DbGenerationManager {
|
||||
protected String tabSpaceString = DEFAULT_TAB_SPACE_STRING;
|
||||
|
||||
protected static final String DEFAULT_TAB_SPACE_STRING = ""; //$NON-NLS-1$
|
||||
|
||||
protected List<String> queryColumnsSegments = new ArrayList<String>();
|
||||
|
||||
protected List<String> querySegments = new ArrayList<String>();
|
||||
|
||||
/**
|
||||
* DOC amaumont GenerationManager constructor comment.
|
||||
@@ -252,6 +256,9 @@ public abstract class DbGenerationManager {
|
||||
public String buildSqlSelect(DbMapComponent component, String outputTableName, String tabString) {
|
||||
queryColumnsName = "\""; //$NON-NLS-1$
|
||||
aliasAlreadyDeclared.clear();
|
||||
queryColumnsSegments.clear();
|
||||
querySegments.clear();
|
||||
|
||||
this.tabSpaceString = tabString;
|
||||
|
||||
List<IConnection> outputConnections = (List<IConnection>) component.getOutgoingConnections();
|
||||
@@ -288,10 +295,10 @@ public abstract class DbGenerationManager {
|
||||
// outputTable = removeUnmatchingEntriesWithColumnsOfMetadataTable(outputTable, metadataTable);
|
||||
}
|
||||
}
|
||||
sb.append("\""); //$NON-NLS-1$
|
||||
sb.append(DbMapSqlConstants.SELECT);
|
||||
sb.append(DbMapSqlConstants.NEW_LINE).append(tabSpaceString);
|
||||
|
||||
appendSqlQuery(sb, "\"", false); //$NON-NLS-1$
|
||||
appendSqlQuery(sb, DbMapSqlConstants.SELECT);
|
||||
appendSqlQuery(sb, DbMapSqlConstants.NEW_LINE);
|
||||
appendSqlQuery(sb, tabSpaceString);
|
||||
List<ExternalDbMapEntry> metadataTableEntries = outputTable.getMetadataTableEntries();
|
||||
if (metadataTableEntries != null) {
|
||||
int lstSizeOutTableEntries = metadataTableEntries.size();
|
||||
@@ -311,28 +318,29 @@ public abstract class DbGenerationManager {
|
||||
expression += DbMapSqlConstants.SPACE + DbMapSqlConstants.AS + DbMapSqlConstants.SPACE
|
||||
+ getAliasOf(dbMapEntry.getName());
|
||||
}
|
||||
String columnSegment = expression;
|
||||
if (i > 0) {
|
||||
sb.append(DbMapSqlConstants.COMMA);
|
||||
sb.append(DbMapSqlConstants.SPACE);
|
||||
|
||||
appendSqlQuery(sb, DbMapSqlConstants.COMMA);
|
||||
appendSqlQuery(sb, DbMapSqlConstants.SPACE);
|
||||
queryColumnsName += DbMapSqlConstants.COMMA + DbMapSqlConstants.SPACE;
|
||||
columnSegment = DbMapSqlConstants.COMMA + DbMapSqlConstants.SPACE + columnSegment;
|
||||
}
|
||||
if (expression != null && expression.trim().length() > 0) {
|
||||
sb.append(expression);
|
||||
|
||||
appendSqlQuery(sb, expression);
|
||||
queryColumnsName += expression;
|
||||
queryColumnsSegments.add(columnSegment);
|
||||
} else {
|
||||
sb.append(DbMapSqlConstants.LEFT_COMMENT);
|
||||
appendSqlQuery(sb, DbMapSqlConstants.LEFT_COMMENT);
|
||||
String str = outputTable.getName() + DbMapSqlConstants.DOT + dbMapEntry.getName();
|
||||
sb.append(Messages.getString("DbGenerationManager.OuputExpSetMessage", str)); //$NON-NLS-1$
|
||||
sb.append(DbMapSqlConstants.RIGHT_COMMENT);
|
||||
appendSqlQuery(sb, Messages.getString("DbGenerationManager.OuputExpSetMessage", str));//$NON-NLS-1$
|
||||
appendSqlQuery(sb, DbMapSqlConstants.RIGHT_COMMENT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sb.append(DbMapSqlConstants.NEW_LINE).append(tabSpaceString);
|
||||
sb.append(DbMapSqlConstants.FROM);
|
||||
|
||||
appendSqlQuery(sb, DbMapSqlConstants.NEW_LINE);
|
||||
appendSqlQuery(sb, tabSpaceString);
|
||||
appendSqlQuery(sb, DbMapSqlConstants.FROM);
|
||||
List<ExternalDbMapTable> inputTables = data.getInputTables();
|
||||
|
||||
// load input table in hash
|
||||
@@ -358,8 +366,8 @@ public abstract class DbGenerationManager {
|
||||
}
|
||||
}
|
||||
|
||||
sb.append(DbMapSqlConstants.NEW_LINE).append(tabSpaceString);
|
||||
|
||||
appendSqlQuery(sb, DbMapSqlConstants.NEW_LINE);
|
||||
appendSqlQuery(sb, tabSpaceString);
|
||||
IJoinType previousJoinType = null;
|
||||
|
||||
for (int i = 0; i < lstSizeInputTables; i++) {
|
||||
@@ -381,13 +389,14 @@ public abstract class DbGenerationManager {
|
||||
buildTableDeclaration(component, sb, inputTables.get(i - 1), commaCouldBeAdded, crCouldBeAdded, true);
|
||||
previousJoinType = joinType;
|
||||
} else {
|
||||
sb.append(DbMapSqlConstants.NEW_LINE).append(tabSpaceString);
|
||||
appendSqlQuery(sb, DbMapSqlConstants.NEW_LINE);
|
||||
appendSqlQuery(sb, tabSpaceString);
|
||||
}
|
||||
sb.append(DbMapSqlConstants.SPACE);
|
||||
appendSqlQuery(sb, DbMapSqlConstants.SPACE);
|
||||
}
|
||||
String labelJoinType = joinType.getLabel();
|
||||
sb.append(labelJoinType);
|
||||
sb.append(DbMapSqlConstants.SPACE);
|
||||
appendSqlQuery(sb, labelJoinType);
|
||||
appendSqlQuery(sb, DbMapSqlConstants.SPACE);
|
||||
if (joinType == AbstractDbLanguage.JOIN.CROSS_JOIN) {
|
||||
ExternalDbMapTable nextTable = null;
|
||||
if (i < lstSizeInputTables) {
|
||||
@@ -403,19 +412,19 @@ public abstract class DbGenerationManager {
|
||||
// } else {
|
||||
// sb.append(" <!! NO JOIN CLAUSES FOR '" + inputTable.getName() + "' !!> ");
|
||||
// }
|
||||
sb.append(DbMapSqlConstants.SPACE);
|
||||
sb.append(DbMapSqlConstants.ON);
|
||||
sb.append(DbMapSqlConstants.LEFT_BRACKET);
|
||||
sb.append(DbMapSqlConstants.SPACE);
|
||||
appendSqlQuery(sb, DbMapSqlConstants.SPACE);
|
||||
appendSqlQuery(sb, DbMapSqlConstants.ON);
|
||||
appendSqlQuery(sb, DbMapSqlConstants.LEFT_BRACKET);
|
||||
appendSqlQuery(sb, DbMapSqlConstants.SPACE);
|
||||
if (!buildConditions(component, sb, inputTable, true, true)) {
|
||||
sb.append(DbMapSqlConstants.LEFT_COMMENT);
|
||||
sb.append(DbMapSqlConstants.SPACE);
|
||||
sb.append(Messages.getString("DbGenerationManager.conditionNotSet")); //$NON-NLS-1$
|
||||
sb.append(DbMapSqlConstants.SPACE);
|
||||
sb.append(DbMapSqlConstants.RIGHT_COMMENT);
|
||||
appendSqlQuery(sb, DbMapSqlConstants.LEFT_COMMENT);
|
||||
appendSqlQuery(sb, DbMapSqlConstants.SPACE);
|
||||
appendSqlQuery(sb, Messages.getString("DbGenerationManager.conditionNotSet"));//$NON-NLS-1$
|
||||
appendSqlQuery(sb, DbMapSqlConstants.SPACE);
|
||||
appendSqlQuery(sb, DbMapSqlConstants.RIGHT_COMMENT);
|
||||
}
|
||||
sb.append(DbMapSqlConstants.SPACE);
|
||||
sb.append(DbMapSqlConstants.RIGHT_BRACKET);
|
||||
appendSqlQuery(sb, DbMapSqlConstants.SPACE);
|
||||
appendSqlQuery(sb, DbMapSqlConstants.RIGHT_BRACKET);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -473,35 +482,39 @@ public abstract class DbGenerationManager {
|
||||
|
||||
boolean whereOriginalFlag = !originalWhereAddition.isEmpty();
|
||||
if (whereFlag || whereAddFlag || whereOriginalFlag) {
|
||||
sb.append(DbMapSqlConstants.NEW_LINE).append(tabSpaceString);
|
||||
sb.append(DbMapSqlConstants.WHERE);
|
||||
appendSqlQuery(sb, DbMapSqlConstants.NEW_LINE);
|
||||
appendSqlQuery(sb, tabSpaceString);
|
||||
appendSqlQuery(sb, DbMapSqlConstants.WHERE);
|
||||
}
|
||||
if (whereFlag) {
|
||||
sb.append(whereClauses);
|
||||
appendSqlQuery(sb, whereClauses);
|
||||
}
|
||||
if (whereAddFlag) {
|
||||
for (int i = 0; i < whereAddition.size(); i++) {
|
||||
if (i == 0 && whereFlag || i > 0) {
|
||||
sb.append(DbMapSqlConstants.NEW_LINE).append(tabSpaceString);
|
||||
sb.append(DbMapSqlConstants.SPACE);
|
||||
sb.append(DbMapSqlConstants.AND);
|
||||
appendSqlQuery(sb, DbMapSqlConstants.NEW_LINE);
|
||||
appendSqlQuery(sb, tabSpaceString);
|
||||
appendSqlQuery(sb, DbMapSqlConstants.SPACE);
|
||||
appendSqlQuery(sb, DbMapSqlConstants.AND);
|
||||
}
|
||||
sb.append(DbMapSqlConstants.SPACE);
|
||||
sb.append(whereAddition.get(i));
|
||||
appendSqlQuery(sb, DbMapSqlConstants.SPACE);
|
||||
appendSqlQuery(sb, whereAddition.get(i));
|
||||
}
|
||||
}
|
||||
if (whereOriginalFlag) {
|
||||
for (String s : originalWhereAddition) {
|
||||
sb.append(DbMapSqlConstants.NEW_LINE);
|
||||
sb.append(DbMapSqlConstants.SPACE);
|
||||
sb.append(s);
|
||||
appendSqlQuery(sb, DbMapSqlConstants.NEW_LINE);
|
||||
appendSqlQuery(sb, DbMapSqlConstants.SPACE);
|
||||
appendSqlQuery(sb, s);
|
||||
}
|
||||
}
|
||||
if (!otherAddition.isEmpty()) {
|
||||
sb.append(DbMapSqlConstants.NEW_LINE).append(tabSpaceString);
|
||||
appendSqlQuery(sb, DbMapSqlConstants.NEW_LINE);
|
||||
appendSqlQuery(sb, tabSpaceString);
|
||||
for (String s : otherAddition) {
|
||||
sb.append(s);
|
||||
sb.append(DbMapSqlConstants.NEW_LINE).append(tabSpaceString);
|
||||
appendSqlQuery(sb, s);
|
||||
appendSqlQuery(sb, DbMapSqlConstants.NEW_LINE);
|
||||
appendSqlQuery(sb, tabSpaceString);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -514,9 +527,11 @@ public abstract class DbGenerationManager {
|
||||
sqlQuery = sqlQuery.replaceAll("\\b" + context + "\\b", "\" +" + context + "+ \""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
|
||||
haveReplace = true;
|
||||
}
|
||||
replaceQueryContext(querySegments, context);
|
||||
if (queryColumnsName.contains(context)) {
|
||||
queryColumnsName = queryColumnsName.replaceAll("\\b" + context + "\\b", "\" +" + context + "+ \""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
|
||||
}
|
||||
replaceQueryContext(queryColumnsSegments, context);
|
||||
}
|
||||
if (!haveReplace) {
|
||||
List<String> connContextList = getConnectionContextList(component);
|
||||
@@ -524,9 +539,11 @@ public abstract class DbGenerationManager {
|
||||
if (sqlQuery.contains(context)) {
|
||||
sqlQuery = sqlQuery.replaceAll("\\b" + context + "\\b", "\" +" + context + "+ \""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
|
||||
}
|
||||
replaceQueryContext(querySegments, context);
|
||||
if (queryColumnsName.contains(context)) {
|
||||
queryColumnsName = queryColumnsName.replaceAll("\\b" + context + "\\b", "\" +" + context + "+ \""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
|
||||
}
|
||||
replaceQueryContext(queryColumnsSegments, context);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -535,6 +552,40 @@ public abstract class DbGenerationManager {
|
||||
|
||||
return sqlQuery;
|
||||
}
|
||||
|
||||
protected void replaceQueryContext(List<String> querySegments, String context) {
|
||||
if (querySegments == null || querySegments.size() == 0) {
|
||||
return;
|
||||
}
|
||||
for (int i = 0; i < querySegments.size(); i++) {
|
||||
String segment = querySegments.get(i);
|
||||
if (segment.contains(context)) {
|
||||
segment = segment.replaceAll("\\b" + context + "\\b", "\" +" + context + "+ \""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
|
||||
querySegments.set(i, segment);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void appendSqlQuery(StringBuilder sb, String value) {
|
||||
appendSqlQuery(sb, value, true);
|
||||
}
|
||||
|
||||
protected void appendSqlQuery(StringBuilder sb, String value, boolean addToQuerySegment) {
|
||||
if (!"".equals(value)) {//$NON-NLS-1$
|
||||
sb.append(value);
|
||||
if (addToQuerySegment) {
|
||||
querySegments.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public List<String> getQuerySegments() {
|
||||
return querySegments;
|
||||
}
|
||||
|
||||
public List<String> getQueryColumnsSegments() {
|
||||
return queryColumnsSegments;
|
||||
}
|
||||
|
||||
protected String handleQuery(String query) {
|
||||
if (query != null) {
|
||||
@@ -697,7 +748,7 @@ public abstract class DbGenerationManager {
|
||||
*/
|
||||
protected void buildTableDeclaration(DbMapComponent component, StringBuilder sb, ExternalDbMapTable inputTable,
|
||||
boolean commaCouldBeAdded, boolean crCouldBeAdded, boolean writingInJoin) {
|
||||
sb.append(DbMapSqlConstants.SPACE);
|
||||
appendSqlQuery(sb, DbMapSqlConstants.SPACE);
|
||||
String alias = inputTable.getAlias();
|
||||
if (alias != null) {
|
||||
List<IConnection> inputConnections = (List<IConnection>) component.getIncomingConnections();
|
||||
@@ -714,31 +765,34 @@ public abstract class DbGenerationManager {
|
||||
buildTableDeclaration(component, sb, inputTable);
|
||||
} else if (!aliasAlreadyDeclared.contains(inputTable.getName())) {
|
||||
if (crCouldBeAdded) {
|
||||
sb.append(DbMapSqlConstants.NEW_LINE).append(tabSpaceString);
|
||||
appendSqlQuery(sb, DbMapSqlConstants.NEW_LINE);
|
||||
appendSqlQuery(sb, tabSpaceString);
|
||||
}
|
||||
if (commaCouldBeAdded) {
|
||||
sb.append(DbMapSqlConstants.COMMA);
|
||||
sb.append(DbMapSqlConstants.SPACE);
|
||||
appendSqlQuery(sb, DbMapSqlConstants.COMMA);
|
||||
appendSqlQuery(sb, DbMapSqlConstants.SPACE);
|
||||
}
|
||||
sb.append(getHandledTableName(component, inputTable.getTableName()));
|
||||
sb.append(DbMapSqlConstants.SPACE);
|
||||
sb.append(getHandledField(alias));
|
||||
String handledTableName = getHandledTableName(component, inputTable.getTableName());
|
||||
appendSqlQuery(sb, handledTableName);
|
||||
appendSqlQuery(sb, DbMapSqlConstants.SPACE);
|
||||
String handledField = getHandledField(alias);
|
||||
appendSqlQuery(sb, handledField);
|
||||
aliasAlreadyDeclared.add(alias);
|
||||
} else {
|
||||
if (writingInJoin) {
|
||||
sb.append(getHandledTableName(component, inputTable.getName()));
|
||||
appendSqlQuery(sb, getHandledTableName(component, inputTable.getName()));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (crCouldBeAdded) {
|
||||
sb.append(DbMapSqlConstants.NEW_LINE).append(tabSpaceString);
|
||||
appendSqlQuery(sb, DbMapSqlConstants.NEW_LINE);
|
||||
appendSqlQuery(sb, tabSpaceString);
|
||||
}
|
||||
if (commaCouldBeAdded) {
|
||||
sb.append(DbMapSqlConstants.COMMA);
|
||||
sb.append(DbMapSqlConstants.SPACE);
|
||||
appendSqlQuery(sb, DbMapSqlConstants.COMMA);
|
||||
appendSqlQuery(sb, DbMapSqlConstants.SPACE);
|
||||
}
|
||||
buildTableDeclaration(component, sb, inputTable);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -788,9 +842,15 @@ public abstract class DbGenerationManager {
|
||||
int begin = 1;
|
||||
int end = deliveredTable.length() - 1;
|
||||
if (begin <= end) {
|
||||
sb.append("(").append(DbMapSqlConstants.NEW_LINE).append(tabSpaceString).append(" "); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
sb.append(deliveredTable.substring(begin, end)).append(DbMapSqlConstants.NEW_LINE).append(tabSpaceString)
|
||||
.append(" ) "); //$NON-NLS-1$
|
||||
appendSqlQuery(sb, "("); //$NON-NLS-1$
|
||||
appendSqlQuery(sb, DbMapSqlConstants.NEW_LINE);
|
||||
appendSqlQuery(sb, tabSpaceString);
|
||||
appendSqlQuery(sb, " "); //$NON-NLS-1$
|
||||
|
||||
appendSqlQuery(sb, deliveredTable.substring(begin, end));
|
||||
appendSqlQuery(sb, DbMapSqlConstants.NEW_LINE);
|
||||
appendSqlQuery(sb, tabSpaceString);
|
||||
appendSqlQuery(sb, " ) "); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
String tableColneName = tableName;
|
||||
@@ -807,9 +867,8 @@ public abstract class DbGenerationManager {
|
||||
String tableLabel = tableEntry.getKey();
|
||||
String schemaValue = tableEntry.getValue();
|
||||
if (tableLabel.equals(metadataTable.getLabel()) && tableColneName.equals(tableLabel)) {
|
||||
sb.append(schemaValue);
|
||||
sb.append("."); //$NON-NLS-1$
|
||||
sb.append(tableName);
|
||||
String name = schemaValue + "." + tableName; //$NON-NLS-1$
|
||||
appendSqlQuery(sb, name);
|
||||
replace = true;
|
||||
}
|
||||
}
|
||||
@@ -817,16 +876,14 @@ public abstract class DbGenerationManager {
|
||||
}
|
||||
} else if (tableName != null) {
|
||||
if (inputTableName.equals(metadataTable.getLabel()) && tableColneName.equals(inputTableName)) {
|
||||
sb.append(tableName);
|
||||
appendSqlQuery(sb, tableName);
|
||||
replace = true;
|
||||
}
|
||||
}
|
||||
if (!replace) {
|
||||
sb.append(inputTable.getName());
|
||||
appendSqlQuery(sb, inputTable.getName());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected static boolean isELTDBMap(INode node) {
|
||||
|
||||
@@ -42,7 +42,12 @@ public class HiveGenerationManager extends DbGenerationManager {
|
||||
if (inputTableName != null && inputTableName.contains(".")) {
|
||||
String[] inputTableNames = inputTableName.split("\\.");
|
||||
if (inputTableNames.length > 1) {
|
||||
query = query.replaceAll(inputTableName + "\\.", inputTableNames[1] + ".");
|
||||
query = query.replaceAll(inputTableName + "\\.", inputTableNames[1] + "."); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
for (int i = 0; i < querySegments.size(); i++) {
|
||||
String segment = querySegments.get(i);
|
||||
segment = segment.replaceAll(inputTableName + "\\.", inputTableNames[1] + "."); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
querySegments.set(i, segment);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,6 +65,8 @@ public class OracleGenerationManager extends DbGenerationManager {
|
||||
public String buildSqlSelect(DbMapComponent component, String outputTableName, String tabString) {
|
||||
queryColumnsName = "\""; //$NON-NLS-1$
|
||||
aliasAlreadyDeclared.clear();
|
||||
queryColumnsSegments.clear();
|
||||
querySegments.clear();
|
||||
this.tabSpaceString = tabString;
|
||||
|
||||
List<IConnection> outputConnections = (List<IConnection>) component.getOutgoingConnections();
|
||||
@@ -101,9 +103,10 @@ public class OracleGenerationManager extends DbGenerationManager {
|
||||
// outputTable = removeUnmatchingEntriesWithColumnsOfMetadataTable(outputTable, metadataTable);
|
||||
}
|
||||
}
|
||||
sb.append("\""); //$NON-NLS-1$
|
||||
sb.append(DbMapSqlConstants.SELECT);
|
||||
sb.append(DbMapSqlConstants.NEW_LINE).append(tabSpaceString);
|
||||
appendSqlQuery(sb, "\"", false); //$NON-NLS-1$
|
||||
appendSqlQuery(sb, DbMapSqlConstants.SELECT);
|
||||
appendSqlQuery(sb, DbMapSqlConstants.NEW_LINE);
|
||||
appendSqlQuery(sb, tabSpaceString);
|
||||
|
||||
List<ExternalDbMapEntry> metadataTableEntries = outputTable.getMetadataTableEntries();
|
||||
if (metadataTableEntries != null) {
|
||||
@@ -126,14 +129,15 @@ public class OracleGenerationManager extends DbGenerationManager {
|
||||
+ getAliasOf(dbMapEntry.getName());
|
||||
added = true;
|
||||
}
|
||||
String columnSegment = expression;
|
||||
if (i > 0) {
|
||||
sb.append(DbMapSqlConstants.COMMA);
|
||||
sb.append(DbMapSqlConstants.SPACE);
|
||||
|
||||
appendSqlQuery(sb, DbMapSqlConstants.COMMA);
|
||||
appendSqlQuery(sb, DbMapSqlConstants.SPACE);
|
||||
queryColumnsName += DbMapSqlConstants.COMMA + DbMapSqlConstants.SPACE;
|
||||
columnSegment = DbMapSqlConstants.COMMA + DbMapSqlConstants.SPACE + columnSegment;
|
||||
}
|
||||
if (expression != null && expression.trim().length() > 0) {
|
||||
sb.append(expression);
|
||||
appendSqlQuery(sb, expression);
|
||||
if (component.getMapperMain() == null) {
|
||||
component.getExternalEmfData();
|
||||
}
|
||||
@@ -158,22 +162,25 @@ public class OracleGenerationManager extends DbGenerationManager {
|
||||
}
|
||||
}
|
||||
if (!added && columnChanged) {
|
||||
sb.append(DbMapSqlConstants.SPACE + DbMapSqlConstants.AS + DbMapSqlConstants.SPACE
|
||||
+ getAliasOf(dbMapEntry.getName()));
|
||||
String name = DbMapSqlConstants.SPACE + DbMapSqlConstants.AS + DbMapSqlConstants.SPACE
|
||||
+ getAliasOf(dbMapEntry.getName());
|
||||
appendSqlQuery(sb, name);
|
||||
}
|
||||
}
|
||||
queryColumnsName += expression;
|
||||
queryColumnsSegments.add(columnSegment);
|
||||
} else {
|
||||
sb.append(DbMapSqlConstants.LEFT_COMMENT);
|
||||
appendSqlQuery(sb, DbMapSqlConstants.LEFT_COMMENT);
|
||||
String str = outputTable.getName() + DbMapSqlConstants.DOT + dbMapEntry.getName();
|
||||
sb.append(Messages.getString("DbGenerationManager.OuputExpSetMessage", str)); //$NON-NLS-1$
|
||||
sb.append(DbMapSqlConstants.RIGHT_COMMENT);
|
||||
appendSqlQuery(sb, Messages.getString("DbGenerationManager.OuputExpSetMessage", str));//$NON-NLS-1$
|
||||
appendSqlQuery(sb, DbMapSqlConstants.RIGHT_COMMENT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sb.append(DbMapSqlConstants.NEW_LINE).append(tabSpaceString);
|
||||
sb.append(DbMapSqlConstants.FROM);
|
||||
appendSqlQuery(sb, DbMapSqlConstants.NEW_LINE);
|
||||
appendSqlQuery(sb, tabSpaceString);
|
||||
appendSqlQuery(sb, DbMapSqlConstants.FROM);
|
||||
|
||||
List<ExternalDbMapTable> inputTables = data.getInputTables();
|
||||
|
||||
@@ -200,7 +207,8 @@ public class OracleGenerationManager extends DbGenerationManager {
|
||||
}
|
||||
}
|
||||
|
||||
sb.append(DbMapSqlConstants.NEW_LINE).append(tabSpaceString);
|
||||
appendSqlQuery(sb, DbMapSqlConstants.NEW_LINE);
|
||||
appendSqlQuery(sb, tabSpaceString);
|
||||
|
||||
IJoinType previousJoinType = null;
|
||||
|
||||
@@ -223,13 +231,14 @@ public class OracleGenerationManager extends DbGenerationManager {
|
||||
buildTableDeclaration(component, sb, inputTables.get(i - 1), commaCouldBeAdded, crCouldBeAdded, true);
|
||||
previousJoinType = joinType;
|
||||
} else {
|
||||
sb.append(DbMapSqlConstants.NEW_LINE).append(tabSpaceString);
|
||||
appendSqlQuery(sb, DbMapSqlConstants.NEW_LINE);
|
||||
appendSqlQuery(sb, tabSpaceString);
|
||||
}
|
||||
sb.append(DbMapSqlConstants.SPACE);
|
||||
appendSqlQuery(sb, DbMapSqlConstants.SPACE);
|
||||
}
|
||||
String labelJoinType = joinType.getLabel();
|
||||
sb.append(labelJoinType);
|
||||
sb.append(DbMapSqlConstants.SPACE);
|
||||
appendSqlQuery(sb, labelJoinType);
|
||||
appendSqlQuery(sb, DbMapSqlConstants.SPACE);
|
||||
if (joinType == AbstractDbLanguage.JOIN.CROSS_JOIN) {
|
||||
ExternalDbMapTable nextTable = null;
|
||||
if (i < lstSizeInputTables) {
|
||||
@@ -244,20 +253,20 @@ public class OracleGenerationManager extends DbGenerationManager {
|
||||
// if (rightTable != null) {
|
||||
// } else {
|
||||
// sb.append(" <!! NO JOIN CLAUSES FOR '" + inputTable.getName() + "' !!> ");
|
||||
// }
|
||||
sb.append(DbMapSqlConstants.SPACE);
|
||||
sb.append(DbMapSqlConstants.ON);
|
||||
sb.append(DbMapSqlConstants.LEFT_BRACKET);
|
||||
sb.append(DbMapSqlConstants.SPACE);
|
||||
// }
|
||||
appendSqlQuery(sb, DbMapSqlConstants.SPACE);
|
||||
appendSqlQuery(sb, DbMapSqlConstants.ON);
|
||||
appendSqlQuery(sb, DbMapSqlConstants.LEFT_BRACKET);
|
||||
appendSqlQuery(sb, DbMapSqlConstants.SPACE);
|
||||
if (!buildConditions(component, sb, inputTable, true, true)) {
|
||||
sb.append(DbMapSqlConstants.LEFT_COMMENT);
|
||||
sb.append(DbMapSqlConstants.SPACE);
|
||||
sb.append(Messages.getString("DbGenerationManager.conditionNotSet")); //$NON-NLS-1$
|
||||
sb.append(DbMapSqlConstants.SPACE);
|
||||
sb.append(DbMapSqlConstants.RIGHT_COMMENT);
|
||||
appendSqlQuery(sb, DbMapSqlConstants.LEFT_COMMENT);
|
||||
appendSqlQuery(sb, DbMapSqlConstants.SPACE);
|
||||
appendSqlQuery(sb, Messages.getString("DbGenerationManager.conditionNotSet"));//$NON-NLS-1$
|
||||
appendSqlQuery(sb, DbMapSqlConstants.SPACE);
|
||||
appendSqlQuery(sb, DbMapSqlConstants.RIGHT_COMMENT);
|
||||
}
|
||||
sb.append(DbMapSqlConstants.SPACE);
|
||||
sb.append(DbMapSqlConstants.RIGHT_BRACKET);
|
||||
appendSqlQuery(sb, DbMapSqlConstants.SPACE);
|
||||
appendSqlQuery(sb, DbMapSqlConstants.RIGHT_BRACKET);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -315,35 +324,39 @@ public class OracleGenerationManager extends DbGenerationManager {
|
||||
|
||||
boolean whereOriginalFlag = !originalWhereAddition.isEmpty();
|
||||
if (whereFlag || whereAddFlag || whereOriginalFlag) {
|
||||
sb.append(DbMapSqlConstants.NEW_LINE).append(tabSpaceString);
|
||||
sb.append(DbMapSqlConstants.WHERE);
|
||||
appendSqlQuery(sb, DbMapSqlConstants.NEW_LINE);
|
||||
appendSqlQuery(sb, tabSpaceString);
|
||||
appendSqlQuery(sb, DbMapSqlConstants.WHERE);
|
||||
}
|
||||
if (whereFlag) {
|
||||
sb.append(whereClauses);
|
||||
}
|
||||
if (whereAddFlag) {
|
||||
for (int i = 0; i < whereAddition.size(); i++) {
|
||||
if (i == 0 && whereFlag || i > 0) {
|
||||
sb.append(DbMapSqlConstants.NEW_LINE).append(tabSpaceString);
|
||||
sb.append(DbMapSqlConstants.SPACE);
|
||||
sb.append(DbMapSqlConstants.AND);
|
||||
if (i == 0 && whereFlag || i > 0) {
|
||||
appendSqlQuery(sb, DbMapSqlConstants.NEW_LINE);
|
||||
appendSqlQuery(sb, tabSpaceString);
|
||||
appendSqlQuery(sb, DbMapSqlConstants.SPACE);
|
||||
appendSqlQuery(sb, DbMapSqlConstants.AND);
|
||||
}
|
||||
sb.append(DbMapSqlConstants.SPACE);
|
||||
sb.append(whereAddition.get(i));
|
||||
appendSqlQuery(sb, DbMapSqlConstants.SPACE);
|
||||
appendSqlQuery(sb, whereAddition.get(i));
|
||||
}
|
||||
}
|
||||
if (whereOriginalFlag) {
|
||||
for (String s : originalWhereAddition) {
|
||||
sb.append(DbMapSqlConstants.NEW_LINE);
|
||||
sb.append(DbMapSqlConstants.SPACE);
|
||||
sb.append(s);
|
||||
appendSqlQuery(sb, DbMapSqlConstants.NEW_LINE);
|
||||
appendSqlQuery(sb, DbMapSqlConstants.SPACE);
|
||||
appendSqlQuery(sb, s);
|
||||
}
|
||||
}
|
||||
if (!otherAddition.isEmpty()) {
|
||||
sb.append(DbMapSqlConstants.NEW_LINE).append(tabSpaceString);
|
||||
appendSqlQuery(sb, DbMapSqlConstants.NEW_LINE);
|
||||
appendSqlQuery(sb, tabSpaceString);
|
||||
for (String s : otherAddition) {
|
||||
sb.append(s);
|
||||
sb.append(DbMapSqlConstants.NEW_LINE).append(tabSpaceString);
|
||||
appendSqlQuery(sb, s);
|
||||
appendSqlQuery(sb, DbMapSqlConstants.NEW_LINE);
|
||||
appendSqlQuery(sb, tabSpaceString);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -356,9 +369,11 @@ public class OracleGenerationManager extends DbGenerationManager {
|
||||
sqlQuery = sqlQuery.replaceAll("\\b" + context + "\\b", "\" +" + context + "+ \""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
|
||||
haveReplace = true;
|
||||
}
|
||||
replaceQueryContext(querySegments, context);
|
||||
if (queryColumnsName.contains(context)) {
|
||||
queryColumnsName = queryColumnsName.replaceAll("\\b" + context + "\\b", "\" +" + context + "+ \""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
|
||||
}
|
||||
replaceQueryContext(queryColumnsSegments, context);
|
||||
}
|
||||
if (!haveReplace) {
|
||||
List<String> connContextList = getConnectionContextList(component);
|
||||
@@ -366,9 +381,11 @@ public class OracleGenerationManager extends DbGenerationManager {
|
||||
if (sqlQuery.contains(context)) {
|
||||
sqlQuery = sqlQuery.replaceAll("\\b" + context + "\\b", "\" +" + context + "+ \""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
|
||||
}
|
||||
replaceQueryContext(querySegments, context);
|
||||
if (queryColumnsName.contains(context)) {
|
||||
queryColumnsName = queryColumnsName.replaceAll("\\b" + context + "\\b", "\" +" + context + "+ \""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
|
||||
}
|
||||
replaceQueryContext(queryColumnsSegments, context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -384,5 +384,63 @@ public class AbstractDBDataMapTableImpl extends EObjectImpl implements AbstractD
|
||||
result.append(')');
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated not
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
AbstractDBDataMapTableImpl other = (AbstractDBDataMapTableImpl) obj;
|
||||
if(this.minimized != other.minimized){
|
||||
return false;
|
||||
}
|
||||
if (this.name == null) {
|
||||
if (other.name != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this.name.equals(other.name)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.tableName == null) {
|
||||
if (other.tableName != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this.tableName.equals(other.tableName)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
EList<DBMapperTableEntry> otherEntriss = other.getDBMapperTableEntries();
|
||||
if(getDBMapperTableEntries().size() != otherEntriss.size()){
|
||||
return false;
|
||||
}
|
||||
for(DBMapperTableEntry entry:dbMapperTableEntries){
|
||||
boolean found = false;
|
||||
for(DBMapperTableEntry otherEntry:otherEntriss){
|
||||
if(entry.getName().equals(otherEntry.getName())){
|
||||
found = true;
|
||||
if(!entry.equals(otherEntry)){
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(found == false){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
} //AbstractDBDataMapTableImpl
|
||||
|
||||
@@ -227,4 +227,83 @@ public class DBMapDataImpl extends AbstractExternalDataImpl implements DBMapData
|
||||
return super.eIsSet(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated not
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
DBMapDataImpl dbObj = (DBMapDataImpl) obj;
|
||||
EList<InputTable> inputs = dbObj.getInputTables();
|
||||
EList<OutputTable> outputs =dbObj.getOutputTables();
|
||||
EList<VarTable> vars =dbObj.getVarTables();
|
||||
if(inputs.size() != getInputTables().size()){
|
||||
return false;
|
||||
}
|
||||
if(outputs.size() != getOutputTables().size()){
|
||||
return false;
|
||||
}
|
||||
if(vars.size() != getVarTables().size()){
|
||||
return false;
|
||||
}
|
||||
for(InputTable inputTable:inputTables){
|
||||
boolean found = false;
|
||||
for(InputTable input:inputs){
|
||||
if(inputTable.getName().equals(input.getName())){
|
||||
found = true;
|
||||
if(!inputTable.equals(input)){
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(found == false){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
for(OutputTable outputTable:outputTables){
|
||||
boolean found = false;
|
||||
for(OutputTable output:outputs){
|
||||
if(outputTable.getName().equals(output.getName())){
|
||||
found = true;
|
||||
if(!outputTable.equals(output)){
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(found == false){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
for(VarTable varTable:varTables){
|
||||
boolean found = false;
|
||||
for(VarTable var:vars){
|
||||
if(varTable.getName().equals(var.getName())){
|
||||
found = true;
|
||||
if(!varTable.equals(var)){
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(found == false){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
} //DBMapDataImpl
|
||||
|
||||
@@ -433,5 +433,62 @@ public class DBMapperTableEntryImpl extends EObjectImpl implements DBMapperTable
|
||||
result.append(')');
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated not
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
DBMapperTableEntryImpl other = (DBMapperTableEntryImpl) obj;
|
||||
if(this.join != other.join){
|
||||
return false;
|
||||
}
|
||||
if(this.nullable != other.nullable){
|
||||
return false;
|
||||
}
|
||||
if (this.name == null) {
|
||||
if (other.name != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this.name.equals(other.name)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.expression == null) {
|
||||
if (other.expression != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this.expression.equals(other.expression)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.operator == null) {
|
||||
if (other.operator != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this.operator.equals(other.operator)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.type == null) {
|
||||
if (other.type != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this.type.equals(other.type)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
} //DBMapperTableEntryImpl
|
||||
|
||||
@@ -253,5 +253,48 @@ public class FilterEntryImpl extends EObjectImpl implements FilterEntry {
|
||||
result.append(')');
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated not
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
FilterEntryImpl other = (FilterEntryImpl) obj;
|
||||
if (this.name == null) {
|
||||
if (other.name != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this.name.equals(other.name)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.expression == null) {
|
||||
if (other.expression != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this.expression.equals(other.expression)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.filterKind == null) {
|
||||
if (other.filterKind != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this.filterKind.equals(other.filterKind)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
} // FilterEntryImpl
|
||||
|
||||
@@ -7,13 +7,14 @@
|
||||
package org.talend.designer.dbmap.model.emf.dbmap.impl;
|
||||
|
||||
import org.eclipse.emf.common.notify.Notification;
|
||||
|
||||
import org.eclipse.emf.common.util.EList;
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
|
||||
import org.eclipse.emf.ecore.impl.ENotificationImpl;
|
||||
|
||||
import org.talend.designer.dbmap.model.emf.dbmap.DBMapperTableEntry;
|
||||
import org.talend.designer.dbmap.model.emf.dbmap.DbmapPackage;
|
||||
import org.talend.designer.dbmap.model.emf.dbmap.InputTable;
|
||||
import org.talend.designer.dbmap.model.emf.dbmap.VarTable;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
@@ -216,5 +217,41 @@ public class InputTableImpl extends AbstaceDBInOutTableImpl implements InputTabl
|
||||
result.append(')');
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated not
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
InputTableImpl other = (InputTableImpl) obj;
|
||||
if (this.alias == null) {
|
||||
if (other.alias != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this.alias.equals(other.alias)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.joinType == null) {
|
||||
if (other.joinType != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this.joinType.equals(other.joinType)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return super.equals(obj);
|
||||
}
|
||||
|
||||
} //InputTableImpl
|
||||
|
||||
@@ -13,6 +13,7 @@ import org.eclipse.emf.ecore.EClass;
|
||||
import org.eclipse.emf.ecore.InternalEObject;
|
||||
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
|
||||
import org.eclipse.emf.ecore.util.InternalEList;
|
||||
import org.talend.designer.dbmap.model.emf.dbmap.DBMapperTableEntry;
|
||||
import org.talend.designer.dbmap.model.emf.dbmap.DbmapPackage;
|
||||
import org.talend.designer.dbmap.model.emf.dbmap.FilterEntry;
|
||||
import org.talend.designer.dbmap.model.emf.dbmap.OutputTable;
|
||||
@@ -146,5 +147,47 @@ public class OutputTableImpl extends AbstaceDBInOutTableImpl implements OutputTa
|
||||
}
|
||||
return super.eIsSet(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated not
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
OutputTableImpl other = (OutputTableImpl) obj;
|
||||
|
||||
EList<FilterEntry> otherFilters = other.getFilterEntries();
|
||||
|
||||
if (getFilterEntries().size() != otherFilters.size()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for(FilterEntry filter:getFilterEntries()){
|
||||
boolean found = false;
|
||||
for(FilterEntry otherFilter:otherFilters){
|
||||
if(filter.getName().equals(otherFilter.getName())){
|
||||
found = true;
|
||||
if(!filter.equals(otherFilter)){
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(found == false){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return super.equals(obj);
|
||||
}
|
||||
|
||||
} // OutputTableImpl
|
||||
|
||||
@@ -140,26 +140,62 @@ public class ExternalMapperData implements IExternalData {
|
||||
return false;
|
||||
}
|
||||
final ExternalMapperData other = (ExternalMapperData) obj;
|
||||
if (this.inputTables == null) {
|
||||
if (other.inputTables != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this.inputTables.equals(other.inputTables)) {
|
||||
if(this.inputTables.size() != other.inputTables.size()){
|
||||
return false;
|
||||
}
|
||||
if (this.outputTables == null) {
|
||||
if (other.outputTables != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this.outputTables.equals(other.outputTables)) {
|
||||
if(this.outputTables.size() != other.outputTables.size()){
|
||||
return false;
|
||||
}
|
||||
if (this.varsTables == null) {
|
||||
if (other.varsTables != null) {
|
||||
if(this.varsTables.size() != other.varsTables.size()){
|
||||
return false;
|
||||
}
|
||||
|
||||
for(ExternalMapperTable inTable:inputTables){
|
||||
boolean found = false;
|
||||
for(ExternalMapperTable otherTable:other.inputTables){
|
||||
if(inTable.getName().equals(otherTable.getName())){
|
||||
found = true;
|
||||
if(!inTable.equals(otherTable)){
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(found == false){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
for(ExternalMapperTable outTable:outputTables){
|
||||
boolean found = false;
|
||||
for(ExternalMapperTable otherTable:other.outputTables){
|
||||
if(outTable.getName().equals(otherTable.getName())){
|
||||
found = true;
|
||||
if(!outTable.equals(otherTable)){
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(found == false){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
for(ExternalMapperTable varTable:varsTables){
|
||||
boolean found = false;
|
||||
for(ExternalMapperTable var:other.varsTables){
|
||||
if(varTable.getName().equals(var.getName())){
|
||||
found = true;
|
||||
if(!varTable.equals(var)){
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(found == false){
|
||||
return false;
|
||||
}
|
||||
} else if (!this.varsTables.equals(other.varsTables)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -399,13 +399,7 @@ public class ExternalMapperTable extends AbstractExternalMapTable implements Ser
|
||||
if (this.activateExpressionFilter != other.activateExpressionFilter) {
|
||||
return false;
|
||||
}
|
||||
if (this.constraintTableEntries == null) {
|
||||
if (other.constraintTableEntries != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this.constraintTableEntries.equals(other.constraintTableEntries)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.expressionFilter == null) {
|
||||
if (other.expressionFilter != null) {
|
||||
return false;
|
||||
@@ -430,13 +424,7 @@ public class ExternalMapperTable extends AbstractExternalMapTable implements Ser
|
||||
} else if (!this.lookupMode.equals(other.lookupMode)) {
|
||||
return false;
|
||||
}
|
||||
if (this.metadataTableEntries == null) {
|
||||
if (other.metadataTableEntries != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this.metadataTableEntries.equals(other.metadataTableEntries)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.minimized != other.minimized) {
|
||||
return false;
|
||||
}
|
||||
@@ -473,13 +461,101 @@ public class ExternalMapperTable extends AbstractExternalMapTable implements Ser
|
||||
} else if (!this.id.equals(other.id)) {
|
||||
return false;
|
||||
}
|
||||
if (this.globalMapKeysValues == null) {
|
||||
if (other.globalMapKeysValues != null) {
|
||||
|
||||
List<ExternalMapperTableEntry> this_constraintTableEntries = null;
|
||||
if(this.constraintTableEntries == null){
|
||||
this_constraintTableEntries = new ArrayList<ExternalMapperTableEntry>();
|
||||
}else{
|
||||
this_constraintTableEntries = new ArrayList<ExternalMapperTableEntry>(this.constraintTableEntries);
|
||||
}
|
||||
List<ExternalMapperTableEntry> this_metadataTableEntries = null;
|
||||
if(this.metadataTableEntries == null){
|
||||
this_metadataTableEntries = new ArrayList<ExternalMapperTableEntry>();
|
||||
}else{
|
||||
this_metadataTableEntries = new ArrayList<ExternalMapperTableEntry>(this.metadataTableEntries);
|
||||
}
|
||||
List<ExternalMapperTableEntry> this_globalMapKeysValues = null;
|
||||
if(this.globalMapKeysValues == null){
|
||||
this_globalMapKeysValues = new ArrayList<ExternalMapperTableEntry>();
|
||||
}else{
|
||||
this_globalMapKeysValues = new ArrayList<ExternalMapperTableEntry>(this.globalMapKeysValues);
|
||||
}
|
||||
|
||||
List<ExternalMapperTableEntry> other_constraintTableEntries = null;
|
||||
if(other.constraintTableEntries == null){
|
||||
other_constraintTableEntries = new ArrayList<ExternalMapperTableEntry>();
|
||||
}else{
|
||||
other_constraintTableEntries = new ArrayList<ExternalMapperTableEntry>(other.constraintTableEntries);
|
||||
}
|
||||
List<ExternalMapperTableEntry> other_metadataTableEntries = null;
|
||||
if(other.metadataTableEntries == null){
|
||||
other_metadataTableEntries = new ArrayList<ExternalMapperTableEntry>();
|
||||
}else{
|
||||
other_metadataTableEntries = new ArrayList<ExternalMapperTableEntry>(other.metadataTableEntries);
|
||||
}
|
||||
List<ExternalMapperTableEntry> other_globalMapKeysValues = null;
|
||||
if(other.globalMapKeysValues == null){
|
||||
other_globalMapKeysValues = new ArrayList<ExternalMapperTableEntry>();
|
||||
}else{
|
||||
other_globalMapKeysValues = new ArrayList<ExternalMapperTableEntry>(other.globalMapKeysValues);
|
||||
}
|
||||
|
||||
if(this_constraintTableEntries.size() != other_constraintTableEntries.size()){
|
||||
return false;
|
||||
}
|
||||
for(ExternalMapperTableEntry oriObj:this_constraintTableEntries){
|
||||
boolean found = false;
|
||||
for(ExternalMapperTableEntry otherObj:other_constraintTableEntries){
|
||||
if(oriObj.getName().equals(otherObj.getName())){
|
||||
found = true;
|
||||
if(!oriObj.equals(otherObj)){
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(found == false){
|
||||
return false;
|
||||
}
|
||||
} else if (!this.globalMapKeysValues.equals(other.globalMapKeysValues)) {
|
||||
}
|
||||
|
||||
if(this_metadataTableEntries.size() != other_metadataTableEntries.size()){
|
||||
return false;
|
||||
}
|
||||
for(ExternalMapperTableEntry oriObj:this_metadataTableEntries){
|
||||
boolean found = false;
|
||||
for(ExternalMapperTableEntry otherObj:other_metadataTableEntries){
|
||||
if(oriObj.getName().equals(otherObj.getName())){
|
||||
found = true;
|
||||
if(!oriObj.equals(otherObj)){
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(found == false){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if(this_globalMapKeysValues.size() != other_globalMapKeysValues.size()){
|
||||
return false;
|
||||
}
|
||||
for(ExternalMapperTableEntry oriObj:this_globalMapKeysValues){
|
||||
boolean found = false;
|
||||
for(ExternalMapperTableEntry otherObj:other_globalMapKeysValues){
|
||||
if(oriObj.getName().equals(otherObj.getName())){
|
||||
found = true;
|
||||
if(!oriObj.equals(otherObj)){
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(found == false){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -86,6 +86,7 @@ import org.talend.designer.mapper.ui.visualmap.table.EntryState;
|
||||
import org.talend.designer.mapper.ui.visualmap.zone.Zone;
|
||||
import org.talend.designer.mapper.ui.visualmap.zone.scrollable.TablesZoneView;
|
||||
import org.talend.designer.mapper.utils.DataMapExpressionParser;
|
||||
import org.talend.designer.mapper.utils.MapperHelper;
|
||||
import org.talend.repository.model.IRepositoryService;
|
||||
import org.talend.repository.model.RepositoryConstants;
|
||||
|
||||
@@ -132,8 +133,7 @@ public class MapperManager extends AbstractMapperManager {
|
||||
problemsManager = new ProblemsManager(this);
|
||||
IProcess process = getAbstractMapComponent().getProcess();
|
||||
isMRProcess = ComponentCategory.CATEGORY_4_MAPREDUCE.getName().equals(process.getComponentsType());
|
||||
isBigDataProcess = isMRProcess || ComponentCategory.CATEGORY_4_SPARK.getName().equals(process.getComponentsType())
|
||||
|| ComponentCategory.CATEGORY_4_SPARKSTREAMING.getName().equals(process.getComponentsType());
|
||||
isBigDataProcess = MapperHelper.isMapperOnBigDataProcess(process.getComponentsType());
|
||||
getDefaultSetting();
|
||||
}
|
||||
|
||||
|
||||
@@ -310,4 +310,64 @@ public abstract class AbstractDataMapTableImpl extends EObjectImpl implements Ab
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated not
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
AbstractDataMapTableImpl other = (AbstractDataMapTableImpl) obj;
|
||||
if(this.minimized != other.minimized){
|
||||
return false;
|
||||
}
|
||||
if (this.name == null) {
|
||||
if (other.name != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this.name.equals(other.name)) {
|
||||
return false;
|
||||
}
|
||||
if (this.sizeState == null) {
|
||||
if (other.sizeState != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this.sizeState.getName().equals(other.sizeState.getName())) {
|
||||
return false;
|
||||
}else if (this.sizeState.getValue() != other.sizeState.getValue()) {
|
||||
return false;
|
||||
}else if (!this.sizeState.getLiteral().equals(other.sizeState.getLiteral())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
EList<MapperTableEntry> otherEntries = other.getMapperTableEntries();
|
||||
if(getMapperTableEntries().size() != otherEntries.size()){
|
||||
return false;
|
||||
}
|
||||
for(MapperTableEntry entry:mapperTableEntries){
|
||||
boolean found = false;
|
||||
for(MapperTableEntry otherEntry:otherEntries){
|
||||
if(entry.getName().equals(otherEntry.getName())){
|
||||
found = true;
|
||||
if(!entry.equals(otherEntry)){
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(found == false){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
} // AbstractDataMapTableImpl
|
||||
|
||||
@@ -7,11 +7,8 @@
|
||||
package org.talend.designer.mapper.model.emf.mapper.impl;
|
||||
|
||||
import org.eclipse.emf.common.notify.Notification;
|
||||
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
|
||||
import org.eclipse.emf.ecore.impl.ENotificationImpl;
|
||||
|
||||
import org.talend.designer.mapper.model.emf.mapper.AbstractInOutTable;
|
||||
import org.talend.designer.mapper.model.emf.mapper.MapperPackage;
|
||||
|
||||
@@ -324,5 +321,40 @@ public abstract class AbstractInOutTableImpl extends AbstractDataMapTableImpl im
|
||||
result.append(')');
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated not
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
AbstractInOutTableImpl other = (AbstractInOutTableImpl) obj;
|
||||
if (this.activateCondensedTool != other.activateCondensedTool) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.activateExpressionFilter != other.activateExpressionFilter) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.expressionFilter == null) {
|
||||
if (other.expressionFilter != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this.expressionFilter.equals(other.expressionFilter)) {
|
||||
return false;
|
||||
}
|
||||
return super.equals(obj);
|
||||
}
|
||||
|
||||
} //AbstractInOutTableImpl
|
||||
|
||||
@@ -380,5 +380,69 @@ public class InputTableImpl extends AbstractInOutTableImpl implements InputTable
|
||||
result.append(')');
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated not
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
InputTableImpl other = (InputTableImpl) obj;
|
||||
if (this.innerJoin != other.innerJoin) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.persistent != other.persistent) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.lookupMode == null) {
|
||||
if (other.lookupMode != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this.lookupMode.equals(other.lookupMode)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.matchingMode == null) {
|
||||
if (other.matchingMode != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this.matchingMode.equals(other.matchingMode)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
EList<MapperTableEntry> otherEntries = other.getGlobalMapKeysValues();
|
||||
if(getGlobalMapKeysValues().size() != otherEntries.size()){
|
||||
return false;
|
||||
}
|
||||
for(MapperTableEntry entry:getGlobalMapKeysValues()){
|
||||
boolean found = false;
|
||||
for(MapperTableEntry otherEntry:otherEntries){
|
||||
if(entry.getName().equals(otherEntry.getName())){
|
||||
found = true;
|
||||
if(!entry.equals(otherEntry)){
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(found == false){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return super.equals(obj);
|
||||
}
|
||||
|
||||
} //InputTableImpl
|
||||
|
||||
@@ -22,7 +22,6 @@ import org.eclipse.emf.ecore.util.EObjectContainmentEList;
|
||||
import org.eclipse.emf.ecore.util.InternalEList;
|
||||
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.impl.AbstractExternalDataImpl;
|
||||
|
||||
import org.talend.designer.mapper.model.emf.mapper.InputTable;
|
||||
import org.talend.designer.mapper.model.emf.mapper.MapperData;
|
||||
import org.talend.designer.mapper.model.emf.mapper.MapperPackage;
|
||||
@@ -297,4 +296,83 @@ public class MapperDataImpl extends AbstractExternalDataImpl implements MapperDa
|
||||
return super.eIsSet(featureID);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated not
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
MapperDataImpl dbObj = (MapperDataImpl) obj;
|
||||
EList<InputTable> inputs = dbObj.getInputTables();
|
||||
EList<OutputTable> outputs =dbObj.getOutputTables();
|
||||
EList<VarTable> vars =dbObj.getVarTables();
|
||||
if(inputs.size() != getInputTables().size()){
|
||||
return false;
|
||||
}
|
||||
if(outputs.size() != getOutputTables().size()){
|
||||
return false;
|
||||
}
|
||||
if(vars.size() != getVarTables().size()){
|
||||
return false;
|
||||
}
|
||||
for(InputTable inputTable:inputTables){
|
||||
boolean found = false;
|
||||
for(InputTable input:inputs){
|
||||
if(inputTable.getName().equals(input.getName())){
|
||||
found = true;
|
||||
if(!inputTable.equals(input)){
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(found == false){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
for(OutputTable outputTable:outputTables){
|
||||
boolean found = false;
|
||||
for(OutputTable output:outputs){
|
||||
if(outputTable.getName().equals(output.getName())){
|
||||
found = true;
|
||||
if(!outputTable.equals(output)){
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(found == false){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
for(VarTable varTable:varTables){
|
||||
boolean found = false;
|
||||
for(VarTable var:vars){
|
||||
if(varTable.getName().equals(var.getName())){
|
||||
found = true;
|
||||
if(!varTable.equals(var)){
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(found == false){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
} //MapperDataImpl
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
package org.talend.designer.mapper.model.emf.mapper.impl;
|
||||
|
||||
import org.eclipse.emf.common.notify.Notification;
|
||||
|
||||
import org.eclipse.emf.common.util.EList;
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
|
||||
import org.eclipse.emf.ecore.impl.ENotificationImpl;
|
||||
@@ -379,5 +379,60 @@ public class MapperTableEntryImpl extends EObjectImpl implements MapperTableEntr
|
||||
result.append(')');
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated not
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
MapperTableEntryImpl other = (MapperTableEntryImpl) obj;
|
||||
if(this.nullable != other.nullable){
|
||||
return false;
|
||||
}
|
||||
if (this.name == null) {
|
||||
if (other.name != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this.name.equals(other.name)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.expression == null) {
|
||||
if (other.expression != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this.expression.equals(other.expression)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.type == null) {
|
||||
if (other.type != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this.type.equals(other.type)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.operator == null) {
|
||||
if (other.operator != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this.operator.equals(other.operator)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
} //MapperTableEntryImpl
|
||||
|
||||
@@ -7,11 +7,10 @@
|
||||
package org.talend.designer.mapper.model.emf.mapper.impl;
|
||||
|
||||
import org.eclipse.emf.common.notify.Notification;
|
||||
|
||||
import org.eclipse.emf.common.util.EList;
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
|
||||
import org.eclipse.emf.ecore.impl.ENotificationImpl;
|
||||
|
||||
import org.talend.designer.mapper.model.emf.mapper.MapperPackage;
|
||||
import org.talend.designer.mapper.model.emf.mapper.OutputTable;
|
||||
|
||||
@@ -324,5 +323,51 @@ public class OutputTableImpl extends AbstractInOutTableImpl implements OutputTab
|
||||
result.append(')');
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated not
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
OutputTableImpl other = (OutputTableImpl) obj;
|
||||
if(this.isErrorRejectTable != other.isErrorRejectTable){
|
||||
return false;
|
||||
}
|
||||
if(this.reject != other.reject){
|
||||
return false;
|
||||
}
|
||||
if(this.rejectInnerJoin != other.rejectInnerJoin){
|
||||
return false;
|
||||
}
|
||||
if(this.rejectInnerJoin != other.rejectInnerJoin){
|
||||
return false;
|
||||
}
|
||||
if (this.isJoinTableOf == null) {
|
||||
if (other.isJoinTableOf != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this.isJoinTableOf.equals(other.isJoinTableOf)) {
|
||||
return false;
|
||||
}
|
||||
if (this.expressionFilter == null) {
|
||||
if (other.expressionFilter != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this.expressionFilter.equals(other.expressionFilter)) {
|
||||
return false;
|
||||
}
|
||||
return super.equals(obj);
|
||||
}
|
||||
|
||||
} //OutputTableImpl
|
||||
|
||||
@@ -16,6 +16,7 @@ import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.talend.core.model.components.ComponentCategory;
|
||||
import org.talend.core.model.process.IConnection;
|
||||
import org.talend.core.model.process.INode;
|
||||
import org.talend.designer.mapper.external.data.ExternalMapperData;
|
||||
@@ -45,6 +46,9 @@ public class MapperHelper {
|
||||
* @return
|
||||
*/
|
||||
public static boolean isGeneratedAsVirtualComponent(final INode mapperNode) {
|
||||
if (isMapperOnBigDataProcess(mapperNode.getComponent().getPaletteType())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean hasPersistentSortedLookup = false;
|
||||
|
||||
@@ -86,6 +90,11 @@ public class MapperHelper {
|
||||
}
|
||||
return hasPersistentSortedLookup;
|
||||
}
|
||||
|
||||
public static boolean isMapperOnBigDataProcess(String componentType) {
|
||||
return ComponentCategory.CATEGORY_4_SPARK.getName().equals(componentType)
|
||||
|| ComponentCategory.CATEGORY_4_SPARKSTREAMING.getName().equals(componentType) || ComponentCategory.CATEGORY_4_MAPREDUCE.getName().equals(componentType);
|
||||
}
|
||||
|
||||
public static void saveDataToEmf(ExternalMapperData externalData, MapperData emfMapperData) {
|
||||
if (externalData == null || externalData == null) {
|
||||
|
||||
@@ -196,6 +196,7 @@
|
||||
<moduleSets>
|
||||
<moduleSet>
|
||||
<!-- for routines or talend libs -->
|
||||
<includeSubModules>false</includeSubModules>
|
||||
<useAllReactorProjects>true</useAllReactorProjects>
|
||||
<includes>
|
||||
<include>${routines.binaries.includes.set}</include>
|
||||
@@ -210,6 +211,7 @@
|
||||
</moduleSet>
|
||||
<moduleSet>
|
||||
<!-- for pigudfs or talend libs -->
|
||||
<includeSubModules>false</includeSubModules>
|
||||
<useAllReactorProjects>true</useAllReactorProjects>
|
||||
<includes>
|
||||
<include>${pigudfs.binaries.includes.set}</include>
|
||||
|
||||
@@ -164,9 +164,12 @@ public abstract class AbstractPublishJobAction implements IRunnableWithProgress
|
||||
exportChoiceMap.put(ExportChoice.includeLibs, true);
|
||||
|
||||
ProcessItem processItem = (ProcessItem) node.getObject().getProperty().getItem();
|
||||
|
||||
BuildJobManager.getInstance().buildJob(tmpJob.getAbsolutePath(), processItem, processItem.getProperty().getVersion(),
|
||||
processItem.getProcess().getDefaultContext(), exportChoiceMap, exportType, monitor);
|
||||
String contextName = (String) exportChoiceMap.get(ExportChoice.contextName);
|
||||
if (contextName == null) {
|
||||
contextName = processItem.getProcess().getDefaultContext();
|
||||
}
|
||||
BuildJobManager.getInstance().buildJob(tmpJob.getAbsolutePath(), processItem, jobVersion, contextName,
|
||||
exportChoiceMap, exportType, monitor);
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IRunProcessService.class)) {
|
||||
IRunProcessService service = (IRunProcessService) GlobalServiceRegister.getDefault().getService(
|
||||
IRunProcessService.class);
|
||||
|
||||
@@ -20,23 +20,13 @@ import java.util.List;
|
||||
import org.apache.commons.lang.ArrayUtils;
|
||||
import org.apache.log4j.Level;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.emf.common.util.EList;
|
||||
import org.talend.commons.exception.PersistenceException;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.model.process.IElementParameter;
|
||||
import org.talend.core.model.process.INode;
|
||||
import org.talend.core.model.process.IProcess;
|
||||
import org.talend.core.model.properties.Item;
|
||||
import org.talend.core.model.properties.ProcessItem;
|
||||
import org.talend.core.model.properties.PropertiesPackage;
|
||||
import org.talend.core.model.properties.Property;
|
||||
import org.talend.core.model.repository.IRepositoryViewObject;
|
||||
import org.talend.core.runtime.process.TalendProcessArgumentConstant;
|
||||
import org.talend.core.service.IMRProcessService;
|
||||
import org.talend.core.service.IStormProcessService;
|
||||
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;
|
||||
import org.talend.designer.runprocess.IProcessMessageManager;
|
||||
import org.talend.designer.runprocess.ProcessorException;
|
||||
import org.talend.designer.runprocess.RunProcessPlugin;
|
||||
@@ -73,7 +63,16 @@ public class ExportModelJavaProcessor extends MavenJavaProcessor {
|
||||
// export job
|
||||
String watchParam = ArrayUtils.contains(optionsParam, TalendProcessArgumentConstant.CMD_ARG_WATCH) ? TalendProcessArgumentConstant.CMD_ARG_WATCH
|
||||
: null;
|
||||
archive = helper.exportJob(this, statisticsPort, tracePort, watchParam, monitor);
|
||||
String log4jLevel = null;
|
||||
if (ArrayUtils.contains(optionsParam, TalendProcessArgumentConstant.CMD_ARG_LOG4J_LEVEL)) {
|
||||
for (String param : optionsParam) {
|
||||
if (param != null && param.indexOf(TalendProcessArgumentConstant.CMD_ARG_LOG4J_LEVEL) >= 0) {
|
||||
log4jLevel = param;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
archive = helper.exportJob(this, statisticsPort, tracePort, watchParam, log4jLevel, monitor);
|
||||
unzipFolder = unzipAndDeploy(process, archive);
|
||||
|
||||
Process process = super.execFrom(unzipFolder + File.separatorChar + this.process.getName(), Level.INFO, statisticsPort,
|
||||
|
||||
@@ -107,7 +107,7 @@ public class ExportProcessorHelper {
|
||||
return tempFolder;
|
||||
}
|
||||
|
||||
public String exportJob(Processor processor, int statisticsPort, int tracePort, String watchParam,
|
||||
public String exportJob(Processor processor, int statisticsPort, int tracePort, String watchParam, String log4jLevel,
|
||||
final IProgressMonitor progressMonitor) throws ProcessorException {
|
||||
ProcessItem processItem = (ProcessItem) processor.getProperty().getItem();
|
||||
processName = processor.getProperty().getLabel();
|
||||
@@ -145,7 +145,7 @@ public class ExportProcessorHelper {
|
||||
}
|
||||
|
||||
export(progressMonitor, processItem, ERepositoryObjectType.getItemType(processItem), processor.getContext().getName(),
|
||||
archiveFile.toString(), null, false, statisticsPort, tracePort, prop);
|
||||
archiveFile.toString(), log4jLevel, false, statisticsPort, tracePort, prop);
|
||||
|
||||
return archiveFile.toString();
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ import java.io.LineNumberReader;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
@@ -1307,6 +1308,8 @@ public class JavaProcessor extends AbstractJavaProcessor implements IJavaBreakpo
|
||||
return ""; //$NON-NLS-1$
|
||||
}
|
||||
File[] jarFiles = libDir.listFiles(FilesUtils.getAcceptJARFilesFilter());
|
||||
List<File> listFile = Arrays.asList(jarFiles);
|
||||
Collections.sort(listFile);
|
||||
|
||||
if (jarFiles != null && jarFiles.length > 0) {
|
||||
for (File jarFile : jarFiles) {
|
||||
|
||||
@@ -14,10 +14,12 @@ package org.talend.designer.runprocess.java;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Collection;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
|
||||
import org.eclipse.core.resources.IFolder;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
@@ -157,7 +159,13 @@ public class JavaProcessorUtilities {
|
||||
}
|
||||
|
||||
public static Set<ModuleNeeded> getNeededModulesForProcess(IProcess process) {
|
||||
Set<ModuleNeeded> neededLibraries = new HashSet<ModuleNeeded>();
|
||||
Set<ModuleNeeded> neededLibraries = new TreeSet<ModuleNeeded>(new Comparator<ModuleNeeded>() {
|
||||
@Override
|
||||
public int compare(ModuleNeeded m1, ModuleNeeded m2) {
|
||||
return m1.toString().compareTo(m2.toString());
|
||||
}
|
||||
});
|
||||
|
||||
Set<ModuleNeeded> neededModules = LastGenerationInfo.getInstance().getModulesNeededWithSubjobPerJob(process.getId(),
|
||||
process.getVersion());
|
||||
neededLibraries.addAll(neededModules);
|
||||
|
||||
@@ -215,46 +215,7 @@ public class ImportTreeFromRepository extends SelectionAction {
|
||||
|
||||
private void prepareEmfTreeFromXml(XmlFileConnection connection) throws Exception {
|
||||
if (!connection.isInputModel()) {
|
||||
String file = connection.getXmlFilePath();
|
||||
List<FOXTreeNode> list = new ArrayList<FOXTreeNode>();
|
||||
// fix for TDI-20671 , root element is loop in output
|
||||
String rootXpath = null;
|
||||
if (!connection.getRoot().isEmpty()) {
|
||||
rootXpath = connection.getRoot().get(0).getXMLPath();
|
||||
} else if (!connection.getLoop().isEmpty()) {
|
||||
rootXpath = connection.getLoop().get(0).getXMLPath();
|
||||
}
|
||||
File xmlFile = new File(file);
|
||||
if (xmlFile.exists() && !file.endsWith(".zip")) {
|
||||
list = TreeUtil.getFoxTreeNodesForXmlMap(xmlFile.getAbsolutePath(), rootXpath, true);
|
||||
} else if (connection.getFileContent() != null && connection.getFileContent().length > 0) {
|
||||
String xsdFile = initFileContent(connection);
|
||||
if (xsdFile != null && new File(xsdFile).exists()) {
|
||||
list = TreeUtil.getFoxTreeNodesForXmlMap(xsdFile, rootXpath, true);
|
||||
} else {
|
||||
// for manually created output
|
||||
prepareEmfTreeFromConnection(connection);
|
||||
return;
|
||||
|
||||
}
|
||||
} else {
|
||||
// for manually created output
|
||||
prepareEmfTreeFromConnection(connection);
|
||||
return;
|
||||
}
|
||||
schemaNode.getChildren().clear();
|
||||
root = connection.getRoot();
|
||||
loop = connection.getLoop();
|
||||
group = connection.getGroup();
|
||||
groupElements = new ArrayList<TreeNode>();
|
||||
prepareModelFromOutput(list, schemaNode);
|
||||
if (loopNode != null) {
|
||||
fillGroup(loopNode, groupElements);
|
||||
} else {
|
||||
if (!schemaNode.getChildren().isEmpty()) {
|
||||
schemaNode.getChildren().get(0).setLoop(true);
|
||||
}
|
||||
}
|
||||
prepareEmfTreeFromConnection(connection);
|
||||
} else {
|
||||
List<SchemaTarget> schemaTargets = null;
|
||||
if (!connection.getSchema().isEmpty() && connection.getSchema().get(0) instanceof XmlXPathLoopDescriptorImpl) {
|
||||
|
||||
@@ -19,4 +19,9 @@ import org.eclipse.emf.ecore.EObject;
|
||||
* @generated
|
||||
*/
|
||||
public interface IConnection extends EObject {
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* @generated not
|
||||
*/
|
||||
String getName();
|
||||
} // IConnection
|
||||
|
||||
@@ -18,7 +18,6 @@ import org.eclipse.emf.ecore.impl.ENotificationImpl;
|
||||
import org.eclipse.emf.ecore.impl.EObjectImpl;
|
||||
|
||||
import org.eclipse.emf.ecore.util.EObjectResolvingEList;
|
||||
|
||||
import org.talend.designer.xmlmap.model.emf.xmlmap.AbstractInOutTree;
|
||||
import org.talend.designer.xmlmap.model.emf.xmlmap.FilterConnection;
|
||||
import org.talend.designer.xmlmap.model.emf.xmlmap.XmlmapPackage;
|
||||
@@ -475,5 +474,56 @@ public abstract class AbstractInOutTreeImpl extends EObjectImpl implements Abstr
|
||||
result.append(')');
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated not
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
AbstractInOutTreeImpl other = (AbstractInOutTreeImpl) obj;
|
||||
if(this.getFilterIncomingConnections().size() != other.getFilterIncomingConnections().size()){
|
||||
return false;
|
||||
}
|
||||
if (this.name == null) {
|
||||
if (other.name != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this.name.equals(other.name)) {
|
||||
return false;
|
||||
}
|
||||
if (this.expressionFilter == null) {
|
||||
if (other.expressionFilter != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this.expressionFilter.equals(other.expressionFilter)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if(this.activateExpressionFilter != other.activateExpressionFilter){
|
||||
return false;
|
||||
}
|
||||
if(this.activateCondensedTool != other.activateCondensedTool){
|
||||
return false;
|
||||
}
|
||||
if(this.minimized != other.minimized){
|
||||
return false;
|
||||
}
|
||||
if(this.multiLoops != other.multiLoops){
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
} //AbstractInOutTreeImpl
|
||||
|
||||
@@ -383,4 +383,55 @@ public abstract class AbstractNodeImpl extends EObjectImpl implements AbstractNo
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated not
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
AbstractNodeImpl other = (AbstractNodeImpl) obj;
|
||||
if (this.name == null) {
|
||||
if (other.name != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this.name.equals(other.name)) {
|
||||
return false;
|
||||
}
|
||||
if (this.expression == null) {
|
||||
if (other.expression != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this.expression.equals(other.expression)) {
|
||||
return false;
|
||||
}
|
||||
if (this.type == null) {
|
||||
if (other.type != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this.type.equals(other.type)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if(this.getFilterOutGoingConnections().size() != this.getFilterOutGoingConnections().size()){
|
||||
return false;
|
||||
}
|
||||
if(this.getIncomingConnections().size() != this.getIncomingConnections().size()){
|
||||
return false;
|
||||
}
|
||||
if(this.getOutgoingConnections().size() != this.getOutgoingConnections().size()){
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
} //AbstractNodeImpl
|
||||
|
||||
@@ -529,5 +529,88 @@ public class InputXmlTreeImpl extends AbstractInOutTreeImpl implements InputXmlT
|
||||
result.append(')');
|
||||
return result.toString();
|
||||
}
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated not
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
InputXmlTreeImpl other = (InputXmlTreeImpl) obj;
|
||||
if (this.matchingMode == null) {
|
||||
if (other.matchingMode != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this.matchingMode.equals(other.matchingMode)) {
|
||||
return false;
|
||||
}
|
||||
if (this.lookupMode == null) {
|
||||
if (other.lookupMode != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this.lookupMode.equals(other.lookupMode)) {
|
||||
return false;
|
||||
}
|
||||
if (this.lookup != other.lookup) {
|
||||
return false;
|
||||
}
|
||||
if (this.innerJoin != other.innerJoin) {
|
||||
return false;
|
||||
}
|
||||
if (this.persistent != other.persistent) {
|
||||
return false;
|
||||
}
|
||||
if (this.activateGlobalMap != other.activateGlobalMap) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if(this.getNodes().size() != other.getNodes().size()){
|
||||
return false;
|
||||
}
|
||||
for(TreeNode inputTable:nodes){
|
||||
boolean found = false;
|
||||
for(TreeNode input:other.nodes){
|
||||
if(inputTable.getName().equals(input.getName())){
|
||||
found = true;
|
||||
if(!inputTable.equals(input)){
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(found == false){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if(this.getGlobalMapKeysValues().size() != other.getGlobalMapKeysValues().size()){
|
||||
return false;
|
||||
}
|
||||
for(GlobalMapNode inputTable:globalMapKeysValues){
|
||||
boolean found = false;
|
||||
for(GlobalMapNode input:other.globalMapKeysValues){
|
||||
if(inputTable.getName().equals(input.getName())){
|
||||
found = true;
|
||||
if(!inputTable.equals(input)){
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(found == false){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return super.equals(obj);
|
||||
}
|
||||
|
||||
} //InputXmlTreeImpl
|
||||
|
||||
@@ -20,10 +20,10 @@ import org.eclipse.emf.ecore.impl.ENotificationImpl;
|
||||
|
||||
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
|
||||
import org.eclipse.emf.ecore.util.InternalEList;
|
||||
|
||||
import org.talend.designer.xmlmap.model.emf.xmlmap.InputLoopNodesTable;
|
||||
import org.talend.designer.xmlmap.model.emf.xmlmap.OutputTreeNode;
|
||||
import org.talend.designer.xmlmap.model.emf.xmlmap.OutputXmlTree;
|
||||
import org.talend.designer.xmlmap.model.emf.xmlmap.TreeNode;
|
||||
import org.talend.designer.xmlmap.model.emf.xmlmap.XmlmapPackage;
|
||||
|
||||
/**
|
||||
@@ -474,5 +474,61 @@ public class OutputXmlTreeImpl extends AbstractInOutTreeImpl implements OutputXm
|
||||
result.append(')');
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated not
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
OutputXmlTreeImpl other = (OutputXmlTreeImpl) obj;
|
||||
if(this.reject != other.reject){
|
||||
return false;
|
||||
}
|
||||
if(this.rejectInnerJoin != other.rejectInnerJoin){
|
||||
return false;
|
||||
}
|
||||
if(this.errorReject != other.errorReject){
|
||||
return false;
|
||||
}
|
||||
if(this.allInOne != other.allInOne){
|
||||
return false;
|
||||
}
|
||||
if(this.enableEmptyElement != other.enableEmptyElement){
|
||||
return false;
|
||||
}
|
||||
if(this.getNodes().size() != other.getNodes().size()){
|
||||
return false;
|
||||
}
|
||||
if(this.getInputLoopNodesTables().size() != other.getInputLoopNodesTables().size()){
|
||||
return false;
|
||||
}
|
||||
for(TreeNode tree:nodes){
|
||||
boolean found = false;
|
||||
for(TreeNode otherTree:other.nodes){
|
||||
if(tree.getName().equals(otherTree.getName())){
|
||||
found = true;
|
||||
if(!tree.equals(otherTree)){
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(found == false){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return super.equals(obj);
|
||||
}
|
||||
|
||||
} //OutputXmlTreeImpl
|
||||
|
||||
@@ -21,7 +21,8 @@ import org.eclipse.emf.ecore.impl.ENotificationImpl;
|
||||
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
|
||||
import org.eclipse.emf.ecore.util.EObjectResolvingEList;
|
||||
import org.eclipse.emf.ecore.util.InternalEList;
|
||||
|
||||
import org.talend.designer.xmlmap.model.emf.xmlmap.Connection;
|
||||
import org.talend.designer.xmlmap.model.emf.xmlmap.FilterConnection;
|
||||
import org.talend.designer.xmlmap.model.emf.xmlmap.LookupConnection;
|
||||
import org.talend.designer.xmlmap.model.emf.xmlmap.NodeType;
|
||||
import org.talend.designer.xmlmap.model.emf.xmlmap.TreeNode;
|
||||
@@ -885,5 +886,99 @@ public class TreeNodeImpl extends AbstractNodeImpl implements TreeNode {
|
||||
result.append(')');
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated not
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
TreeNodeImpl other = (TreeNodeImpl) obj;
|
||||
if (this.xpath == null) {
|
||||
if (other.xpath != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this.xpath.equals(other.xpath)) {
|
||||
return false;
|
||||
}
|
||||
if (this.pattern == null) {
|
||||
if (other.pattern != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this.pattern.equals(other.pattern)) {
|
||||
return false;
|
||||
}
|
||||
if (this.nodeType == null) {
|
||||
if (other.nodeType != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (this.nodeType.getValue() != other.nodeType.getValue()) {
|
||||
return false;
|
||||
}else if (!this.nodeType.getLiteral().equals(other.nodeType.getLiteral())) {
|
||||
return false;
|
||||
}else if (!this.nodeType.getName().equals(other.nodeType.getName())) {
|
||||
return false;
|
||||
}
|
||||
if(this.group != other.group){
|
||||
return false;
|
||||
}
|
||||
if(this.nullable != other.nullable){
|
||||
return false;
|
||||
}
|
||||
if(this.key != other.key){
|
||||
return false;
|
||||
}
|
||||
if(this.choice != other.choice){
|
||||
return false;
|
||||
}
|
||||
if(this.optional != other.optional){
|
||||
return false;
|
||||
}
|
||||
if(this.loop != other.loop){
|
||||
return false;
|
||||
}
|
||||
if(this.main != other.main){
|
||||
return false;
|
||||
}
|
||||
if(this.substitution != other.substitution){
|
||||
return false;
|
||||
}
|
||||
if(this.getChildren().size() != this.getChildren().size()){
|
||||
return false;
|
||||
}
|
||||
if(this.getLookupIncomingConnections().size() != this.getLookupIncomingConnections().size()){
|
||||
return false;
|
||||
}
|
||||
if(this.getLookupOutgoingConnections().size() != this.getLookupOutgoingConnections().size()){
|
||||
return false;
|
||||
}
|
||||
|
||||
for(TreeNode inputTable:getChildren()){
|
||||
boolean found = false;
|
||||
for(TreeNode input:other.getChildren()){
|
||||
if(inputTable.getName().equals(input.getName())){
|
||||
found = true;
|
||||
if(!inputTable.equals(input)){
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(found == false){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return super.equals(obj);
|
||||
}
|
||||
|
||||
} //TreeNodeImpl
|
||||
|
||||
@@ -162,5 +162,28 @@ public class VarNodeImpl extends AbstractNodeImpl implements VarNode {
|
||||
result.append(')');
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated not
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
VarNodeImpl other = (VarNodeImpl) obj;
|
||||
if(this.nullable != other.nullable){
|
||||
return false;
|
||||
}
|
||||
return super.equals(obj);
|
||||
}
|
||||
|
||||
} //VarNodeImpl
|
||||
|
||||
@@ -21,7 +21,7 @@ import org.eclipse.emf.ecore.impl.EObjectImpl;
|
||||
|
||||
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
|
||||
import org.eclipse.emf.ecore.util.InternalEList;
|
||||
|
||||
import org.talend.designer.xmlmap.model.emf.xmlmap.TreeNode;
|
||||
import org.talend.designer.xmlmap.model.emf.xmlmap.VarNode;
|
||||
import org.talend.designer.xmlmap.model.emf.xmlmap.VarTable;
|
||||
import org.talend.designer.xmlmap.model.emf.xmlmap.XmlmapPackage;
|
||||
@@ -277,4 +277,52 @@ public class VarTableImpl extends EObjectImpl implements VarTable {
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated not
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
VarTableImpl other = (VarTableImpl) obj;
|
||||
if (this.name == null) {
|
||||
if (other.name != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this.name.equals(other.name)) {
|
||||
return false;
|
||||
}
|
||||
if(this.minimized != other.minimized){
|
||||
return false;
|
||||
}
|
||||
if(this.getNodes().size() != other.getNodes().size()){
|
||||
return false;
|
||||
}
|
||||
|
||||
for(VarNode inputTable:getNodes()){
|
||||
boolean found = false;
|
||||
for(VarNode input:other.getNodes()){
|
||||
if(inputTable.getName().equals(input.getName())){
|
||||
found = true;
|
||||
if(!inputTable.equals(input)){
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(found == false){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
} //VarTableImpl
|
||||
|
||||
@@ -19,7 +19,6 @@ import org.eclipse.emf.ecore.util.EObjectContainmentEList;
|
||||
import org.eclipse.emf.ecore.util.InternalEList;
|
||||
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.impl.AbstractExternalDataImpl;
|
||||
|
||||
import org.talend.designer.xmlmap.model.emf.xmlmap.IConnection;
|
||||
import org.talend.designer.xmlmap.model.emf.xmlmap.InputXmlTree;
|
||||
import org.talend.designer.xmlmap.model.emf.xmlmap.OutputXmlTree;
|
||||
@@ -263,5 +262,89 @@ public class XmlMapDataImpl extends AbstractExternalDataImpl implements XmlMapDa
|
||||
}
|
||||
return super.eIsSet(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated not
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
XmlMapDataImpl dbObj = (XmlMapDataImpl) obj;
|
||||
EList<InputXmlTree> inputs = dbObj.getInputTrees();
|
||||
EList<OutputXmlTree> outputs =dbObj.getOutputTrees();
|
||||
EList<VarTable> vars =dbObj.getVarTables();
|
||||
EList<IConnection> conns = dbObj.getConnections();
|
||||
if(inputs.size() != getInputTrees().size()){
|
||||
return false;
|
||||
}
|
||||
if(outputs.size() != getOutputTrees().size()){
|
||||
return false;
|
||||
}
|
||||
if(vars.size() != getVarTables().size()){
|
||||
return false;
|
||||
}
|
||||
if(getConnections().size() != conns.size()){
|
||||
return false;
|
||||
}
|
||||
|
||||
for(InputXmlTree inputTable:inputTrees){
|
||||
boolean found = false;
|
||||
for(InputXmlTree input:inputs){
|
||||
if(inputTable.getName().equals(input.getName())){
|
||||
found = true;
|
||||
if(!inputTable.equals(input)){
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(found == false){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
for(OutputXmlTree outputTable:outputTrees){
|
||||
boolean found = false;
|
||||
for(OutputXmlTree output:outputs){
|
||||
if(outputTable.getName().equals(output.getName())){
|
||||
found = true;
|
||||
if(!outputTable.equals(output)){
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(found == false){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
for(VarTable varTable:varTables){
|
||||
boolean found = false;
|
||||
for(VarTable var:vars){
|
||||
if(varTable.getName().equals(var.getName())){
|
||||
found = true;
|
||||
if(!varTable.equals(var)){
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(found == false){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
} //XmlMapDataImpl
|
||||
|
||||
@@ -188,7 +188,7 @@ public class GenericWizardService implements IGenericWizardService {
|
||||
if (isGenericConnection(connection)) {
|
||||
GenericConnection genericConnection = (GenericConnection) connection;
|
||||
String compProperties = genericConnection.getCompProperties();
|
||||
ComponentProperties cp = ComponentsUtils.getComponentPropertiesFromSerialized(compProperties, connection);
|
||||
ComponentProperties cp = ComponentsUtils.getComponentPropertiesFromSerialized(compProperties, connection, false);
|
||||
if (cp != null) {
|
||||
componentProperties.add(cp);
|
||||
}
|
||||
@@ -202,7 +202,7 @@ public class GenericWizardService implements IGenericWizardService {
|
||||
for (TaggedValue taggedValue : metadataTable.getTaggedValue()) {
|
||||
if (IComponentConstants.COMPONENT_PROPERTIES_TAG.equals(taggedValue.getTag())) {
|
||||
ComponentProperties compPros = ComponentsUtils.getComponentPropertiesFromSerialized(
|
||||
taggedValue.getValue(), connection);
|
||||
taggedValue.getValue(), connection, false);
|
||||
if (compPros != null && !componentProperties.contains(compPros)) {
|
||||
compPros.updateNestedProperties(cp);
|
||||
componentProperties.add(compPros);
|
||||
|
||||
@@ -51,16 +51,12 @@ import org.talend.core.model.repository.RepositoryObject;
|
||||
import org.talend.core.repository.model.ProxyRepositoryFactory;
|
||||
import org.talend.core.runtime.CoreRuntimePlugin;
|
||||
import org.talend.core.runtime.services.IGenericWizardService;
|
||||
import org.talend.daikon.properties.Properties;
|
||||
import org.talend.daikon.properties.presentation.Form;
|
||||
import org.talend.daikon.serialize.PostDeserializeSetup;
|
||||
import org.talend.daikon.serialize.SerializerDeserializer;
|
||||
import org.talend.designer.core.generic.constants.IGenericConstants;
|
||||
import org.talend.designer.core.generic.utils.ComponentsUtils;
|
||||
import org.talend.designer.core.model.components.ElementParameter;
|
||||
import org.talend.metadata.managment.ui.utils.ConnectionContextHelper;
|
||||
import org.talend.metadata.managment.ui.wizard.CheckLastVersionRepositoryWizard;
|
||||
import org.talend.metadata.managment.ui.wizard.context.MetadataContextPropertyValueEvaluator;
|
||||
import org.talend.repository.generic.i18n.Messages;
|
||||
import org.talend.repository.generic.internal.IGenericWizardInternalService;
|
||||
import org.talend.repository.generic.internal.service.GenericWizardInternalService;
|
||||
@@ -147,6 +143,9 @@ public class GenericConnWizard extends CheckLastVersionRepositoryWizard {
|
||||
RepositoryObject object = new RepositoryObject(node.getObject().getProperty());
|
||||
setRepositoryObject(object);
|
||||
connection = (GenericConnection) ((ConnectionItem) object.getProperty().getItem()).getConnection();
|
||||
// Set context name to null so as to open context select dialog once if there are more than one context
|
||||
// group when opening a connection.
|
||||
connection.setContextName(null);
|
||||
connectionProperty = object.getProperty();
|
||||
connectionItem = (ConnectionItem) object.getProperty().getItem();
|
||||
// set the repositoryObject, lock and set isRepositoryObjectEditable
|
||||
@@ -190,7 +189,8 @@ public class GenericConnWizard extends CheckLastVersionRepositoryWizard {
|
||||
} else {
|
||||
String compPropertiesStr = connection.getCompProperties();
|
||||
if (compPropertiesStr != null) {
|
||||
ComponentProperties properties = ComponentsUtils.getComponentPropertiesFromSerialized(compPropertiesStr, connection);
|
||||
ComponentProperties properties = ComponentsUtils.getComponentPropertiesFromSerialized(compPropertiesStr,
|
||||
connection, false);
|
||||
if (properties != null) {
|
||||
componentWizard = internalService.getTopLevelComponentWizard(properties, repNode.getId());
|
||||
}
|
||||
@@ -264,7 +264,7 @@ public class GenericConnWizard extends CheckLastVersionRepositoryWizard {
|
||||
if (creation) {
|
||||
factory.create(connectionItem, pathToSave);
|
||||
}
|
||||
compService.afterFormFinish(form.getName(), (ComponentProperties) form.getProperties());
|
||||
compService.afterFormFinish(form.getName(), form.getProperties());
|
||||
}
|
||||
if (!creation) {
|
||||
GenericUpdateManager.updateGenericConnection(connectionItem, oldMetadataTable);
|
||||
|
||||
@@ -2795,6 +2795,16 @@
|
||||
name="ReviseInvalidContextNamesMigrationTask"
|
||||
version="6.1.2">
|
||||
</projecttask>
|
||||
|
||||
<projecttask
|
||||
beforeLogon="false"
|
||||
breaks="4.2.4"
|
||||
class="org.talend.repository.model.migration.ResetItemLabelMigrationTask"
|
||||
description="Reset the item label"
|
||||
id="org.talend.repository.model.migration.ResetItemLabelMigrationTask"
|
||||
name="ResetItemLabelMigrationTask"
|
||||
version="5.2.2">
|
||||
</projecttask>
|
||||
</extension>
|
||||
|
||||
<extension
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2016 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend.repository.model.migration;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.GregorianCalendar;
|
||||
import java.util.List;
|
||||
|
||||
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.Property;
|
||||
import org.talend.core.model.repository.ERepositoryObjectType;
|
||||
import org.talend.core.runtime.CoreRuntimePlugin;
|
||||
import org.talend.core.utils.WorkspaceUtils;
|
||||
import org.talend.migration.IProjectMigrationTask;
|
||||
import org.talend.repository.items.importexport.handlers.imports.ImportBasicHandler;
|
||||
import org.talend.repository.model.IProxyRepositoryFactory;
|
||||
|
||||
/**
|
||||
* DOC hwang class global comment. Detailled comment
|
||||
*/
|
||||
public class ResetItemLabelMigrationTask extends AbstractItemMigrationTask implements IProjectMigrationTask{
|
||||
|
||||
@Override
|
||||
public Date getOrder() {
|
||||
GregorianCalendar gc = new GregorianCalendar(2017, 3, 13, 12, 0, 0);
|
||||
return gc.getTime();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExecutionResult execute(Item item) {
|
||||
IProxyRepositoryFactory repositoryFactory = CoreRuntimePlugin.getInstance().getProxyRepositoryFactory();
|
||||
ImportBasicHandler handler = new ImportBasicHandler();
|
||||
Property property = item.getProperty();
|
||||
if(property == null){
|
||||
return ExecutionResult.NOTHING_TO_DO;
|
||||
}
|
||||
String label = property.getLabel();
|
||||
if(label == null){
|
||||
return ExecutionResult.NOTHING_TO_DO;
|
||||
}
|
||||
try {
|
||||
boolean isAvailable = WorkspaceUtils.checkNameIsOK(label);
|
||||
if(!isAvailable){
|
||||
property.setLabel(handler.getPropertyLabel(StringUtils.trimToNull(label)));
|
||||
property.setDisplayName(StringUtils.trimToNull(label));
|
||||
repositoryFactory.save(item, true);
|
||||
}
|
||||
} catch (PersistenceException e) {
|
||||
return ExecutionResult.FAILURE;
|
||||
}
|
||||
|
||||
return ExecutionResult.SUCCESS_WITH_ALERT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ERepositoryObjectType> getTypes() {
|
||||
List<ERepositoryObjectType> toReturn = new ArrayList<ERepositoryObjectType>();
|
||||
toReturn.add(ERepositoryObjectType.CONTEXT);
|
||||
return toReturn;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -136,7 +136,7 @@ public class ExportTreeViewer {
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param workArea
|
||||
*/
|
||||
public Composite createItemList(Composite workArea) {
|
||||
@@ -182,7 +182,8 @@ public class ExportTreeViewer {
|
||||
if (treeItem.getData() != null && treeItem.getData() instanceof RepositoryNode) {
|
||||
RepositoryNode repositoryNode = (RepositoryNode) treeItem.getData();
|
||||
for (RepositoryNode repositoryNode2 : repositoryNodes) {
|
||||
if (repositoryNode.getId().equals(repositoryNode2.getId())) {
|
||||
if (repositoryNode.getRoot().getProject().equals(repositoryNode2.getRoot().getProject())
|
||||
&& repositoryNode.getId().equals(repositoryNode2.getId())) {
|
||||
exportItemsTreeViewer.setChecked(repositoryNode, true);
|
||||
}
|
||||
}
|
||||
@@ -338,7 +339,7 @@ public class ExportTreeViewer {
|
||||
|
||||
/**
|
||||
* DOC hcw Comment method "createSelectionButton".
|
||||
*
|
||||
*
|
||||
* @param itemComposite
|
||||
*/
|
||||
private void createSelectionButton(Composite itemComposite) {
|
||||
@@ -399,7 +400,7 @@ public class ExportTreeViewer {
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* A repository view with checkbox on the left.
|
||||
*/
|
||||
|
||||
|
||||
@@ -1472,7 +1472,8 @@ public abstract class JobScriptsExportWizardPage extends WizardFileSystemResourc
|
||||
}
|
||||
|
||||
protected boolean buildJobWithMaven(JobExportType jobExportType, IProgressMonitor monitor) {
|
||||
String context = (contextCombo == null || contextCombo.isDisposed()) ? IContext.DEFAULT : contextCombo.getText();
|
||||
String context = (contextCombo == null || contextCombo.isDisposed()) ? processItem.getProcess().getDefaultContext()
|
||||
: contextCombo.getText();
|
||||
try {
|
||||
String destination = getDestinationValue();
|
||||
int separatorIndex = destination.lastIndexOf(File.separator);
|
||||
|
||||
15
pom.xml
15
pom.xml
@@ -136,7 +136,7 @@
|
||||
<module>main/plugins/org.talend.presentation.onboarding.resource.tos</module>
|
||||
<module>main/plugins/org.talend.rcp.branding.tos</module>
|
||||
<module>main/plugins/org.talend.repository</module>
|
||||
<module>main/plugins/org.talend.repository.ftp</module>
|
||||
<module>main/plugins/org.talend.repository.ftp</module>
|
||||
<module>main/plugins/org.talend.libraries.json</module>
|
||||
<module>main/plugins/org.talend.repository.json</module>
|
||||
<module>main/plugins/org.talend.repository.view.di</module>
|
||||
@@ -147,19 +147,6 @@
|
||||
<module>main/plugins/org.talend.sqlbuilder</module>
|
||||
<module>main/plugins/org.talend.designer.runtime.visualization</module>
|
||||
<module>main/plugins/org.talend.designer.runtime.visualization.tools</module>
|
||||
<module>test/plugins/org.talend.designer.codegen.test</module>
|
||||
<module>test/plugins/org.talend.designer.components.localprovider.test</module>
|
||||
<module>test/plugins/org.talend.designer.core.test</module>
|
||||
<module>test/plugins/org.talend.designer.dbmap.test</module>
|
||||
<module>test/plugins/org.talend.designer.mapper.test</module>
|
||||
<module>test/plugins/org.talend.designer.rowgenerator.test</module>
|
||||
<module>test/plugins/org.talend.designer.runprocess.test</module>
|
||||
<module>test/plugins/org.talend.designer.xmlmap.test</module>
|
||||
<module>test/plugins/org.talend.repository.test</module>
|
||||
<module>test/plugins/org.talend.repository.generic.test</module>
|
||||
<module>test/plugins/org.talend.designer.core.generic.test</module>
|
||||
<module>test/plugins/org.talend.repository.view.di.test</module>
|
||||
<module>test/plugins/org.talend.designer.webservice.test</module>
|
||||
</modules>
|
||||
<build>
|
||||
<plugins>
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2016 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend.designer.core.ui.editor.properties.controllers;
|
||||
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.talend.commons.utils.VersionUtils;
|
||||
import org.talend.core.CorePlugin;
|
||||
import org.talend.core.context.Context;
|
||||
import org.talend.core.context.RepositoryContext;
|
||||
import org.talend.core.model.components.ComponentCategory;
|
||||
import org.talend.core.model.components.IComponent;
|
||||
import org.talend.core.model.process.IElementParameter;
|
||||
import org.talend.core.model.properties.PropertiesFactory;
|
||||
import org.talend.core.model.properties.Property;
|
||||
import org.talend.core.ui.component.ComponentsFactoryProvider;
|
||||
import org.talend.designer.core.ui.editor.nodes.Node;
|
||||
import org.talend.designer.core.ui.editor.process.Process;
|
||||
|
||||
/**
|
||||
* created by hwang on 2017-3-8 Detailled comment
|
||||
*
|
||||
*/
|
||||
|
||||
public class ComponentListControllerTest {
|
||||
|
||||
@Before
|
||||
public void before() {
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testrenameComponentUniqueName(){
|
||||
//---first
|
||||
String oldConnectionName = "joblet3_1";
|
||||
String newConnectionName = "joblet1_1_joblet2_1_joblet3_1";
|
||||
List<Node> nodesToUpdate = new ArrayList<Node>();
|
||||
|
||||
IComponent component = ComponentsFactoryProvider.getInstance().get("tMysqlInput",
|
||||
ComponentCategory.CATEGORY_4_DI.getName());
|
||||
Property property = PropertiesFactory.eINSTANCE.createProperty();
|
||||
property.setAuthor(((RepositoryContext) CorePlugin.getContext().getProperty(Context.REPOSITORY_CONTEXT_KEY)).getUser());
|
||||
property.setVersion(VersionUtils.DEFAULT_VERSION);
|
||||
Process process = new Process(property);
|
||||
Node node = new Node(component, process);
|
||||
nodesToUpdate.add(node);
|
||||
IElementParameter param = node.getElementParameter("CONNECTION");
|
||||
param.setValue("joblet3_1_joblet4_1_joblet5_1_tMysqlConnection_1");
|
||||
|
||||
ComponentListController.renameComponentUniqueName(oldConnectionName, newConnectionName, nodesToUpdate);
|
||||
assertTrue(param.getValue().equals("joblet1_1_joblet2_1_joblet3_1_joblet4_1_joblet5_1_tMysqlConnection_1"));
|
||||
//---second
|
||||
oldConnectionName = "tMysqlConnection_1";
|
||||
newConnectionName = "joblet1_1_joblet2_1_tMysqlConnection_1";
|
||||
param.setValue("tMysqlConnection_1_joblet4_1_joblet5_1_tMysqlConnection_1");
|
||||
ComponentListController.renameComponentUniqueName(oldConnectionName, newConnectionName, nodesToUpdate);
|
||||
assertTrue(param.getValue().equals("joblet1_1_joblet2_1_tMysqlConnection_1_joblet4_1_joblet5_1_tMysqlConnection_1"));
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,172 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2016 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend.designer.dbmap.external.data;
|
||||
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* DOC hwang class global comment. Detailled comment
|
||||
*/
|
||||
public class ExternalDbMapDataTest {
|
||||
|
||||
|
||||
|
||||
@Test
|
||||
public void testEquals() {
|
||||
ExternalDbMapData mapper1 = new ExternalDbMapData();
|
||||
ExternalDbMapData mapper2 = new ExternalDbMapData();
|
||||
assertTrue(mapper1.equals(mapper2));
|
||||
test1();
|
||||
test2();
|
||||
test3();
|
||||
test4();
|
||||
}
|
||||
|
||||
private void test1(){
|
||||
ExternalDbMapData mapper1 = createExternalDbMapData("inDiff", "outDiff", "varDiff");
|
||||
ExternalDbMapData mapper2 = createExternalDbMapData("inDiff", "outDiff", "varDiff");
|
||||
assertTrue(mapper1.equals(mapper2));
|
||||
}
|
||||
|
||||
private void test2(){
|
||||
ExternalDbMapData mapper1 = createExternalDbMapData("inDiff", "outDiff", "varDiff");
|
||||
ExternalDbMapData mapper2 = createExternalDbMapData("inDiff1", "outDiff", "varDiff");
|
||||
assertFalse(mapper1.equals(mapper2));
|
||||
}
|
||||
|
||||
private void test3(){
|
||||
ExternalDbMapData mapper1 = createExternalDbMapData("inDiff", "outDiff", "varDiff");
|
||||
ExternalDbMapData mapper2 = createExternalDbMapData("inDiff", "outDiff1", "varDiff");
|
||||
assertFalse(mapper1.equals(mapper2));
|
||||
}
|
||||
|
||||
private void test4(){
|
||||
ExternalDbMapData mapper1 = createExternalDbMapData("inDiff", "outDiff", "varDiff");
|
||||
ExternalDbMapData mapper2 = createExternalDbMapData("inDiff", "outDiff", "varDiff1");
|
||||
assertFalse(mapper1.equals(mapper2));
|
||||
}
|
||||
|
||||
private ExternalDbMapData createExternalDbMapData(String inDiff, String outDiff, String varDiff){
|
||||
ExternalDbMapData externalData = new ExternalDbMapData();
|
||||
|
||||
List<ExternalDbMapTable> externalTables = new ArrayList<ExternalDbMapTable>();
|
||||
|
||||
// input
|
||||
ExternalDbMapTable externalTable = new ExternalDbMapTable();
|
||||
externalTable.setName("pTableName");
|
||||
externalTable.setMinimized(true);
|
||||
externalTable.setAlias("pTableAlias");
|
||||
externalTable.setJoinType("JoinType");
|
||||
externalTable.setTableName("pTableTableName");
|
||||
List<ExternalDbMapEntry> entities = new ArrayList<ExternalDbMapEntry>();
|
||||
ExternalDbMapEntry entity = new ExternalDbMapEntry();
|
||||
entity.setExpression(inDiff);
|
||||
entity.setJoin(true);
|
||||
entity.setName("pEntityName");
|
||||
entity.setOperator(inDiff);
|
||||
entities.add(entity);
|
||||
externalTable.setMetadataTableEntries(entities);
|
||||
externalTables.add(externalTable);
|
||||
externalData.setInputTables(externalTables);
|
||||
|
||||
// output
|
||||
externalTables = new ArrayList<ExternalDbMapTable>();
|
||||
externalTable = new ExternalDbMapTable();
|
||||
externalTable.setName("pTableName");
|
||||
externalTable.setMinimized(false);
|
||||
externalTable.setTableName(outDiff);
|
||||
entities = new ArrayList<ExternalDbMapEntry>();
|
||||
entity = new ExternalDbMapEntry();
|
||||
entity.setExpression(outDiff);
|
||||
entity.setName("pEntitytName");
|
||||
entities.add(entity);
|
||||
externalTable.setMetadataTableEntries(entities);
|
||||
|
||||
// filters
|
||||
entities = new ArrayList<ExternalDbMapEntry>();
|
||||
List<ExternalDbMapEntry> otherFilterEntities = new ArrayList<ExternalDbMapEntry>();
|
||||
entity = new ExternalDbMapEntry();
|
||||
entity.setExpression(outDiff);
|
||||
entity.setName("pFilterName");
|
||||
entities.add(entity);
|
||||
externalTable.setCustomWhereConditionsEntries(entities);
|
||||
externalTable.setCustomOtherConditionsEntries(otherFilterEntities);
|
||||
externalTables.add(externalTable);
|
||||
externalData.setOutputTables(externalTables);
|
||||
|
||||
// var
|
||||
externalTables = new ArrayList<ExternalDbMapTable>();
|
||||
externalTable = new ExternalDbMapTable();
|
||||
externalTable.setName("pTableName");
|
||||
externalTable.setMinimized(true);
|
||||
externalTable.setAlias("pTableAlias");
|
||||
externalTable.setJoinType("JoinType");
|
||||
externalTable.setTableName("pTableTableName");
|
||||
entities = new ArrayList<ExternalDbMapEntry>();
|
||||
entity = new ExternalDbMapEntry();
|
||||
entity.setExpression(varDiff);
|
||||
entity.setJoin(true);
|
||||
entity.setName("pEntityName");
|
||||
entity.setOperator(varDiff);
|
||||
entities.add(entity);
|
||||
externalTable.setMetadataTableEntries(entities);
|
||||
externalTables.add(externalTable);
|
||||
externalData.setVarsTables(externalTables);
|
||||
|
||||
return externalData;
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEquals2() {
|
||||
ExternalDbMapData mapper1 = new ExternalDbMapData();
|
||||
|
||||
List<ExternalDbMapTable> externalTables = new ArrayList<ExternalDbMapTable>();
|
||||
|
||||
// input
|
||||
ExternalDbMapTable externalTable = new ExternalDbMapTable();
|
||||
externalTable.setName("pTableName");
|
||||
externalTable.setMinimized(true);
|
||||
externalTable.setAlias("pTableAlias");
|
||||
externalTable.setJoinType("JoinType");
|
||||
externalTable.setTableName("pTableTableName");
|
||||
externalTable.setMetadataTableEntries(new ArrayList<ExternalDbMapEntry>());
|
||||
externalTable.setCustomOtherConditionsEntries(new ArrayList<ExternalDbMapEntry>());
|
||||
externalTable.setCustomWhereConditionsEntries(new ArrayList<ExternalDbMapEntry>());
|
||||
externalTables.add(externalTable);
|
||||
mapper1.setInputTables(externalTables);
|
||||
|
||||
|
||||
ExternalDbMapData mapper2 = new ExternalDbMapData();
|
||||
|
||||
List<ExternalDbMapTable> externalTables2 = new ArrayList<ExternalDbMapTable>();
|
||||
|
||||
// input
|
||||
ExternalDbMapTable externalTable2 = new ExternalDbMapTable();
|
||||
externalTable2.setName("pTableName");
|
||||
externalTable2.setMinimized(true);
|
||||
externalTable2.setAlias("pTableAlias");
|
||||
externalTable2.setJoinType("JoinType");
|
||||
externalTable2.setTableName("pTableTableName");
|
||||
externalTables2.add(externalTable2);
|
||||
mapper2.setInputTables(externalTables2);
|
||||
|
||||
assertTrue(mapper1.equals(mapper2));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,185 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2016 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend.designer.dbmap.model.emf.dbmap.impl;
|
||||
|
||||
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.talend.designer.dbmap.model.emf.dbmap.DBMapperTableEntry;
|
||||
import org.talend.designer.dbmap.model.emf.dbmap.DbmapFactory;
|
||||
import org.talend.designer.dbmap.model.emf.dbmap.InputTable;
|
||||
import org.talend.designer.dbmap.model.emf.dbmap.OutputTable;
|
||||
|
||||
/**
|
||||
* DOC hwang class global comment. Detailled comment
|
||||
*/
|
||||
public class DBMapDataImplTest {
|
||||
|
||||
@Test
|
||||
public void testEquals() {
|
||||
test1();
|
||||
test2();
|
||||
test3();
|
||||
test4();
|
||||
}
|
||||
|
||||
private void test1(){
|
||||
DBMapDataImpl mapData1 = new DBMapDataImpl();
|
||||
DBMapDataImpl mapData2 = new DBMapDataImpl();
|
||||
assertTrue(mapData1.equals(mapData2));
|
||||
|
||||
final InputTable persistentTable = DbmapFactory.eINSTANCE.createInputTable();
|
||||
persistentTable.setMinimized(true);
|
||||
persistentTable.setName("table1");
|
||||
persistentTable.setAlias("alias1");
|
||||
persistentTable.setJoinType("type1");
|
||||
persistentTable.setTableName("tableName");
|
||||
|
||||
final DBMapperTableEntry emfMapperTableEntry = DbmapFactory.eINSTANCE.createDBMapperTableEntry();
|
||||
emfMapperTableEntry.setExpression("expression1");
|
||||
emfMapperTableEntry.setName("entityName1");
|
||||
emfMapperTableEntry.setJoin(true);
|
||||
emfMapperTableEntry.setOperator("operator1");
|
||||
persistentTable.getDBMapperTableEntries().add(emfMapperTableEntry);
|
||||
|
||||
mapData1.getInputTables().add(persistentTable);
|
||||
|
||||
final InputTable persistentTable2 = DbmapFactory.eINSTANCE.createInputTable();
|
||||
persistentTable2.setMinimized(true);
|
||||
persistentTable2.setName("table1");
|
||||
persistentTable2.setAlias("alias1");
|
||||
persistentTable2.setJoinType("type1");
|
||||
persistentTable2.setTableName("tableName");
|
||||
|
||||
final DBMapperTableEntry emfMapperTableEntry2 = DbmapFactory.eINSTANCE.createDBMapperTableEntry();
|
||||
emfMapperTableEntry2.setExpression("expression1");
|
||||
emfMapperTableEntry2.setName("entityName1");
|
||||
emfMapperTableEntry2.setJoin(true);
|
||||
emfMapperTableEntry2.setOperator("operator1");
|
||||
persistentTable2.getDBMapperTableEntries().add(emfMapperTableEntry2);
|
||||
|
||||
mapData2.getInputTables().add(persistentTable2);
|
||||
assertTrue(mapData1.equals(mapData2));
|
||||
}
|
||||
|
||||
private void test2(){
|
||||
DBMapDataImpl mapData1 = new DBMapDataImpl();
|
||||
DBMapDataImpl mapData2 = new DBMapDataImpl();
|
||||
assertTrue(mapData1.equals(mapData2));
|
||||
|
||||
final InputTable persistentTable = DbmapFactory.eINSTANCE.createInputTable();
|
||||
persistentTable.setMinimized(true);
|
||||
persistentTable.setName("table1");
|
||||
persistentTable.setAlias("alias1");
|
||||
persistentTable.setJoinType("type1");
|
||||
persistentTable.setTableName("tableName");
|
||||
|
||||
final DBMapperTableEntry emfMapperTableEntry = DbmapFactory.eINSTANCE.createDBMapperTableEntry();
|
||||
emfMapperTableEntry.setExpression("expression1");
|
||||
emfMapperTableEntry.setName("entityName1");
|
||||
emfMapperTableEntry.setJoin(true);
|
||||
emfMapperTableEntry.setOperator("operator1");
|
||||
persistentTable.getDBMapperTableEntries().add(emfMapperTableEntry);
|
||||
|
||||
mapData1.getInputTables().add(persistentTable);
|
||||
|
||||
final InputTable persistentTable2 = DbmapFactory.eINSTANCE.createInputTable();
|
||||
persistentTable2.setMinimized(true);
|
||||
persistentTable2.setName("table1");
|
||||
persistentTable2.setAlias("alias1");
|
||||
persistentTable2.setJoinType("type1");
|
||||
persistentTable2.setTableName("tableName");
|
||||
|
||||
final DBMapperTableEntry emfMapperTableEntry2 = DbmapFactory.eINSTANCE.createDBMapperTableEntry();
|
||||
emfMapperTableEntry2.setExpression("expression_");
|
||||
emfMapperTableEntry2.setName("entityName1");
|
||||
emfMapperTableEntry2.setJoin(true);
|
||||
emfMapperTableEntry2.setOperator("operator1");
|
||||
persistentTable2.getDBMapperTableEntries().add(emfMapperTableEntry2);
|
||||
|
||||
mapData2.getInputTables().add(persistentTable2);
|
||||
assertFalse(mapData1.equals(mapData2));
|
||||
}
|
||||
|
||||
private void test3(){
|
||||
DBMapDataImpl mapData1 = new DBMapDataImpl();
|
||||
DBMapDataImpl mapData2 = new DBMapDataImpl();
|
||||
assertTrue(mapData1.equals(mapData2));
|
||||
|
||||
final OutputTable persistentTable = DbmapFactory.eINSTANCE.createOutputTable();
|
||||
persistentTable.setMinimized(true);
|
||||
persistentTable.setName("table1");
|
||||
persistentTable.setTableName("tableName");
|
||||
|
||||
final DBMapperTableEntry emfMapperTableEntry = DbmapFactory.eINSTANCE.createDBMapperTableEntry();
|
||||
emfMapperTableEntry.setExpression("expression1");
|
||||
emfMapperTableEntry.setName("entityName1");
|
||||
emfMapperTableEntry.setJoin(true);
|
||||
emfMapperTableEntry.setOperator("operator1");
|
||||
persistentTable.getDBMapperTableEntries().add(emfMapperTableEntry);
|
||||
|
||||
mapData1.getOutputTables().add(persistentTable);
|
||||
|
||||
final OutputTable persistentTable2 = DbmapFactory.eINSTANCE.createOutputTable();
|
||||
persistentTable2.setMinimized(true);
|
||||
persistentTable2.setName("table1");
|
||||
persistentTable2.setTableName("tableName");
|
||||
|
||||
final DBMapperTableEntry emfMapperTableEntry2 = DbmapFactory.eINSTANCE.createDBMapperTableEntry();
|
||||
emfMapperTableEntry2.setExpression("expression1");
|
||||
emfMapperTableEntry2.setName("entityName1");
|
||||
emfMapperTableEntry2.setJoin(true);
|
||||
emfMapperTableEntry2.setOperator("operator1");
|
||||
persistentTable2.getDBMapperTableEntries().add(emfMapperTableEntry2);
|
||||
|
||||
mapData2.getOutputTables().add(persistentTable2);
|
||||
assertTrue(mapData1.equals(mapData2));
|
||||
}
|
||||
|
||||
private void test4(){
|
||||
DBMapDataImpl mapData1 = new DBMapDataImpl();
|
||||
DBMapDataImpl mapData2 = new DBMapDataImpl();
|
||||
assertTrue(mapData1.equals(mapData2));
|
||||
|
||||
final OutputTable persistentTable = DbmapFactory.eINSTANCE.createOutputTable();
|
||||
persistentTable.setMinimized(true);
|
||||
persistentTable.setName("table1");
|
||||
persistentTable.setTableName("tableName");
|
||||
|
||||
final DBMapperTableEntry emfMapperTableEntry = DbmapFactory.eINSTANCE.createDBMapperTableEntry();
|
||||
emfMapperTableEntry.setExpression("expression1");
|
||||
emfMapperTableEntry.setName("entityName1");
|
||||
emfMapperTableEntry.setJoin(true);
|
||||
emfMapperTableEntry.setOperator("operator1");
|
||||
persistentTable.getDBMapperTableEntries().add(emfMapperTableEntry);
|
||||
|
||||
mapData1.getOutputTables().add(persistentTable);
|
||||
|
||||
final InputTable persistentTable2 = DbmapFactory.eINSTANCE.createInputTable();
|
||||
persistentTable2.setMinimized(true);
|
||||
persistentTable2.setName("table1");
|
||||
persistentTable2.setTableName("tableName");
|
||||
|
||||
final DBMapperTableEntry emfMapperTableEntry2 = DbmapFactory.eINSTANCE.createDBMapperTableEntry();
|
||||
emfMapperTableEntry2.setExpression("expression1");
|
||||
emfMapperTableEntry2.setName("entityName");
|
||||
emfMapperTableEntry2.setJoin(true);
|
||||
emfMapperTableEntry2.setOperator("operator1");
|
||||
persistentTable2.getDBMapperTableEntries().add(emfMapperTableEntry2);
|
||||
|
||||
mapData2.getOutputTables().add(persistentTable);
|
||||
assertFalse(mapData1.equals(mapData2));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,373 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2016 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend.designer.mapper.model.emf.mapper.impl;
|
||||
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.talend.designer.mapper.model.emf.mapper.InputTable;
|
||||
import org.talend.designer.mapper.model.emf.mapper.MapperFactory;
|
||||
import org.talend.designer.mapper.model.emf.mapper.MapperTableEntry;
|
||||
import org.talend.designer.mapper.model.emf.mapper.OutputTable;
|
||||
import org.talend.designer.mapper.model.emf.mapper.SizeState;
|
||||
import org.talend.designer.mapper.model.emf.mapper.VarTable;
|
||||
|
||||
/**
|
||||
* DOC hwang class global comment. Detailled comment
|
||||
*/
|
||||
public class MapperDataImplTest {
|
||||
|
||||
@Test
|
||||
public void testEquals() {
|
||||
test1();
|
||||
test2();
|
||||
test3();
|
||||
test4();
|
||||
test5();
|
||||
test6();
|
||||
}
|
||||
|
||||
private void test1(){
|
||||
MapperDataImpl mapData1 = new MapperDataImpl();
|
||||
MapperDataImpl mapData2 = new MapperDataImpl();
|
||||
assertTrue(mapData1.equals(mapData2));
|
||||
|
||||
final InputTable persistentTable = MapperFactory.eINSTANCE.createInputTable();
|
||||
persistentTable.setActivateCondensedTool(true);
|
||||
persistentTable.setActivateExpressionFilter(true);
|
||||
persistentTable.setActivateColumnNameFilter(true);
|
||||
persistentTable.setExpressionFilter("expressionFilter1");
|
||||
persistentTable.setMinimized(false);
|
||||
persistentTable.setName("tableName");
|
||||
persistentTable.setSizeState(SizeState.MAXIMIZED);
|
||||
persistentTable.setLookupMode("LookupMode");
|
||||
persistentTable.setMatchingMode("MatchingMode");
|
||||
persistentTable.setInnerJoin(true);
|
||||
persistentTable.setPersistent(false);
|
||||
persistentTable.setId("id1");
|
||||
|
||||
final MapperTableEntry emfMapperTableEntry = MapperFactory.eINSTANCE.createMapperTableEntry();
|
||||
emfMapperTableEntry.setExpression("expression1");
|
||||
emfMapperTableEntry.setName("entityName");
|
||||
emfMapperTableEntry.setNullable(false);
|
||||
emfMapperTableEntry.setType("type1");
|
||||
emfMapperTableEntry.setOperator("operator1");
|
||||
persistentTable.getMapperTableEntries().add(emfMapperTableEntry);
|
||||
|
||||
final MapperTableEntry mapperTableEntry = MapperFactory.eINSTANCE.createMapperTableEntry();
|
||||
mapperTableEntry.setExpression("expression1");
|
||||
mapperTableEntry.setName("entityName");
|
||||
mapperTableEntry.setNullable(true);
|
||||
mapperTableEntry.setType("type1");
|
||||
mapperTableEntry.setOperator("operator1");
|
||||
persistentTable.getGlobalMapKeysValues().add(emfMapperTableEntry);
|
||||
|
||||
mapData1.getInputTables().add(persistentTable);
|
||||
|
||||
final InputTable persistentTable2 = MapperFactory.eINSTANCE.createInputTable();
|
||||
persistentTable2.setActivateCondensedTool(true);
|
||||
persistentTable2.setActivateExpressionFilter(true);
|
||||
persistentTable2.setActivateColumnNameFilter(true);
|
||||
persistentTable2.setExpressionFilter("expressionFilter1");
|
||||
persistentTable2.setMinimized(false);
|
||||
persistentTable2.setName("tableName");
|
||||
persistentTable2.setSizeState(SizeState.MAXIMIZED);
|
||||
persistentTable2.setLookupMode("LookupMode");
|
||||
persistentTable2.setMatchingMode("MatchingMode");
|
||||
persistentTable2.setInnerJoin(true);
|
||||
persistentTable2.setPersistent(false);
|
||||
persistentTable2.setId("id1");
|
||||
|
||||
final MapperTableEntry emfMapperTableEntry2 = MapperFactory.eINSTANCE.createMapperTableEntry();
|
||||
emfMapperTableEntry2.setExpression("expression1");
|
||||
emfMapperTableEntry2.setName("entityName");
|
||||
emfMapperTableEntry2.setNullable(false);
|
||||
emfMapperTableEntry2.setType("type1");
|
||||
emfMapperTableEntry2.setOperator("operator1");
|
||||
persistentTable2.getMapperTableEntries().add(emfMapperTableEntry2);
|
||||
|
||||
final MapperTableEntry mapperTableEntry2 = MapperFactory.eINSTANCE.createMapperTableEntry();
|
||||
mapperTableEntry2.setExpression("expression1");
|
||||
mapperTableEntry2.setName("entityName");
|
||||
mapperTableEntry2.setNullable(true);
|
||||
mapperTableEntry2.setType("type1");
|
||||
mapperTableEntry2.setOperator("operator1");
|
||||
persistentTable2.getGlobalMapKeysValues().add(emfMapperTableEntry2);
|
||||
|
||||
mapData2.getInputTables().add(persistentTable2);
|
||||
|
||||
assertTrue(mapData1.equals(mapData2));
|
||||
|
||||
}
|
||||
|
||||
private void test2(){
|
||||
MapperDataImpl mapData1 = new MapperDataImpl();
|
||||
MapperDataImpl mapData2 = new MapperDataImpl();
|
||||
assertTrue(mapData1.equals(mapData2));
|
||||
|
||||
final InputTable persistentTable = MapperFactory.eINSTANCE.createInputTable();
|
||||
persistentTable.setActivateCondensedTool(true);
|
||||
persistentTable.setActivateExpressionFilter(true);
|
||||
persistentTable.setActivateColumnNameFilter(true);
|
||||
persistentTable.setExpressionFilter("expressionFilter1");
|
||||
persistentTable.setMinimized(false);
|
||||
persistentTable.setName("tableName");
|
||||
persistentTable.setSizeState(SizeState.MAXIMIZED);
|
||||
persistentTable.setLookupMode("LookupMode");
|
||||
persistentTable.setMatchingMode("MatchingMode");
|
||||
persistentTable.setInnerJoin(true);
|
||||
persistentTable.setPersistent(false);
|
||||
persistentTable.setId("id1");
|
||||
|
||||
final MapperTableEntry emfMapperTableEntry = MapperFactory.eINSTANCE.createMapperTableEntry();
|
||||
emfMapperTableEntry.setExpression("expression1");
|
||||
emfMapperTableEntry.setName("entityName");
|
||||
emfMapperTableEntry.setNullable(false);
|
||||
emfMapperTableEntry.setType("type1");
|
||||
emfMapperTableEntry.setOperator("operator1");
|
||||
persistentTable.getMapperTableEntries().add(emfMapperTableEntry);
|
||||
|
||||
final MapperTableEntry mapperTableEntry = MapperFactory.eINSTANCE.createMapperTableEntry();
|
||||
mapperTableEntry.setExpression("expression1");
|
||||
mapperTableEntry.setName("entityName");
|
||||
mapperTableEntry.setNullable(true);
|
||||
mapperTableEntry.setType("type1");
|
||||
mapperTableEntry.setOperator("operator1");
|
||||
persistentTable.getGlobalMapKeysValues().add(emfMapperTableEntry);
|
||||
|
||||
mapData1.getInputTables().add(persistentTable);
|
||||
|
||||
final InputTable persistentTable2 = MapperFactory.eINSTANCE.createInputTable();
|
||||
persistentTable2.setActivateCondensedTool(true);
|
||||
persistentTable2.setActivateExpressionFilter(true);
|
||||
persistentTable2.setActivateColumnNameFilter(true);
|
||||
persistentTable2.setExpressionFilter("exprefssionFilter1");
|
||||
persistentTable2.setMinimized(false);
|
||||
persistentTable2.setName("tableName");
|
||||
persistentTable2.setSizeState(SizeState.MAXIMIZED);
|
||||
persistentTable2.setLookupMode("LookupMode");
|
||||
persistentTable2.setMatchingMode("MatchiggngMode");
|
||||
persistentTable2.setInnerJoin(true);
|
||||
persistentTable2.setPersistent(false);
|
||||
persistentTable2.setId("id1");
|
||||
|
||||
final MapperTableEntry emfMapperTableEntry2 = MapperFactory.eINSTANCE.createMapperTableEntry();
|
||||
emfMapperTableEntry2.setExpression("expression1");
|
||||
emfMapperTableEntry2.setName("entityName");
|
||||
emfMapperTableEntry2.setNullable(false);
|
||||
emfMapperTableEntry2.setType("type1");
|
||||
emfMapperTableEntry2.setOperator("operat");
|
||||
persistentTable.getMapperTableEntries().add(emfMapperTableEntry2);
|
||||
|
||||
final MapperTableEntry mapperTableEntry2 = MapperFactory.eINSTANCE.createMapperTableEntry();
|
||||
mapperTableEntry2.setExpression("expression1");
|
||||
mapperTableEntry2.setName("entityName");
|
||||
mapperTableEntry2.setNullable(true);
|
||||
mapperTableEntry2.setType("typge1");
|
||||
mapperTableEntry2.setOperator("opgerator1");
|
||||
persistentTable.getGlobalMapKeysValues().add(emfMapperTableEntry2);
|
||||
|
||||
mapData2.getInputTables().add(persistentTable2);
|
||||
|
||||
assertFalse(mapData1.equals(mapData2));
|
||||
|
||||
}
|
||||
|
||||
private void test3(){
|
||||
MapperDataImpl mapData1 = new MapperDataImpl();
|
||||
MapperDataImpl mapData2 = new MapperDataImpl();
|
||||
assertTrue(mapData1.equals(mapData2));
|
||||
|
||||
final OutputTable persistentTable = MapperFactory.eINSTANCE.createOutputTable();
|
||||
persistentTable.setActivateCondensedTool(true);
|
||||
persistentTable.setActivateExpressionFilter(true);
|
||||
persistentTable.setActivateColumnNameFilter(true);
|
||||
persistentTable.setExpressionFilter("expressionFilter1");
|
||||
persistentTable.setMinimized(false);
|
||||
persistentTable.setName("tableName");
|
||||
persistentTable.setSizeState(SizeState.MAXIMIZED);
|
||||
persistentTable.setId("id1");
|
||||
persistentTable.setReject(true);
|
||||
persistentTable.setRejectInnerJoin(false);
|
||||
persistentTable.setIsErrorRejectTable(false);
|
||||
persistentTable.setIsJoinTableOf("join");
|
||||
|
||||
final MapperTableEntry emfMapperTableEntry = MapperFactory.eINSTANCE.createMapperTableEntry();
|
||||
emfMapperTableEntry.setExpression("expression1");
|
||||
emfMapperTableEntry.setName("entityName");
|
||||
emfMapperTableEntry.setNullable(false);
|
||||
emfMapperTableEntry.setType("type1");
|
||||
emfMapperTableEntry.setOperator("operator1");
|
||||
persistentTable.getMapperTableEntries().add(emfMapperTableEntry);
|
||||
|
||||
mapData1.getOutputTables().add(persistentTable);
|
||||
|
||||
final OutputTable persistentTable2 = MapperFactory.eINSTANCE.createOutputTable();
|
||||
persistentTable2.setActivateCondensedTool(true);
|
||||
persistentTable2.setActivateExpressionFilter(true);
|
||||
persistentTable2.setActivateColumnNameFilter(true);
|
||||
persistentTable2.setExpressionFilter("expressionFilter1");
|
||||
persistentTable2.setMinimized(false);
|
||||
persistentTable2.setName("tableName");
|
||||
persistentTable2.setSizeState(SizeState.MAXIMIZED);
|
||||
persistentTable2.setId("id1");
|
||||
persistentTable2.setReject(true);
|
||||
persistentTable2.setRejectInnerJoin(false);
|
||||
persistentTable2.setIsErrorRejectTable(false);
|
||||
persistentTable2.setIsJoinTableOf("join");
|
||||
|
||||
final MapperTableEntry emfMapperTableEntry2 = MapperFactory.eINSTANCE.createMapperTableEntry();
|
||||
emfMapperTableEntry2.setExpression("expression1");
|
||||
emfMapperTableEntry2.setName("entityName");
|
||||
emfMapperTableEntry2.setNullable(false);
|
||||
emfMapperTableEntry2.setType("type1");
|
||||
emfMapperTableEntry2.setOperator("operator1");
|
||||
persistentTable2.getMapperTableEntries().add(emfMapperTableEntry2);
|
||||
|
||||
mapData2.getOutputTables().add(persistentTable2);
|
||||
|
||||
assertTrue(mapData1.equals(mapData2));
|
||||
|
||||
}
|
||||
|
||||
private void test4(){
|
||||
MapperDataImpl mapData1 = new MapperDataImpl();
|
||||
MapperDataImpl mapData2 = new MapperDataImpl();
|
||||
assertTrue(mapData1.equals(mapData2));
|
||||
|
||||
final OutputTable persistentTable = MapperFactory.eINSTANCE.createOutputTable();
|
||||
persistentTable.setActivateCondensedTool(true);
|
||||
persistentTable.setActivateExpressionFilter(true);
|
||||
persistentTable.setActivateColumnNameFilter(true);
|
||||
persistentTable.setExpressionFilter("expressionFilter1");
|
||||
persistentTable.setMinimized(false);
|
||||
persistentTable.setName("tableName");
|
||||
persistentTable.setSizeState(SizeState.MAXIMIZED);
|
||||
persistentTable.setId("id1");
|
||||
persistentTable.setReject(true);
|
||||
persistentTable.setRejectInnerJoin(false);
|
||||
persistentTable.setIsErrorRejectTable(false);
|
||||
persistentTable.setIsJoinTableOf("join");
|
||||
|
||||
final MapperTableEntry emfMapperTableEntry = MapperFactory.eINSTANCE.createMapperTableEntry();
|
||||
emfMapperTableEntry.setExpression("expression1");
|
||||
emfMapperTableEntry.setName("entityName");
|
||||
emfMapperTableEntry.setNullable(false);
|
||||
emfMapperTableEntry.setType("type1");
|
||||
emfMapperTableEntry.setOperator("operator1");
|
||||
persistentTable.getMapperTableEntries().add(emfMapperTableEntry);
|
||||
|
||||
mapData1.getOutputTables().add(persistentTable);
|
||||
|
||||
final OutputTable persistentTable2 = MapperFactory.eINSTANCE.createOutputTable();
|
||||
persistentTable2.setActivateCondensedTool(true);
|
||||
persistentTable2.setActivateExpressionFilter(true);
|
||||
persistentTable2.setActivateColumnNameFilter(true);
|
||||
persistentTable2.setExpressionFilter("expressionhhFilter1");
|
||||
persistentTable2.setMinimized(false);
|
||||
persistentTable2.setName("tablebbName");
|
||||
persistentTable2.setSizeState(SizeState.MAXIMIZED);
|
||||
persistentTable2.setId("id2");
|
||||
persistentTable2.setReject(true);
|
||||
persistentTable2.setRejectInnerJoin(false);
|
||||
persistentTable2.setIsErrorRejectTable(false);
|
||||
persistentTable2.setIsJoinTableOf("jonnin");
|
||||
|
||||
final MapperTableEntry emfMapperTableEntry2 = MapperFactory.eINSTANCE.createMapperTableEntry();
|
||||
emfMapperTableEntry2.setExpression("expggression1");
|
||||
emfMapperTableEntry2.setName("entityName");
|
||||
emfMapperTableEntry2.setNullable(false);
|
||||
emfMapperTableEntry2.setType("tyggpe1");
|
||||
emfMapperTableEntry2.setOperator("opeggrator1");
|
||||
persistentTable2.getMapperTableEntries().add(emfMapperTableEntry2);
|
||||
|
||||
mapData2.getOutputTables().add(persistentTable2);
|
||||
|
||||
assertFalse(mapData1.equals(mapData2));
|
||||
}
|
||||
|
||||
private void test5(){
|
||||
MapperDataImpl mapData1 = new MapperDataImpl();
|
||||
MapperDataImpl mapData2 = new MapperDataImpl();
|
||||
assertTrue(mapData1.equals(mapData2));
|
||||
|
||||
final VarTable persistentVarTable = MapperFactory.eINSTANCE.createVarTable();
|
||||
persistentVarTable.setMinimized(false);
|
||||
persistentVarTable.setName("name1");
|
||||
persistentVarTable.setSizeState(SizeState.INTERMEDIATE);
|
||||
|
||||
final MapperTableEntry emfMapperTableEntry = MapperFactory.eINSTANCE.createMapperTableEntry();
|
||||
emfMapperTableEntry.setExpression("expression1");
|
||||
emfMapperTableEntry.setName("ss");
|
||||
emfMapperTableEntry.setNullable(true);
|
||||
emfMapperTableEntry.setType("dd");
|
||||
emfMapperTableEntry.setOperator("oo");
|
||||
persistentVarTable.getMapperTableEntries().add(emfMapperTableEntry);
|
||||
|
||||
mapData1.getVarTables().add(persistentVarTable);
|
||||
|
||||
final VarTable persistentVarTable2 = MapperFactory.eINSTANCE.createVarTable();
|
||||
persistentVarTable2.setMinimized(false);
|
||||
persistentVarTable2.setName("name1");
|
||||
persistentVarTable2.setSizeState(SizeState.INTERMEDIATE);
|
||||
|
||||
final MapperTableEntry emfMapperTableEntry2 = MapperFactory.eINSTANCE.createMapperTableEntry();
|
||||
emfMapperTableEntry2.setExpression("expression1");
|
||||
emfMapperTableEntry2.setName("ss");
|
||||
emfMapperTableEntry2.setNullable(true);
|
||||
emfMapperTableEntry2.setType("dd");
|
||||
emfMapperTableEntry2.setOperator("oo");
|
||||
persistentVarTable2.getMapperTableEntries().add(emfMapperTableEntry2);
|
||||
|
||||
mapData2.getVarTables().add(persistentVarTable2);
|
||||
assertTrue(mapData1.equals(mapData2));
|
||||
}
|
||||
|
||||
private void test6(){
|
||||
MapperDataImpl mapData1 = new MapperDataImpl();
|
||||
MapperDataImpl mapData2 = new MapperDataImpl();
|
||||
assertTrue(mapData1.equals(mapData2));
|
||||
|
||||
final VarTable persistentVarTable = MapperFactory.eINSTANCE.createVarTable();
|
||||
persistentVarTable.setMinimized(false);
|
||||
persistentVarTable.setName("name1");
|
||||
persistentVarTable.setSizeState(SizeState.INTERMEDIATE);
|
||||
|
||||
final MapperTableEntry emfMapperTableEntry = MapperFactory.eINSTANCE.createMapperTableEntry();
|
||||
emfMapperTableEntry.setExpression("expression1");
|
||||
emfMapperTableEntry.setName("ss");
|
||||
emfMapperTableEntry.setNullable(true);
|
||||
emfMapperTableEntry.setType("dvvd");
|
||||
emfMapperTableEntry.setOperator("ovvo");
|
||||
persistentVarTable.getMapperTableEntries().add(emfMapperTableEntry);
|
||||
|
||||
mapData1.getVarTables().add(persistentVarTable);
|
||||
|
||||
final VarTable persistentVarTable2 = MapperFactory.eINSTANCE.createVarTable();
|
||||
persistentVarTable2.setMinimized(false);
|
||||
persistentVarTable2.setName("name1");
|
||||
persistentVarTable2.setSizeState(SizeState.INTERMEDIATE);
|
||||
|
||||
final MapperTableEntry emfMapperTableEntry2 = MapperFactory.eINSTANCE.createMapperTableEntry();
|
||||
emfMapperTableEntry2.setExpression("expreshsion1");
|
||||
emfMapperTableEntry2.setName("ss");
|
||||
emfMapperTableEntry2.setNullable(true);
|
||||
emfMapperTableEntry2.setType("dvd");
|
||||
emfMapperTableEntry2.setOperator("oov");
|
||||
persistentVarTable2.getMapperTableEntries().add(emfMapperTableEntry2);
|
||||
|
||||
mapData2.getVarTables().add(persistentVarTable2);
|
||||
assertFalse(mapData1.equals(mapData2));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2014 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend.designer.mapper.utils;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.talend.core.model.components.ComponentCategory;
|
||||
import org.talend.core.model.components.IComponent;
|
||||
import org.talend.core.model.properties.PropertiesFactory;
|
||||
import org.talend.core.model.properties.Property;
|
||||
import org.talend.core.ui.component.ComponentsFactoryProvider;
|
||||
import org.talend.designer.core.ui.editor.nodes.Node;
|
||||
import org.talend.designer.core.ui.editor.process.Process;
|
||||
|
||||
/**
|
||||
* created by nrousseau on Mar 21, 2017 Detailled comment
|
||||
*
|
||||
*/
|
||||
public class MapperHelperTest {
|
||||
|
||||
@Test
|
||||
public void test() {
|
||||
Property property1 = PropertiesFactory.eINSTANCE.createProperty();
|
||||
property1.setId("property1"); //$NON-NLS-1$
|
||||
property1.setVersion("0.1"); //$NON-NLS-1$
|
||||
property1.setLabel("test1");//$NON-NLS-1$
|
||||
Process process = new Process(property1);
|
||||
|
||||
IComponent sparkComponent = ComponentsFactoryProvider.getInstance().get("tMap",
|
||||
ComponentCategory.CATEGORY_4_SPARK.getName());
|
||||
Node sparkTMap = new Node(sparkComponent, process);
|
||||
assertFalse("Spark tMap should not be a virtual component", MapperHelper.isGeneratedAsVirtualComponent(sparkTMap));
|
||||
|
||||
|
||||
IComponent sparkStreamingComponent = ComponentsFactoryProvider.getInstance().get("tMap",
|
||||
ComponentCategory.CATEGORY_4_SPARKSTREAMING.getName());
|
||||
Node sparkStreamingTMap = new Node(sparkStreamingComponent, process);
|
||||
assertFalse("Spark Streaming tMap should not be a virtual component", MapperHelper.isGeneratedAsVirtualComponent(sparkStreamingTMap));
|
||||
|
||||
IComponent mapReduceComponent = ComponentsFactoryProvider.getInstance().get("tMap",
|
||||
ComponentCategory.CATEGORY_4_MAPREDUCE.getName());
|
||||
Node mapReduceTMap = new Node(mapReduceComponent, process);
|
||||
assertFalse("Spark Streaming tMap should not be a virtual component", MapperHelper.isGeneratedAsVirtualComponent(mapReduceTMap));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,157 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2016 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend.designer.xmlmap.model.emf.xmlmap.impl;
|
||||
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.talend.designer.xmlmap.model.emf.xmlmap.Connection;
|
||||
import org.talend.designer.xmlmap.model.emf.xmlmap.FilterConnection;
|
||||
import org.talend.designer.xmlmap.model.emf.xmlmap.InputXmlTree;
|
||||
import org.talend.designer.xmlmap.model.emf.xmlmap.OutputTreeNode;
|
||||
import org.talend.designer.xmlmap.model.emf.xmlmap.OutputXmlTree;
|
||||
import org.talend.designer.xmlmap.model.emf.xmlmap.TreeNode;
|
||||
import org.talend.designer.xmlmap.model.emf.xmlmap.VarNode;
|
||||
import org.talend.designer.xmlmap.model.emf.xmlmap.VarTable;
|
||||
import org.talend.designer.xmlmap.model.emf.xmlmap.XmlMapData;
|
||||
import org.talend.designer.xmlmap.model.emf.xmlmap.XmlmapFactory;
|
||||
|
||||
/**
|
||||
* DOC hwang class global comment. Detailled comment
|
||||
*/
|
||||
public class XmlMapDataImplTest {
|
||||
|
||||
@Test
|
||||
public void testEquals() {
|
||||
XmlMapData data1 = XmlmapFactory.eINSTANCE.createXmlMapData();
|
||||
XmlMapData data2 = XmlmapFactory.eINSTANCE.createXmlMapData();
|
||||
assertTrue(data1.equals(data2));
|
||||
test1();
|
||||
test2();
|
||||
test3();
|
||||
test4();
|
||||
}
|
||||
|
||||
private void test1(){
|
||||
XmlMapData data1 = createSparkData("diff","diff", "diff");
|
||||
XmlMapData data2 = createSparkData("diff","diff", "diff");
|
||||
assertTrue(data1.equals(data2));
|
||||
}
|
||||
|
||||
private void test2(){
|
||||
XmlMapData data1 = createSparkData("diff","diff", "diff");
|
||||
XmlMapData data2 = createSparkData("diff1","diff", "diff");
|
||||
assertFalse(data1.equals(data2));
|
||||
}
|
||||
|
||||
private void test3(){
|
||||
XmlMapData data1 = createSparkData("diff","diff", "diff");
|
||||
XmlMapData data2 = createSparkData("diff","diff1", "diff");
|
||||
assertFalse(data1.equals(data2));
|
||||
}
|
||||
|
||||
private void test4(){
|
||||
XmlMapData data1 = createSparkData("diff","diff", "diff");
|
||||
XmlMapData data2 = createSparkData("diff","diff", "diff1");
|
||||
assertFalse(data1.equals(data2));
|
||||
}
|
||||
|
||||
private XmlMapData createSparkData(String inputDiff,String outputDiff, String varDiff){
|
||||
XmlMapData data = XmlmapFactory.eINSTANCE.createXmlMapData();
|
||||
//
|
||||
InputXmlTree inputTree = XmlmapFactory.eINSTANCE.createInputXmlTree();
|
||||
inputTree.setName("input_1");
|
||||
inputTree.setLookup(true);
|
||||
inputTree.setInnerJoin(false);
|
||||
inputTree.setLookupMode("LOAD_ONCE");
|
||||
inputTree.setMatchingMode("ALL_ROWS");
|
||||
inputTree.setMinimized(false);
|
||||
inputTree.setMultiLoops(false);
|
||||
inputTree.setPersistent(false);
|
||||
data.getInputTrees().add(inputTree);
|
||||
|
||||
TreeNode treeNode = XmlmapFactory.eINSTANCE.createTreeNode();
|
||||
treeNode.setName("inputTreeNode");
|
||||
treeNode.setXpath("row1/newColumn");
|
||||
treeNode.setExpression(inputDiff);
|
||||
treeNode.setType("id_String");
|
||||
treeNode.setLoop(false);
|
||||
treeNode.setPattern(inputDiff);
|
||||
treeNode.setKey(false);
|
||||
treeNode.setGroup(false);
|
||||
treeNode.setMain(false);
|
||||
treeNode.setDefaultValue("value");
|
||||
treeNode.setNullable(false);
|
||||
treeNode.setChoice(false);
|
||||
treeNode.setSubstitution(false);
|
||||
treeNode.setOptional(false);
|
||||
treeNode.setNodeType(org.talend.designer.xmlmap.model.emf.xmlmap.NodeType.ATTRIBUT);
|
||||
inputTree.getNodes().add(treeNode);
|
||||
|
||||
OutputXmlTree outputTree = XmlmapFactory.eINSTANCE.createOutputXmlTree();
|
||||
outputTree.setName("output_1");
|
||||
outputTree.setReject(false);
|
||||
outputTree.setRejectInnerJoin(false);
|
||||
outputTree.setErrorReject(false);
|
||||
outputTree.setAllInOne(false);
|
||||
outputTree.setEnableEmptyElement(false);
|
||||
data.getOutputTrees().add(outputTree);
|
||||
|
||||
OutputTreeNode treeNode2 = XmlmapFactory.eINSTANCE.createOutputTreeNode();
|
||||
treeNode2.setName("outputTreeNode");
|
||||
treeNode2.setXpath("out/newColumn");
|
||||
treeNode2.setType("id_String");
|
||||
treeNode2.setAggregate(false);
|
||||
treeNode2.setLoop(false);
|
||||
treeNode2.setPattern(outputDiff);
|
||||
treeNode2.setExpression(outputDiff);
|
||||
treeNode2.setKey(false);
|
||||
treeNode2.setGroup(false);
|
||||
treeNode2.setMain(false);
|
||||
treeNode2.setDefaultValue("value");
|
||||
treeNode2.setNullable(false);
|
||||
treeNode2.setChoice(false);
|
||||
treeNode2.setSubstitution(false);
|
||||
treeNode2.setOptional(false);
|
||||
treeNode2.setNodeType(org.talend.designer.xmlmap.model.emf.xmlmap.NodeType.ATTRIBUT);
|
||||
outputTree.getNodes().add(treeNode2);
|
||||
|
||||
VarTable vatTable = XmlmapFactory.eINSTANCE.createVarTable();
|
||||
vatTable.setName("varTable");
|
||||
vatTable.setMinimized(true);
|
||||
|
||||
VarNode varNode = XmlmapFactory.eINSTANCE.createVarNode();
|
||||
varNode.setName("varNode");
|
||||
varNode.setNullable(false);
|
||||
varNode.setType("id_String");
|
||||
varNode.setExpression(varDiff);
|
||||
vatTable.getNodes().add(varNode);
|
||||
data.getVarTables().add(vatTable);
|
||||
|
||||
Connection connection = XmlmapFactory.eINSTANCE.createConnection();
|
||||
connection.setSource(treeNode);
|
||||
connection.setTarget(treeNode2);
|
||||
data.getConnections().add(connection);
|
||||
treeNode.getOutgoingConnections().add(connection);
|
||||
treeNode2.getIncomingConnections().add(connection);
|
||||
|
||||
FilterConnection fc = XmlmapFactory.eINSTANCE.createFilterConnection();
|
||||
fc.setSource(treeNode);
|
||||
fc.setTarget(outputTree);
|
||||
data.getConnections().add(fc);
|
||||
treeNode.getFilterOutGoingConnections().add(fc);
|
||||
outputTree.getFilterIncomingConnections().add(fc);
|
||||
return data;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user