Are you a member? sign in or take a minute to sign up

Cancel
User Id: Password:
SyrinxLogo-beulah.png

Using Syrinx CS Web Services in JavaScript


Syrinx CS now provides a way for external sites to use contents hosted in a Syrinx CS Web (SCS) site. A restful web service api is now exposed in SCS, which combines the power of ajax and jquery.

With this service, one can now create a basic html page and retrieve contents from SCS web site and have it hosted on a free web hosting sites.

The SCS Web Services is leveraging heavily  jquery and jquery.tmpl technology. A jquery UI Widget is also available for this service, and is covered on the JQuery UI documentation.

The basic syntax is:

 
ksg.service.getArticles({
    id:"parentUniqueTitle",
    details:"basicDetails",
    template:"templateName"},
    function(data){
        //Process response.
    });

Where:

ksg.service.baseUrl: refers to the url of the site whose articles you will be consuming.

ksg.service.getArticles: calls the service passing in the parameters

Valid Parameters

id: this represents the article uniqueTitle whose children you would want to retrieve. You can get this information from the ArticleManagement Page

details: tells the services the details of the information you will be requesting. Valid options are (fullDetails, basicDetails, idOnly, idAndTitle and idTitleAndPicture).

maxElements: tells the services the maximum number of  elements to be retrieve in the list. When this parameter is not provide all articles are returned from the list.

pageSize: specifies the number of articles to be displayed per page. A pagination will automatically created when this option is provided.

The second part of the parameter represents the jQuery.tmpl which is use to bind/display the result. (For a detail discussion on jQuery.tmpl please refer to the documentation on this api.)In this example we first make sure that the ul #out is empty before the bind the result to it.