Compare commits
9 Commits
patch/TPS-
...
azure_patc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
81f603037b | ||
|
|
3c9ff7e553 | ||
|
|
6611515bd6 | ||
|
|
66dfb4f0bf | ||
|
|
75b74d2c17 | ||
|
|
92e5a0801d | ||
|
|
62ce41a0e9 | ||
|
|
aa9c2b08b9 | ||
|
|
37c58a98cd |
@@ -624,8 +624,10 @@ public class ChangeMetadataCommand extends Command {
|
||||
setTableMAPPING();
|
||||
|
||||
if (!internal) {
|
||||
updateColumnList(oldOutputMetadata, newOutputMetadata);
|
||||
((Process) node.getProcess()).checkProcess();
|
||||
if (!oldOutputMetadata.sameMetadataAs(newOutputMetadata, IMetadataColumn.OPTIONS_NONE)) {
|
||||
updateColumnList(oldOutputMetadata, newOutputMetadata);
|
||||
((Process) node.getProcess()).checkProcess();
|
||||
}
|
||||
}
|
||||
refreshMetadataChanged();
|
||||
}
|
||||
|
||||
@@ -123,6 +123,7 @@ 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;
|
||||
@@ -1079,7 +1080,7 @@ public class Process extends Element implements IProcess2, IGEFProcess, ILastVer
|
||||
ElementParameterType pType;
|
||||
boolean isJoblet = false;
|
||||
if (param.getElement() instanceof INode && PluginChecker.isJobLetPluginLoaded()) {
|
||||
IJobletProviderService service = (IJobletProviderService) GlobalServiceRegister.getDefault().getService(
|
||||
IJobletProviderService service = GlobalServiceRegister.getDefault().getService(
|
||||
IJobletProviderService.class);
|
||||
if (service != null && service.isJobletComponent((INode) param.getElement())) {
|
||||
isJoblet = true;
|
||||
@@ -1920,12 +1921,25 @@ public class Process extends Element implements IProcess2, IGEFProcess, ILastVer
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
//
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (PersistenceException e) {
|
||||
@@ -2283,7 +2297,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 = (IJobletProviderService) GlobalServiceRegister.getDefault()
|
||||
IJobletProviderService service = GlobalServiceRegister.getDefault()
|
||||
.getService(IJobletProviderService.class);
|
||||
if (service != null) {
|
||||
Property jobletProperty = service.getJobletComponentItem(component);
|
||||
@@ -2453,7 +2467,7 @@ public class Process extends Element implements IProcess2, IGEFProcess, ILastVer
|
||||
updateAllMappingTypes();
|
||||
nc.setNeedLoadLib(false);
|
||||
if (nc.isJoblet()) {
|
||||
IJobletProviderService service = (IJobletProviderService) GlobalServiceRegister.getDefault().getService(
|
||||
IJobletProviderService service = GlobalServiceRegister.getDefault().getService(
|
||||
IJobletProviderService.class);
|
||||
if (service != null) {
|
||||
// reload only for stuido ,because joblet can be changed in the job editor
|
||||
@@ -2467,7 +2481,7 @@ public class Process extends Element implements IProcess2, IGEFProcess, ILastVer
|
||||
NodeContainer nodeContainer = null;
|
||||
if (isJunitContainer) {
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(ITestContainerGEFService.class)) {
|
||||
ITestContainerGEFService testContainerService = (ITestContainerGEFService) GlobalServiceRegister.getDefault()
|
||||
ITestContainerGEFService testContainerService = GlobalServiceRegister.getDefault()
|
||||
.getService(ITestContainerGEFService.class);
|
||||
if (testContainerService != null) {
|
||||
nodeContainer = testContainerService.createJunitContainer(node);
|
||||
@@ -2669,7 +2683,7 @@ public class Process extends Element implements IProcess2, IGEFProcess, ILastVer
|
||||
}
|
||||
}
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IScdComponentService.class)) {
|
||||
IScdComponentService service = (IScdComponentService) GlobalServiceRegister.getDefault().getService(
|
||||
IScdComponentService service = GlobalServiceRegister.getDefault().getService(
|
||||
IScdComponentService.class);
|
||||
service.updateOutputMetadata(nc, metadataTable);
|
||||
}
|
||||
@@ -2796,7 +2810,7 @@ public class Process extends Element implements IProcess2, IGEFProcess, ILastVer
|
||||
}
|
||||
} else {
|
||||
if (PluginChecker.isJobLetPluginLoaded()) { // bug 12764
|
||||
IJobletProviderService service = (IJobletProviderService) GlobalServiceRegister.getDefault().getService(
|
||||
IJobletProviderService service = GlobalServiceRegister.getDefault().getService(
|
||||
IJobletProviderService.class);
|
||||
if (service != null && service.isJobletComponent(source)) {
|
||||
continue;
|
||||
@@ -4572,7 +4586,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 = (IJobletProviderService) GlobalServiceRegister.getDefault().getService(
|
||||
IJobletProviderService service = GlobalServiceRegister.getDefault().getService(
|
||||
IJobletProviderService.class);
|
||||
if (service != null) {
|
||||
service.saveJobletNode(jobletItem, jobletContainer);
|
||||
@@ -4621,7 +4635,7 @@ public class Process extends Element implements IProcess2, IGEFProcess, ILastVer
|
||||
|
||||
IJobletProviderService jobletService = null;
|
||||
if (PluginChecker.isJobLetPluginLoaded()) {
|
||||
jobletService = (IJobletProviderService) GlobalServiceRegister.getDefault().getService(IJobletProviderService.class);
|
||||
jobletService = GlobalServiceRegister.getDefault().getService(IJobletProviderService.class);
|
||||
for (INode node : getGraphicalNodes()) {
|
||||
if (jobletService.isJobletComponent(node)) {
|
||||
listRoutines.addAll(getJobletRoutines(jobletService, node));
|
||||
|
||||
@@ -51,6 +51,14 @@
|
||||
<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,6 +1914,42 @@ 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,10 +14,12 @@ 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;
|
||||
@@ -26,15 +28,20 @@ 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;
|
||||
@@ -58,6 +65,7 @@ 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
|
||||
@@ -303,6 +311,30 @@ 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,10 +577,11 @@ LoginProjectPage.previous=Previous
|
||||
LoginProjectPage.finish=Finish
|
||||
LoginProjectPage.remote=Remote
|
||||
LoginProjectPage.remote.talend=Remote TAC
|
||||
LoginProjectPage.cloud.us=Cloud US
|
||||
LoginProjectPage.cloud.eu=Cloud EU
|
||||
LoginProjectPage.cloud.apac=Cloud APAC
|
||||
LoginProjectPage.cloud.custom=Cloud Custom
|
||||
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.local=Local
|
||||
LoginProjectPage.restart=Restart
|
||||
LoginProjectPage.update=Update
|
||||
|
||||
@@ -241,16 +241,18 @@ public class LoginHelper {
|
||||
}
|
||||
|
||||
/**
|
||||
* if the connection is Cloud US/EU/APAC/Custom
|
||||
* if the connection is AWS – USA East/AWS – Europe/AWS – Asia Pacific/Azure – USA West/Cloud – Custom
|
||||
*
|
||||
* @param connectionBean
|
||||
* @return true if connection is Cloud US or Cloud EU or Cloud APAC or Cloud Custom
|
||||
* @return true if connection is USA East or AWS – Europe or AWS – Asia Pacific or Azure – USA West or Cloud –
|
||||
* Custom
|
||||
*/
|
||||
public static boolean isCloudConnection(ConnectionBean connectionBean) {
|
||||
if (connectionBean == null) {
|
||||
return false;
|
||||
}
|
||||
return isCloudUSConnection(connectionBean) || isCloudEUConnection(connectionBean) || isCloudAPACConnection(connectionBean)
|
||||
return isCloudUSConnection(connectionBean) || isCloudUSWestConnection(connectionBean)
|
||||
|| isCloudEUConnection(connectionBean) || isCloudAPACConnection(connectionBean)
|
||||
|| isCloudCustomConnection(connectionBean);
|
||||
}
|
||||
|
||||
@@ -275,6 +277,13 @@ 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;
|
||||
@@ -284,7 +293,7 @@ public class LoginHelper {
|
||||
|
||||
public static boolean isCloudRepository(String repositoryId) {
|
||||
return isCloudUSRepository(repositoryId) || isCloudEURepository(repositoryId) || isCloudAPACRepository(repositoryId)
|
||||
|| isCloudCustomRepository(repositoryId);
|
||||
|| isCloudCustomRepository(repositoryId) || isCloudUSWestRepository(repositoryId);
|
||||
}
|
||||
|
||||
public static boolean isCloudUSRepository(String repositoryId) {
|
||||
@@ -299,6 +308,10 @@ 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,13 +2088,15 @@ public class LoginProjectPage extends AbstractLoginActionPage {
|
||||
}
|
||||
connectionName = connectionName + " (" + remoteLabel; //$NON-NLS-1$
|
||||
} else if (LoginHelper.isCloudUSConnection(prj)) {
|
||||
connectionName = connectionName + " (" + Messages.getString("LoginProjectPage.cloud.us"); //$NON-NLS-1$//$NON-NLS-2$
|
||||
connectionName = connectionName + " (" + Messages.getString("LoginProjectPage.cloud.aws_us"); //$NON-NLS-1$//$NON-NLS-2$
|
||||
} else if (LoginHelper.isCloudEUConnection(prj)) {
|
||||
connectionName = connectionName + " (" + Messages.getString("LoginProjectPage.cloud.eu"); //$NON-NLS-1$//$NON-NLS-2$
|
||||
connectionName = connectionName + " (" + Messages.getString("LoginProjectPage.cloud.aws_eu"); //$NON-NLS-1$//$NON-NLS-2$
|
||||
} else if (LoginHelper.isCloudAPACConnection(prj)) {
|
||||
connectionName = connectionName + " (" + Messages.getString("LoginProjectPage.cloud.apac"); //$NON-NLS-1$//$NON-NLS-2$
|
||||
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$
|
||||
} else if (LoginHelper.isCloudCustomConnection(prj)) {
|
||||
connectionName = connectionName + " (" + Messages.getString("LoginProjectPage.cloud.custom"); //$NON-NLS-1$//$NON-NLS-2$
|
||||
connectionName = connectionName + " (" + Messages.getString("LoginProjectPage.cloud.cloud_custom"); //$NON-NLS-1$//$NON-NLS-2$
|
||||
} else {
|
||||
connectionName = connectionName + " (" + Messages.getString("LoginProjectPage.local"); //$NON-NLS-1$//$NON-NLS-2$
|
||||
}
|
||||
|
||||
@@ -24,7 +24,6 @@ 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;
|
||||
|
||||
@@ -36,7 +35,6 @@ 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;
|
||||
@@ -161,7 +159,7 @@ public class BuildOSGiBundleHandler extends BuildJobHandler {
|
||||
fileExtension = esbExportType;
|
||||
}
|
||||
|
||||
if (fileExtension.equals(file.getFileExtension()) && file.getName().contains("bundle")) {
|
||||
if (fileExtension.equals(file.getFileExtension())) {
|
||||
bundleFile = file;
|
||||
break;
|
||||
}
|
||||
@@ -174,6 +172,7 @@ 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,7 +26,6 @@ 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;
|
||||
@@ -97,16 +96,6 @@ 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,6 +769,7 @@ public class JobJavaScriptOSGIForESBManager extends JobJavaScriptsManager {
|
||||
Manifest manifest = null;
|
||||
try {
|
||||
manifest = analyzer.calcManifest();
|
||||
filterImportPackages(manifest);
|
||||
} catch (IOException e) {
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
@@ -792,6 +793,38 @@ 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,9 +12,6 @@
|
||||
// ============================================================================
|
||||
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;
|
||||
@@ -26,12 +23,10 @@ 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
|
||||
@@ -118,22 +113,4 @@ 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