Compare commits

...

5 Commits

Author SHA1 Message Date
vyu-talend
661665512e chore(TPS-5418):updates release note. 2022-12-13 18:25:34 +08:00
vyu-talend
b2830b78ef fix(TPS-5418):updates file name and xml file. 2022-12-13 18:25:05 +08:00
vyu-talend
dcbc0441d3 fix(TPS-5418):updates some info. 2022-12-13 17:33:33 +08:00
jzhao-talend
a811be3329 chore(TPS-5390):add patch note 2022-12-13 17:20:42 +08:00
vyu-talend
3166b3cb77 fix(TPS-5390):add new migration task. 2022-12-13 17:20:24 +08:00
4 changed files with 160 additions and 1 deletions

48
PATCH_RELEASE_NOTE.md Normal file
View File

@@ -0,0 +1,48 @@
---
version: 8.0.1
module: https://talend.poolparty.biz/coretaxonomy/42
product:
- https://talend.poolparty.biz/coretaxonomy/183
- https://talend.poolparty.biz/coretaxonomy/23
---
# TPS-5418
| Info | Value |
| ---------------- |-------------------------------------|
| Patch Name | Patch\_20221223\_TPS-5418\_v1-8.0.1 |
| Release date | 2022-12-23 |
| Target version | 20211109\_1610-8.0.1 |
| Product affected | Talend Studio |
## Introduction
This is a self-contained patch.
**NOTE**: For information on how to obtain this patch, reach out to your Support contact at Talend.
## Fixed issues
This patch contains the following fix:
- TDI-48617 [8.0.1] tFTPConnection : Sftp issue after R2022-08 jsch-0.2.1 library ( PubkeyAcceptedKeyTypes )
## Prerequisites
Consider the following requirements for your system:
- Must install Talend Studio 8.0.1 with the monthly released patch, Patch\_20220923\_R2022-09\_v1-8.0.1.zip.
- Or must update the Talend Studio 8.0.1 with the URL, https://update.talend.com/Studio/8/updates/R2022-09/.
## Installation
Installation On Studio:
1. Shut down Talend studio if it is opened.
2. Extract the zip.
3. Merge the folder "plugins" and its content to "{studio}/plugins" and overwrite the existing files.
4. remove the folder "{studio}/configuration/org.eclipse.osgi".
5. Start the Talend studio.
6. Rebuild your jobs.

View File

@@ -3811,6 +3811,15 @@
name="tFtileInputJson convert USE_NASHORN to JDK_VERSION"
version="8.0.1">
</projecttask>
<projecttask
beforeLogon="false"
breaks="8.0.1"
class="org.talend.repository.model.migration.AddPubkeyAcceptedKeyTypesToFTP"
description="Add PubkeyAcceptedKeyTypes configuration when using sftp"
id="org.talend.repository.model.migration.AddPubkeyAcceptedKeyTypesToFTP"
name="AddPubkeyAcceptedKeyTypesToFTP"
version="8.0.1">
</projecttask>
</extension>
<extension

View File

@@ -116,4 +116,4 @@ public class AddClientParamsToFTPTDI44761 extends AbstractJobMigrationTask {
return ExecutionResult.FAILURE;
}
}
}
}

View File

@@ -0,0 +1,102 @@
package org.talend.repository.model.migration;
import java.util.*;
import org.eclipse.emf.common.util.EList;
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
import org.talend.core.language.ECodeLanguage;
import org.talend.core.model.components.ComponentUtilities;
import org.talend.core.model.components.ModifyComponentsAction;
import org.talend.core.model.components.conversions.IComponentConversion;
import org.talend.core.model.components.filters.IComponentFilter;
import org.talend.core.model.components.filters.NameComponentFilter;
import org.talend.core.model.migration.AbstractJobMigrationTask;
import org.talend.core.model.properties.Item;
import org.talend.designer.core.model.utils.emf.talendfile.*;
public class AddPubkeyAcceptedKeyTypesToFTP extends AbstractJobMigrationTask {
/*
* (non-Javadoc)
*
* @see org.talend.migration.IMigrationTask#getOrder()
*/
public Date getOrder() {
GregorianCalendar gc = new GregorianCalendar(2022, 11, 13, 17, 0, 0);
return gc.getTime();
}
/*
* (non-Javadoc)
*
* @seeorg.talend.core.model.migration.AbstractJobMigrationTask#executeOnProcess(org.talend.core.model.properties.
* ProcessItem)
*/
@Override
public ExecutionResult execute(Item item) {
ProcessType processType = getProcessType(item);
if (getProject().getLanguage() != ECodeLanguage.JAVA || processType == null) {
return ExecutionResult.NOTHING_TO_DO;
}
String[] componentsName = new String[] { "tFTPConnection","tFTPDelete","tFTPFileExist","tFTPFileList",
"tFTPFileProperties","tFTPGet","tFTPPut","tFTPRename","tFTPTruncate" };
try {
boolean modified = false;
for (int i = 0; i < componentsName.length; i++) {
IComponentFilter filter = new NameComponentFilter(componentsName[i]);
modified |= ModifyComponentsAction.searchAndModify(item, processType, filter,
Arrays.<IComponentConversion> asList(new IComponentConversion() {
public void transform(NodeType node) {
String useExistConnection = ComponentUtilities.getNodePropertyValue(node, "USE_EXISTING_CONNECTION");
boolean ifConfigClient = "true".equals(ComponentUtilities.getNodePropertyValue(node, "CONFIG_CLIENT"));
boolean useSFTP = "true".equals(ComponentUtilities.getNodePropertyValue(node, "SFTP"));
if (useSFTP && (useExistConnection == null || "false". equals(useExistConnection)) && ifConfigClient) {
final ElementParameterType client_parameters = ComponentUtilities.getNodeProperty(node, "CLIENT_PARAMETERS");
boolean ifHasKey = false;
final EList configurations = client_parameters.getElementValue();
final Iterator iterator = configurations.iterator();
while (iterator.hasNext()){
final ElementValueType next = (ElementValueType)iterator.next();
if(next.getValue().trim().equalsIgnoreCase("\"PubkeyAcceptedKeyTypes\"")){
ifHasKey = true;
}
}
if (!ifHasKey) {
TalendFileFactory fileFact = TalendFileFactory.eINSTANCE;
ElementValueType elementKey = fileFact.createElementValueType();
elementKey.setElementRef("PARAMETER"); //$NON-NLS-1$
elementKey.setValue("\"PubkeyAcceptedKeyTypes\"");
configurations.add(elementKey);
ElementValueType elementValue = fileFact.createElementValueType();
elementValue.setElementRef("VALUE"); //$NON-NLS-1$
elementValue.setValue("\"ssh-rsa\"");
configurations.add(elementValue);
ComponentUtilities.setNodeProperty(node, "CLIENT_PARAMETERS", configurations);
}
}
}
}));
}
if (modified) {
return ExecutionResult.SUCCESS_NO_ALERT;
} else {
return ExecutionResult.NOTHING_TO_DO;
}
} catch (Exception e) {
ExceptionHandler.process(e);
return ExecutionResult.FAILURE;
}
}
}