Compare commits
20 Commits
pyzhou/TDI
...
patch/5.4.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8dfe58aab7 | ||
|
|
a6bd49a36d | ||
|
|
8de5f36ad1 | ||
|
|
ba91ce0970 | ||
|
|
2cbba78fc4 | ||
|
|
7588e0eb6f | ||
|
|
be4544d403 | ||
|
|
39cd9e073e | ||
|
|
227eba73c1 | ||
|
|
7d73437198 | ||
|
|
1d38839f7d | ||
|
|
ab1cf73d97 | ||
|
|
4765c0b7a4 | ||
|
|
d9e0eba817 | ||
|
|
6d9b77be9b | ||
|
|
3c4852a3bc | ||
|
|
4009192f85 | ||
|
|
991649b01f | ||
|
|
40328be34c | ||
|
|
5eed1e6ccb |
@@ -77,7 +77,12 @@ public class JavaRoutineSynchronizer extends AbstractRoutineSynchronizer {
|
||||
*/
|
||||
@Override
|
||||
public void syncAllRoutines() throws SystemException {
|
||||
syncRoutineItems(getRoutines());
|
||||
syncRoutineItems(getRoutines(),false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void syncAllRoutinesForLogOn() throws SystemException {
|
||||
syncRoutineItems(getRoutines(),true);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -87,13 +92,18 @@ public class JavaRoutineSynchronizer extends AbstractRoutineSynchronizer {
|
||||
*/
|
||||
@Override
|
||||
public void syncAllPigudf() throws SystemException {
|
||||
syncRoutineItems(getAllPigudf());
|
||||
syncRoutineItems(getAllPigudf(),false);
|
||||
}
|
||||
|
||||
private void syncRoutineItems(List<IRepositoryViewObject> routineObjects) throws SystemException {
|
||||
@Override
|
||||
public void syncAllPigudfForLogOn() throws SystemException {
|
||||
syncRoutineItems(getAllPigudf(), true);
|
||||
}
|
||||
|
||||
private void syncRoutineItems(List<IRepositoryViewObject> routineObjects, boolean forceUpdate) throws SystemException {
|
||||
for (IRepositoryViewObject routine : routineObjects) {
|
||||
RoutineItem routineItem = (RoutineItem) routine.getProperty().getItem();
|
||||
syncRoutine(routineItem, true);
|
||||
syncRoutine(routineItem, true,forceUpdate);
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
@@ -2,9 +2,11 @@
|
||||
<project name="org.talend.designer.components.libs" default="process" basedir=".">
|
||||
|
||||
<property name="component.plugin.home" value="../../../org.talend.designer.components.localprovider/components" />
|
||||
<property name="axis2.dir" value="../../../org.talend.libraries.apache.axis2/lib" />
|
||||
<property name="targetplugin.dir" value="/home/bchen/Develope/yoxos/targets/target-530/plugins" />
|
||||
<property name="http.dir" value="../../../org.talend.libraries.apache.http/lib" />
|
||||
<property name="axis2.dir" value="../../../../tcommon-studio-se/org.talend.libraries.apache.axis2/lib" />
|
||||
<property name="http.dir" value="../../../../tcommon-studio-se/org.talend.libraries.apache.http/lib" />
|
||||
<property name="json.dir" value="../../../../tcommon-studio-se/org.talend.libraries.jackson/lib" />
|
||||
<property name="cxf.dir" value="../../../../tcommon-studio-se/org.talend.libraries.apache.cxf/lib" />
|
||||
<property name="salesforce.dir" value="../../../org.talend.libraries.salesforce/lib" />
|
||||
|
||||
<!-- #################################################### -->
|
||||
|
||||
@@ -12,7 +14,7 @@
|
||||
<property name="jar.name" value="salesforceCRMManagement.jar" />
|
||||
<property name="component.name" value="tSalesforceInput" />
|
||||
<property name="author.name" value="wyang" />
|
||||
<property name="lib.dir" value="../../../org.talend.libraries.salesforce/lib" />
|
||||
<property name="lib.dir" value="${salesforce.dir}" />
|
||||
|
||||
<!-- modification 2: compile classpath -->
|
||||
<path id="compile.classpath">
|
||||
@@ -21,18 +23,18 @@
|
||||
<pathelement location="${axis2.dir}/axis2-kernel-1.6.2.jar" />
|
||||
<pathelement location="${axis2.dir}/axis2-transport-http-1.6.2.jar" />
|
||||
<pathelement location="${axis2.dir}/axis2-transport-local-1.6.2.jar" />
|
||||
<pathelement location="${targetplugin.dir}/org.apache.commons.codec_1.3.0.v201101211617.jar" />
|
||||
<pathelement location="${http.dir}/commons-httpclient-3.1.jar" />
|
||||
<pathelement location="${targetplugin.dir}/org.apache.commons.logging_1.1.1.v201101211721.jar" />
|
||||
<pathelement location="${http.dir}/httpcore-4.0.jar" />
|
||||
<pathelement location="${axis2.dir}/mail-1.4.jar" />
|
||||
<pathelement location="${axis2.dir}/neethi-3.0.1.jar" />
|
||||
<pathelement location="${axis2.dir}/wsdl4j-1.6.2.jar" />
|
||||
<pathelement location="${axis2.dir}/wsdl4j-1.6.3.jar" />
|
||||
<pathelement location="${axis2.dir}/xmlschema-core-2.0.1.jar" />
|
||||
<pathelement location="${axis2.dir}/axis2-adb-1.6.2.jar" />
|
||||
<pathelement location="${axis2.dir}/geronimo-stax-api_1.0_spec-1.0.1.jar" />
|
||||
<pathelement location="${axis2.dir}/activation-1.1.jar" />
|
||||
<pathelement location="${axis2.dir}/wstx-asl-3.2.9.jar" />
|
||||
<pathelement location="${cxf.dir}/woodstox-core-asl-4.2.0.jar" />
|
||||
<pathelement location="${http.dir}/httpcore-4.0.jar" />
|
||||
<pathelement location="${http.dir}/commons-httpclient-3.1.jar" />
|
||||
<pathelement location="${json.dir}/json_simple-1.1.jar" />
|
||||
<pathelement location="${salesforce.dir}/salesforceOAuth.jar" />
|
||||
</path>
|
||||
|
||||
<!-- #################################################### -->
|
||||
|
||||
@@ -10306,7 +10306,23 @@ public class SforceServiceStub extends org.apache.axis2.client.Stub implements
|
||||
"urn:partner.soap.sforce.com:Soap:describeGlobalRequest");
|
||||
_operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(
|
||||
true);
|
||||
|
||||
{
|
||||
/*- ADD - START - BY cmeng - 20140901*/
|
||||
/**
|
||||
* https://jira.talendforge.org/browse/TDI-30366<br>
|
||||
* 1. Because this API seems not support this case: server use HTTP Protocol 1.0(not support CHUNKED) while client use HTTP Protocol 1.1<br>
|
||||
* , then client will throw exception(org.apache.axis2.AxisFault: Transport error: 411 Error: Length Required)<br>
|
||||
* 2. If the new API can support this case, then this additional codes can be cancelled.
|
||||
*
|
||||
* Some information I searched on the net:<br>
|
||||
* https://www.mail-archive.com/basedb-devel@lists.sourceforge.net/msg00309.html
|
||||
* http://axis.apache.org/axis2/java/core/docs/http-transport.html
|
||||
* http://en.wikipedia.org/wiki/Chunked_transfer_encoding
|
||||
*/
|
||||
_operationClient.getOptions().setProperty(
|
||||
org.apache.axis2.transport.http.HTTPConstants.CHUNKED, "false");
|
||||
/*- ADD - END - BY cmeng* - 20140901*/
|
||||
}
|
||||
addPropertyToOperationClient(
|
||||
_operationClient,
|
||||
org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,
|
||||
@@ -12816,7 +12832,23 @@ public class SforceServiceStub extends org.apache.axis2.client.Stub implements
|
||||
"urn:partner.soap.sforce.com:Soap:describeSObjectRequest");
|
||||
_operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(
|
||||
true);
|
||||
|
||||
{
|
||||
/*- ADD - START - BY cmeng - 20140901*/
|
||||
/**
|
||||
* https://jira.talendforge.org/browse/TDI-30366<br>
|
||||
* 1. Because this API seems not support this case: server use HTTP Protocol 1.0(not support CHUNKED) while client use HTTP Protocol 1.1<br>
|
||||
* , then client will throw exception(org.apache.axis2.AxisFault: Transport error: 411 Error: Length Required)<br>
|
||||
* 2. If the new API can support this case, then this additional codes can be cancelled.
|
||||
*
|
||||
* Some information I searched on the net:<br>
|
||||
* https://www.mail-archive.com/basedb-devel@lists.sourceforge.net/msg00309.html
|
||||
* http://axis.apache.org/axis2/java/core/docs/http-transport.html
|
||||
* http://en.wikipedia.org/wiki/Chunked_transfer_encoding
|
||||
*/
|
||||
_operationClient.getOptions().setProperty(
|
||||
org.apache.axis2.transport.http.HTTPConstants.CHUNKED, "false");
|
||||
/*- ADD - END - BY cmeng - 20140901*/
|
||||
}
|
||||
addPropertyToOperationClient(
|
||||
_operationClient,
|
||||
org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,
|
||||
|
||||
@@ -193,6 +193,23 @@ public class SforceManagementImpl implements SforceManagement {
|
||||
this.upsertKeyColumn = "";
|
||||
}
|
||||
|
||||
private boolean chunked = true;
|
||||
|
||||
/**
|
||||
* This is a special method in impl class for customer's patch
|
||||
*/
|
||||
public void setHttpChunked(boolean chunked){
|
||||
this.chunked = chunked;
|
||||
}
|
||||
|
||||
/**
|
||||
* This is a special method in impl class for customer's patch
|
||||
*/
|
||||
private void applyHttpChunked(Options options){
|
||||
options.setProperty(HTTPConstants.CHUNKED, chunked);
|
||||
}
|
||||
|
||||
|
||||
private boolean _login(String endpoint, String username, String password, int timeout, boolean needCompression)
|
||||
throws Exception {
|
||||
if (endpoint == null || endpoint.trim().length() == 0) {
|
||||
@@ -211,6 +228,7 @@ public class SforceManagementImpl implements SforceManagement {
|
||||
needCompression(options);
|
||||
}
|
||||
setTimeout(options, timeout);
|
||||
applyHttpChunked(options);
|
||||
setHttpProxy(options);
|
||||
|
||||
Login login = new Login();
|
||||
@@ -250,6 +268,7 @@ public class SforceManagementImpl implements SforceManagement {
|
||||
needCompression(options);
|
||||
}
|
||||
setTimeout(options, timeout);
|
||||
applyHttpChunked(options);
|
||||
setHttpProxy(options);
|
||||
|
||||
return true;
|
||||
|
||||
@@ -154,6 +154,13 @@ if(bulkConnection){
|
||||
globalMap.put("callOptions_<%=cid%>", sfMgr_<%=cid%>.getCallOptions());
|
||||
<%
|
||||
}
|
||||
|
||||
boolean useHttpChunked = "true".equals(ElementParameterParser.getValue(node,"__USE_HTTP_CHUNKED__"));
|
||||
%>
|
||||
|
||||
((org.talend.salesforce.SforceManagementImpl)sfMgr_<%=cid%>).setHttpChunked(<%=useHttpChunked%>);
|
||||
|
||||
<%
|
||||
if(useOAuth){
|
||||
%>
|
||||
boolean result_<%=cid%> = sfMgr_<%=cid%>.login(accessToken_<%=cid%>, endpointURL_<%=cid%>,<%=timeout%>,<%=needCompression%>);
|
||||
|
||||
@@ -239,6 +239,14 @@
|
||||
SHOW_IF="BULK_CONNECTION=='false'">
|
||||
<DEFAULT>""</DEFAULT>
|
||||
</PARAMETER>
|
||||
|
||||
<PARAMETER
|
||||
NAME="USE_HTTP_CHUNKED"
|
||||
FIELD="CHECK"
|
||||
SHOW="false"
|
||||
NUM_ROW="50">
|
||||
<DEFAULT>false</DEFAULT>
|
||||
</PARAMETER>
|
||||
</ADVANCED_PARAMETERS>
|
||||
|
||||
<CODEGENERATION>
|
||||
|
||||
@@ -27,4 +27,6 @@ NEED_COMPRESSION.NAME=Use Soap Compression
|
||||
TIMEOUT.NAME=Timeout(milliseconds)
|
||||
CLIENT_ID.NAME=Client ID
|
||||
|
||||
HTTP_TRACEMESSAGE.NAME=Output Http Trace Message
|
||||
HTTP_TRACEMESSAGE.NAME=Output Http Trace Message
|
||||
|
||||
USE_HTTP_CHUNKED.NAME=Use Http Chunked
|
||||
@@ -153,33 +153,40 @@ if ((metadatas != null) && (metadatas.size() > 0)) {
|
||||
<%if(clientID!=null && !"".equals(clientID) && !"\"\"".equals(clientID)){%>
|
||||
sfMgr_<%=cid%>.setClientID(<%=clientID%>);
|
||||
<%}
|
||||
|
||||
boolean useHttpChunked = "true".equals(ElementParameterParser.getValue(node,"__USE_HTTP_CHUNKED__"));
|
||||
%>
|
||||
|
||||
((org.talend.salesforce.SforceManagementImpl)sfMgr_<%=cid%>).setHttpChunked(<%=useHttpChunked%>);
|
||||
|
||||
<%
|
||||
if(useOAuth){
|
||||
%>
|
||||
boolean result_<%=cid%> = sfMgr_<%=cid%>.login(accessToken_<%=cid%>, endpointURL_<%=cid%>,<%=timeout%>,<%=needCompression%>);
|
||||
if(!result_<%=cid%>){
|
||||
throw new RuntimeException("Login failed!");
|
||||
}
|
||||
<%
|
||||
}else{
|
||||
if(useProxy){
|
||||
%>
|
||||
boolean result_<%=cid%> = sfMgr_<%=cid%>.login(accessToken_<%=cid%>, endpointURL_<%=cid%>,<%=timeout%>,<%=needCompression%>);
|
||||
if(!result_<%=cid%>){
|
||||
throw new RuntimeException("Login failed!");
|
||||
}
|
||||
java.util.Properties props_<%=cid%> = System.getProperties();
|
||||
props_<%=cid%>.put("socksProxyHost",<%=proxyHost %>);
|
||||
props_<%=cid%>.put("socksProxyPort",<%=proxyPort %>);
|
||||
props_<%=cid%>.put("java.net.socks.username", <%=proxyUsername %>);
|
||||
props_<%=cid%>.put("java.net.socks.password", <%=proxyPassword %>);
|
||||
|
||||
<%
|
||||
}else{
|
||||
if(useProxy){
|
||||
%>
|
||||
java.util.Properties props_<%=cid%> = System.getProperties();
|
||||
props_<%=cid%>.put("socksProxyHost",<%=proxyHost %>);
|
||||
props_<%=cid%>.put("socksProxyPort",<%=proxyPort %>);
|
||||
props_<%=cid%>.put("java.net.socks.username", <%=proxyUsername %>);
|
||||
props_<%=cid%>.put("java.net.socks.password", <%=proxyPassword %>);
|
||||
|
||||
<%
|
||||
}
|
||||
%>
|
||||
boolean result_<%=cid%> = sfMgr_<%=cid%>.login(<%=endpoint%>,<%=username%>, <%=password%>,<%=timeout%>,<%=needCompression%>);
|
||||
if(!result_<%=cid%>){
|
||||
throw new RuntimeException("Login failed! Please check the username,password and endpoint");
|
||||
}
|
||||
<%
|
||||
}
|
||||
}
|
||||
%>
|
||||
}
|
||||
%>
|
||||
boolean result_<%=cid%> = sfMgr_<%=cid%>.login(<%=endpoint%>,<%=username%>, <%=password%>,<%=timeout%>,<%=needCompression%>);
|
||||
if(!result_<%=cid%>){
|
||||
throw new RuntimeException("Login failed! Please check the username,password and endpoint");
|
||||
}
|
||||
<%
|
||||
}
|
||||
}
|
||||
%>
|
||||
|
||||
<%
|
||||
java.lang.StringBuilder sb = new java.lang.StringBuilder();
|
||||
|
||||
@@ -2507,6 +2507,14 @@
|
||||
SHOW_IF="USE_EXISTING_CONNECTION == 'false'">
|
||||
<DEFAULT>""</DEFAULT>
|
||||
</PARAMETER>
|
||||
|
||||
<PARAMETER
|
||||
NAME="USE_HTTP_CHUNKED"
|
||||
FIELD="CHECK"
|
||||
SHOW="false"
|
||||
NUM_ROW="50">
|
||||
<DEFAULT>false</DEFAULT>
|
||||
</PARAMETER>
|
||||
</ADVANCED_PARAMETERS>
|
||||
<CODEGENERATION>
|
||||
<IMPORTS>
|
||||
|
||||
@@ -180,3 +180,5 @@ USE_EXISTING_CONNECTION.NAME=Use an existing connection
|
||||
CONNECTION.NAME=Component List
|
||||
TIMEOUT.NAME=Timeout(milliseconds)
|
||||
CLIENT_ID.NAME=Client ID
|
||||
|
||||
USE_HTTP_CHUNKED.NAME=Use Http Chunked
|
||||
@@ -133,6 +133,13 @@ if ((metadatas != null) && (metadatas.size() > 0)) {
|
||||
sfMgr_<%=cid%>.setClientID(<%=clientID%>);
|
||||
<%
|
||||
}
|
||||
|
||||
boolean useHttpChunked = "true".equals(ElementParameterParser.getValue(node,"__USE_HTTP_CHUNKED__"));
|
||||
%>
|
||||
|
||||
((org.talend.salesforce.SforceManagementImpl)sfMgr_<%=cid%>).setHttpChunked(<%=useHttpChunked%>);
|
||||
|
||||
<%
|
||||
if(useOAuth){
|
||||
%>
|
||||
boolean result_<%=cid%> = sfMgr_<%=cid%>.login(accessToken_<%=cid%>, endpointURL_<%=cid%>,<%=timeout%>,<%=needCompression%>);
|
||||
|
||||
@@ -241,6 +241,13 @@
|
||||
<DEFAULT>""</DEFAULT>
|
||||
</PARAMETER>
|
||||
|
||||
<PARAMETER
|
||||
NAME="USE_HTTP_CHUNKED"
|
||||
FIELD="CHECK"
|
||||
SHOW="false"
|
||||
NUM_ROW="80">
|
||||
<DEFAULT>false</DEFAULT>
|
||||
</PARAMETER>
|
||||
</ADVANCED_PARAMETERS>
|
||||
|
||||
<CODEGENERATION>
|
||||
|
||||
@@ -32,4 +32,6 @@ OAUTH_CLIENT_ID.NAME=Consumer Key
|
||||
OAUTH_CLIENT_SECRET.NAME=Consumer Secret
|
||||
OAUTH_CALLBACK_HOST.NAME=CallBack Host
|
||||
OAUTH_CALLBACK_PORT.NAME=CallBack Port
|
||||
OAUTH_TOKEN_FILE.NAME=Token File
|
||||
OAUTH_TOKEN_FILE.NAME=Token File
|
||||
|
||||
USE_HTTP_CHUNKED.NAME=Use Http Chunked
|
||||
@@ -155,6 +155,13 @@ if ((metadatas != null) && (metadatas.size() > 0)) {
|
||||
sfMgr_<%=cid%>.setClientID(<%=clientID%>);
|
||||
<%
|
||||
}
|
||||
|
||||
boolean useHttpChunked = "true".equals(ElementParameterParser.getValue(node,"__USE_HTTP_CHUNKED__"));
|
||||
%>
|
||||
|
||||
((org.talend.salesforce.SforceManagementImpl)sfMgr_<%=cid%>).setHttpChunked(<%=useHttpChunked%>);
|
||||
|
||||
<%
|
||||
if(useOAuth){
|
||||
%>
|
||||
boolean result_<%=cid%> = sfMgr_<%=cid%>.login(accessToken_<%=cid%>, endpointURL_<%=cid%>,<%=timeout%>,<%=needCompression%>);
|
||||
|
||||
@@ -2503,6 +2503,14 @@
|
||||
SHOW_IF="USE_EXISTING_CONNECTION == 'false'">
|
||||
<DEFAULT>""</DEFAULT>
|
||||
</PARAMETER>
|
||||
|
||||
<PARAMETER
|
||||
NAME="USE_HTTP_CHUNKED"
|
||||
FIELD="CHECK"
|
||||
SHOW="false"
|
||||
NUM_ROW="50">
|
||||
<DEFAULT>false</DEFAULT>
|
||||
</PARAMETER>
|
||||
</ADVANCED_PARAMETERS>
|
||||
<CODEGENERATION>
|
||||
<IMPORTS>
|
||||
|
||||
@@ -181,4 +181,6 @@ NEED_COMPRESSION.NAME=Use Soap Compression
|
||||
USE_EXISTING_CONNECTION.NAME=Use an existing connection
|
||||
CONNECTION.NAME=Component List
|
||||
TIMEOUT.NAME=Timeout(milliseconds)
|
||||
CLIENT_ID.NAME=Client ID
|
||||
CLIENT_ID.NAME=Client ID
|
||||
|
||||
USE_HTTP_CHUNKED.NAME=Use Http Chunked
|
||||
@@ -181,6 +181,13 @@ if ((metadatas != null) && (metadatas.size() > 0)) {
|
||||
sfMgr_<%=cid%>.setClientID(<%=clientID%>);
|
||||
<%
|
||||
}
|
||||
|
||||
boolean useHttpChunked = "true".equals(ElementParameterParser.getValue(node,"__USE_HTTP_CHUNKED__"));
|
||||
%>
|
||||
|
||||
((org.talend.salesforce.SforceManagementImpl)sfMgr_<%=cid%>).setHttpChunked(<%=useHttpChunked%>);
|
||||
|
||||
<%
|
||||
if(useOAuth){
|
||||
%>
|
||||
boolean result_<%=cid%> = false;
|
||||
|
||||
@@ -2624,6 +2624,14 @@
|
||||
SHOW_IF="(USE_EXISTING_CONNECTION == 'false') AND (API == 'soap')">
|
||||
<DEFAULT>""</DEFAULT>
|
||||
</PARAMETER>
|
||||
|
||||
<PARAMETER
|
||||
NAME="USE_HTTP_CHUNKED"
|
||||
FIELD="CHECK"
|
||||
SHOW="false"
|
||||
NUM_ROW="120">
|
||||
<DEFAULT>false</DEFAULT>
|
||||
</PARAMETER>
|
||||
</ADVANCED_PARAMETERS>
|
||||
|
||||
<CODEGENERATION>
|
||||
|
||||
@@ -200,4 +200,6 @@ CONNECTION.NAME=Component List
|
||||
TIMEOUT.NAME=Timeout(milliseconds)
|
||||
|
||||
QUERY_ALL.NAME=Query all records(include deleted records)
|
||||
CLIENT_ID.NAME=Client ID
|
||||
CLIENT_ID.NAME=Client ID
|
||||
|
||||
USE_HTTP_CHUNKED.NAME=Use Http Chunked
|
||||
@@ -126,6 +126,13 @@ imports="
|
||||
sforceManagement_<%=cid%>.setClientID(<%=clientID%>);
|
||||
<%
|
||||
}
|
||||
|
||||
boolean useHttpChunked = "true".equals(ElementParameterParser.getValue(node,"__USE_HTTP_CHUNKED__"));
|
||||
%>
|
||||
|
||||
((org.talend.salesforce.SforceManagementImpl)sforceManagement_<%=cid%>).setHttpChunked(<%=useHttpChunked%>);
|
||||
|
||||
<%
|
||||
if(useOAuth){
|
||||
%>
|
||||
boolean result_<%=cid%> = sforceManagement_<%=cid%>.login(accessToken_<%=cid%>, endpointURL_<%=cid%>,<%=timeout%>,<%=needCompression%>);
|
||||
|
||||
@@ -3468,6 +3468,14 @@
|
||||
<ITEM NAME="LOOKUP_FIELD_EXTERNAL_ID_NAME" />
|
||||
</ITEMS>
|
||||
</PARAMETER>
|
||||
|
||||
<PARAMETER
|
||||
NAME="USE_HTTP_CHUNKED"
|
||||
FIELD="CHECK"
|
||||
SHOW="false"
|
||||
NUM_ROW="90">
|
||||
<DEFAULT>false</DEFAULT>
|
||||
</PARAMETER>
|
||||
</ADVANCED_PARAMETERS>
|
||||
|
||||
<CODEGENERATION>
|
||||
|
||||
@@ -193,4 +193,6 @@ OAUTH_CLIENT_ID.NAME=Consumer Key
|
||||
OAUTH_CLIENT_SECRET.NAME=Consumer Secret
|
||||
OAUTH_CALLBACK_HOST.NAME=CallBack Host
|
||||
OAUTH_CALLBACK_PORT.NAME=CallBack Port
|
||||
OAUTH_TOKEN_FILE.NAME=Token File
|
||||
OAUTH_TOKEN_FILE.NAME=Token File
|
||||
|
||||
USE_HTTP_CHUNKED.NAME=Use Http Chunked
|
||||
@@ -835,7 +835,7 @@ if (bCreateDir){
|
||||
org.talend.designer.components.tsort.io.sortimpl.FlowSorterIterator<<%=rowName %>StructILightSerializable> iterator_<%=cid %> = new org.talend.designer.components.tsort.io.sortimpl.FlowSorterIterator<<%=rowName %>StructILightSerializable>();
|
||||
iterator_<%=cid %>.setBufferSize(<%=bufferSize %>);
|
||||
iterator_<%=cid %>.setILightSerializable(new <%=rowName %>StructILightSerializable());
|
||||
iterator_<%=cid %>.workDirectory = <%=tempDirectory %> + "/" + jobName + "<%=cid %> _" + pid;
|
||||
iterator_<%=cid %>.workDirectory = <%=tempDirectory %> + "/" + jobName + "<%=cid %> _" + Thread.currentThread().getId() + "_" + pid;
|
||||
iterator_<%=cid %>.initPut("");
|
||||
|
||||
<%
|
||||
|
||||
@@ -25,6 +25,18 @@
|
||||
id="org.talend.designer.core.ui.editor.StandAloneTalendJavaEditor"
|
||||
name="Java Editor">
|
||||
</editor>
|
||||
<editor
|
||||
class="org.talend.designer.core.ui.editor.TalendDefaultJavaEditor"
|
||||
contributorClass="org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditorActionContributor"
|
||||
default="true"
|
||||
icon="icons/java.gif"
|
||||
id="org.talend.designer.core.ui.editor.TalendDefaultJavaEditor"
|
||||
name="Talend Default Java Editor"
|
||||
symbolicFontName="org.eclipse.jdt.ui.editors.textfont">
|
||||
<contentTypeBinding
|
||||
contentTypeId="org.eclipse.jdt.core.javaSource">
|
||||
</contentTypeBinding>
|
||||
</editor>
|
||||
</extension>
|
||||
<extension point="org.eclipse.ui.startup">
|
||||
<startup class="org.eclipse.update.internal.scheduler.SchedulerStartup"/>
|
||||
|
||||
@@ -481,6 +481,7 @@ Node.lostPartitioner=there should have a partitioner row before the departitione
|
||||
Node.lostDepartitioner=there should have a departitioner row after the partitioner row.
|
||||
Node.setPartitioning=Set Parallelization.
|
||||
Node.nothingDoForPartitioning=Nothing to do for this job.
|
||||
Node.repeatMergeSort={0} already set merge sort,please remove the merge sort in {1}
|
||||
Node.hasInexistentColumn=Columns ({0}) of Parameter ({1}) are not existing in the schema and \nstudio will take the first column instead of the original one. Please correct them manually.
|
||||
NodeBreakpointAction.addBreakPoint=Add breakpoint
|
||||
NodeBreakpointAction.removeBreakpoint=Remove breakpoint
|
||||
|
||||
@@ -70,9 +70,9 @@ public class MetadataEmfFactory {
|
||||
colType.setComment(metaCol.getComment());
|
||||
colType.setKey(metaCol.isKey());
|
||||
colType.setNullable(metaCol.isNullable());
|
||||
if (metaCol.getLength() == null) {
|
||||
// colType.setLength(-1);
|
||||
colType.unsetLength();
|
||||
if (metaCol.getLength() == null || metaCol.getLength().intValue() < 0) {
|
||||
colType.setLength(-1);
|
||||
// colType.unsetLength();
|
||||
} else {
|
||||
colType.setLength(metaCol.getLength());
|
||||
}
|
||||
@@ -87,9 +87,9 @@ public class MetadataEmfFactory {
|
||||
}
|
||||
|
||||
colType.setName(metaCol.getLabel());
|
||||
if (metaCol.getPrecision() == null) {
|
||||
// colType.setPrecision(-1);
|
||||
colType.unsetPrecision();
|
||||
if (metaCol.getPrecision() == null || metaCol.getPrecision().intValue() < 0) {
|
||||
colType.setPrecision(-1);
|
||||
// colType.unsetPrecision();
|
||||
} else {
|
||||
colType.setPrecision(metaCol.getPrecision());
|
||||
}
|
||||
@@ -137,12 +137,8 @@ public class MetadataEmfFactory {
|
||||
metaCol.setComment(colType.getComment());
|
||||
metaCol.setKey(colType.isKey());
|
||||
metaCol.setNullable(colType.isNullable());
|
||||
if (colType.isSetLength()) {
|
||||
if (colType.getLength() >= 0) {
|
||||
metaCol.setLength(new Integer(colType.getLength()));
|
||||
} else {
|
||||
metaCol.setLength(null);
|
||||
}
|
||||
if (colType.getLength() >= 0) {
|
||||
metaCol.setLength(new Integer(colType.getLength()));
|
||||
} else {
|
||||
metaCol.setLength(null);
|
||||
}
|
||||
@@ -161,12 +157,8 @@ public class MetadataEmfFactory {
|
||||
}
|
||||
}
|
||||
metaCol.setLabel(colType.getName());
|
||||
if (colType.isSetPrecision()) {
|
||||
if (colType.getPrecision() >= 0) {
|
||||
metaCol.setPrecision(new Integer(colType.getPrecision()));
|
||||
} else {
|
||||
metaCol.setPrecision(null);
|
||||
}
|
||||
if (colType.getPrecision() >= 0) {
|
||||
metaCol.setPrecision(new Integer(colType.getPrecision()));
|
||||
} else {
|
||||
metaCol.setPrecision(null);
|
||||
}
|
||||
|
||||
@@ -344,6 +344,7 @@ public class StandAloneTalendJavaEditor extends CompilationUnitEditor implements
|
||||
}
|
||||
};
|
||||
repFactory.executeRepositoryWorkUnit(repositoryWorkUnit);
|
||||
repositoryWorkUnit.throwPersistenceExceptionIfAny();
|
||||
|
||||
// for bug 11930: Unable to save Routines.* in db project
|
||||
|
||||
@@ -357,12 +358,12 @@ public class StandAloneTalendJavaEditor extends CompilationUnitEditor implements
|
||||
|
||||
}
|
||||
|
||||
private void refreshJobAndSave(final IProxyRepositoryFactory repFactory) {
|
||||
try {
|
||||
// cause it to update MaxInformationLevel
|
||||
repFactory.save(item);
|
||||
} catch (Exception e) {
|
||||
}
|
||||
private void refreshJobAndSave(final IProxyRepositoryFactory repFactory) throws PersistenceException {
|
||||
// try {
|
||||
// cause it to update MaxInformationLevel
|
||||
repFactory.save(item);
|
||||
// } catch (Exception e) {
|
||||
// }
|
||||
// update editor image
|
||||
setTitleImage(getTitleImage());
|
||||
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2015 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;
|
||||
|
||||
import org.apache.log4j.Priority;
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.jdt.core.IJavaProject;
|
||||
import org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor;
|
||||
import org.eclipse.ui.IEditorInput;
|
||||
import org.eclipse.ui.part.FileEditorInput;
|
||||
import org.talend.commons.exception.CommonExceptionHandler;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.model.repository.ERepositoryObjectType;
|
||||
import org.talend.designer.runprocess.IRunProcessService;
|
||||
|
||||
/**
|
||||
* DOC cmeng class global comment. Detailled comment
|
||||
*/
|
||||
public class TalendDefaultJavaEditor extends CompilationUnitEditor {
|
||||
|
||||
protected String fileType = FILE_TYPE_OTHERS;
|
||||
|
||||
protected static final String FILE_TYPE_TALEND_GENERATED_READONLY = "READONLY_GENERATED_BY_TALEND"; //$NON-NLS-1$
|
||||
|
||||
protected static final String FILE_TYPE_TALEND_GENERATED_WRITEABLE = "WRITEABLE_GENERATED_BY_TALEND"; //$NON-NLS-1$
|
||||
|
||||
protected static final String FILE_TYPE_OTHERS = "OTHERS_NOT_BY_TALEND"; //$NON-NLS-1$
|
||||
|
||||
@Override
|
||||
protected void doSetInput(IEditorInput input) throws CoreException {
|
||||
|
||||
if (input instanceof FileEditorInput) {
|
||||
try {
|
||||
// IRepositoryService repositoryService = DesignerPlugin.getDefault().getRepositoryService();
|
||||
// IProxyRepositoryFactory repFactory = repositoryService.getProxyRepositoryFactory();
|
||||
IRunProcessService runProcessService = (IRunProcessService) GlobalServiceRegister.getDefault().getService(
|
||||
IRunProcessService.class);
|
||||
// I think runProcessService can't be null, and should throw exception if it is null
|
||||
IJavaProject talendJavaProject = runProcessService.getJavaProject();
|
||||
final String pathSeperator = "/"; //$NON-NLS-1$
|
||||
String routinesFolderName = ERepositoryObjectType.ROUTINES.getFolder().split(pathSeperator)[1];
|
||||
String talendSrcFolderPath = talendJavaProject.getProject().getLocation().toString() + pathSeperator
|
||||
+ "src" + pathSeperator; //$NON-NLS-1$
|
||||
String routineFolderPath = talendSrcFolderPath + routinesFolderName + pathSeperator;
|
||||
IFile openedFile = ((FileEditorInput) input).getFile();
|
||||
String openedFilePath = openedFile.getLocation().toString();
|
||||
boolean isRoutine = openedFilePath.startsWith(routineFolderPath);
|
||||
boolean isTalendGeneratedFile = openedFilePath.startsWith(talendSrcFolderPath);
|
||||
String systemRoutineFolderName = "system"; //$NON-NLS-1$
|
||||
String systemRoutineFolderPath = routineFolderPath + systemRoutineFolderName + pathSeperator;
|
||||
boolean isSystemRoutine = openedFilePath.startsWith(systemRoutineFolderPath);
|
||||
|
||||
if (isSystemRoutine) {
|
||||
fileType = FILE_TYPE_TALEND_GENERATED_READONLY;
|
||||
} else if (isRoutine) {
|
||||
fileType = FILE_TYPE_TALEND_GENERATED_READONLY;
|
||||
} else if (isTalendGeneratedFile) {
|
||||
fileType = FILE_TYPE_TALEND_GENERATED_READONLY;
|
||||
} else {
|
||||
fileType = FILE_TYPE_OTHERS;
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
CommonExceptionHandler.process(e, Priority.WARN);
|
||||
fileType = FILE_TYPE_OTHERS;
|
||||
}
|
||||
|
||||
}
|
||||
super.doSetInput(input);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEditable() {
|
||||
boolean isEditable = false;
|
||||
|
||||
if (FILE_TYPE_TALEND_GENERATED_READONLY.equals(fileType)) {
|
||||
isEditable = false;
|
||||
} else if (FILE_TYPE_TALEND_GENERATED_WRITEABLE.equals(fileType)) {
|
||||
isEditable = true;
|
||||
} else if (FILE_TYPE_OTHERS.equals(fileType)) {
|
||||
isEditable = true;
|
||||
}
|
||||
|
||||
return isEditable;
|
||||
}
|
||||
}
|
||||
@@ -430,6 +430,13 @@ public class PropertyChangeCommand extends Command {
|
||||
((IGraphicalNode) elem).checkAndRefreshNode();
|
||||
}
|
||||
|
||||
if (elem instanceof IConnection) {
|
||||
IProcess process = ((IConnection) elem).getSource().getProcess();
|
||||
if (process instanceof IProcess2) {
|
||||
((IProcess2) process).checkProcess();
|
||||
}
|
||||
}
|
||||
|
||||
// See feature 3902
|
||||
if (needUpdateMonitorConnection()) {
|
||||
((Connection) elem).setMonitorConnection((Boolean) currentParam.getValue());
|
||||
|
||||
@@ -36,6 +36,7 @@ import org.talend.core.model.repository.IRepositoryViewObject;
|
||||
import org.talend.core.model.utils.ContextParameterUtils;
|
||||
import org.talend.core.model.utils.IDragAndDropServiceHandler;
|
||||
import org.talend.core.utils.TalendQuoteUtils;
|
||||
import org.talend.cwm.helper.TaggedValueHelper;
|
||||
import org.talend.designer.core.model.components.EParameterName;
|
||||
import org.talend.designer.core.model.components.EmfComponent;
|
||||
import org.talend.designer.core.ui.editor.nodes.Node;
|
||||
@@ -122,7 +123,12 @@ public class RepositoryChangeMetadataCommand extends ChangeMetadataCommand {
|
||||
|
||||
node.getElementParameter(EParameterName.UPDATE_COMPONENTS.getName()).setValue(true);
|
||||
if (newOutputMetadata != null) {
|
||||
setDBTableFieldValue(node, newOutputMetadata.getTableName(), oldOutputMetadata.getTableName());
|
||||
Map<String, String> addMap = newOutputMetadata.getAdditionalProperties();
|
||||
if (addMap.get(TaggedValueHelper.SYSTEMTABLENAME) != null && node.getComponent().getName().equals("tAS400CDC")) {
|
||||
setDBTableFieldValue(node, addMap.get(TaggedValueHelper.SYSTEMTABLENAME), oldOutputMetadata.getTableName());
|
||||
} else {
|
||||
setDBTableFieldValue(node, newOutputMetadata.getTableName(), oldOutputMetadata.getTableName());
|
||||
}
|
||||
IElementParameter parameter = node.getElementParameter("SAP_FUNCTION");
|
||||
if (parameter != null)
|
||||
setSAPFunctionName(node, parameter.getValue() == null ? null : (String) parameter.getValue());
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
package org.talend.designer.core.ui.editor.cmd;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -37,7 +38,7 @@ public class SetParallelizationCommand extends Command {
|
||||
|
||||
private static final String HASH_KEYS = "HASH_KEYS";
|
||||
|
||||
private boolean isExistParallel = false;
|
||||
private Map<INode, Boolean> existParallelMap = new HashMap<INode, Boolean>();
|
||||
|
||||
public SetParallelizationCommand(INode node) {
|
||||
this.node = node;
|
||||
@@ -49,13 +50,34 @@ public class SetParallelizationCommand extends Command {
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
existParallelMap.clear();
|
||||
initParallelNodeMap();
|
||||
setParallelization(this.node);
|
||||
if (!isExistParallel) {
|
||||
setParallelParametersForConn();
|
||||
if (!isExistParalInSubjob(existParallelMap, node.getProcessStartNode(false))) {
|
||||
MessageDialog.openInformation(new Shell(), Messages.getString("Node.setPartitioning"),
|
||||
Messages.getString("Node.nothingDoForPartitioning"));
|
||||
}
|
||||
}
|
||||
|
||||
private void initParallelNodeMap() {
|
||||
List<? extends INode> nodes = this.node.getProcess().getGraphicalNodes();
|
||||
for (INode node : nodes) {
|
||||
if (node.isSubProcessStart()) {
|
||||
// by default for subjob the parallel does not exist
|
||||
existParallelMap.put(node, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isExistParalInSubjob(Map<INode, Boolean> existParallelMap, INode node) {
|
||||
INode subJobStartNode = node.getSubProcessStartNode(false);
|
||||
if (existParallelMap.containsKey(subJobStartNode)) {
|
||||
return existParallelMap.get(subJobStartNode);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean isComponentCanParlization(IConnection parConnection, Node needToPar) {
|
||||
if (needToPar.getComponent().getPartitioning().equals("NONE")) {
|
||||
return false;
|
||||
@@ -111,7 +133,7 @@ public class SetParallelizationCommand extends Command {
|
||||
} else if (value instanceof Integer) {
|
||||
Integer index = (Integer) value;
|
||||
if (nodeElemForList.getListItemsDisplayName().length > index) {
|
||||
columnKeyValues.add((String) nodeElemForList.getListItemsDisplayName()[index]);
|
||||
columnKeyValues.add(nodeElemForList.getListItemsDisplayName()[index]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -135,91 +157,41 @@ public class SetParallelizationCommand extends Command {
|
||||
for (IConnection con : node.getOutgoingConnections()) {
|
||||
EConnectionType lineStyle = con.getLineStyle();
|
||||
if (lineStyle.hasConnectionCategory(IConnectionCategory.DATA)) {
|
||||
// if (con.isActivate()) {
|
||||
boolean isEndRow = con.getTarget().getOutgoingConnections().size() == 0;
|
||||
boolean isStartRow = node.isStart();
|
||||
if (ParallelExecutionUtils.isPartitionKeysExist(con)) {
|
||||
ParallelExecutionUtils.reSetParKeyValuesForCon(con);
|
||||
}
|
||||
if (!isEndRow && isComponentCanParlization(con, (Node) con.getTarget())) {
|
||||
// For those component support tPartitioner,but its keys not same as previous
|
||||
// tPartitioner,need do Repartitioner automatic
|
||||
if (isExistParallel && !isStartRow && isComponentNeedRepartion(con, (Node) con.getTarget())) {
|
||||
con.getElementParameter(EParameterName.NONE.getName()).setValue(Boolean.FALSE);
|
||||
con.getElementParameter(EParameterName.PARTITIONER.getName()).setValue(Boolean.FALSE);
|
||||
con.getElementParameter(EParameterName.DEPARTITIONER.getName()).setValue(Boolean.FALSE);
|
||||
con.setPropertyValue(EParameterName.REPARTITIONER.getName(), Boolean.TRUE);
|
||||
if (!lineStyle.equals(EConnectionType.FLOW_MERGE)) {
|
||||
boolean isEndRow = con.getTarget().getOutgoingConnections().size() == 0;
|
||||
boolean isStartRow = node.isStart();
|
||||
|
||||
// set the keys for hash keys
|
||||
ParallelExecutionUtils.setHashKeysFromTarget(con, (Node) con.getTarget());
|
||||
setParallelization(con.getTarget());
|
||||
|
||||
} else {
|
||||
// when pervious con is par/repar/none,keep current is none
|
||||
if (isExistParallel
|
||||
&& (ParallelExecutionUtils.existPreviousPar((Node) con.getSource())
|
||||
|| ParallelExecutionUtils.existPreviousNone((Node) con.getSource()) || ParallelExecutionUtils
|
||||
.existPreviousRepar((Node) con.getSource()))) {
|
||||
con.getElementParameter(EParameterName.REPARTITIONER.getName()).setValue(Boolean.FALSE);
|
||||
con.getElementParameter(EParameterName.PARTITIONER.getName()).setValue(Boolean.FALSE);
|
||||
con.getElementParameter(EParameterName.DEPARTITIONER.getName()).setValue(Boolean.FALSE);
|
||||
con.setPropertyValue(EParameterName.NONE.getName(), Boolean.TRUE);
|
||||
setParallelization(con.getTarget());
|
||||
if (ParallelExecutionUtils.isPartitionKeysExist(con)) {
|
||||
ParallelExecutionUtils.reSetParKeyValuesForCon(con);
|
||||
}
|
||||
if (!isEndRow && isComponentCanParlization(con, (Node) con.getTarget())) {
|
||||
// For those component support tPartitioner,but its keys not same as previous
|
||||
// tPartitioner,need do Repartitioner automatic
|
||||
if (isExistParalInSubjob(existParallelMap, node) && !isStartRow
|
||||
&& isComponentNeedRepartion(con, (Node) con.getTarget())) {
|
||||
setRepartioner(con);
|
||||
} else {
|
||||
// add flag here is judge for if has did parallelization
|
||||
isExistParallel = true;
|
||||
INode nextPartionerNode = null;
|
||||
IElementParameter deparElem = con.getElementParameter(EParameterName.DEPARTITIONER.getName());
|
||||
deparElem.setValue(Boolean.FALSE);
|
||||
con.getElementParameter(EParameterName.REPARTITIONER.getName()).setValue(Boolean.FALSE);
|
||||
con.getElementParameter(EParameterName.NONE.getName()).setValue(Boolean.FALSE);
|
||||
con.setPropertyValue(EParameterName.PARTITIONER.getName(), Boolean.TRUE);
|
||||
|
||||
if (isStartRow && lineStyle.equals(EConnectionType.FLOW_MERGE)) {
|
||||
con.setPropertyValue(EParameterName.PARTITIONER.getName(), Boolean.FALSE);
|
||||
con.getElementParameter(EParameterName.NONE.getName()).setValue(Boolean.TRUE);
|
||||
isExistParallel = false;
|
||||
// when pervious con is par/repar/none,keep current is none
|
||||
if (isExistParalInSubjob(existParallelMap, node)
|
||||
&& (ParallelExecutionUtils.existPreviousPar((Node) con.getSource())
|
||||
|| ParallelExecutionUtils.existPreviousNone((Node) con.getSource()) || ParallelExecutionUtils
|
||||
.existPreviousRepar((Node) con.getSource()))) {
|
||||
setNone(con);
|
||||
} else {
|
||||
nextPartionerNode = ParallelExecutionUtils.getNextPartionerTargetNode(con);
|
||||
|
||||
// set the keys from target node keys
|
||||
if (nextPartionerNode != null) {
|
||||
// TDI-26555:in case the target partitioner key not in the main flow.such as
|
||||
// in lookup row,need to go next connection for partitioning
|
||||
if (ParallelExecutionUtils.isConClumnsContainsPartionKey(con,
|
||||
(Node) nextPartionerNode)) {
|
||||
if (ParallelExecutionUtils.getColumnListFromTargetNode((Node) nextPartionerNode)
|
||||
.size() > 0) {
|
||||
ParallelExecutionUtils.setHashKeysFromTarget(con, (Node) nextPartionerNode);
|
||||
} else {
|
||||
ParallelExecutionUtils.setHashKeysForCon(con);
|
||||
}
|
||||
} else {
|
||||
if (isStartRow) {
|
||||
con.setPropertyValue(EParameterName.PARTITIONER.getName(), Boolean.FALSE);
|
||||
isExistParallel = false;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ParallelExecutionUtils.setHashKeysForCon(con);
|
||||
}
|
||||
}
|
||||
if (con.getTarget() != null) {
|
||||
setParallelization(con.getTarget());
|
||||
setPartioner(con, lineStyle, isStartRow);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!con.getSource().isStart()) {
|
||||
setDepartioner(con);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!con.getSource().isStart()) {
|
||||
if (isExistParallel && !ParallelExecutionUtils.existPreviousDepar((Node) con.getSource())) {
|
||||
setDeparallelization(con.getTarget());
|
||||
}
|
||||
}
|
||||
setParallelization(con.getTarget());
|
||||
}
|
||||
// }
|
||||
} else {
|
||||
node = con.getTarget();
|
||||
setParallelization(node);
|
||||
// in case the con here is not data flow,such as onSubjobOk,we skip to next target
|
||||
setParallelization(con.getTarget());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -230,13 +202,87 @@ public class SetParallelizationCommand extends Command {
|
||||
}
|
||||
}
|
||||
|
||||
private void setPartioner(IConnection con, EConnectionType lineStyle, boolean isStartRow) {
|
||||
// add flag here is judge for did parallelization or not
|
||||
INode subjobStartNode = con.getTarget().getSubProcessStartNode(false);
|
||||
if (existParallelMap.containsKey(subjobStartNode)) {
|
||||
existParallelMap.put(subjobStartNode, true);
|
||||
|
||||
}
|
||||
INode nextPartionerNode = null;
|
||||
con.getElementParameter(EParameterName.DEPARTITIONER.getName()).setValue(Boolean.FALSE);
|
||||
con.getElementParameter(EParameterName.REPARTITIONER.getName()).setValue(Boolean.FALSE);
|
||||
con.getElementParameter(EParameterName.NONE.getName()).setValue(Boolean.FALSE);
|
||||
con.setPropertyValue(EParameterName.PARTITIONER.getName(), Boolean.TRUE);
|
||||
|
||||
if (isStartRow && lineStyle.equals(EConnectionType.FLOW_MERGE)) {
|
||||
con.setPropertyValue(EParameterName.PARTITIONER.getName(), Boolean.FALSE);
|
||||
con.getElementParameter(EParameterName.NONE.getName()).setValue(Boolean.TRUE);
|
||||
existParallelMap.put(subjobStartNode, false);
|
||||
} else {
|
||||
nextPartionerNode = ParallelExecutionUtils.getNextPartionerTargetNode(con);
|
||||
|
||||
// set the keys from target node keys
|
||||
if (nextPartionerNode != null) {
|
||||
// TDI-26555:in case the target partitioner key not in the main flow.such as
|
||||
// in lookup row,need to go next connection for partitioning
|
||||
if (ParallelExecutionUtils.isConClumnsContainsPartionKey(con, (Node) nextPartionerNode)) {
|
||||
if (ParallelExecutionUtils.getColumnListFromTargetNode((Node) nextPartionerNode).size() > 0) {
|
||||
ParallelExecutionUtils.setHashKeysFromTarget(con, (Node) nextPartionerNode);
|
||||
} else {
|
||||
ParallelExecutionUtils.setHashKeysForCon(con);
|
||||
}
|
||||
} else {
|
||||
if (isStartRow) {
|
||||
con.setPropertyValue(EParameterName.PARTITIONER.getName(), Boolean.FALSE);
|
||||
existParallelMap.put(subjobStartNode, false);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ParallelExecutionUtils.setHashKeysForCon(con);
|
||||
}
|
||||
}
|
||||
if (con.getTarget() != null) {
|
||||
setParallelization(con.getTarget());
|
||||
}
|
||||
}
|
||||
|
||||
private void setDepartioner(IConnection con) {
|
||||
// TDI-29137: Need consider the other subjobs when do parallelization
|
||||
INode subJobStart = con.getSource().getSubProcessStartNode(false);
|
||||
boolean existNextPar = ParallelExecutionUtils.isExistParallelCon((Node) subJobStart);
|
||||
boolean existPreDepar = ParallelExecutionUtils.existPreviousDepar((Node) con.getSource());
|
||||
boolean canSetDepar = isExistParalInSubjob(existParallelMap, subJobStart) && existNextPar && !existPreDepar;
|
||||
if (canSetDepar) {
|
||||
setDeparallelization(con.getTarget());
|
||||
}
|
||||
}
|
||||
|
||||
private void setRepartioner(IConnection con) {
|
||||
con.getElementParameter(EParameterName.NONE.getName()).setValue(Boolean.FALSE);
|
||||
con.getElementParameter(EParameterName.PARTITIONER.getName()).setValue(Boolean.FALSE);
|
||||
con.getElementParameter(EParameterName.DEPARTITIONER.getName()).setValue(Boolean.FALSE);
|
||||
con.setPropertyValue(EParameterName.REPARTITIONER.getName(), Boolean.TRUE);
|
||||
|
||||
// set the keys for hash keys
|
||||
ParallelExecutionUtils.setHashKeysFromTarget(con, (Node) con.getTarget());
|
||||
setParallelization(con.getTarget());
|
||||
}
|
||||
|
||||
private void setNone(IConnection con) {
|
||||
con.getElementParameter(EParameterName.REPARTITIONER.getName()).setValue(Boolean.FALSE);
|
||||
con.getElementParameter(EParameterName.PARTITIONER.getName()).setValue(Boolean.FALSE);
|
||||
con.getElementParameter(EParameterName.DEPARTITIONER.getName()).setValue(Boolean.FALSE);
|
||||
con.setPropertyValue(EParameterName.NONE.getName(), Boolean.TRUE);
|
||||
setParallelization(con.getTarget());
|
||||
}
|
||||
|
||||
private void setDeparallelization(INode node) {
|
||||
if (node.isActivate()) {
|
||||
for (IConnection con : node.getIncomingConnections()) {
|
||||
EConnectionType lineStyle = con.getLineStyle();
|
||||
if (lineStyle.hasConnectionCategory(IConnectionCategory.DATA)) {
|
||||
IElementParameter parElem = con.getElementParameter(EParameterName.PARTITIONER.getName());
|
||||
parElem.setValue(Boolean.FALSE);
|
||||
con.getElementParameter(EParameterName.PARTITIONER.getName()).setValue(Boolean.FALSE);
|
||||
con.getElementParameter(EParameterName.REPARTITIONER.getName()).setValue(Boolean.FALSE);
|
||||
con.getElementParameter(EParameterName.NONE.getName()).setValue(Boolean.FALSE);
|
||||
con.setPropertyValue(EParameterName.DEPARTITIONER.getName(), Boolean.TRUE);
|
||||
@@ -247,4 +293,14 @@ public class SetParallelizationCommand extends Command {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void setParallelParametersForConn() {
|
||||
for (IConnection conn : node.getProcess().getAllConnections(null)) {
|
||||
boolean isRepar = (Boolean) conn.getPropertyValue(EParameterName.REPARTITIONER.getName());
|
||||
if (isRepar) {
|
||||
// set sort parameter for repartioner
|
||||
ParallelExecutionUtils.setMergeSortByConditions(conn);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1818,7 +1818,7 @@ public class Process extends Element implements IProcess2, IGEFProcess, ILastVer
|
||||
note.setText(noteType.getText());
|
||||
note.setProcess(this);
|
||||
loadElementParameters(note, noteType.getElementParameter());
|
||||
addNote(note);
|
||||
addNote(note, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2269,18 +2269,27 @@ public class Process extends Element implements IProcess2, IGEFProcess, ILastVer
|
||||
// here force a rename without call the ChangeConnTextCommand
|
||||
// if goes here, it means simply there is a problem since the name is not the same as the unique
|
||||
// name.
|
||||
// we just force the name here since in all case the job was wrong first !
|
||||
connec.setName(connec.getUniqueName());
|
||||
// we just force the unique name here since in all case the job was wrong first !
|
||||
|
||||
connec.setPropertyValue(EParameterName.UNIQUE_NAME.getName(), connec.getName());
|
||||
uniqueName = connec.getName();
|
||||
}
|
||||
}
|
||||
// at this point we should have the uniquename set correctly in the connection.
|
||||
if (!connectionUniqueNames.contains(uniqueName) && checkValidConnectionName(uniqueName, false)) {
|
||||
boolean isValidName = checkValidConnectionName(uniqueName, false);
|
||||
if (!connectionUniqueNames.contains(uniqueName) && isValidName) {
|
||||
try {
|
||||
source.getProcess().addUniqueConnectionName(uniqueName);
|
||||
} catch (Exception e) {
|
||||
// nothing, since it should be added already in fact.
|
||||
}
|
||||
} else {
|
||||
if (!isValidName) {
|
||||
// fix for TDI-28468 ,some connection uniquename are not valid from some old
|
||||
// version like uniquename = OnSubjobOk (OnSubjobOK(TRIGGER_OUTPUT_1))
|
||||
// if base name is not valid ,generate a new one based on the default link name
|
||||
uniqueName = connec.getLineStyle().getDefaultLinkName();
|
||||
}
|
||||
uniqueName = source.getProcess().generateUniqueConnectionName(uniqueName);
|
||||
if (connec.getLineStyle().hasConnectionCategory(IConnectionCategory.FLOW)) {
|
||||
ChangeConnTextCommand cctc = new ChangeConnTextCommand(connec, uniqueName);
|
||||
@@ -3237,10 +3246,16 @@ public class Process extends Element implements IProcess2, IGEFProcess, ILastVer
|
||||
this.repositoryId = repositoryId;
|
||||
}
|
||||
|
||||
public void addNote(Note note) {
|
||||
public void addNote(Note note, boolean fireUpdate) {
|
||||
elem.add(note);
|
||||
notes.add(note);
|
||||
fireStructureChange(NEED_UPDATE_JOB, elem);
|
||||
if (fireUpdate) {
|
||||
fireStructureChange(NEED_UPDATE_JOB, elem);
|
||||
}
|
||||
}
|
||||
|
||||
public void addNote(Note note) {
|
||||
addNote(note, true);
|
||||
}
|
||||
|
||||
public void removeNote(Note note) {
|
||||
|
||||
@@ -22,6 +22,12 @@ public class ParallelExecutionUtils {
|
||||
|
||||
private static final String HASH_KEYS = "HASH_KEYS";
|
||||
|
||||
private static final String HASH_PARTION = "HASH_PARTITION";
|
||||
|
||||
private static final String MERGE_SORT = "IS_SORTING";
|
||||
|
||||
private static final String SPECIAL_SORT_COMPONENT = "tSortRow";
|
||||
|
||||
public static boolean compareKeyPartions(IConnection parConnection, Node needToPar) {
|
||||
String partitioning = needToPar.getComponent().getPartitioning();
|
||||
boolean isSame = false;
|
||||
@@ -63,7 +69,7 @@ public class ParallelExecutionUtils {
|
||||
} else if (value instanceof Integer) {
|
||||
Integer index = (Integer) value;
|
||||
if (nodeElemForList.getListItemsDisplayName().length > index) {
|
||||
columnKeyValues.add((String) nodeElemForList.getListItemsDisplayName()[index]);
|
||||
columnKeyValues.add(nodeElemForList.getListItemsDisplayName()[index]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -105,7 +111,7 @@ public class ParallelExecutionUtils {
|
||||
if (parTableCon != null) {
|
||||
((List) parTableCon.getValue()).clear();
|
||||
if (targetKeyColumnList.size() > 0) {
|
||||
con.getElementParameter("HASH_PARTITION").setValue(true);
|
||||
con.getElementParameter(HASH_PARTION).setValue(true);
|
||||
|
||||
Object[] itemCon = parTableCon.getListItemsValue();
|
||||
String clumnKeyListName = "";
|
||||
@@ -155,7 +161,7 @@ public class ParallelExecutionUtils {
|
||||
} else if (value instanceof Integer) {
|
||||
Integer index = (Integer) value;
|
||||
if (clumnNodeList.getListItemsDisplayName().length > index) {
|
||||
columnKeyValues.add((String) clumnNodeList.getListItemsDisplayName()[index]);
|
||||
columnKeyValues.add(clumnNodeList.getListItemsDisplayName()[index]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -227,7 +233,7 @@ public class ParallelExecutionUtils {
|
||||
if (parTableCon != null) {
|
||||
if (conKeyColumnList.size() > 0) {
|
||||
((List) parTableCon.getValue()).clear();
|
||||
con.getElementParameter("HASH_PARTITION").setValue(true);
|
||||
con.getElementParameter(HASH_PARTION).setValue(true);
|
||||
|
||||
Object[] itemCon = parTableCon.getListItemsValue();
|
||||
String clumnKeyListName = "";
|
||||
@@ -253,7 +259,7 @@ public class ParallelExecutionUtils {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
con.getElementParameter("HASH_PARTITION").setValue(false);
|
||||
con.getElementParameter(HASH_PARTION).setValue(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -431,6 +437,23 @@ public class ParallelExecutionUtils {
|
||||
return hasDeparInPreviousCon;
|
||||
}
|
||||
|
||||
public static boolean isExistParallelCon(Node startNode) {
|
||||
boolean existPartitioningCon = false;
|
||||
for (IConnection con : startNode.getOutgoingConnections()) {
|
||||
if ((con.getElementParameter(EParameterName.PARTITIONER.getName()) != null && con
|
||||
.getElementParameter(EParameterName.PARTITIONER.getName()).getValue().equals(true))) {
|
||||
existPartitioningCon = true;
|
||||
break;
|
||||
} else {
|
||||
existPartitioningCon = isExistParallelCon((Node) con.getTarget());
|
||||
if (existPartitioningCon) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return existPartitioningCon;
|
||||
}
|
||||
|
||||
public static boolean isExistPartitioningCon(Node startNode) {
|
||||
boolean existPartitioningCon = false;
|
||||
for (IConnection con : startNode.getOutgoingConnections()) {
|
||||
@@ -504,4 +527,71 @@ public class ParallelExecutionUtils {
|
||||
target.sortCustomColumns();
|
||||
target.setLabel(source.getLabel());
|
||||
}
|
||||
|
||||
public static void setMergeSortByConditions(IConnection currentReparCon) {
|
||||
if (currentReparCon.getSource().getComponent().getName().equals(SPECIAL_SORT_COMPONENT)) {
|
||||
currentReparCon.getElementParameter(MERGE_SORT).setValue(true);
|
||||
} else {
|
||||
Node previousSortNode = ParallelExecutionUtils.getFirstPreviousSortNode(currentReparCon.getSource());
|
||||
for (IConnection outConOfSort : previousSortNode.getOutgoingConnections()) {
|
||||
if ((Boolean) outConOfSort.getPropertyValue(EParameterName.PARTITIONER.getName())
|
||||
|| (Boolean) outConOfSort.getPropertyValue(EParameterName.REPARTITIONER.getName())) {
|
||||
if ((Boolean) outConOfSort.getElementParameter(MERGE_SORT).getValue()) {
|
||||
currentReparCon.getElementParameter(MERGE_SORT).setValue(false);
|
||||
} else {
|
||||
currentReparCon.getElementParameter(MERGE_SORT).setValue(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static IConnection getPreviousMainCon(Node previousNode) {
|
||||
for (IConnection con : previousNode.getIncomingConnections()) {
|
||||
if (con.getLineStyle().equals(EConnectionType.FLOW_MAIN)) {
|
||||
return con;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static IConnection getFirstPreviousParCon(Node previousNode) {
|
||||
for (IConnection con : previousNode.getIncomingConnections()) {
|
||||
if ((con.getElementParameter(EParameterName.PARTITIONER.getName()) != null && con
|
||||
.getElementParameter(EParameterName.PARTITIONER.getName()).getValue().equals(true))
|
||||
|| (con.getElementParameter(EParameterName.REPARTITIONER.getName()) != null && con
|
||||
.getElementParameter(EParameterName.REPARTITIONER.getName()).getValue().equals(true))) {
|
||||
return con;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Node getFirstPreviousSortNode(INode previousNode) {
|
||||
for (IConnection con : previousNode.getIncomingConnections()) {
|
||||
if (con.getSource().getComponent().getName().equals(SPECIAL_SORT_COMPONENT)) {
|
||||
if (con.getLineStyle().equals(EConnectionType.FLOW_MAIN)) {
|
||||
return (Node) con.getSource();
|
||||
}
|
||||
} else {
|
||||
return getFirstPreviousSortNode(con.getSource());
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static IConnection getRepeatMergeSortCon(IConnection currentConn) {
|
||||
Node previousSortNode = ParallelExecutionUtils.getFirstPreviousSortNode(currentConn.getSource());
|
||||
if (previousSortNode != null) {
|
||||
for (IConnection outConOfSort : previousSortNode.getOutgoingConnections()) {
|
||||
if (outConOfSort.getElementParameter(EParameterName.PARTITIONER.getName()).getValue().equals(true)
|
||||
|| outConOfSort.getElementParameter(EParameterName.REPARTITIONER.getName()).getValue().equals(true)) {
|
||||
if ((Boolean) outConOfSort.getElementParameter(MERGE_SORT).getValue()) {
|
||||
return outConOfSort;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1058,6 +1058,9 @@ public class RunProcessContext {
|
||||
}
|
||||
|
||||
private void processPerformances(final String data, final PerformanceData perfData, final IConnection conn) {
|
||||
if (conn == null) {
|
||||
return;
|
||||
}
|
||||
processPerformanceForConnection(data, perfData, conn);
|
||||
String uniqueName = ConnectionUtil.getConnectionUnifiedName(conn);
|
||||
IConnection[] shadowConnections = traceConnectionsManager.getShadowConnenctions(uniqueName);
|
||||
|
||||
@@ -18,7 +18,7 @@ public class XmlMapExpressionManager {
|
||||
|
||||
private final static String EXPRESSION_PATTERN = "(\\[)\\s*(\\w+)\\s*\\.(\\w+\\s*:\\s*(/.+?)+(/@.+?)*)\\s*(\\])|((?!\\[)\\s*\\w+)\\s*\\.\\s*(\\w+(?!\\]))";
|
||||
|
||||
private final String SUBS_PATTERN_FOR_REPLACE_LOCATION = "{0}(\\s*){1}(\\s*)\\.(\\s*){2}(\\s*){3}";
|
||||
private final String SUBS_PATTERN_FOR_REPLACE_LOCATION = "{0}(\\s*\\b){1}(\\s*)\\.(\\s*){2}(\\b\\s*){3}";
|
||||
|
||||
private Perl5Matcher matcher = new Perl5Matcher();
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
source.. = src/
|
||||
output.. = bin/
|
||||
bin.includes = META-INF/,\
|
||||
.,\
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
source.. = src/
|
||||
output.. = bin/
|
||||
bin.includes = META-INF/,\
|
||||
.,\
|
||||
|
||||
Binary file not shown.
@@ -495,6 +495,10 @@ LoginComposite.buttons.changeButton=Change
|
||||
LoginComposite.label.workspace=Workspace
|
||||
LoginComposite.NewCreate=Create...
|
||||
LoginComposite.NewImport=Import...
|
||||
LoginComposite.updateArchiva=Update is required,please click the button to update.
|
||||
LoginComposite.archivaFailed=Update site does not work.
|
||||
LoginComposite.archivaFinish=Update finished,need to restart.
|
||||
LoginComposite.archivaJarLost=The javax.ws.rs-api-2.0-m10.jar is required to use the Update Site functionality.
|
||||
TOSLoginComposite.welcomeTitle=Welcome to {0}.Please select an existing \nproject to start work,or create a new one.
|
||||
TOSLoginComposite.projectLabel=Project:
|
||||
TOSLoginComposite.openButton=Open
|
||||
|
||||
@@ -30,6 +30,7 @@ import org.eclipse.core.runtime.Platform;
|
||||
import org.eclipse.core.runtime.jobs.IJobChangeEvent;
|
||||
import org.eclipse.core.runtime.jobs.Job;
|
||||
import org.eclipse.core.runtime.jobs.JobChangeAdapter;
|
||||
import org.eclipse.jface.dialogs.IDialogConstants;
|
||||
import org.eclipse.jface.dialogs.MessageDialog;
|
||||
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
|
||||
import org.eclipse.jface.operation.IRunnableWithProgress;
|
||||
@@ -80,6 +81,7 @@ import org.osgi.service.prefs.BackingStoreException;
|
||||
import org.talend.commons.exception.BusinessException;
|
||||
import org.talend.commons.exception.LoginException;
|
||||
import org.talend.commons.exception.PersistenceException;
|
||||
import org.talend.commons.exception.SystemException;
|
||||
import org.talend.commons.exception.WarningException;
|
||||
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
|
||||
import org.talend.commons.ui.runtime.exception.MessageBoxExceptionHandler;
|
||||
@@ -295,6 +297,8 @@ public class LoginComposite extends Composite {
|
||||
|
||||
private static Logger log = Logger.getLogger(LoginComposite.class);
|
||||
|
||||
private String archivaErrorMsg = "";
|
||||
|
||||
/**
|
||||
* Constructs a new LoginComposite.
|
||||
*
|
||||
@@ -374,6 +378,40 @@ public class LoginComposite extends Composite {
|
||||
}
|
||||
}
|
||||
|
||||
private void updateArchivaErrorButton() {
|
||||
iconLabel.setImage(LOGIN_WARNING_IMAGE);
|
||||
onIconLabel.setImage(LOGIN_WARNING_IMAGE);
|
||||
colorComposite.setBackground(YELLOW_COLOR);
|
||||
onIconLabel.setBackground(colorComposite.getBackground());
|
||||
statusLabel.setText(Messages.getString("LoginComposite.archivaFailed")); //$NON-NLS-1$ //, the third party jar is required,please install it.
|
||||
statusLabel.setBackground(YELLOW_COLOR);
|
||||
statusLabel.setForeground(WHITE_COLOR);
|
||||
Font font = new Font(null, LoginComposite.FONT_ARIAL, 9, SWT.BOLD);// Arial courier
|
||||
statusLabel.setFont(font);
|
||||
openProjectBtn.setEnabled(true);
|
||||
updateBtn.setVisible(true);
|
||||
updateBtn.setEnabled(true);
|
||||
updateBtn.setText("Details");
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for archivaErrorMsg.
|
||||
*
|
||||
* @return the archivaErrorMsg
|
||||
*/
|
||||
public String getArchivaErrorMsg() {
|
||||
return this.archivaErrorMsg;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the archivaErrorMsg.
|
||||
*
|
||||
* @param archivaErrorMsg the archivaErrorMsg to set
|
||||
*/
|
||||
public void setArchivaErrorMsg(String archivaErrorMsg) {
|
||||
this.archivaErrorMsg = archivaErrorMsg;
|
||||
}
|
||||
|
||||
private void initConnection() {
|
||||
if (storedConnections == null || storedConnections.size() == 0) {
|
||||
getConnection();
|
||||
@@ -1061,7 +1099,6 @@ public class LoginComposite extends Composite {
|
||||
updateBtnformData.right = new FormAttachment(restartBut, -5);
|
||||
updateBtnformData.bottom = new FormAttachment(100, 0);
|
||||
updateBtn.setLayoutData(updateBtnformData);// new GridData(GridData.FILL_HORIZONTAL)
|
||||
|
||||
}
|
||||
|
||||
private void createTisRepositoryArea(Composite parent) {
|
||||
@@ -1714,36 +1751,57 @@ public class LoginComposite extends Composite {
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
// install and update all patches;
|
||||
try {
|
||||
ICoreTisService tisService = (ICoreTisService) GlobalServiceRegister.getDefault().getService(
|
||||
ICoreTisService.class);
|
||||
afterUpdate = false;
|
||||
if (tisService != null) {
|
||||
JSONObject archivaProperties = getArchivaServicesProperties(getAdminURL());
|
||||
String archivaServicesURL = archivaProperties.getString(ARCHIVA_SERVICES_URL_KEY)
|
||||
+ ARCHIVA_SERVICES_SEGMENT;
|
||||
String repository = archivaProperties.getString(ARCHIVA_REPOSITORY_KEY);
|
||||
String username = archivaProperties.getString(ARCHIVA_USER);
|
||||
String password = archivaProperties.getString(ARCHIVA_USER_PWD);
|
||||
List<String> repositories = new ArrayList<String>();
|
||||
// if no repository return,just use a empty repositories array
|
||||
if (repository != null) {
|
||||
repositories.add(repository);
|
||||
if (updateBtn.getText().equals("update")) {
|
||||
ICoreTisService tisService = (ICoreTisService) GlobalServiceRegister.getDefault().getService(
|
||||
ICoreTisService.class);
|
||||
afterUpdate = false;
|
||||
if (tisService != null) {
|
||||
JSONObject archivaProperties = getArchivaServicesProperties(getAdminURL());
|
||||
String archivaServicesURL = archivaProperties.getString(ARCHIVA_SERVICES_URL_KEY)
|
||||
+ ARCHIVA_SERVICES_SEGMENT;
|
||||
String repository = archivaProperties.getString(ARCHIVA_REPOSITORY_KEY);
|
||||
String username = archivaProperties.getString(ARCHIVA_USER);
|
||||
String password = archivaProperties.getString(ARCHIVA_USER_PWD);
|
||||
List<String> repositories = new ArrayList<String>();
|
||||
// if no repository return,just use a empty repositories array
|
||||
if (repository != null) {
|
||||
repositories.add(repository);
|
||||
}
|
||||
tisService.downLoadAndInstallUpdateSites(archivaServicesURL, username, password, updateSiteToInstall,
|
||||
repositories);
|
||||
afterUpdate = true;
|
||||
tisService.setNeedResartAfterUpdate(afterUpdate);
|
||||
updateSiteToInstall.clear();
|
||||
}
|
||||
tisService.downLoadAndInstallUpdateSites(archivaServicesURL, username, password, updateSiteToInstall,
|
||||
repositories);
|
||||
afterUpdate = true;
|
||||
tisService.setNeedResartAfterUpdate(afterUpdate);
|
||||
updateSiteToInstall.clear();
|
||||
// need to relauch the studio automaticlly after updating
|
||||
isRestart = true;
|
||||
perReader.saveLastConnectionBean(getConnection());
|
||||
dialog.okPressed();
|
||||
} else {
|
||||
String[] buttons = new String[] { IDialogConstants.OK_LABEL };
|
||||
String message = Messages.getString("LoginComposite.archivaJarLost");
|
||||
ArchivaErrorDialog archivaDialog = new ArchivaErrorDialog(getShell(), "Warning", null, message,
|
||||
MessageDialog.WARNING, buttons, 0);
|
||||
archivaDialog.open();
|
||||
}
|
||||
// need to relauch the studio automaticlly after updating
|
||||
isRestart = true;
|
||||
perReader.saveLastConnectionBean(getConnection());
|
||||
dialog.okPressed();
|
||||
} catch (Exception e1) {
|
||||
ExceptionHandler.process(e1);
|
||||
}
|
||||
}
|
||||
});
|
||||
// archivaErrorButton.addSelectionListener(new SelectionAdapter() {
|
||||
//
|
||||
// @Override
|
||||
// public void widgetSelected(SelectionEvent e) {
|
||||
// String[] buttons = new String[] { IDialogConstants.OK_LABEL };
|
||||
// String message = "The javax.ws.rs-api-2.0-m10.jar is required to use the Update Site functionality.";
|
||||
// ArchivaErrorDialog archivaDialog = new ArchivaErrorDialog(getShell(), "Warning", LOGIN_CORRECT_IMAGE,
|
||||
// message,
|
||||
// HORIZONTAL_SPACE, buttons, HORIZONTAL_FOUR_SPACE);
|
||||
//
|
||||
// archivaDialog.open();
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
private void validateUpdate() throws JSONException {
|
||||
@@ -1785,7 +1843,7 @@ public class LoginComposite extends Composite {
|
||||
onIconLabel.setImage(LOGIN_CRITICAL_IMAGE);
|
||||
colorComposite.setBackground(RED_COLOR);
|
||||
onIconLabel.setBackground(colorComposite.getBackground());
|
||||
statusLabel.setText("Update finished,need to restart"); //$NON-NLS-1$
|
||||
statusLabel.setText(Messages.getString("LoginComposite.archivaFinish")); //$NON-NLS-1$
|
||||
statusLabel.setBackground(RED_COLOR);
|
||||
statusLabel.setForeground(WHITE_COLOR);
|
||||
Font font = new Font(null, LoginComposite.FONT_ARIAL, 9, SWT.BOLD);// Arial courier
|
||||
@@ -1800,7 +1858,7 @@ public class LoginComposite extends Composite {
|
||||
onIconLabel.setImage(LOGIN_CRITICAL_IMAGE);
|
||||
colorComposite.setBackground(RED_COLOR);
|
||||
onIconLabel.setBackground(colorComposite.getBackground());
|
||||
statusLabel.setText("Update is required,please click the button to update"); //$NON-NLS-1$
|
||||
statusLabel.setText(Messages.getString("LoginComposite.updateArchiva")); //$NON-NLS-1$
|
||||
statusLabel.setBackground(RED_COLOR);
|
||||
statusLabel.setForeground(WHITE_COLOR);
|
||||
Font font = new Font(null, LoginComposite.FONT_ARIAL, 9, SWT.BOLD);// Arial courier
|
||||
@@ -1808,18 +1866,21 @@ public class LoginComposite extends Composite {
|
||||
openProjectBtn.setEnabled(!needUpdate);
|
||||
updateBtn.setVisible(needUpdate);
|
||||
updateBtn.setEnabled(needUpdate);
|
||||
updateBtn.setText("update");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
updateBtn.setVisible(false);
|
||||
updateBtn.setEnabled(false);
|
||||
|
||||
}
|
||||
} catch (PersistenceException e) {
|
||||
ExceptionHandler.process(e);
|
||||
} catch (LoginException e) {
|
||||
ExceptionHandler.process(e);
|
||||
} catch (SystemException e) {
|
||||
updateArchivaErrorButton();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private String getAdminURL() {
|
||||
@@ -1847,7 +1908,8 @@ public class LoginComposite extends Composite {
|
||||
}
|
||||
|
||||
// method need update is used to control the status of updateBtn
|
||||
private boolean needUpdate(String username, String password, String archivaURL, List<String> repositories) {
|
||||
private boolean needUpdate(String username, String password, String archivaURL, List<String> repositories)
|
||||
throws SystemException {
|
||||
|
||||
ICoreTisService tisService = (ICoreTisService) GlobalServiceRegister.getDefault().getService(ICoreTisService.class);
|
||||
if (tisService != null) {
|
||||
@@ -2703,4 +2765,44 @@ public class LoginComposite extends Composite {
|
||||
}
|
||||
return fontsize;
|
||||
}
|
||||
|
||||
private static class ArchivaErrorDialog extends MessageDialog {
|
||||
|
||||
public ArchivaErrorDialog(Shell parentShell, String dialogTitle, Image dialogTitleImage, String dialogMessage,
|
||||
int dialogImageType, String[] dialogButtonLabels, int defaultIndex) {
|
||||
super(parentShell, dialogTitle, dialogTitleImage, dialogMessage, dialogImageType, dialogButtonLabels, defaultIndex);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Composite createCustomArea(Composite parent) {
|
||||
Composite helpComposite = new Composite(parent, SWT.NONE);
|
||||
GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
|
||||
gridData.minimumHeight = 45;
|
||||
helpComposite.setLayoutData(gridData);
|
||||
GC gc = new GC(helpComposite);
|
||||
String linkLabel = "How to install a jar"; //$NON-NLS-1$
|
||||
Point linkSize = gc.stringExtent(linkLabel);
|
||||
Font font = new Font(null, LoginComposite.FONT_ARIAL, 9, SWT.NORMAL);
|
||||
Hyperlink link = new Hyperlink(helpComposite, SWT.NONE);
|
||||
link.setText(linkLabel);
|
||||
link.setSize(linkSize.x + 15, 30);
|
||||
link.setBackground(helpComposite.getBackground());
|
||||
link.setUnderlined(true);
|
||||
link.setFont(font);
|
||||
|
||||
GridData gridData1 = new GridData(SWT.FILL, SWT.CENTER, true, false);
|
||||
gridData1.widthHint = this.getMinimumMessageWidth();
|
||||
link.setLayoutData(gridData1);
|
||||
gc.dispose();
|
||||
link.addHyperlinkListener(new HyperlinkAdapter() {
|
||||
|
||||
@Override
|
||||
public void linkActivated(HyperlinkEvent e) {
|
||||
String url = "https://help.talend.com/pages/viewpage.action?pageId=14230347";
|
||||
TalendBrowserLaunchHelper.openURL(url);
|
||||
}
|
||||
});
|
||||
return helpComposite;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,10 +33,12 @@ import org.talend.sqlbuilder.sessiontree.model.SessionTreeNode;
|
||||
*/
|
||||
public class ColumnInfoTab extends AbstractDataSetTab {
|
||||
|
||||
@Override
|
||||
public String getLabelText() {
|
||||
return Messages.getString("DatabaseDetailView.Tab.ColumnInfo"); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataSet getDataSet() throws Exception {
|
||||
|
||||
INode node = getNode();
|
||||
@@ -67,8 +69,14 @@ public class ColumnInfoTab extends AbstractDataSetTab {
|
||||
.getColumns(ti.getCatalogName(), ti.getSchemaName(), realTableName, "%"); //$NON-NLS-1$
|
||||
|
||||
} else {
|
||||
|
||||
resultSet = node.getSession().getMetaData().getColumns(tableNode.getTableInfo());
|
||||
// https://jira.talendforge.org/browse/TDI-28578
|
||||
String tableName = ti.getSimpleName();
|
||||
if (tableName.contains("/")) {
|
||||
tableName = tableName.replaceAll("/", "//");
|
||||
}
|
||||
resultSet = node.getSession().getMetaData().getJDBCMetaData()
|
||||
.getColumns(ti.getCatalogName(), ti.getSchemaName(), tableName, "%");
|
||||
// resultSet = node.getSession().getMetaData().getColumns(tableNode.getTableInfo());
|
||||
}
|
||||
|
||||
DataSet dataSet = new DataSet(null, resultSet, new int[] { 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 });
|
||||
@@ -79,6 +87,7 @@ public class ColumnInfoTab extends AbstractDataSetTab {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getStatusMessage() {
|
||||
return Messages.getString("DatabaseDetailView.Tab.ColumnInfo.status", getNode().getQualifiedName()); //$NON-NLS-1$
|
||||
}
|
||||
@@ -107,4 +116,4 @@ public class ColumnInfoTab extends AbstractDataSetTab {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user