Basic programming examples


Beside the classical Hello World, the example application provided with CSA contains an "hello-folks" script (and more examples will be provided in the future). To call this program from your Web browser just type:  
replacing the relevant parts with your local values, as usual. The "hello-folks" script source code, from $CSA_ROOT/rpclib/hello-folks is:
# Sample "hello-folks" CSA application. 

csaExit.ok hello-link.$CSA_TPLEXT

# End of program.
Unlike Hello World, here a template other than the default csaOk.html is displayed, namely hello-link.html, which is also stored in the HTML template directory $CSA_ROOT/forms/$CSA_LANG/. Since the template name is a custom one, it cannot be implied by csaExit.ok and MUST be passed to the function as an argument. Beside the message-capture tag $[CSA_MSG_TEXT:x], the template now has also the additional URL tag $[CSA_RPC_URL], that is used to "resolve" the clickable hyperlink on the page. The value associated with CSA_RPC_URL is based on the CSA_RPC_URL1 and CSA_RPC_URL2 (if any) local configuration parameters, defined in the application profile $CSA_ROOT/csa.rc. The $[CSA_URL] tag, which value is derived from the CSA_URL1 and CSA_URL2 (if any) defined in $CSA_ROOT/csa.rc, is useful to resolve relative URL's to images or other external HTML obiects, in spite of the fact that the page was served through the path of the CSA CGI driver, and not directly as a static object by the Web server.


Trackbacks (0) | New trackback | Print