I want to use services like http://docs.atlassian.com/greenhopper/6.2/com/atlassian/greenhopper/service/rapid/RapidViewLocationService.htmlin my plugin.
<component-import key="rapidViewService" name="RapidView service" interface="com.atlassian.greenhopper.service.rapid.view.RapidViewService"> <description>Component to access GH Rapid Views</description></component-import>
I specify the component in my constructor, and added a <component-import> specifying the interface, but the plugin fails to initialise with an error like:
[plugin.osgi.factory.OsgiPlugin] Never resolved service '&rapidViewService' for plugin '' with filter (objectClass=com.atlassian.greenhopper.service.rapid.view.RapidViewService)
Anyone know how to use injection to access the Greenhopper APIs?
Community moderators have prevented the ability to post new answers.
Pulled down the GH source to see what components were exposed. As of 6.2 the only interfaces you'll be able to inject are:
<interface>com.pyxis.greenhopper.jira.license.GreenHopperLicenseStore</interface> <interface>com.pyxis.greenhopper.jira.license.GreenHopperLicenseManager</interface> <interface>com.atlassian.upm.license.compatibility.PluginLicenseManagerAccessor</interface> <interface>com.atlassian.upm.license.compatibility.LegacyCompatiblePluginLicenseManager</interface> <interface>com.pyxis.greenhopper.GreenHopper</interface> <interface>com.atlassian.sal.api.lifecycle.LifecycleAware</interface> <interface>com.atlassian.greenhopper.plugin.sampledata.JiraImportersPluginInstaller</interface> <interface>com.atlassian.greenhopper.optionalfeatures.OptionalFeatureService</interface> <!-- ==================== public Java API to be used by others. DO NOT CHANGE if you don't know what you're doing. ==================== --> <interface>com.atlassian.greenhopper.api.rank.RankService</interface> <interface>com.atlassian.greenhopper.api.rapid.configuration.LabsConfigurationService</interface> <interface>com.atlassian.greenhopper.api.rapid.view.RapidViewCreationService</interface> <!-- ==================== end public API ==================== -->
As far as I know, you can only access the Sprints via the REST API. This means you would need to use the HttpClient and get the JSON via REST.
This post might help as well:
Some code at the bottom :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yeah, I am certainly not making any calls with user credentials in the URL. That exposes passwords to half our IT staff via the http access logs.
Maybe I can just call from JS to highjack the user's existing auth session, but I would also need to find a better way to load the context url.
Also I have seen a number of comments where users report full access to the com.pyxis.greenhopper classes, but nothing in the com.atlassian paths work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think JIRA REST APIs also supports oAuth but not sure about Greenhopper. Maybe that could make the calls more secure ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can post the credentials and get a token back to use in subsequent requests, which is much better then passing credentials as URL query parameters. But it doesn't actually help me as I am writing a plugin for a wider audience and cannot require a generic system ID, and there is no way I am aware of to get the current user's credentials, especially if using remote directories.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Eddie,
Is there any equivalent class like ComponentAccessor to get the GreenHopper service. How do i get the GreenHopper interface object so that i can make use of the getConfiguration(Project project) method in java to access a project
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If it is one of the exposed services listed in my original post, just use the <component-import to declare the interface you need. It will then be available for injection into any of your classes.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.