Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Jira with ActiveObjects

b
Contributor
March 29, 2012

Hi,
I followed by ActiveObjects tutorial, and I have trouble with getting ActiveObjects object.

My atlassian plugin config file contains:

<component-import key="ao" name="Active Objects service" interface="com.atlassian.activeobjects.external.ActiveObjects">
    <description>Component to access Active Objects functionality from the plugin</description>
</component-import>

My pom.xml contains:

<dependency>
  <groupId>com.atlassian.activeobjects</groupId>
  <artifactId>activeobjects-plugin</artifactId>
  <version>${ao.version}</version>
  <scope>provided</scope>
</dependency>

I've also created an entity interface, but I want to invoke the AO service inside my class. It means inside of:

public class ManageTemplates extends JiraWebActionSupport { ... }

I want to get an instance of ActiveObjects... How could I get it?

1 answer

1 accepted

4 votes
Answer accepted
Mizan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 29, 2012

You will have to configure the AO module in your atlassian-plugin.xml:

<ao key="ao-module">
  <description>The module configuring the Active Objects service used by this plugin</description>
  <entity>com.example.MyAoEntity</entity>
</ao>

And to access this entity in your ManageTemplates class you will have to get the ActiveObjects service injected:

public class ManageTemplates extends JiraWebActionSupport
{
  private final ActiveObjects ao;
           
  public ManageTemplates(
    JiraAuthenticationContext authenticationContext,
    SearchProvider searchProvider,
    ActiveObjects ao)
  {
    this.ao = ao;
  }

  ...
}

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events