Package com.atlassian.plugin

Examples of com.atlassian.plugin.Plugin



    public Repository open(HttpServletRequest req, String name) throws RepositoryNotFoundException, ServiceNotAuthorizedException, ServiceNotEnabledException
    {
        String pluginKey = extractKeyFromUrl(name);
        Plugin plugin = pluginAccessor.getPlugin(pluginKey);
        if ((plugin != null && isPureSpeakeasyExtension(bundleContext, plugin)) || new File(gitRepositoryManager.getRepositoriesDir(), pluginKey).exists())
        {
            gitRepositoryManager.ensureRepository(pluginKey);
            return resolver.open(req, pluginKey);
        }
View Full Code Here


        this.pluginAccessor = pluginAccessor;
    }

    public Extension getExtension(String pluginKey)
    {
        Plugin plugin = getPlugin(pluginKey);
        return extensionBuilder.build(plugin);
    }
View Full Code Here

        return extensionBuilder.build(plugin);
    }

    public UserExtension getUserExtension(String pluginKey, String user)
    {
        Plugin plugin = getPlugin(pluginKey);
        if (plugin == null)
        {
            return null;
        }
        else
View Full Code Here

    }

    public String getScreenshotUrl(String pluginKey, String user) throws UnauthorizedAccessException
    {
        validateAccess(user);
        Plugin plugin = getPlugin(pluginKey);
        ModuleDescriptor<?> screenshotDescriptor = plugin.getModuleDescriptor("screenshot");
        if (screenshotDescriptor == null)
        {
            screenshotDescriptor = unknownScreenshotDescriptor;
        }
        return webResourceManager.getStaticPluginResource(screenshotDescriptor, "screenshot.png", UrlMode.ABSOLUTE);
View Full Code Here

    }

    @Override
    public final Object getService(Bundle bundle, ServiceRegistration registration)
    {
        Plugin plugin = pluginAccessor.getPlugin(OsgiHeaderUtil.getPluginKey(bundle));
        if (plugin == null)
        {
            throw new IllegalArgumentException("Clients can only be used by plugins");
        }
        Set<String> permissions = permissionsReader.getPermissionsForPlugin(plugin);

        BundleContext bundleContext = bundle.getBundleContext();
        return clientClass.cast(Proxy.newProxyInstance(
                new ChainingClassLoader(getClass().getClassLoader(), clientClass.getClassLoader()),
                new Class[]{clientClass},
                new ClientInvocationHandler(
                        "confluence2",
                        wrapService(bundleContext, HostXmlRpcClient.class, getClass().getClassLoader()),
                        permissions,
                        plugin.getKey(),
                        wrapService(bundleContext, HostHttpClient.class, getClass().getClassLoader()),
                        wrapService(bundleContext, RequestContext.class, getClass().getClassLoader()))));
    }
View Full Code Here

  @PluginEventListener
  public void onModuleDisabled(PluginModuleDisabledEvent event) {
    if (event == null) return;
    ModuleDescriptor module = event.getModule();
    if (module == null) return;
    Plugin plugin = module.getPlugin();
    if (plugin == null) return;
    if (myPluginKey.equals(plugin.getKey()) && myModuleKey.equals(module.getKey())) {
      stop();
    }
  }
View Full Code Here

  @PluginEventListener
  public void onModuleDisabled(PluginModuleDisabledEvent event) {
    if (event == null) return;
    ModuleDescriptor module = event.getModule();
    if (module == null) return;
    Plugin plugin = module.getPlugin();
    if (plugin == null) return;
    if (myPluginKey.equals(plugin.getKey()) && myModuleKey.equals(module.getKey())) {
      stop();
    }
  }
View Full Code Here

TOP

Related Classes of com.atlassian.plugin.Plugin

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.