Compare commits
2 Commits
azure_patc
...
dgrygorenk
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
773f84278a | ||
|
|
f29408b841 |
66
PATCH_RELEASE_NOTE.md
Normal file
66
PATCH_RELEASE_NOTE.md
Normal file
@@ -0,0 +1,66 @@
|
||||
---
|
||||
version: 7.2.1
|
||||
module: https://talend.poolparty.biz/coretaxonomy/42
|
||||
product:
|
||||
- https://talend.poolparty.biz/coretaxonomy/23
|
||||
---
|
||||
|
||||
# TPS-4053
|
||||
|
||||
| Info | Value |
|
||||
| ---------------- | ---------------- |
|
||||
| Patch Name | Patch\_20200514\_TPS-4053\_v1-7.2.1 |
|
||||
| Release Date | 2020-05-14 |
|
||||
| Target Version | 20190620\_1446-V7.2.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 fixes:
|
||||
|
||||
- TPS-4053 [7.2.1] Unable to execute the job, receiving "Failed to generate code." when using tAmazonRedshiftManage component.(TDI-44070)
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Consider the following requirements for your system:
|
||||
|
||||
- Talend Studio 7.2.1 must be installed.
|
||||
|
||||
## Installation
|
||||
|
||||
### Installing the patch using Software update
|
||||
|
||||
1) Logon TAC and switch to Configuration->Software Update, then enter the correct values and save referring to the documentation: https://help.talend.com/reader/f7Em9WV_cPm2RRywucSN0Q/j9x5iXV~vyxMlUafnDejaQ
|
||||
|
||||
2) Switch to Software update page, where the new patch will be listed. The patch can be downloaded from here into the nexus repository.
|
||||
|
||||
3) On Studio Side: Logon Studio with remote mode, on the logon page the Update button is displayed: click this button to install the patch.
|
||||
|
||||
### Installing the patch using Talend Studio
|
||||
|
||||
1) Create a folder named "patches" under your studio installer directory and copy the patch .zip file to this folder.
|
||||
|
||||
2) Restart your studio: a window pops up, then click OK to install the patch, or restart the commandline and the patch will be installed automatically.
|
||||
|
||||
### Installing the patch using Commandline
|
||||
|
||||
Execute the following commands:
|
||||
|
||||
1. Talend-Studio-win-x86_64.exe -nosplash -application org.talend.commandline.CommandLine -consoleLog -data commandline-workspace startServer -p 8002 --talendDebug
|
||||
2. initRemote {tac_url} -ul {TAC login username} -up {TAC login password}
|
||||
3. checkAndUpdate -tu {TAC login username} -tup {TAC login password}
|
||||
|
||||
## Uninstallation
|
||||
Backup the Affected files list below. Uninstall the patch by restore the backup files.
|
||||
|
||||
## Affected files for this patch
|
||||
|
||||
The following files are installed by this patch:
|
||||
|
||||
- {Talend\_Studio\_path}/plugins/org.talend.designer.components.localprovider\_7.2.1.20190614\_0309/components/tAmazonRedshiftManage/tAmazonRedshiftManage\_begin.javajet
|
||||
@@ -24,6 +24,9 @@
|
||||
String user = ElementParameterParser.getValue(node, "__USER__");
|
||||
String node_type = ElementParameterParser.getValue(node, "__NODE_TYPE__");
|
||||
String node_count = ElementParameterParser.getValue(node, "__NODE_COUNT__");
|
||||
if (node_count.isEmpty()) {
|
||||
node_count = "1";
|
||||
}
|
||||
|
||||
boolean isLog4jEnabled = "true".equals(ElementParameterParser.getValue(node.getProcess(), "__LOG4J_ACTIVATE__"));
|
||||
|
||||
@@ -88,52 +91,46 @@
|
||||
.withMasterUsername(<%=user%>)
|
||||
.withMasterUserPassword(decryptedPwd_<%=cid%>)
|
||||
|
||||
.withNodeType(<%=node_type%>)
|
||||
.withNodeType(<%=node_type%>);
|
||||
|
||||
<%
|
||||
if(new Integer(node_count) > 1){
|
||||
%>
|
||||
.withNumberOfNodes(<%=node_count%>)
|
||||
<%
|
||||
} else {
|
||||
%>
|
||||
.withClusterType("single-node")
|
||||
<%
|
||||
}
|
||||
%>
|
||||
|
||||
//advanced settings
|
||||
<%if(parameterUtil.isValid(parameter_group_name)) {%>
|
||||
.withClusterParameterGroupName(<%=parameter_group_name%>)
|
||||
<%}%>
|
||||
|
||||
<%if(parameterUtil.isValid(subnet_group_name)) {%>
|
||||
.withClusterSubnetGroupName(<%=subnet_group_name%>)
|
||||
if (<%=node_count%> > 1) {
|
||||
request_<%=cid%> = request_<%=cid%>.withNumberOfNodes(<%=node_count%>);
|
||||
} else {
|
||||
request_<%=cid%> = request_<%=cid%>.withClusterType("single-node");
|
||||
}
|
||||
|
||||
//advanced settings
|
||||
<%if(parameterUtil.isValid(parameter_group_name)) {%>
|
||||
request_<%=cid%> = request_<%=cid%>.withClusterParameterGroupName(<%=parameter_group_name%>);
|
||||
<%}%>
|
||||
|
||||
<%if(parameterUtil.isValid(subnet_group_name)) {%>
|
||||
request_<%=cid%> = request_<%=cid%>.withClusterSubnetGroupName(<%=subnet_group_name%>);
|
||||
<%}%>
|
||||
|
||||
<%
|
||||
if(publicly_accessible) {
|
||||
%>
|
||||
request_<%=cid%> = request_<%=cid%>.withPubliclyAccessible(true);
|
||||
<%if(set_public_ip_address) {%>
|
||||
request_<%=cid%> = request_<%=cid%>.withElasticIp(<%=elastic_ip%>);
|
||||
<%}%>
|
||||
|
||||
<%
|
||||
if(publicly_accessible) {
|
||||
%>
|
||||
.withPubliclyAccessible(true)
|
||||
<%if(set_public_ip_address) {%>
|
||||
.withElasticIp(<%=elastic_ip%>)
|
||||
<%}%>
|
||||
<%
|
||||
} else {
|
||||
%>
|
||||
.withPubliclyAccessible(false)
|
||||
<%
|
||||
}
|
||||
%>
|
||||
|
||||
<%if(parameterUtil.isValid(availability_zone)) {%>
|
||||
.withAvailabilityZone(<%=availability_zone%>)
|
||||
<%}%>
|
||||
|
||||
<%if(parameterUtil.isValid(vpc_security_groupids)) {%>
|
||||
.withVpcSecurityGroupIds(<%=vpc_security_groupids%>.split(","))
|
||||
<%}%>
|
||||
;
|
||||
<%
|
||||
} else {
|
||||
%>
|
||||
request_<%=cid%> = request_<%=cid%>.withPubliclyAccessible(false);
|
||||
<%
|
||||
}
|
||||
%>
|
||||
|
||||
<%if(parameterUtil.isValid(availability_zone)) {%>
|
||||
request_<%=cid%> = request_<%=cid%>.withAvailabilityZone(<%=availability_zone%>);
|
||||
<%}%>
|
||||
|
||||
<%if(parameterUtil.isValid(vpc_security_groupids)) {%>
|
||||
request_<%=cid%> = request_<%=cid%>.withVpcSecurityGroupIds(<%=vpc_security_groupids%>.split(","));
|
||||
<%}%>
|
||||
|
||||
|
||||
com.amazonaws.services.redshift.model.Cluster result_<%=cid%> = client_<%=cid%>.createCluster(request_<%=cid%>);
|
||||
<%if(isLog4jEnabled) {%>
|
||||
|
||||
@@ -624,10 +624,8 @@ public class ChangeMetadataCommand extends Command {
|
||||
setTableMAPPING();
|
||||
|
||||
if (!internal) {
|
||||
if (!oldOutputMetadata.sameMetadataAs(newOutputMetadata, IMetadataColumn.OPTIONS_NONE)) {
|
||||
updateColumnList(oldOutputMetadata, newOutputMetadata);
|
||||
((Process) node.getProcess()).checkProcess();
|
||||
}
|
||||
updateColumnList(oldOutputMetadata, newOutputMetadata);
|
||||
((Process) node.getProcess()).checkProcess();
|
||||
}
|
||||
refreshMetadataChanged();
|
||||
}
|
||||
|
||||
@@ -123,7 +123,6 @@ import org.talend.core.model.update.IUpdateManager;
|
||||
import org.talend.core.model.utils.TalendTextUtils;
|
||||
import org.talend.core.repository.model.ProxyRepositoryFactory;
|
||||
import org.talend.core.repository.utils.ConvertJobsUtil;
|
||||
import org.talend.core.repository.utils.ProjectHelper;
|
||||
import org.talend.core.repository.utils.XmiResourceManager;
|
||||
import org.talend.core.runtime.repository.item.ItemProductKeys;
|
||||
import org.talend.core.runtime.util.ItemDateParser;
|
||||
@@ -1080,7 +1079,7 @@ public class Process extends Element implements IProcess2, IGEFProcess, ILastVer
|
||||
ElementParameterType pType;
|
||||
boolean isJoblet = false;
|
||||
if (param.getElement() instanceof INode && PluginChecker.isJobLetPluginLoaded()) {
|
||||
IJobletProviderService service = GlobalServiceRegister.getDefault().getService(
|
||||
IJobletProviderService service = (IJobletProviderService) GlobalServiceRegister.getDefault().getService(
|
||||
IJobletProviderService.class);
|
||||
if (service != null && service.isJobletComponent((INode) param.getElement())) {
|
||||
isJoblet = true;
|
||||
@@ -1921,25 +1920,12 @@ public class Process extends Element implements IProcess2, IGEFProcess, ILastVer
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
boolean isLimited = false;
|
||||
org.talend.core.model.properties.Project currProject = getProject().getEmfProject();
|
||||
org.talend.core.model.properties.Project project = ProjectManager.getInstance().getProject(this.property);
|
||||
if (currProject != null && project != null && !currProject.equals(project)) {
|
||||
int currOrdinal = ProjectHelper.getProjectTypeOrdinal(currProject);
|
||||
int ordinal = ProjectHelper.getProjectTypeOrdinal(project);
|
||||
if (currOrdinal > ordinal) {
|
||||
isLimited = true;
|
||||
}
|
||||
}
|
||||
if (!isLimited) {
|
||||
for (IRepositoryViewObject object : routines) {
|
||||
if (routinesToAdd.contains(object.getLabel()) && !routinesAlreadySetup.contains(object.getLabel())) {
|
||||
RoutinesParameterType routinesParameterType = TalendFileFactory.eINSTANCE.createRoutinesParameterType();
|
||||
routinesParameterType.setId(object.getId());
|
||||
routinesParameterType.setName(object.getLabel());
|
||||
routinesDependencies.add(routinesParameterType);
|
||||
}
|
||||
for (IRepositoryViewObject object : routines) {
|
||||
if (routinesToAdd.contains(object.getLabel()) && !routinesAlreadySetup.contains(object.getLabel())) {
|
||||
RoutinesParameterType routinesParameterType = TalendFileFactory.eINSTANCE.createRoutinesParameterType();
|
||||
routinesParameterType.setId(object.getId());
|
||||
routinesParameterType.setName(object.getLabel());
|
||||
routinesDependencies.add(routinesParameterType);
|
||||
}
|
||||
}
|
||||
} catch (PersistenceException e) {
|
||||
@@ -2297,7 +2283,7 @@ public class Process extends Element implements IProcess2, IGEFProcess, ILastVer
|
||||
if (EParameterName.PROCESS_TYPE_VERSION.name().equals(pType.getName())) {
|
||||
String jobletVersion = pType.getValue();
|
||||
if (!RelationshipItemBuilder.LATEST_VERSION.equals(jobletVersion)) {
|
||||
IJobletProviderService service = GlobalServiceRegister.getDefault()
|
||||
IJobletProviderService service = (IJobletProviderService) GlobalServiceRegister.getDefault()
|
||||
.getService(IJobletProviderService.class);
|
||||
if (service != null) {
|
||||
Property jobletProperty = service.getJobletComponentItem(component);
|
||||
@@ -2467,7 +2453,7 @@ public class Process extends Element implements IProcess2, IGEFProcess, ILastVer
|
||||
updateAllMappingTypes();
|
||||
nc.setNeedLoadLib(false);
|
||||
if (nc.isJoblet()) {
|
||||
IJobletProviderService service = GlobalServiceRegister.getDefault().getService(
|
||||
IJobletProviderService service = (IJobletProviderService) GlobalServiceRegister.getDefault().getService(
|
||||
IJobletProviderService.class);
|
||||
if (service != null) {
|
||||
// reload only for stuido ,because joblet can be changed in the job editor
|
||||
@@ -2481,7 +2467,7 @@ public class Process extends Element implements IProcess2, IGEFProcess, ILastVer
|
||||
NodeContainer nodeContainer = null;
|
||||
if (isJunitContainer) {
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(ITestContainerGEFService.class)) {
|
||||
ITestContainerGEFService testContainerService = GlobalServiceRegister.getDefault()
|
||||
ITestContainerGEFService testContainerService = (ITestContainerGEFService) GlobalServiceRegister.getDefault()
|
||||
.getService(ITestContainerGEFService.class);
|
||||
if (testContainerService != null) {
|
||||
nodeContainer = testContainerService.createJunitContainer(node);
|
||||
@@ -2683,7 +2669,7 @@ public class Process extends Element implements IProcess2, IGEFProcess, ILastVer
|
||||
}
|
||||
}
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IScdComponentService.class)) {
|
||||
IScdComponentService service = GlobalServiceRegister.getDefault().getService(
|
||||
IScdComponentService service = (IScdComponentService) GlobalServiceRegister.getDefault().getService(
|
||||
IScdComponentService.class);
|
||||
service.updateOutputMetadata(nc, metadataTable);
|
||||
}
|
||||
@@ -2810,7 +2796,7 @@ public class Process extends Element implements IProcess2, IGEFProcess, ILastVer
|
||||
}
|
||||
} else {
|
||||
if (PluginChecker.isJobLetPluginLoaded()) { // bug 12764
|
||||
IJobletProviderService service = GlobalServiceRegister.getDefault().getService(
|
||||
IJobletProviderService service = (IJobletProviderService) GlobalServiceRegister.getDefault().getService(
|
||||
IJobletProviderService.class);
|
||||
if (service != null && service.isJobletComponent(source)) {
|
||||
continue;
|
||||
@@ -4586,7 +4572,7 @@ public class Process extends Element implements IProcess2, IGEFProcess, ILastVer
|
||||
Item item = ((IProcess2) jobletProcess).getProperty().getItem();
|
||||
if (item instanceof JobletProcessItem) {
|
||||
JobletProcessItem jobletItem = ((JobletProcessItem) item);
|
||||
IJobletProviderService service = GlobalServiceRegister.getDefault().getService(
|
||||
IJobletProviderService service = (IJobletProviderService) GlobalServiceRegister.getDefault().getService(
|
||||
IJobletProviderService.class);
|
||||
if (service != null) {
|
||||
service.saveJobletNode(jobletItem, jobletContainer);
|
||||
@@ -4635,7 +4621,7 @@ public class Process extends Element implements IProcess2, IGEFProcess, ILastVer
|
||||
|
||||
IJobletProviderService jobletService = null;
|
||||
if (PluginChecker.isJobLetPluginLoaded()) {
|
||||
jobletService = GlobalServiceRegister.getDefault().getService(IJobletProviderService.class);
|
||||
jobletService = (IJobletProviderService) GlobalServiceRegister.getDefault().getService(IJobletProviderService.class);
|
||||
for (INode node : getGraphicalNodes()) {
|
||||
if (jobletService.isJobletComponent(node)) {
|
||||
listRoutines.addAll(getJobletRoutines(jobletService, node));
|
||||
|
||||
@@ -51,14 +51,6 @@
|
||||
<include>${talend.job.path}/**</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
|
||||
<fileSet><!-- add context resources -->
|
||||
<directory>${resources.path}</directory>
|
||||
<outputDirectory>${file.separator}</outputDirectory>
|
||||
<includes>
|
||||
<include>${talend.job.path}/**</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
|
||||
<fileSet> <!-- add provided-lib -->
|
||||
<directory>${current.bundle.resources.dir}/provided-lib</directory>
|
||||
|
||||
@@ -1914,42 +1914,6 @@ public class JavaProcessor extends AbstractJavaProcessor implements IJavaBreakpo
|
||||
copyEsbConfigFile(esbConfigsSourceFolder, esbConfigsTargetFolder, "oidc.properties"); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
ITalendProcessJavaProject tProcessJvaProject = this.getTalendJavaProject();
|
||||
if (tProcessJvaProject == null) {
|
||||
return;
|
||||
}
|
||||
Item item = property.getItem();
|
||||
IFolder externalResourcesFolder = tProcessJvaProject.getExternalResourcesFolder();
|
||||
IFolder resourcesFolder = tProcessJvaProject.getResourcesFolder();
|
||||
String jobClassPackageFolder = JavaResourcesHelper.getJobClassPackageFolder(item, false);
|
||||
IPath jobContextFolderPath = new Path(jobClassPackageFolder).append(JavaUtils.JAVA_CONTEXTS_DIRECTORY);
|
||||
|
||||
IFolder extResourcePath = externalResourcesFolder.getFolder(jobContextFolderPath);
|
||||
IFolder resourcesPath = resourcesFolder.getFolder(jobContextFolderPath);
|
||||
|
||||
if(!resourcesPath.exists()) {
|
||||
tProcessJvaProject.createSubFolder(null, resourcesFolder, jobContextFolderPath.toString());
|
||||
}
|
||||
|
||||
resourcesPath.refreshLocal(IResource.DEPTH_INFINITE, null);
|
||||
|
||||
for (IResource resource : extResourcePath.members()) {
|
||||
IFile context = resourcesPath.getFile(resource.getName());
|
||||
|
||||
if (context.exists()) {
|
||||
context.delete(true, null);
|
||||
}
|
||||
resource.copy(context.getFullPath(), true, null);
|
||||
}
|
||||
|
||||
resourcesPath.refreshLocal(IResource.DEPTH_INFINITE, null);
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -14,12 +14,10 @@ package org.talend.designer.runprocess.maven;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.lang.ArrayUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.resources.IFolder;
|
||||
import org.eclipse.core.resources.IResource;
|
||||
@@ -28,20 +26,15 @@ import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
import org.talend.commons.exception.ExceptionHandler;
|
||||
import org.talend.commons.exception.PersistenceException;
|
||||
import org.talend.commons.ui.runtime.CommonUIPlugin;
|
||||
import org.talend.commons.utils.generation.JavaUtils;
|
||||
import org.talend.commons.utils.resource.FileExtensions;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.IESBService;
|
||||
import org.talend.core.model.process.IProcess;
|
||||
import org.talend.core.model.process.JobInfo;
|
||||
import org.talend.core.model.process.ProcessUtils;
|
||||
import org.talend.core.model.properties.Property;
|
||||
import org.talend.core.model.repository.ERepositoryObjectType;
|
||||
import org.talend.core.model.repository.IRepositoryViewObject;
|
||||
import org.talend.core.model.utils.JavaResourcesHelper;
|
||||
import org.talend.core.repository.model.ProxyRepositoryFactory;
|
||||
import org.talend.core.repository.utils.ItemResourceUtil;
|
||||
import org.talend.core.runtime.process.ITalendProcessJavaProject;
|
||||
import org.talend.core.runtime.process.LastGenerationInfo;
|
||||
@@ -65,7 +58,6 @@ import org.talend.designer.runprocess.ProcessorException;
|
||||
import org.talend.designer.runprocess.ProcessorUtilities;
|
||||
import org.talend.designer.runprocess.java.JavaProcessor;
|
||||
import org.talend.repository.i18n.Messages;
|
||||
import org.talend.repository.model.IProxyRepositoryFactory;
|
||||
|
||||
/**
|
||||
* created by ggu on 2 Feb 2015 Detailled comment
|
||||
@@ -311,30 +303,6 @@ public class MavenJavaProcessor extends JavaProcessor {
|
||||
|
||||
buildTypeName = exportType != null ? exportType.toString() : null;
|
||||
|
||||
if (StringUtils.isBlank(buildTypeName)) {
|
||||
List<IRepositoryViewObject> serviceRepoList = null;
|
||||
|
||||
IESBService service = (IESBService) GlobalServiceRegister.getDefault().getService(IESBService.class);
|
||||
|
||||
try {
|
||||
IProxyRepositoryFactory factory = ProxyRepositoryFactory.getInstance();
|
||||
serviceRepoList = factory.getAll(ERepositoryObjectType.valueOf(ERepositoryObjectType.class, "SERVICES"));
|
||||
|
||||
for (IRepositoryViewObject serviceItem : serviceRepoList) {
|
||||
if (service != null) {
|
||||
List<String> jobIds = service.getSerivceRelatedJobIds(serviceItem.getProperty().getItem());
|
||||
if (jobIds.contains(itemProperty.getId())) {
|
||||
buildTypeName = "OSGI";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} catch (PersistenceException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, Object> parameters = new HashMap<String, Object>();
|
||||
parameters.put(IBuildParametes.ITEM, itemProperty.getItem());
|
||||
parameters.put(IBuildPomCreatorParameters.PROCESSOR, this);
|
||||
|
||||
@@ -577,11 +577,10 @@ LoginProjectPage.previous=Previous
|
||||
LoginProjectPage.finish=Finish
|
||||
LoginProjectPage.remote=Remote
|
||||
LoginProjectPage.remote.talend=Remote TAC
|
||||
LoginProjectPage.cloud.aws_us=AWS - USA East
|
||||
LoginProjectPage.cloud.aws_eu=AWS - Europe
|
||||
LoginProjectPage.cloud.aws_apac=AWS - Asia Pacific
|
||||
LoginProjectPage.cloud.usa_west=Azure - USA West
|
||||
LoginProjectPage.cloud.cloud_custom=Cloud - Custom
|
||||
LoginProjectPage.cloud.us=Cloud US
|
||||
LoginProjectPage.cloud.eu=Cloud EU
|
||||
LoginProjectPage.cloud.apac=Cloud APAC
|
||||
LoginProjectPage.cloud.custom=Cloud Custom
|
||||
LoginProjectPage.local=Local
|
||||
LoginProjectPage.restart=Restart
|
||||
LoginProjectPage.update=Update
|
||||
|
||||
@@ -241,18 +241,16 @@ public class LoginHelper {
|
||||
}
|
||||
|
||||
/**
|
||||
* if the connection is AWS – USA East/AWS – Europe/AWS – Asia Pacific/Azure – USA West/Cloud – Custom
|
||||
* if the connection is Cloud US/EU/APAC/Custom
|
||||
*
|
||||
* @param connectionBean
|
||||
* @return true if connection is USA East or AWS – Europe or AWS – Asia Pacific or Azure – USA West or Cloud –
|
||||
* Custom
|
||||
* @return true if connection is Cloud US or Cloud EU or Cloud APAC or Cloud Custom
|
||||
*/
|
||||
public static boolean isCloudConnection(ConnectionBean connectionBean) {
|
||||
if (connectionBean == null) {
|
||||
return false;
|
||||
}
|
||||
return isCloudUSConnection(connectionBean) || isCloudUSWestConnection(connectionBean)
|
||||
|| isCloudEUConnection(connectionBean) || isCloudAPACConnection(connectionBean)
|
||||
return isCloudUSConnection(connectionBean) || isCloudEUConnection(connectionBean) || isCloudAPACConnection(connectionBean)
|
||||
|| isCloudCustomConnection(connectionBean);
|
||||
}
|
||||
|
||||
@@ -277,13 +275,6 @@ public class LoginHelper {
|
||||
return RepositoryConstants.REPOSITORY_CLOUD_APAC_ID.equals(connectionBean.getRepositoryId());
|
||||
}
|
||||
|
||||
public static boolean isCloudUSWestConnection(ConnectionBean connectionBean) {
|
||||
if (connectionBean == null) {
|
||||
return false;
|
||||
}
|
||||
return RepositoryConstants.REPOSITORY_CLOUD_US_WEST_ID.equals(connectionBean.getRepositoryId());
|
||||
}
|
||||
|
||||
public static boolean isCloudCustomConnection(ConnectionBean connectionBean) {
|
||||
if (connectionBean == null) {
|
||||
return false;
|
||||
@@ -293,7 +284,7 @@ public class LoginHelper {
|
||||
|
||||
public static boolean isCloudRepository(String repositoryId) {
|
||||
return isCloudUSRepository(repositoryId) || isCloudEURepository(repositoryId) || isCloudAPACRepository(repositoryId)
|
||||
|| isCloudCustomRepository(repositoryId) || isCloudUSWestRepository(repositoryId);
|
||||
|| isCloudCustomRepository(repositoryId);
|
||||
}
|
||||
|
||||
public static boolean isCloudUSRepository(String repositoryId) {
|
||||
@@ -308,10 +299,6 @@ public class LoginHelper {
|
||||
return RepositoryConstants.REPOSITORY_CLOUD_APAC_ID.equals(repositoryId);
|
||||
}
|
||||
|
||||
public static boolean isCloudUSWestRepository(String repositoryId) {
|
||||
return RepositoryConstants.REPOSITORY_CLOUD_US_WEST_ID.equals(repositoryId);
|
||||
}
|
||||
|
||||
public static boolean isCloudCustomRepository(String repositoryId) {
|
||||
return RepositoryConstants.REPOSITORY_CLOUD_CUSTOM_ID.equals(repositoryId);
|
||||
}
|
||||
|
||||
@@ -2088,15 +2088,13 @@ public class LoginProjectPage extends AbstractLoginActionPage {
|
||||
}
|
||||
connectionName = connectionName + " (" + remoteLabel; //$NON-NLS-1$
|
||||
} else if (LoginHelper.isCloudUSConnection(prj)) {
|
||||
connectionName = connectionName + " (" + Messages.getString("LoginProjectPage.cloud.aws_us"); //$NON-NLS-1$//$NON-NLS-2$
|
||||
connectionName = connectionName + " (" + Messages.getString("LoginProjectPage.cloud.us"); //$NON-NLS-1$//$NON-NLS-2$
|
||||
} else if (LoginHelper.isCloudEUConnection(prj)) {
|
||||
connectionName = connectionName + " (" + Messages.getString("LoginProjectPage.cloud.aws_eu"); //$NON-NLS-1$//$NON-NLS-2$
|
||||
connectionName = connectionName + " (" + Messages.getString("LoginProjectPage.cloud.eu"); //$NON-NLS-1$//$NON-NLS-2$
|
||||
} else if (LoginHelper.isCloudAPACConnection(prj)) {
|
||||
connectionName = connectionName + " (" + Messages.getString("LoginProjectPage.cloud.aws_apac"); //$NON-NLS-1$//$NON-NLS-2$
|
||||
} else if (LoginHelper.isCloudUSWestConnection(prj)) {
|
||||
connectionName = connectionName + " (" + Messages.getString("LoginProjectPage.cloud.usa_west"); //$NON-NLS-1$//$NON-NLS-2$
|
||||
connectionName = connectionName + " (" + Messages.getString("LoginProjectPage.cloud.apac"); //$NON-NLS-1$//$NON-NLS-2$
|
||||
} else if (LoginHelper.isCloudCustomConnection(prj)) {
|
||||
connectionName = connectionName + " (" + Messages.getString("LoginProjectPage.cloud.cloud_custom"); //$NON-NLS-1$//$NON-NLS-2$
|
||||
connectionName = connectionName + " (" + Messages.getString("LoginProjectPage.cloud.custom"); //$NON-NLS-1$//$NON-NLS-2$
|
||||
} else {
|
||||
connectionName = connectionName + " (" + Messages.getString("LoginProjectPage.local"); //$NON-NLS-1$//$NON-NLS-2$
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ package org.talend.repository.ui.wizards.exportjob.handler;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.InputStream;
|
||||
import java.net.URL;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -35,6 +36,7 @@ import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.talend.commons.exception.ExceptionHandler;
|
||||
import org.talend.core.model.properties.ProcessItem;
|
||||
import org.talend.core.runtime.process.TalendProcessArgumentConstant;
|
||||
import org.talend.designer.maven.launch.MavenPomCommandLauncher;
|
||||
import org.talend.designer.maven.model.MavenSystemFolders;
|
||||
import org.talend.designer.maven.model.TalendMavenConstants;
|
||||
@@ -159,7 +161,7 @@ public class BuildOSGiBundleHandler extends BuildJobHandler {
|
||||
fileExtension = esbExportType;
|
||||
}
|
||||
|
||||
if (fileExtension.equals(file.getFileExtension())) {
|
||||
if (fileExtension.equals(file.getFileExtension()) && file.getName().contains("bundle")) {
|
||||
bundleFile = file;
|
||||
break;
|
||||
}
|
||||
@@ -172,7 +174,6 @@ public class BuildOSGiBundleHandler extends BuildJobHandler {
|
||||
}
|
||||
|
||||
private void setFileContent(InputStream inputStream, IFile file, IProgressMonitor monitor) throws CoreException {
|
||||
file.refreshLocal(IResource.DEPTH_ZERO, monitor);
|
||||
if (file.exists()) {
|
||||
file.setContents(inputStream, 0, monitor);
|
||||
} else {
|
||||
|
||||
@@ -26,6 +26,7 @@ import org.talend.core.runtime.repository.build.BuildExportManager;
|
||||
import org.talend.core.runtime.repository.build.IBuildExportHandler;
|
||||
import org.talend.core.runtime.repository.build.IBuildJobParameters;
|
||||
import org.talend.core.runtime.repository.build.IBuildParametes;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.NodeType;
|
||||
import org.talend.repository.constants.BuildJobConstants;
|
||||
import org.talend.repository.ui.wizards.exportjob.JavaJobScriptsExportWSWizardPage.JobExportType;
|
||||
import org.talend.repository.ui.wizards.exportjob.handler.BuildJobHandler;
|
||||
@@ -96,6 +97,16 @@ public class BuildJobFactory {
|
||||
ERepositoryObjectType repositoryObjectType = ERepositoryObjectType.getItemType(processItem);
|
||||
if (repositoryObjectType == ERepositoryObjectType.PROCESS_ROUTE && "ROUTE_MICROSERVICE".equals(type)) {
|
||||
esb = true;
|
||||
} else {
|
||||
for (Object o : ((ProcessItem) processItem).getProcess().getNode()) {
|
||||
if (o instanceof NodeType) {
|
||||
NodeType currentNode = (NodeType) o;
|
||||
if (BuildJobConstants.esbComponents.contains(currentNode.getComponentName())) {
|
||||
esb = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -769,7 +769,6 @@ public class JobJavaScriptOSGIForESBManager extends JobJavaScriptsManager {
|
||||
Manifest manifest = null;
|
||||
try {
|
||||
manifest = analyzer.calcManifest();
|
||||
filterImportPackages(manifest);
|
||||
} catch (IOException e) {
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
@@ -793,38 +792,6 @@ public class JobJavaScriptOSGIForESBManager extends JobJavaScriptsManager {
|
||||
|
||||
return manifest;
|
||||
}
|
||||
|
||||
private void filterImportPackages(Manifest manifest) {
|
||||
|
||||
// remove import packages which are present in private packages
|
||||
|
||||
List<String> privatePackages = new ArrayList<String>();
|
||||
String privatePackagesString = manifest.getMainAttributes().getValue(Analyzer.PRIVATE_PACKAGE);
|
||||
if (privatePackagesString != null) {
|
||||
String [] packages = privatePackagesString.split(",");
|
||||
for (String p : packages) {
|
||||
privatePackages.add(p);
|
||||
}
|
||||
}
|
||||
|
||||
StringBuilder fileterdImportPackage = new StringBuilder();
|
||||
String importPackagesString = manifest.getMainAttributes().getValue(Analyzer.IMPORT_PACKAGE);
|
||||
if (importPackagesString != null) {
|
||||
String [] packages = importPackagesString.split(",");
|
||||
for (String p : packages) {
|
||||
String importPackage = p.split(";")[0];
|
||||
if (!privatePackages.contains(importPackage) || importPackage.startsWith("routines")) {
|
||||
fileterdImportPackage.append(p).append(",");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
String str = fileterdImportPackage.toString();
|
||||
if (str != null && str.length() > 0 && str.endsWith(",")) {
|
||||
str = str.substring(0, str.length() - 1);
|
||||
}
|
||||
manifest.getMainAttributes().putValue(Analyzer.IMPORT_PACKAGE, str);
|
||||
}
|
||||
|
||||
protected Analyzer createAnalyzer(ExportFileResource libResource, ProcessItem processItem) throws IOException {
|
||||
Analyzer analyzer = new Analyzer();
|
||||
|
||||
@@ -12,6 +12,9 @@
|
||||
// ============================================================================
|
||||
package org.talend.repository.ui.wizards.exportjob.scriptsmanager;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.talend.commons.utils.VersionUtils;
|
||||
@@ -23,10 +26,12 @@ import org.talend.core.model.properties.PropertiesFactory;
|
||||
import org.talend.core.model.properties.Property;
|
||||
import org.talend.core.runtime.process.IBuildJobHandler;
|
||||
import org.talend.core.runtime.process.TalendProcessArgumentConstant;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.NodeType;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.ProcessType;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.TalendFileFactory;
|
||||
import org.talend.repository.ui.wizards.exportjob.JavaJobScriptsExportWSWizardPage.JobExportType;
|
||||
import org.talend.repository.ui.wizards.exportjob.handler.BuildJobHandler;
|
||||
import org.talend.repository.ui.wizards.exportjob.handler.BuildOSGiBundleHandler;
|
||||
|
||||
/**
|
||||
* DOC ggu class global comment. Detailled comment
|
||||
@@ -113,4 +118,22 @@ public class BuildJobFactoryTest {
|
||||
Assert.assertNotNull("Can't build job for standalone job", handler);
|
||||
Assert.assertEquals(BuildJobHandler.class.getName(), handler.getClass().getName());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_createBuildJobHandler_String_default_withOSGiSetting() {
|
||||
List<String> esbComponents = Arrays.asList("tRESTClient", "tRESTRequest", "tRESTResponse", "tESBConsumer",
|
||||
"tESBProviderFault", "tESBProviderRequest", "tESBProviderResponse", "tRouteInput", "tREST");
|
||||
ProcessItem processItem = createTestProcessItem();
|
||||
NodeType node = TalendFileFactory.eINSTANCE.createNodeType();
|
||||
processItem.getProcess().getNode().add(node);
|
||||
Property property = processItem.getProperty();
|
||||
property.getAdditionalProperties().put(TalendProcessArgumentConstant.ARG_BUILD_TYPE, "OSGI");
|
||||
for (String componentName : esbComponents) {
|
||||
node.setComponentName(componentName);
|
||||
IBuildJobHandler handler = BuildJobFactory.createBuildJobHandler(processItem, "Default", property.getVersion(),
|
||||
JobScriptsManagerFactory.getDefaultExportChoiceMap(), (String) null);
|
||||
Assert.assertNotNull("Can't build job for OSGI bundle", handler);
|
||||
Assert.assertEquals(BuildOSGiBundleHandler.class.getName(), handler.getClass().getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user