Jump to content

REST API bug ? No way to add a SUBresource file-reference to a report unit


ntjp
Go to solution Solved by Dhiraj Pahlani,

Recommended Posts

Hi
I'm having a problem trying to add a SUBresource file-reference to a report unit through the REST API (this pattern happens when the main report and its sub-report are both file-references)
Whichever way I try, the ReportUnitHandler for the rest API ends up calling AbstractResourceHandler->CreateChildResource which itself calls FileResourceHandler->CreateResource.
However contrary to the SOAP fileResourceHandler which works fine, the REST FileResourceHandler doesn't make any any effort to check if the resourcedescriptor is for a file, or a reference.
As a result com.jaspersoft.jasperserver.remote.handlers.FileResourceHandler.updateResource throws a "could not find the binary content" exception because my REST API request doesn't have any file attached to it (of course it doesnt ! ... thesubresource is just assumed to be a reference to an already existing file in the repository !)

Is this a bug or am I doing anything wrong ?

Regards

kb

PS:

1) if it is indeed a bug, it would be nice to provide a source-code fix, even if it means having to recompile the server.
2) if it is not a bug, would it be possible to demonstrate how to add, through the REST API, a subresource file-reference to a report-unit ?
 

Link to comment
Share on other sites

  • Replies 7
  • Created
  • Last Reply

Top Posters In This Topic

Hello kb

Yes, it is clearly a bug. You might want to open a ticket for it.

What's strange is that such functionality seems to be missing from the documentation, as well as any examples of resource descriptors to show how one references a file on a server. Could you please provide us with the resource descriptor you're using in your request? This will make it much easier to respond you with the fix.

With best regards,
Paul Danyliuk

Link to comment
Share on other sites

As per your request, I've added a resource descriptor sample to my initial post for a report unit where the main report and the subreport are both file references. (I've created this descriptor directly through the web GUI; I also managed to create it without problem through SOAP). For REST, I've tried 2 approaches:
1) creating the whole resource-descriptor in one go
2) first creating the resource-descriptor without the subreport resource-descriptor (that steps works fine), then separately add the subreport resource-descriptor (couldn't manage to get that part to work)
However both above-mentionned approaches failed

Regards

kb

Link to comment
Share on other sites

  • 8 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...