Presto Content Management System
1) Application Setup

<- ->

Documentation > Presto Developer's Manual > Under The Hood > Presto Request Process

URL Processing begins with: \application.cfm

  • If not defined, does preliminary initialization of request.server variable.  This initialization covers the minimal fields necessary to email errors, and to set up initial contact with the Presto database via ODBC.  Shortly after this step, application.server values are loaded based on database settings for the presto installation held in the setup table, and the request.server variable is set to equal application.server, and so returns all of application.server's fields, and takes on its persistence - it exists on the next request by ANY browser so long as application.server exists!  The only reason request.server is set up like this is to enable reporting on database errors in advance of actually connecting with the database.

    request.server
    .live 0 indicates test site, 1 indicates live site.  Some settings, like relative directory from domain root, vary according to this setting.
    .admin_email site administrator's email address
    .info_email For general inquiry emails, and this will also be used as the "from" email for system generated emails sent to the site administrator. On some ISP's this has to be different from the site administrator's email address because of SMTP server security.
    .email_errors Defaults to 1 in advance of database setting.
    .datasource Presto ODBC datasource holding all data for this Presto installation
    .sql_user: This Presto database may require an SQL_User password. If not, leave it blank.
    .sql_password as above

  • Activate basic error emailing using error reporting html template   /presto/error.cfm . This template has an email_errors flag which is primed by default to have any error report emailed to the site administrator (via the email address set up above).  Default error text is provided which can be customized.

    On initialization of a Presto website, most of these settings are almost immediately overwritten by site-specific (and possibly multilingual) settings that are retrieved from the database (as detailed later).  So in practice, there are very few errors that can occur before the database's settings are utilized, and consequently the default error_page_html text can be quite specific.  Errors here typically only occur on initialization of the database if the ODBC connection is malfunctioning, or the Presto database's "setup" table is missing necessary fields (as detailed in init_application.cfm below), making initialization impossible.

    request.site.error_page_html

    Default message in english indicating that an error has occured. Included with this is a report of the error's Date & Time,Browser,IP address of the remote client,Page that request came from,Page being executed when the error occurred,URL parameters and Cold Fusion Error details.

    cgi.server_name Uses this variable in subject heading of email

    server.admin_email
    server.info_email

    To and from email addresses used.

  • Load Presto database-managed application structures if they don't already exist.  This is done in presto/tags/setup/init_application.cfm.

    • Initialize application.server variable.  This establishes application.server to contain a query of all fields in setup table (which should never have more than 1 record). 

      application.server, also available as request.server  contains all of the request.server fields set up above, plus:
      .name Plain text name of Presto installation.
      .isp ISP code:0= generic,1=Paconline,2=Magma. Some Internet Service Providers require variations on the Presto core code.
      .sql_type 0=Microsoft Access, 1=Microsoft SQL Server
      .administrator Full name of web server or Presto administrator.  Currently no standard Presto templates reference this.
      .admin_phone Phone number of administrator.  Currently no standard Presto templates reference this.
      .website_timeout Inactivity timeout in minutes before a website user's session variables are forgotten.  This doesn't apply to anonymous users, who get a 1 day account.  It applies to logged-in users who are navigating through a website.
      .presto_timeout Inactivity Timeout in minutes before a backend presto user is logged-out.
      Note: the setup table does not include the .datasource, .sql_user, or .sql_password fields.  These are passed through from the settings established in application.cfm.
    • As well, this initializes the application.phrase and application.page_type structures which are respectively used as a quick method to lookup text phrases and pertinent page type names, icons, query fields, and search index fields.
    • Initialize application.sites variable .  This variable contains a structure for each home page, containing all its fields, ALL section info, and a site map, for ALL languages that the site is available in.  Additional fields required for a specialized home page template can be added to this list.
      application.sites 

      .site_[group_id]_[language]

      Key to a particular website's home page, section, and site map, taking into account language.  Once the requested site has been identified, its structure (i.e. all fields below) is obtained by referencing request.site.[field or structure name]
      .section_[group_id]

      Each section of this website has a .section_[group_id]a structure containing all the fields of that section (with appropriate language). See request.section table below for details.

      .site_map Each site (& language variation) has a site map, which is a sorted array of site pages, much as they appear in the Presto backend under the home page.  See request.site below for more information.
      .site_map_index See request.site below.
      .name Home page name; it may appear in cookie crumbs or site navigation or site map.  May vary by language.  This is common to all page and section templates too.
      .long_name This may be programmed into html title of page, or may be longer version of page name as it appears in content, depends on how website's templates are implemented.  This is common to all page and section templates too.
      .metatags Contains metatags for this page, including full <metatag ...> coding for each tag.
      .installation Presto/ subfolder holding this site's templates.  Defaults to "default_website".  Home pages can share the same installation value.
      .languages Languages that are pertinent to this website.
      .stats_type 0=none;1=Urchin;2=Webtrends. site's footer.cfm template and presto_pub/stats.cfm use this to determine appropriate includes and responses for statistics tracking.
      .enable_caching Enable caching for all pages?  If not, no page will be cached, even if its individual page settings have caching selected.
      .email_errors Email errors to server administrator?
      .error_page_html This can be set up to vary depending on the website styling, and can also vary by the user's language.  By default only one language is supplied.
      .info_email A website's general info mailbox; this might not be referenced in any website templates, but by default the system uses it for the "from" address of any emails sent out by the system (including error reports).
      .show_debug_info
      When this flag is set, selected users (whose IP's are in the CF Server's debugging list) will see debug output
      .content Field that can contain WYSIWYG content for the home page.
      .content_B As above, for a second content area.
      .login_form_id
      .map_page_id
      .search_page_id
      .search_form_id
      .search_index_id
      Other page ids specific to this website.  These are used in this installation's index.cfm page to bring up the appropriate pages & forms.  These may be subject to revision.
      .file_path Full file path to site's application.cfm .  For ANY home page, whenever this field is empty, and presto is initialized, this is set to the directory that /application.cfm is in when initialization occurs.
      .web_path
      Relative file path to application.cfm from website's domain, e.g. "somesite.com/mysubsite/" yeilds a web_path of "/mysubsite/".  This is initialized in the same way as above.

    • Calculate request.site array. The site map is a (language appropriate) sorted array of site pages, much as they appear in the Presto backend under the home page.  It comes with a request.site_index structure which takes in a "g[group_id]" key, and returns a structure containing the page's group information as detailed below.  If a page doesn't fall under the home page's hierarchy, it won't have an entry here, although this doesn't necessarily prevent the page from being displayed - that is up to the site's templates to determine.  This structure contains a page's hold, and on_site_map status, among other flags.
      request.site[row]
      .group_id group id of page
      .name language appropriate name for this page.
      .depth levels down from the home page that this page is located
      .parent points directly to structure containing this page's parent page, if any.  So request.site[row].parent.group_id works.
      .page_type type of requested page.
      ...etc. All other fields in groups table are available here.

      Updates to home page are reflected immediately in the site map.

<- ->

Valid XHTML 1.0!