Search in sources :

Example 1 with DependenciesResolver

use of org.talend.designer.camel.dependencies.core.DependenciesResolver in project tesb-studio-se by Talend.

the class CamelDependenciesEditor method updateInput.

private void updateInput() {
    // re-calculate all datas
    final DependenciesResolver resolver = new DependenciesResolver(getJobEditorInput().getLoadedProcess());
    // set datas
    importPackageViewer.setInput(resolver.getImportPackages());
    requireBundleViewer.setInput(resolver.getRequireBundles());
    bundleClasspathViewer.setInput(resolver.getBundleClasspaths());
    exportPackageViewer.setInput(resolver.getExportPackages());
    manageRouteResourcePanel.setInput(RouteResourceUtil.getResourceDependencies(getJobEditorInput().getLoadedProcess()));
}
Also used : DependenciesResolver(org.talend.designer.camel.dependencies.core.DependenciesResolver)

Example 2 with DependenciesResolver

use of org.talend.designer.camel.dependencies.core.DependenciesResolver in project tesb-studio-se by Talend.

the class RouteJavaScriptOSGIForESBManager method addOsgiDependencies.

@Override
protected void addOsgiDependencies(Analyzer analyzer, ExportFileResource libResource, ProcessItem processItem) throws IOException {
    final DependenciesResolver resolver = new DependenciesResolver(processItem);
    //exportPackage.append(getPackageName(processItem));
    // Add Route Resource Export packages
    // http://jira.talendforge.org/browse/TESB-6227
    // add manifest items
    analyzer.setProperty(Analyzer.REQUIRE_BUNDLE, resolver.getManifestRequireBundle(MANIFEST_ITEM_SEPARATOR));
    analyzer.setProperty(Analyzer.IMPORT_PACKAGE, //$NON-NLS-1$
    resolver.getManifestImportPackage(MANIFEST_ITEM_SEPARATOR) + ",*;resolution:=optional");
    analyzer.setProperty(Analyzer.EXPORT_PACKAGE, resolver.getManifestExportPackage(MANIFEST_ITEM_SEPARATOR));
    if (GlobalServiceRegister.getDefault().isServiceRegistered(IRunProcessService.class)) {
        IRunProcessService processService = (IRunProcessService) GlobalServiceRegister.getDefault().getService(IRunProcessService.class);
        ITalendProcessJavaProject talendProcessJavaProject = processService.getTalendProcessJavaProject();
        if (talendProcessJavaProject != null) {
            final IPath libPath = talendProcessJavaProject.getLibFolder().getLocation();
            // process external libs
            final List<URL> list = new ArrayList<URL>();
            for (String s : resolver.getManifestBundleClasspath(MANIFEST_ITEM_SEPARATOR).split(Character.toString(MANIFEST_ITEM_SEPARATOR))) {
                if (!s.isEmpty()) {
                    list.add(libPath.append(s).toFile().toURI().toURL());
                }
            }
            libResource.addResources(list);
        }
    }
}
Also used : IPath(org.eclipse.core.runtime.IPath) IRunProcessService(org.talend.designer.runprocess.IRunProcessService) DependenciesResolver(org.talend.designer.camel.dependencies.core.DependenciesResolver) ArrayList(java.util.ArrayList) ITalendProcessJavaProject(org.talend.core.runtime.process.ITalendProcessJavaProject) URL(java.net.URL)

Example 3 with DependenciesResolver

use of org.talend.designer.camel.dependencies.core.DependenciesResolver in project tesb-studio-se by Talend.

the class CamelDesignerCoreService method addManifestContent.

private void addManifestContent(Item item, Element jobElement) {
    Element manifestElement = jobElement.addElement("RouteManifest");
    manifestElement.addAttribute(QName.get("space", Namespace.XML_NAMESPACE), "preserve");
    final DependenciesResolver resolver = new DependenciesResolver((ProcessItem) item);
    manifestElement.addElement(ManifestItem.IMPORT_PACKAGE).addText(resolver.getManifestImportPackage('\n'));
    manifestElement.addElement(ManifestItem.EXPORT_PACKAGE).addText(resolver.getManifestExportPackage('\n'));
    manifestElement.addElement(ManifestItem.REQUIRE_BUNDLE).addText(resolver.getManifestRequireBundle('\n'));
    manifestElement.addElement(ManifestItem.BUNDLE_CLASSPATH).addText(resolver.getManifestBundleClasspath('\n'));
}
Also used : Element(org.dom4j.Element) DependenciesResolver(org.talend.designer.camel.dependencies.core.DependenciesResolver)

Aggregations

DependenciesResolver (org.talend.designer.camel.dependencies.core.DependenciesResolver)3 URL (java.net.URL)1 ArrayList (java.util.ArrayList)1 Element (org.dom4j.Element)1 IPath (org.eclipse.core.runtime.IPath)1 ITalendProcessJavaProject (org.talend.core.runtime.process.ITalendProcessJavaProject)1 IRunProcessService (org.talend.designer.runprocess.IRunProcessService)1