Hi Dan,

Perfect! Changing the return type from Object to Clob worked just fine (I
copied the Object return from the Dto Mixin, I suppose there is some
additional Isis magic that solves this issue there).

By the way, the existing service action already took a Report as a
parameter - but the Clob return solves this error and now works.

I will look into the docx module.

Kind regards,
Kevin

On Thu, November 26, 2015 01:31, Dan Haywood wrote:
>> On 24 November 2015 at 19:02, Kevin Meyer <[email protected]> wrote:
>>
>>
>>> I've added the project to github on [1]. Sorry - I've not put much
>>> effort into consolidating the menu/service actions, most of them are
>>> visible even when not appropriate.
>>>
>>> I've implemented the "convert and send as file" as a service at [2].
>>>
>>>
>>> For convenience, I've created a fixture script.
>>> After loading the fixture, go to "Reports" and use "Find First" to get
>>> a report[3], then choose "Print as Html" - which fails with the
>>> exception. "Print As Latex" just returns a String.
>>>
>>>
>>>
> OK, so this is pretty obscure, but the good news is that there are easy
> workarounds to the problem.
>
> This code fails:
>
>
> public Object download() { return new Clob(...); }
>
> but this code will work:
>
> public Clob download() { return new Clob(...); }
>
> (ie specify Clob not Object as return type)
>
>
> and so will:
>
> public Object download(String filename) { return new Clob(...); }
>
>
> (ie take at least 1 argument).
>
>
>
> ~~~~
> The issue is down to the way in which we set up the Wicket viewer's Ajax
> handlers; downloadable objects with no-args have to be dealt with in a
> certain way, and we look at the action signature to try to guess.
>
> I've raised a ticket [6] to see if we can support all the cases, but I
> don't see it as a high priority to fix.
>
>
> Thx
> Dan
>
>
> PS: probably tangential to what you are working on, but the isisaddons
> has a docx module [7] for mail merges.  And Jeroen experimented with
> xdocreport [8], which looks simpler still; we will probably make a very
> minimal module around that, too.
>
>
>
> [6] https://issues.apache.org/jira/browse/ISIS-1264
> [7] https://github.com/isisaddons/isis-module-docx
> [8] https://github.com/opensagres/xdocreport
>
>
>


-- 
Kevin Meyer
Ljubljana, Slovenia


Reply via email to