Export maps

0

I am working on an embedded app using jasperserver-pro 6 for aws, using a combination of java rest controllers and visualize.js. I was working on setting up a CSVMetadataExporter and followed the documentation, adding it to the `flows/viewReportBeans.xml` and then commented out the others (we only want the slimmed down csv export option) but for some reason when I looked at a report's export options returned by visualize I was getting a completely different list. After much confusion and searching I found the files `applicationContext-web-services.xml` and `applicationContext-remote-services.xml` both of which have their own list of exporter maps and bean configurations... I'm playing around with how/if these relate to eachother and how that corresponds to what is returned by visualize but I was wondering if anyone here understood the reasoning for three lists of exporters which ones are for what.

Thanks in advance!

srang's picture
206
Joined: Oct 28 2014 - 11:52am
Last seen: 3 years 1 month ago

I think visualize is pulling its list from the remote-services but for some reason when I add or remove items from the exporter map they don't always disappear. Not sure why that is.

srang - 4 years 3 months ago

Another interesting wrinkle I've come across: I created a remote csv metadata exporter bean and configured it in the list of remote export options, and then reloaded the server. When I went into my webapp the option wasn't there but I hardcoded the key for that new exporter as the export type and ran it and it worked. Also as hinted above, when I comment out a bean from the remote exporters map the option doesn't disappear but if I try to export it, it fails. This leads me to believe that it is configuring the server correctly but just isn't updating the list of export options to reflect that... Not sure where to go from here

srang - 4 years 3 months ago

I will look into this.. applicationContext-web-services.xml should be only for the REST API and applicationContext-remote-services.xml should be the one visualize.js uses. 

I'm not sure what do you refer when you talk about " export options list returned by visualize" which method are you talking about?
Can you send me a fiddel with a bare bones sample of what you ate attemting so I can replicate it?

marianol - 4 years 3 months ago
show 1 more...

I think I figured out part of my problem. I assumed that jasper/visualize determined the export options available to a report at the time of report generation by checking with the server. Under this assumption I didn't think that visualize.js would change ever so I curled visualize down when we first upgraded to 6.0 and put it inside the project with the rest of the javascript, so I could minfy them together at deployment. Upon further inpection I found that the "export map" I was looking at configuring in the beans is actually an enum within visualize. What I'm guessing now is that when the server builds and deploys it generates visualize based on the configured beans, which in hind sight makes a lot of sense. I haven't had a chance to test this but I imagine if I pull down visualize from the server now that I've configured the beans, it will have the proper export options. That being said, I really don't know and would love your insight

srang - 4 years 3 months ago

1 Answer:

0

Posting the last 2 comments here for reference since it will be easier for somebody else to follow:

marianol - 1 day 19 hours ago
I will look into this.. applicationContext-web-services.xml should be only for the REST API and applicationContext-remote-services.xml should be the one visualize.js uses. 
I'm not sure what do you refer when you talk about " export options list returned by visualize" which method are you talking about? Can you send me a fiddel with a bare bones sample of what you ate attemting so I can replicate it?
 
srang - 1 day 16 hours ago
I think I figured out part of my problem. I assumed that jasper/visualize determined the export options available to a report at the time of report generation by checking with the server. Under this assumption I didn't think that visualize.js would change ever so I curled visualize down when we first upgraded to 6.0 and put it inside the project with the rest of the javascript, so I could minfy them together at deployment. Upon further inpection I found that the "export map" I was looking at configuring in the beans is actually an enum within visualize. What I'm guessing now is that when the server builds and deploys it generates visualize based on the configured beans, which in hind sight makes a lot of sense. I haven't had a chance to test this but I imagine if I pull down visualize from the server now that I've configured the beans, it will have the proper export options. That being said, I really don't know and would love your insight
You are correct, and visualize does change on each upgrade. We are adding more features in each release. The visualize.js script is tied to the server so you need to use it form there, in 6.0.1 it should be minimized already since that was added in this version.
On the other hand I will have to confirm if we do indeed update that enum once the beans change in the server.
marianol's picture
4427
Joined: Sep 13 2011 - 8:04am
Last seen: 9 months 2 weeks ago
Feedback
randomness