Using the RedDot CMS Query Language (RQL) outside from RedDot

Hello RedDot CMS partners! And hello RedDot developers! A little snippet to play with. Just for those who did not know until now.

For using RQL scripts outside of RedDot you have to copy the file "Reddot.CMS.Rql.dll" which can be found in "\RedDot\CMS\GAC"
"RedDot\CMS\ASP\bin".

After that "include" the DLL inside your Scriptpage (i prefer .NET) with:

C#:
  1. using Reddot.CMS.Rql;
  2. namespace YourNameSpace
  3. {
  4.   public class YourClass
  5.   {
  6.     ... your methods and stuff
  7.   }
  8. }

1 Star2 Stars3 Stars4 Stars5 Stars (4 votes, average: 4.25 out of 5)
Loading ... Loading ...

3 Reaktionen zu “Using the RedDot CMS Query Language (RQL) outside from RedDot”

  1. Sudhanshu

    Hey I found this information very useful.
    Though I would like to add another way of running rql queries remotely here. This method was suggested by Reddot and can’t say if it has any side effects.

    Hope it adds value :)

    [REDDOT]:
    We do not have any official document regarding this but here is some information which might help you. Key requirement is that you have to have the SOAP installed on the CMS server. CMS installer does install this if you have selected this option on the installation. If not then you will need to install this in order to get this RQL working. Also please note that this document was written on CMS version 5 so please change the locaction or file name accordingly.

    RedDot CMS / Sending RQL Messages Using C#

    Overview
    RedDot CMS can be customized through custom programming using the RedDot Query Language, or RQL. RQL is a protocol that is similar to HTTP in several ways. First, both are stateless. Second, both are message-based: requests messages are sent from a client to a server, and a response message is sent from the server back to the client. But RQL is different from HTTP in that RQL messages are XML.

    RQL messages are usually sent using the RedDot5ASP.RdPageData COM-object. .NET provides COM interoperability functionality, so this COM-object can be used from the .NET environment. Another option exists for programmatically communicating with a RedDot CMS server. A web service can be used to send and receive RQL messages. Writing applications that consume web services is easy using the .NET Framework.

    RedDot CMS Web Service
    Installing the RedDot CMS web service is an optional part of the regular software installation process. The CMS installer displays the dialog. The web service is installed and configured automatically if install is selected.

    If the web service is installed, you should see a WebService directory in the ASP folder. Inside this directory is a file named RD5XMLServer.WSDL. The WSDL file describes the web service. It provides all of the information needed for a client application to be able to connect to and use a web service. This file is also accessible via a browser, at http://SERVER-NAME/RedDot5/WebService/RD5XMLServer.WSDL. Connect to this page using your browser to make sure the web service is, in fact, installed.

    If you are unable to locate this WSDL file, it is likely the SOAP Toolkit was not installed along with the rest of RedDot CMS. You will need to run the installation process in order for to install the SOAP Toolkit.

    Generating .NET Classes from a WSDL File
    The .NET Framework SDK includes a utility that takes a WSDL file and generates .NET classes from the WSDL file. WSDL.exe generates all of the complicated code needed to actually connect to the web service. Once those classes are generated, you are free to concentrate on writing your business logic rather than infrastructure code.

    WSDL.exe is a command-line application located in the bin subdirectory in the folder into which the .NET Framework SDK was installed. The WSDL.exe program supports many switches that allow you to control the files it generates. The .NET Framework SDK documentation describes these options in detail. To execute the WSDL.exe program, run the following command. Be sure to substitute the url of your RedDot CMS web service’s WSDL file:

    wsdl http://wsdl-file-url

    The tool will generate source code for a class that represents the web service. Compile this source code.
    The generated class can be used to get a reference to the web service. In addition, the generated class will contain all of the code needed to connect to the web service. The methods available from the web service are included as methods on the generated class.

    Writing a C# Application to Send and Receive RQL Messages
    Writing a client application using the generated class is relatively easy. A reference to the web service is created. That reference is used to call methods available from the web service.

    The web service method you will call is Execute. This method allows you to send an RQL message to the RedDot CMS server. Execute accepts three parameters. The first parameter is a string containing the RQL request message. The second parameter is an object that is passed by reference. It is used as a buffer to store any error text CMS wants to communicate back to your client application. The third parameter is similar to the second parameter. It is passed by reference. It is also a buffer used to store information CMS wants to communicate back. This parameter, however, stores informational text rather than error text.

    The method will return a string containing the RQL response from the server. You need to parse the RQL response to get to the information you are seeking. Loading an XML DOM with the RQL response string is probably the easiest way to parse the response.

    The following code sends a logon message and displays the resulting login GUID:
    RD5XMLServer cms = new RD5XMLServer();
    string rqlRequest = “”;
    object errors = “”;
    object resultInfo = “”;
    string rqlResponse = cms.Execute(rqlRequest, ref errors, ref resultInfo);
    System.Xml.XmlDocument dom = new System.Xml.XmlDocument();
    dom.LoadXml(rqlResponse);
    System.Xml.XmlNodeList nodes = dom.GetElementsByTagName(”LOGIN”);
    for (int currentNode=0; currentNode

  2. Sudhanshu

    for (int currentNode=0; currentNode

  3. Sudhanshu

    —for (int currentNode=0; currentNode

Einen Kommentar schreiben

Please copy the string ylDwFy to the field below: