Forum Discussion

tapatalk's avatar
tapatalk
Helper
12 years ago

Some questions about endpoint and freemarker.

Hello:

 

I'm Tapatalk TomWu.We are developing plugin for lithium.We have some questions for the usage of endpoint and freemarker in lithium.

 

1.our app need communicate with forum site through xmlrpc protocol,so my question is:whether or not lithium and(or) endpoint directly support xmlrpc protocol?

If not,is that means we have to implement a proxy to communicate with endpoint and convert the data to our app needed xmlrpc data?

 

2.whether or not the freemarker in lithium can recieve the json data through lithium rest api,and convert the data to any we needed json or xml data to our app or other client?Any code example or guiding would be great.

And I have posted a topic about it:

http://lithosphere.lithium.com/t5/developers-discussion/How-to-loop-json-data-in-my-test-endpoint/td-p/103019

 

3.how to make json or xml data through freemarker?Is there any matters need attention or skill for it?Any code example or guiding would be great.

 

4.whether or not endpoint and(or) freemarker is useful enough to implement the all or the most features on lithium sites?Including read feature,login,writing topic/post with correct user right,etc?

 

5.we are curious with the methods to call rest api.

We found there is a method called "rest(restApiUrl)" can get data through rest api with a relative rest api url in the document:

http://lithosphere.lithium.com/t5/developers-knowledge-base/Using-Endpoints-to-Condense-REST-API-Requests/ta-p/88908

We found another way to call rest api using the http.client object in the following document,it needs a full rest api url to call:

https://lithosphere.lithium.com/t5/developers-knowledge-base/http-client-FreeMarker-Context-Object/ta-p/80614

So the question is:

The two methods,rest(restApiUrl) and http.client,which one should be more useful or high-performance to condense REST API Requests with I previously said proxy mode or other ordinary mode?What is the differentia between them?How should we choose?

Especially we need the best high-performance to be implemented for our requirement,since we have done some test to get data only through rest api in proxy mode,our proxy need call rest api many many times to implement our only one method,it is too slow to respond.

 

Thanks.

3 Replies

  • As far as I know rest() and restadmin() are internally mapped calls to the rest api. http.client is your best bet, however it does have some oddities with filtering HTML (even if its escaped in the JSON) and its picky about JSON array formatting. Not sure about XML I don't think its supported.. (?)

     

  • tapatalk's avatar
    tapatalk
    Helper
    12 years ago

    Hello Chris Blown:

     

    Thank you for your reply.

     

    Your said means we should choose rest() and restadmin() to condense REST API Requests as a new rest api for our proxy?Is it high-performance enough?

     

    The http.client object looks useful for site to site calling between lithium sites.And the rest() and restadmin() looks have more high-performance than the http.client object,since they are internally mapped calls to the rest api?Am I right?

     

    And I got issue when using endpoint to develop new feature for our requirement,do you have any idea for it?

    http://lithosphere.lithium.com/t5/developers-discussion/How-to-loop-json-data-in-my-test-endpoint/td-p/103019

     

    Thanks.

     

     

  • cblown's avatar
    cblown
    Boss
    12 years ago

    Sorry I re-read your original post.. You are right http.client won't help in this case :)

     

    You might be able to return XML from your endpoint however it would be a lot of work to get it working like XMLRPC as you'd have to write the API in Freemarker.. 

     

    The proxy would be easier and you'd best implement some form of caching (if possible) so that you can boost performance.