Hi Erik,

Before you plough on, there is one further option, namely to use the use
XmlSnapshotService [1] eg:

public class Customer {

    public String getName() { .. }
    public LocalDate getMostRecentOrderDate() { .. }

    public List<Order> getOrder() { ... }
    public Address getAddress() { ... }

}

Customer customer = ...

XmlSnapshotService.Builder builder =
xmlSnapshotService.builderFor(customer);

// name and mostRecentOrderDate automatically included

// to traverse collections and references, use:
builder.includePath("orders");
builder.includePath("address");

XmlSnapshotService.Snapshot snapshot = builder.build();

XmlDocument xmlSnapshot = snapshot.getXmlDocument();  // or
getXmlDocumentAsString(), etc.



In writing this mail I noticed that the XmlSnapshot.Builder interface was
slightly incorrect; it was missing the build(...) method (!)  But I fixed
that in the latest 1.8.0-SNAPSHOT.


~~~
Also, in 1.8.0 we're mothballing the todoapp from Isis proper, and making a
more fully fledged example available via Isis addons [2].  I've been
working on that example, it's just about there (still need to do a README).

Anyway, you can pull it down and take a look, or just peruse [3]

HTH
Dan

[1] http://isis.apache.org/reference/services/xmlsnapshot-service.html
[2] https://github.com/isisaddons/isis-app-todoapp
[3]
https://github.com/isisaddons/isis-app-todoapp/blob/61b8114a8e01dbb3c380b31cf09eaed456407570/dom/src/main/java/todoapp/dom/app/export/ExportAsXmlContributions.java#L47




On 17 February 2015 at 07:57, Erik de Hair <[email protected]> wrote:

>  Hi Martin, Oscar,
>
> Thanks for your help. This will help me out. I think it will be a
> combination of your solutions.
>
> Erik
>
>
> On 02/16/2015 07:01 PM, GESCONSULTOR - Óscar Bou wrote:
>
> Hi Erik.
>
>  Depending on your use case, you could also take a look also at:
> - the Bookmark Service at [1].
> - the Publishing Service, including its Event Serializers at [2] and its
> alternative implementations such as the EventSerializer for the Restul
> Objects specification at [3].
>
>  HTH,
>
>  Oscar
>
>  [1] http://isis.apache.org/reference/services/bookmark-service.html
> [2] http://isis.apache.org/reference/services/publishing-service.html
> [3]
> http://isis.apache.org/components/viewers/restfulobjects/event-serializer-rospec.html
>
>
>
>
> El 16/2/2015, a las 17:32, Martin Grigorov <[email protected]>
> escribió:
>
> Hi,
>
> With https://issues.apache.org/jira/browse/ISIS-705 it is possible to have
> an action that returns a Clob. E.g. you can use Gson/Jackson to serialize
> your object to JSON in whatever format you need.
> Example:
>
> https://github.com/apache/isis/blob/master/mothballed/example/application/todoapp/dom/src/main/java/dom/todo/ToDoItemContributions.java#L240
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Mon, Feb 16, 2015 at 6:22 PM, Erik de Hair <[email protected]>
> <[email protected]> wrote:
>
> Hi,
>
> Is there any possibility in Isis to export an entire entity (including
> possible directly related entities)?
>
> In one of our processes we need a snapshot of an entity that can be used
> later. We don't really need full history, only the 'full' state of the
> object just before one particular action is executed by a user, and it
> doesn't have to be readable by a business person.
>
> I could use the restful viewer but maybe there's another option with less
> meta data in the output.
>
> Thanks,
> Erik
>
>
>
> Óscar Bou Bou
> Responsable de Producto
> Auditor Jefe de Certificación ISO 27001 en BSI
> CISA, CRISC, APMG ISO 20000, ITIL-F
>
>    902 900 231 / 620 267 520
>    http://www.twitter.com/oscarbou
>
>    http://es.linkedin.com/in/oscarbou
>
>    http://www.GesConsultor.com <http://www.gesconsultor.com/>
>
>
>
>  Este mensaje y los ficheros anexos son confidenciales. Los mismos
> contienen información reservada que no puede ser difundida. Si usted ha
> recibido este correo por error, tenga la amabilidad de eliminarlo de su
> sistema y avisar al remitente mediante reenvío a su dirección electrónica;
> no deberá copiar el mensaje ni divulgar su contenido a ninguna persona.
> Su dirección de correo electrónico junto a sus datos personales constan en
> un fichero titularidad de Gesdatos Software, S.L. cuya finalidad es la de
> mantener el contacto con Ud. Si quiere saber de qué información disponemos
> de Ud., modificarla, y en su caso, cancelarla, puede hacerlo enviando un
> escrito al efecto, acompañado de una fotocopia de su D.N.I. a la siguiente
> dirección: Gesdatos Software, S.L. , Paseo de la Castellana, 153 bajo -
> 28046 (Madrid), y Avda. Cortes Valencianas num. 50, 1ºC - 46015 (Valencia).
> Asimismo, es su responsabilidad comprobar que este mensaje o sus archivos
> adjuntos no contengan virus informáticos, y en caso que los tuvieran
> eliminarlos.
>
>
>
>
>
>
>

Reply via email to