SaveTopobase

Syntax

<web service URL>/SaveTopobase?<operation parameters>

Description

The SaveTopobase operation is used to get topobase from repository using GET request and to save the topobase to file.

Comments

Operation parameters contain moniker and parameter with name of the file, to which the topobase is to be saved. A parameter and its value are separated with the = character in the address bar; different parameters are separated with the & character.

Available parameters of the SaveTopobase operation:

Parameter Description
mon Moniker of the repository topobase, for which the operation is executed.
Moniker format: <repository connection moniker>!<id/folder key>!<topobase format>
Available formats: Svg and Tbs.
fileName File name, with which loading is executed. Example: &fileName=RF_MAP.svg.

IMPORTANT. Parameter names are case-sensitive.

Example

Below is the example of code of the HTML page used for getting topobase from repository, saving it to file using by means of browser.

When the page is opened, repository connection is established and the topobase is obtained from the object with the specified identifier. The browser will prompt to save the topobase to file.

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 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>Use of the SaveTopobase operation</title>
</head>
<body>
    <script language="javascript" type="text/javascript">
        var svc = "http://localhost:9090/axis2/services/PP.SOM.Som";
        var topobaseId = "RF_MAP";
        var OpenMetabase = { "OpenMetabase": { "tDef": { "id": "Warehouse" }, "tCreds": { "user": { "id": "User" }, "pass": "Password" } } };
        var OpenMetabaseResult = PostRequest(svc, OpenMetabase);
        /*
            PostRequest script
        */
        //Execute SaveTopobase
        var url = svc + "/SaveTopobase?mon=" + OpenMetabaseResult.OpenMetabaseResult.id + '!' + topobaseId + "!Svg&fileName=test.svg";
        window.open(url);
    </script>
</body>
</html>

See also:

Additional Operations