views:

25

answers:

1

I have a JIRA plugin that I'm developing that has a REST service. That service should be able to accept POSTed requests, unmarshall some data and store it. The seemingly suggested way to do this in JIRA is to make use of the Bandana persistence framework. According to this page, I should be able to simply define a setter that Spring should call to give me my Bandana manager.

@Path("/path")
public class SCMService {

  private BandanaManager bandanaManager;

  // setter called by Spring
  public void setBandanaManager(BandanaManager bandanaManager) {
    this.bandanaManager = bandanaManager;
  }

  //...More methods...
}

However, when I test this, the setter is never being called and my manager is null. I'm guessing this should be as simple as registering this service with Spring for injection somehow but I can't seem to find anything like that.

How would I get my setter called? Is there a better way to do this?

+1  A: 

Er, I'm not sure that JIRA uses Bandana in that way, though Confluence does. You can certainly post data to a JIRA rest resource and then store it using properties tables

Something like this:

@POST
@Consumes (MediaType.APPLICATION_XML)
public Response createComponentAndIssues(@Context HttpServletRequest request, ...
mdoar
Could you expand on this? I'm not getting how I would store a property with a given thing. For example, if I get a string from the request and I want to story it as "SillyString" for an entity with id "SomeSillyInfo", how would I go about doing that? I haven't figured it out.
Drew