mwmd / circuit14-aem-replication

Circuit14 code examples for AEM replication customization
9 stars 2 forks source link

Alternative solution for JSONContentBuilder #1

Open dlh3 opened 8 years ago

dlh3 commented 8 years ago

Let me begin by saying thank you. These samples and the accompanying SlideShare deck from Circuit 14 were immensely helpful in solving a problem that I was faced with.

I found the JSONContentBuilder so helpful that I nominated it for inclusion in the ACS-AEM-Samples project. Upon doing so, it was suggested that the JSON Writer API may be more efficient/appropriate than the Sling Request Processor. Following that suggestion, I have reimplemented the JSONContentBuilder and submitted it to the ACS-AEM-Samples project.

Prior to reimplementing with the JSON Writer, I experienced an issue with a content path that didn't have a jcr:content node (invalid content). I resolved the issue by implementing the status code methods on the FakeHttpResponse, but it was not as clean to handle as the JSON Writer approach allows for.

Out of curiosity, was the Sling Request Processor approach used for a particular reason?

Thanks again!

mwmd commented 8 years ago

Great to hear you've found the material & code helpful to solve your requirement! The Sling Request Processor approach was simply used as one example of how to seralize the content in JSON. The main purpose of the example is to demonstrate usage of the ContentBuilder API. For that, the content had to get seralized to JSON, and using the Request Processor was one easy way to do it. That code has only been produced for demonstration purposes, so there's no specific requirement to use Request Processor instead of the JSON Writer.

amoghdaryapurkar commented 7 years ago

Out of curiosity.. This is very helpful and very well written code I could find till now. But, I am still not clear with the ReplicationAgent requirement. As i could not see TransportHandler in this project and it looks like it is necessary while creating replication agent with this content builder. Can you please help me to get clarify on this ?