Hi Dan,
On Fri, Nov 13, 2015 at 6:57 PM, <[email protected]> wrote:
> public Dto_downloadXml(final Dto dto) {
> + this.dto = dto;
> + try {
> + mimeTypeApplicationZip = new MimeType("application", "zip");
>
What is the magic here that it is a "zip"?
The methods below deal with "xml" (as I'd expect).
> + } catch (final MimeTypeParseException ex) {
> + throw new FatalException(ex);
> + }
> + }
> +
> + public static class ActionDomainEvent extends
> org.apache.isis.applib.IsisApplibModule.ActionDomainEvent<Dto> {}
> +
> + @Action(
> + domainEvent = ActionDomainEvent.class,
> + semantics = SemanticsOf.SAFE
> + )
> + @MemberOrder(sequence = "500.1")
> + public Object $(final String fileName) throws JAXBException,
> IOException {
> +
> + final String xml = jaxbService.toXml(dto);
> + return new Clob(Util.withSuffix(fileName, "xml"), "text/xml",
> xml);
> + }
> +
> + public String default0$() {
> + return Util.withSuffix(dto.getClass().getName(), "xml");
> + }
>
Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov