Using @OPCGIPARAM to define a default value

You can use @OPCGIPARAM on the CGI parameter page to define a parameter’s (default) value, using syntax similar to:

@OPCGIPARAM[sEntry]

Note there are no quotes around the text inside the []. This value is used during the execution of the application (or portlet), when the @OPCGIPARAM tag is replaced by a runtime value derived by looking up the value (in this example, “sEntry”) which has been determined earlier on in the application execution.

This is necessary sometimes during Web element execution, when we need to generate a HTTP post or get, that includes CGI parameters that vary from execution to execution. For example, a URL may have a CGI parameter that indicates some session key or cache lookup key. During original application capture, UA records the URLs with the values of the CGI parameters obtained at that time – but subsequent executions need values appropriate for that execution.

@OPCGIPARAM[] allows you to specify that the CGI parameter for the URL be modified appropriately at execution time. Note that the @OPCGIPARAM tag specifies a “key” or “tag” that indicates to UA that we lookup the OPCGIPARAM with this name.

UA determines the value for the @OPCGIPARAM tag in two ways: automatically, or by some explicit coding. During execution of a Web application, UA notes all CGI parameters that appear in URLs that are read from the Web server. These URLs could be the result of explicit requests encoded in the CCL used to describe this Web application, or the result of frame fetches or redirects that occur during loading. Quite often a URL is requested by a HTTP get, and a redirect to a session-sensitive URL occurs, with the session key encoded in the redirect URL. UA automatically notes and records these URLs and the CGI parameters.

For example, if a redirect occurs to: http://www.company.com/ somepath?cmd=somecmd&session=24155217677FFA65, UA automatically records the OPCGIPARAMs “cmd” and “session”. Then if the next URL request in the CCL has session as a CGI parameter, using the OPCGIPARAM syntax, you can automatically use the value that occurred during the redirect.

It is also possible to determine OPCGIPARAMs programatically, via a “page content processor” JSP. This is a JSP that can be specified to analyze intermediate page content during the web execution. You specify such a JSP when determining a suitable “CCL fixup” step on the Select page immediately after capturing the target Web page. This JSP can return a set of OPCGIPARAM key/value pairs, which can then be accessed using the OPCGIPARAM syntax. This is used in Business Objects Capture strategy, described in “Business Objects capture strategy”.