Check out the Red programming language from the same author
En /

Using RSP

  • RSP code is included between <% RSP-Code %> tags.
  • RSP pages use the Rebol PRINT word to put something into the output buffer.
  • The output buffer is sent back to the client.
  • RSP API Reference

Here is a simple example of a RSP page:

	<html><body>

	<%
	print [now <br> what-dir]
	%>

	</body></html>

Execution Model

Cheyenne serves static resources from the main process (UniServe process), CGI and RSP are executed by pre-forked worker processes. So writing to the same file from RSP script can be an issue if you don't have a mean to ensure that write accesses are serialized.

Database support

Cheyenne has no driver included, you have to load them. The best place is in 'worker-libs config block (see ChangeLog.txt).

For webapps specific libraries, the best place is 'on-application-start in %app-init.r.

Sessions

  • Session's data block is hashed, so session access time is constant and the only impact is on memory usage.
  • Passing RSP session ID as GET or POST parameter (named RSPID) is supported.

Debugging

There are two debug loggin options.

  1. Writing messages to a log file on the server
  2. Posting debug / error output back to the client

After installation option 2 is disabled. You can re-enable it by adding a DEBUG keyword in httpd.cfg in domain or webapp config block.

Even if you keep option 2 disabled, you can enable debug output to the client on a per script-file base. Add this line at the beginning of the RSP script: debug-banner/active?: yes This value is reseted at every RSP page request.

HTTP request Methods

At the moment Chyenne supports:

  • GET
  • POST
  • PUT

Web Applications

Cheyenne supports the concept of a web application. That's a collection of files in a seperate directory. Every web app has an app-init.r file where you can specify different handlers that are exectued at different times. The supported handlers are:

  • on-application-start: add here your library / modules loading
  • on-application-end: add here your library / modules proper closing
  • on-session-start: add here your per session init code like: session/add 'foo 0 that can be latter accessed with : session/content/foo
  • on-session-end: add here your per session closing/cleanup code
  • on-page-start:
  • on-page-end:

Authentification

You can specify a special login sequence if you're using the AUTH keyword in the webapp config bloc. If you do this, a user has first to login to request any other page/file from the web application directory. Even if the user tries a direct request the login sequence is first executed.

Inside a web app directory you can create a public folder where you store files that are accessible without having to login. For example: If your login page uses CSS, images etc. these go into the public directory. Otherwise the files won't be loaded.

If AUTH is not used, you can access every webapp resource directly, it's up to each RSP to manage the access rights strategy. In this case you can use a common filter script called from 'on-page-start to control access as you like.

Basic Authentification

Cheyenne has no builtin support for basic auth. You need to provide your own code. 'on-page-start is a good place to put that kind of filter.



Page last modified on September 26, 2009, at 01:11 AM
Powered by Cheyenne Web Server - © Softinnov