SBM ModScript Reference → Introduction to SBM ModScript → SBM ModScript Contexts → Direct Access Contexts → URL Direct Access Context
A script can generate HTML output to be viewed in the browser without using an HTML template. A URL can invoke a script directly and display the output in the browser. In this case, the script must generate valid HTML for an entire browser page, including the <HTML> start and end tags. Such scripts are invoked by browsing to a URL in one of the following formats, where "..." denotes zero or more optional URL parameters of the form "¶m=value.>
http://server/workcenter/tmtrack.dll?ScriptPage&scriptName=name… http://server/workcenter/tmtrack.dll?ScriptPage&scriptID=number… http://server/workcenter/tmtrack.dll?ScriptPage&scriptUUID=uuid…
For example, the following script generates an entire browser page displaying a message given by a URL parameter:
Ext.WriteStream("<HTML>"); Ext.WriteStream("<HEAD><TITLE>Script Test</TITLE></HEAD>"); Ext.WriteStream("<BODY><H2>" &&& Shell.Params().Item("msg")); Ext.WriteStream("</H2></BODY>"); Ext.WriteStream("</HTML>");
If this script is named "myScript," you can invoke it by browsing to the following URL:
http://server/workcenter/tmtrack.dll?
→ScriptPage&scriptName=myScript&msg=This%20is%20a%20message
For details on using the URL context with an HTTP POST, refer to PostData Shell Properties.
For a detailed example of directly invoking a SBM ModScript via a URL, see https://www.serenacentral.com/blogs/entry/sbm-modscript-part-7-rest-call-into-modscript.
Copyright © 2007–2019 Micro Focus or one of its affiliates. All rights reserved.