ReloadTopobase

Syntax

<web service URL>/ReloadTopobase?mon=<topobase moniker>

Description

The ReloadTopobase operation is used to load topobase from file to the existing repository topobase using POST request.

Comments

Operation parameters contain the topobase moniker in the repository. The moniker is specified in the following format: <repository connection moniker>!<id/key topobase>. A topobase to be loaded should be included in the POST request.

The operation results in the logical True if the repository topobase was updated successfully.

Example

Below is the example of code of HTML page used for updating the topobase in the repository. A form implemented on the HTML page is sent as a value. This form contains a control that opens the topobase file. The data is sent by clicking the hyperlink.

To reduce the example, the PostRequest function script is excluded from the code, the function is used to execute operations in JSON format. See code of this function in the Connecting to Repository article.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>Use of the ReloadTopobase operation</title>
</head>
<body>
    <script type="text/javascript">
        var svc = "http://localhost:9090/axis2/services/PP.SOM.Som";
        var topobaseId = "RF_MAP";
        function getFormElement(id) {
            var res = document.getElementById(id);
            return res;
        }
        function sendForm(form, url) {
            var sta = getFormElement('status');
            sta.innerHTML = '';
            var xhr = new XMLHttpRequest();
            xhr.open('POST', url, false);
            var data = new FormData(form);
            xhr.send(data);
            if (xhr.status == 200) {
                sta.innerHTML = "Response:<p>" + xhr.responseText + "<p>";
            } else {
                sta.innerHTML = "Request execution error:<p>" + xhr.responseText +  "<p>";
            }
        }
        // Connect to repository and send request to execute the ReloadTopobase operation
        function ReloadTopobase(form) {
            var OpenMetabase = { "OpenMetabase": { "tDef": { "id": "Warehouse" }, "tCreds": { "user": { "id": "User" }, "pass": "Password" } } };
            //Repository connection
            var OpenMetabaseResult = PostRequest(svc, OpenMetabase);
            //Send data to server
            return sendForm(form, svc + "/ReloadTopobase?mon=" + OpenMetabaseResult.OpenMetabaseResult.id + "!" + topobaseId);
        }
        /*
            PostRequest script
        */
    </script>
    <!--A form, which data is sent to server-->
    <form id="fileForm" action="" method="" enctype="multipart/form-data" onsubmit="ReloadTopobase(this)">
        <div>
            <input type="file" name="file" id="file" />
        </div>
    </form>
    <!--Hyperlink for sending data-->
    <div>
        <a href="javascript:ReloadTopobase(getFormElement('fileForm'))">ReloadTopobase</a>
    </div>
    <!--A field for creating operation execution state-->
    <div id="status"></div>
</body>
</html>

See also:

Additional Operations