Starting a Natural Application with a URL

#### Search Results

Search

# Starting a Natural Application with a URL

The connection parameters available in the configuration file for the session and on the logon page can also be specified as URL parameters of the logon page URL. This allows bookmarking the startup URL of a Natural application or starting an application by clicking a hyperlink in a document.

The URL parameters overrule the definitions in the configuration file, with the exception described in the table below.

The following URL parameters are available for the logon page:

URL Parameter | Corresponding Option in the Session Configuration
--- | ---
`xciParameters.` `natsession` | Session ID
`xciParameters.` `natserver` | Host name
`xciParameters.` `natport` | Port number
`xciParameters.` `natuser` | User name
`xciParameters.natpassword` | Password
`xciParameters.` `natprog` | Application
`xciParameters.` `natparam` | Natural parameters
`xciParameters.` `natparamext` | Natural parameters The URL parameter `xciParameters.` `natparamext` extends an existing Natural parameter definition in the configuration file. The extension works in the following way: the Natural parameters defined in the configuration file come first. Then, the Natural parameters defined in the URL parameter `xciParameters.` `natparamext` are added, separated by a space character. If you want to overrule the definition in the configuration file, use the URL parameter `xciParameters.` `natparam` instead.
`xciParameters.` `nattimeout` | Timeout (n seconds)
`xciParameters.savesessionuser` | Save user credentials
`xciParameters.sharesessionuser` | Share session user

Important
All parameter values must be URL-encoded.

Example: In order to start the Natural program `MENU-NJX` from the library `SYSEXNJX` , while your application server is running on myappserver:4711 , your Natural Web I/O Interface server is running on mywebio:4712 , and the name of the Natural startup script is nwo.sh , you can use the following URL:

http://myappserver:4711/cisnatural/servlet/StartCISPage?PAGEURL=%2Fcisnatural%2FNatLogon.html&xciParameters.natserver=mywebio&xciParameters.natprog=nwo.sh&xciParameters.natport=4712&xciParameters.natparam=stack%3D%28logon+SYSEXNJX%3BMENU-NJX%3Bfin%29

Instead of adding the parameters to the URL, you can also use the HTTP method `POST` to set the parameters in an HTML form. Example:

    <html>
    <head>
    <title>Start Natural for Ajax Session</title>
    <script type="text/javascript">
    function submitStart() {
    document.forms["myform"].submit();
    }
    </script>
    </head>
    <body>
     <form id="myform" name="myform" action="servlet/StartCISPage" method="post">
      <input type="hidden" name="PAGEURL" value="/cisnatural/NatLogon.html" />
       Host: <input type="input" size="20" name="xciParameters.natserver" value="mywebio" /><br/>
       Port: <input type="input" size="10" name="xciParameters.natport" value="4712" /><br/>
       Natural program: <input type="input" size="20" name="xciParameters.natprog" value="nwo.sh" /><br/>
       Natural parameter: <input type="input" size="50" name="xciParameters.natparam" value="stack=(logon sysexnjx;menu)" />
     </form>
     <a href="#" onclick="submitStart()">Start Session</a>
     <div id="status">Click on Start Session</div>
    </body>
    </html>

When you write the above example code to a file named startWithPost.html which is located in the cisnatural main directory, you can start the form with the following URL:

http://myappserver:4711/cisnatural/startWithPost.html