Search in sources :

Example 1 with EmbeddedArtifact

use of org.apache.sling.ide.artifacts.EmbeddedArtifact in project sling by apache.

the class ArtifactsLocatorImpl method loadToolingSupportBundle.

@Override
public EmbeddedArtifact loadToolingSupportBundle() {
    BundleContext bundleContext = context.getBundleContext();
    // TODO - remove version hardcoding
    String version = "1.0.2";
    String artifactId = "org.apache.sling.tooling.support.install";
    String extension = "jar";
    URL jarUrl = loadResource(bundleContext, ARTIFACTS_LOCATION + "/sling-tooling-support-install/" + artifactId + "." + extension);
    return new EmbeddedArtifact(artifactId + "-" + version + "." + extension, version, jarUrl);
}
Also used : EmbeddedArtifact(org.apache.sling.ide.artifacts.EmbeddedArtifact) URL(java.net.URL) BundleContext(org.osgi.framework.BundleContext)

Example 2 with EmbeddedArtifact

use of org.apache.sling.ide.artifacts.EmbeddedArtifact in project sling by apache.

the class ArtifactsLocatorImpl method loadSourceSupportBundle.

@Override
public EmbeddedArtifact loadSourceSupportBundle() {
    BundleContext bundleContext = context.getBundleContext();
    // TODO - remove version hardcoding
    String version = "1.0.2";
    String artifactId = "org.apache.sling.tooling.support.source";
    String extension = "jar";
    URL jarUrl = loadResource(bundleContext, ARTIFACTS_LOCATION + "/sling-tooling-support-source/" + artifactId + "." + extension);
    return new EmbeddedArtifact(artifactId + "-" + version + "." + extension, version, jarUrl);
}
Also used : EmbeddedArtifact(org.apache.sling.ide.artifacts.EmbeddedArtifact) URL(java.net.URL) BundleContext(org.osgi.framework.BundleContext)

Example 3 with EmbeddedArtifact

use of org.apache.sling.ide.artifacts.EmbeddedArtifact in project sling by apache.

the class ToolingSupportBundle method before.

@Override
protected void before() throws Throwable {
    EmbeddedArtifactLocator locator = Activator.getDefault().getArtifactLocator();
    EmbeddedArtifact toolingBundle = locator.loadToolingSupportBundle();
    OsgiClientFactory clientFactory = Activator.getDefault().getOsgiClientFactory();
    OsgiClient osgiClient = clientFactory.createOsgiClient(new RepositoryInfo(config.getUsername(), config.getPassword(), config.getUrl()));
    osgiClient.installBundle(toolingBundle.openInputStream(), toolingBundle.getName());
}
Also used : OsgiClientFactory(org.apache.sling.ide.osgi.OsgiClientFactory) RepositoryInfo(org.apache.sling.ide.transport.RepositoryInfo) EmbeddedArtifactLocator(org.apache.sling.ide.artifacts.EmbeddedArtifactLocator) OsgiClient(org.apache.sling.ide.osgi.OsgiClient) EmbeddedArtifact(org.apache.sling.ide.artifacts.EmbeddedArtifact)

Aggregations

EmbeddedArtifact (org.apache.sling.ide.artifacts.EmbeddedArtifact)3 URL (java.net.URL)2 BundleContext (org.osgi.framework.BundleContext)2 EmbeddedArtifactLocator (org.apache.sling.ide.artifacts.EmbeddedArtifactLocator)1 OsgiClient (org.apache.sling.ide.osgi.OsgiClient)1 OsgiClientFactory (org.apache.sling.ide.osgi.OsgiClientFactory)1 RepositoryInfo (org.apache.sling.ide.transport.RepositoryInfo)1