Compare commits

...

20 Commits

Author SHA1 Message Date
wang wei
8dfe58aab7 TPS-1063: [5.4.1] Access to SFDC after they replace https certificates
(TDI-31716)
https://jira.talendforge.org/browse/TPS-1063
2015-08-24 16:00:58 +08:00
xhkong
a6bd49a36d TDI-33278 Column length should be visible when length value is
zero
https://jira.talendforge.org/browse/TDI-33278
(fix the cell null → 0 & 0 → null)
2015-07-31 12:01:12 +08:00
xhkong
8de5f36ad1 Revert "TDI-33278 Column length should be visible when length value is zero https://jira.talendforge.org/browse/TDI-33278 (fix the cell null → 0 & 0 → null)"
This reverts commit ba91ce0970.
2015-07-31 11:41:38 +08:00
xhkong
ba91ce0970 TDI-33278 Column length should be visible when length value is
zero
https://jira.talendforge.org/browse/TDI-33278
(fix the cell null → 0 & 0 → null)
2015-07-31 01:13:49 +08:00
iwangtalend
2cbba78fc4 TUP-1835 : Studio build properties : remove all references to empty folders 2015-07-17 17:09:44 +02:00
iwangtalend
7588e0eb6f TUP-1835 : Studio build properties : remove all references to empty folders 2015-07-17 17:08:00 +02:00
cmeng-talend
be4544d403 TUP-2850 fix bug : Classes found by searching for references open as
editable even though they aren't locked
https://jira.talendforge.org/browse/TUP-2850
2015-05-14 15:30:09 +08:00
xhkong
39cd9e073e fix bug TUP-2694 Sometimes it's impossible to save the routines
https://jira.talendforge.org/browse/TUP-2694
2015-04-13 11:18:01 +08:00
cmeng-talend
227eba73c1 TDI-31531 fix bug: Bug with txmlmap used in a joblet
https://jira.talendforge.org/browse/TDI-31531
2014-12-26 18:20:55 +08:00
Wu Liu
7d73437198 TDI-31013 : tRecollector gives code error when using parrelization
https://jira.talendforge.org/browse/TDI-31013
tSortRow doesn't work well in partition with "sort on disk" is enabled.
2014-12-04 16:42:24 +08:00
ldong-talend
1d38839f7d commited by ldong for TPS-771:tRecollector gives code error when using
parrelization.
2014-11-28 13:43:24 +08:00
cmeng-talend
ab1cf73d97 TPS-725 : [5.4.1] Unable to retrieve salesforce modules from Salesforce
metadata connection(TDI-30366)
https://jira.talendforge.org/browse/TPS-725
2014-10-09 11:37:09 +08:00
zwzhao-talend
4765c0b7a4 TPS-579 : [5.4.1]Problems when importing jobs on new TISTE 5.4.1
(TDI-28618)
2014-08-01 11:13:38 +08:00
Sébastien Gandon
d9e0eba817 TPS-621 : [5.4.1] CDC component: Conversion into short table names in GUI (TDI-29052) 2014-06-22 14:47:07 +02:00
Sébastien Gandon
6d9b77be9b Commited by ldong for Patch TPS-578:[5.4.1]Impossible to use Update site / archiva system(TUP-1645). 2014-06-22 14:47:07 +02:00
Sébastien Gandon
3c4852a3bc Commited by ldong for bug TPS-579:[5.4.1]Problems when importing jobs on new TISTE 5.4.1 (TDI-28618). 2014-06-22 14:47:06 +02:00
Sébastien Gandon
4009192f85 Fixed the NPE for TDI-28332. 2014-06-22 14:47:06 +02:00
Sébastien Gandon
991649b01f Committed by hcyi for Patch TPS-580 : [5.4.1] Metadata wizard doesn't display tables starting with '/' (TDI-28578). 2014-06-22 14:47:06 +02:00
Sébastien Gandon
40328be34c bug TDI-28435 fixed : Generation fails after generate another project's job with the same name routines. 2014-06-22 14:47:06 +02:00
Sébastien Gandon
5eed1e6ccb Committed by wchen for bug TPS-559 :[5.4.1] Unable to open a 5.2.2 DI job in the 5.4.1 TUP studio -- Wrong connection unique name (TDI-28537). 2014-06-22 14:47:06 +02:00
41 changed files with 753 additions and 197 deletions

View File

@@ -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 {

View File

@@ -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>
<!-- #################################################### -->

View File

@@ -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,

View File

@@ -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;

View File

@@ -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%>);

View File

@@ -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>

View File

@@ -28,3 +28,5 @@ TIMEOUT.NAME=Timeout(milliseconds)
CLIENT_ID.NAME=Client ID
HTTP_TRACEMESSAGE.NAME=Output Http Trace Message
USE_HTTP_CHUNKED.NAME=Use Http Chunked

View File

@@ -153,6 +153,13 @@ 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%>);

View File

@@ -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>

View File

@@ -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

View File

@@ -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%>);

View File

@@ -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>

View File

@@ -33,3 +33,5 @@ OAUTH_CLIENT_SECRET.NAME=Consumer Secret
OAUTH_CALLBACK_HOST.NAME=CallBack Host
OAUTH_CALLBACK_PORT.NAME=CallBack Port
OAUTH_TOKEN_FILE.NAME=Token File
USE_HTTP_CHUNKED.NAME=Use Http Chunked

View File

@@ -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%>);

View File

@@ -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>

View File

@@ -182,3 +182,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

View File

@@ -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;

View File

@@ -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>

View File

@@ -201,3 +201,5 @@ TIMEOUT.NAME=Timeout(milliseconds)
QUERY_ALL.NAME=Query all records(include deleted records)
CLIENT_ID.NAME=Client ID
USE_HTTP_CHUNKED.NAME=Use Http Chunked

View File

@@ -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%>);

View File

@@ -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>

View File

@@ -194,3 +194,5 @@ OAUTH_CLIENT_SECRET.NAME=Consumer Secret
OAUTH_CALLBACK_HOST.NAME=CallBack Host
OAUTH_CALLBACK_PORT.NAME=CallBack Port
OAUTH_TOKEN_FILE.NAME=Token File
USE_HTTP_CHUNKED.NAME=Use Http Chunked

View File

@@ -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("");
<%

View File

@@ -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"/>

View File

@@ -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

View File

@@ -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,15 +137,11 @@ 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);
}
} else {
metaCol.setLength(null);
}
if (colType.getOriginalLength() >= 0) {
metaCol.setOriginalLength(new Integer(colType.getOriginalLength()));
@@ -161,15 +157,11 @@ public class MetadataEmfFactory {
}
}
metaCol.setLabel(colType.getName());
if (colType.isSetPrecision()) {
if (colType.getPrecision() >= 0) {
metaCol.setPrecision(new Integer(colType.getPrecision()));
} else {
metaCol.setPrecision(null);
}
} else {
metaCol.setPrecision(null);
}
metaCol.setTalendType(colType.getType());
metaCol.setType(colType.getSourceType());
metaCol.setPattern(colType.getPattern());

View File

@@ -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 {
private void refreshJobAndSave(final IProxyRepositoryFactory repFactory) throws PersistenceException {
// try {
// cause it to update MaxInformationLevel
repFactory.save(item);
} catch (Exception e) {
}
// } catch (Exception e) {
// }
// update editor image
setTitleImage(getTitleImage());

View File

@@ -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;
}
}

View File

@@ -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());

View File

@@ -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) {
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());

View File

@@ -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()) {
if (!lineStyle.equals(EConnectionType.FLOW_MERGE)) {
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);
// set the keys for hash keys
ParallelExecutionUtils.setHashKeysFromTarget(con, (Node) con.getTarget());
setParallelization(con.getTarget());
if (isExistParalInSubjob(existParallelMap, node) && !isStartRow
&& isComponentNeedRepartion(con, (Node) con.getTarget())) {
setRepartioner(con);
} else {
// when pervious con is par/repar/none,keep current is none
if (isExistParallel
if (isExistParalInSubjob(existParallelMap, node)
&& (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());
setNone(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;
} 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()) {
if (isExistParallel && !ParallelExecutionUtils.existPreviousDepar((Node) con.getSource())) {
setDeparallelization(con.getTarget());
setDepartioner(con);
}
}
}
// }
} else {
node = con.getTarget();
setParallelization(node);
setParallelization(con.getTarget());
}
} else {
// 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);
}
}
}
}

View File

@@ -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,11 +3246,17 @@ 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);
if (fireUpdate) {
fireStructureChange(NEED_UPDATE_JOB, elem);
}
}
public void addNote(Note note) {
addNote(note, true);
}
public void removeNote(Note note) {
elem.remove(note);

View File

@@ -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;
}
}

View File

@@ -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);

View File

@@ -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();

View File

@@ -1,4 +1,3 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\

View File

@@ -1,4 +1,3 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\

View File

@@ -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

View File

@@ -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,6 +1751,7 @@ public class LoginComposite extends Composite {
public void widgetSelected(SelectionEvent e) {
// install and update all patches;
try {
if (updateBtn.getText().equals("update")) {
ICoreTisService tisService = (ICoreTisService) GlobalServiceRegister.getDefault().getService(
ICoreTisService.class);
afterUpdate = false;
@@ -1739,11 +1777,31 @@ public class LoginComposite extends Composite {
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();
}
} 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;
}
}
}

View File

@@ -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$
}