Configuring the RESTful Web Service

This section explains how to configure several settings of the global RESTful Web service (http://localhost:9090/denodo-restfulws).

This section is not about the settings of REST Web services, which publish a specific set of views.

Limit the Maximum Number of Rows Returned

You can limit the maximum number of rows returned by the RESTful Web service. That is, if this limit is enabled, when a client queries a view, the number of rows in the response will never exceed this limit.

This feature is useful to make sure that there is not any client who puts too much strain on the Virtual DataPort server or its data sources.

To set this limit, follow these steps:

  1. Edit the file other_settings.xml of the folder <DENODO_HOME>/resources/apache-tomcat/webapps/denodo-restfulws/WEB-INF/
  2. Set the value of the property maximumRowsPerPage to the limit you want to set.
  3. Restart the Virtual DataPort server to apply the changes.

The changes in this file will not be overwritten by the installation of subsequent updates of the Denodo Platform.

The Administration Tool provides graphical support to configure this limit on REST Web services (the ones that only publish a set of views). The section Settings Tab (REST) explains how to do this.

Cross-origin Resource Sharing (CORS)

The RESTful Web service provides support for Cross-origin resource sharing (Cross-Origin Resource Sharing (CORS)). The section Cross-origin Resource Sharing (CORS) (settings of published REST web services) explains in more details what CORS is.

To enable the CORS support on the global RESTful Web service, follow these steps:

  1. Edit the file cors_settings.xml of the folder <DENODO_HOME>/resources/apache-tomcat/webapps/denodo-restfulws/WEB-INF/

  2. Uncomment the contents of the file.

  3. If the value of the property is *, the Service will allow CORS requests received from any domain.

    To limit the domains from which CORS requests are allowed, change the value of the property cors.allowOrigin; replace * with the list of allowed URLs. Separate each URL by a comma.

    For example, https://foo.com, http://foo.com, https://foo.bar.com

    CORS requests from any other origin will be denied with the HTTP code 403 (Forbidden)

    Important

    For each URL, enter its protocol as well. URLs that not contain the protocol are invalid. E.g. foo.com is invalid.

  4. Restart the Virtual DataPort server to apply the changes.

The changes in this file will not be overwritten by the installation of subsequent updates of the Denodo Platform.

This change only affects the global RESTful Web service. If you want to publish REST Web services with CORS support, see the section Cross-origin Resource Sharing (CORS) (settings of published REST web services).

Customizing the Look & Feel of the RESTful Web Service

The RESTful Web service provides support to replace the logo displayed at the top of the HTML representation.

image0

To replace the Denodo logo with another logo, follow these steps:

  1. Edit the file denodo-customizable.css of the folder <DENODO_HOME>/resources/apache-tomcat/webapps/denodo-restfulws/resources/

  2. Uncomment the CSS definition div#page-header.

  3. In this definition, replace the URL of the attribute background-image with the URL of the new logo.

    If you want to host the new logo in the Web container embedded in Denodo, copy it to the folder <DENODO_HOME>/resources/apache-tomcat/webapps/export/.

    You should end up with a CSS definition similar to this one:

    div#page-header {
       background-image: url('http://localhost:9090/export/new_logo.png');
       background-position: top left;
       background-repeat: no-repeat;
       height: 45px;
       padding-bottom: 25px;
       position: relative;
       width: 85%;
       height: 80px;
    }
    

These changes are effective immediately and will not be overwritten by the installation of subsequent updates of the Denodo Platform.

After following the steps above, all the REST Web services that you deploy or redeploy and that do not have its CSS definition customized, will use this new CSS definition. Therefore, they will display the new icon instead of the Denodo one.

Modifying the Connection Parameters Between the RESTful Web Service and Virtual DataPort

As any client of Virtual DataPort, the RESTful Web service has its own connection parameters. In most situations, the default connection parameters of the service are fine, but there may be scenarios where you need to change them. For example, let us say that you are going to query views that take a long time to respond. The default query timeout of this service is fifteen minutes. If you think that some queries may take longer, increase it by following these steps:

  1. Edit the file connection_settings.xml of the folder <DENODO_HOME>/resources/apache-tomcat/webapps/denodo-restfulws/WEB-INF/.

  2. Increase the value of the property queryTimeout. Note the value of this property is in milliseconds.

    You can also modify other properties of this file if you need to. Each property has a comment above explaining it.

  3. Restart the Virtual DataPort server to apply the changes.

The changes in this file will not be overwritten by the installation of subsequent updates of the Denodo Platform.

This change only affects the global RESTful Web service. Each REST Web service has its own connection parameters.