this.jsonManifestHandler = jsonManifestHandler;
}
public Object getService(Bundle bundle, ServiceRegistration registration)
{
DocumentFactory factory = DocumentFactory.getInstance();
String pluginKey = OsgiHeaderUtil.getPluginKey(bundle);
Plugin plugin = pluginAccessor.getPlugin(pluginKey);
if (bundle.getEntry("atlassian-extension.json") != null)
{
JsonManifest mf = jsonManifestHandler.read(plugin);
if (mf.getScreenshot() != null)
{
registerScreenshotWebResourceDescriptor(bundle, factory, plugin, mf.getScreenshot());
}
}
if (bundle.getEntry("js/") != null)
{
SpeakeasyCommonJsModulesDescriptor descriptor = new SpeakeasyCommonJsModulesDescriptor(
moduleFactory, bundleContext, hostContainer, descriptorGeneratorManager, pluginAccessor);
Element modules = factory.createElement("scoped-modules")
.addAttribute("key", "modules")
.addAttribute("location", "js");
if (bundle.getEntry("css/") != null)
{
modules.addElement("dependency").setText("css");