The response should be JSON because we will need a few separate fields
there. If you look at FreeMarkerServiceResponse, you will see 3
candidates, but then you will find more, as the thrown exceptions also
carries information that's needed for the UI, as you can see in
FreeMarkerService.calculateTemplateOutput.
--
Thanks,
Daniel Dekany
Friday, August 28, 2015, 9:57:58 PM, Pradeep Murugesan wrote:
> Sure Daniel,
> I will change as per your comments.
> A quick clarification regarding the json response can be like following ?
> { result: <output> }
> Pradeep.
>
>> Date: Fri, 28 Aug 2015 21:26:58 +0200
>> From: [email protected]
>> To: [email protected]
>> Subject: Re: Rest Service for FreeMarkerOnline
>>
>> Friday, August 28, 2015, 7:53:45 PM, Pradeep Murugesan wrote:
>>
>> > Hi Daniel,
>> > I have made the rest service up @ a new path /compile
>> > The service takes the following json as input
>> > { "template": "Hello ${user}", "dataModel": "user=pradeep"}
>> > and then compiles the template and dataModel and returns the output.
>> > https://github.com/pradeepmurugesan/freemarker-online/commit/10de59ac0db0bf0f79ab28214f50c851a5610e20
>> >
>> > Please review the above commit and let me know if its ok.
>>
>> The response will have to be JSON as well (not TEXT_PLAIN), but I
>> guess that was planned later.
>>
>> The usage of the "compile" term is confusing here, as you actually
>> parse (aka. compile) and then "process" (aka. execute) here. The last
>> naturally implies the first. So I guess it should be, like, "run" or
>> "execute".
>>
>> Also, all the web service operations should go under /api/, and the UI
>> outside it.
>>
>> > Will
>> > Integrate with the UI. I have a questions though
>> > 1. Should I modify in the same path as "/" or keeping it in a
>> > separate path like "/compile" is fine ?
>>
>> The UI addresses should remain /, and the current web service should
>> be under /api/run or something, I think.
>>
>> > Also I will write unit tests once we finalize the path.
>> > Pradeep.
>>
>> --
>> Thanks,
>> Daniel Dekany
>>
>