use of org.talend.designer.publish.core.models.FeatureModel in project tesb-studio-se by Talend.
the class ExportServiceAction method addRequiredFeatures.
private void addRequiredFeatures(FeaturesModel features) {
// add correlation feature
ServiceConnection connection = (ServiceConnection) serviceItem.getConnection();
String useRegistry = connection.getAdditionalInfo().get(ServiceMetadataDialog.USE_SERVICE_REGISTRY);
if (!"true".equals(useRegistry)) {
String useCorrelation = connection.getAdditionalInfo().get(ServiceMetadataDialog.USE_BUSINESS_CORRELATION);
if ("true".equals(useCorrelation)) {
features.addFeature(new FeatureModel(FeaturesModel.CORRELATION_FEATURE_NAME));
}
}
// add talend-data-mapper feature
for (IRepositoryViewObject node : nodes) {
ProcessItem processItem = (ProcessItem) node.getProperty().getItem();
if (null != EmfModelUtils.getComponentByName(processItem, THMAP_COMPONENT_NAME)) {
features.addFeature(new FeatureModel(FeaturesModel.TALEND_DATA_MAPPER_FEATURE_NAME));
break;
}
}
}
use of org.talend.designer.publish.core.models.FeatureModel in project tesb-studio-se by Talend.
the class CamelFeatureUtil method addFeatureAndBundles.
/**
* Add feature and bundle to Feature Model
*
* @param node
* @param featuresModel
*/
public static void addFeatureAndBundles(ProcessItem routeProcess, FeaturesModel featuresModel) {
IDesignerCoreService designerService = RepositoryPlugin.getDefault().getDesignerCoreService();
IProcess process = designerService.getProcessFromProcessItem(routeProcess, false);
Collection<FeatureModel> features = new HashSet<FeatureModel>();
for (String lib : process.getNeededLibraries(true)) {
Collection<FeatureModel> featureModel = computeFeature(getNameWithoutVersion(lib));
if (featureModel != null) {
features.addAll(featureModel);
}
}
addNodesSpecialFeatures(features, routeProcess.getProcess());
addConnectionsSpecialFeatures(features, routeProcess.getProcess());
for (FeatureModel model : features) {
featuresModel.addFeature(model);
}
}
use of org.talend.designer.publish.core.models.FeatureModel in project tdi-studio-se by Talend.
the class AbstractPublishJobAction method exportJobForOSGI.
private void exportJobForOSGI(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
File tmpJob = null;
final ProcessItem processItem = (ProcessItem) node.getObject().getProperty().getItem();
try {
tmpJob = File.createTempFile("job", ".jar", null);
jobScriptsManager = JobScriptsManagerFactory.createManagerInstance(JobScriptsManagerFactory.getDefaultExportChoiceMap(), processItem.getProcess().getDefaultContext(), JobScriptsManager.LAUNCHER_ALL, IProcessor.NO_STATISTICS, IProcessor.NO_TRACES, JobExportType.OSGI);
// generate
jobScriptsManager.setDestinationPath(tmpJob.getAbsolutePath());
JobExportAction action = new JobExportAction(Collections.singletonList(node), jobVersion, bundleVersion, jobScriptsManager, System.getProperty("java.io.tmpdir"));
action.run(monitor);
if (!action.isBuildSuccessful()) {
return;
}
monitor.beginTask("Deploy to Artifact Repository....", IProgressMonitor.UNKNOWN);
FeaturesModel featuresModel = getFeatureModel(tmpJob);
// [TESB-12036] add talend-data-mapper feature
NodeType tHMapNode = EmfModelUtils.getComponentByName(processItem, THMAP_COMPONENT_NAME);
if (tHMapNode != null) {
featuresModel.addFeature(new FeatureModel(FeaturesModel.TALEND_DATA_MAPPER_FEATURE_NAME));
}
processModules(featuresModel, ((JobJavaScriptOSGIForESBManager) jobScriptsManager).getExcludedModuleNeededs());
process(processItem, featuresModel, monitor);
} catch (IOException e) {
throw new InvocationTargetException(e);
} finally {
if (tmpJob != null && tmpJob.exists()) {
tmpJob.delete();
}
}
}
Aggregations