[Mydatabasepilot-cvs] MyDatabasePilot Application.cfm,1.16,1.17
Status: Alpha
Brought to you by:
nanoface
From: <nan...@us...> - 2003-06-18 14:03:34
|
Update of /cvsroot/mydatabasepilot/MyDatabasePilot In directory sc8-pr-cvs1:/tmp/cvs-serv30459 Modified Files: Application.cfm Log Message: Functionality Added: [ 756607 ] Added local scope variable CRLF to Application.cfm. This variable is a New Line Break: Carriage Return and Linefeed Characters, and is used as delimiters. <cfset CRLF="#Chr(13)##Chr(10)#" /> Index: Application.cfm =================================================================== RCS file: /cvsroot/mydatabasepilot/MyDatabasePilot/Application.cfm,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Application.cfm 23 May 2003 04:11:19 -0000 1.16 --- Application.cfm 18 Jun 2003 14:03:31 -0000 1.17 *************** *** 1,141 **** ! <!---******************************************************************************************* ! * Copyright: MyDatabase Pilot is distributed under the terms of the GNU GPL license * ! * Template: Application.cfm * ! * Purpose: - Creates Client variables for personalization * ! * - Creates Session variables for connecting to database * ! * - Application wide variables, functions and errorhandling * ! ********************************************************************************************---> ! ! <!----------------------------------------------------------> ! <!--- Set application name and enable sesson variables ---> ! <!--- and enable client variables in the form of cookies ---> ! <!----------------------------------------------------------> ! <cfapplication name="MyDatabasePilot-0.7.2.a" applicationtimeout="#CreateTimeSpan(2,0,0,0)#" ! clientmanagement="yes" setclientcookies="yes" setdomaincookies="no" ! sessionmanagement="yes" sessiontimeout="#CreateTimeSpan(0,0,15,0)#"> ! ! <!-------------------------> ! <!--- Used in Debugging ---> ! <!-------------------------> ! <!---<cfsetting showdebugoutput="No"> Specifies whether to show debugging output---> ! <!---<cfsetting enablecfoutputonly="yes"> Disables output of text that is not included inside cfoutput tags---> ! <!---<cfsetting requestTimeOut = "value in seconds"> You can use this setting to increase the page time-out if your application or page frequently accesses external resources that might be particularly slow---> ! ! <!----------------------------------------------> ! <!--- Set custom global error handling pages ---> ! <!----------------------------------------------> ! <!--- This is on the ToDo list ! <cferror type="exception" template="ErrorHandling/ExceptionErr.cfm"> ! <cferror type="monitor" template="ErrorHandling/MonitorErr.cfm"> ! <cferror type="request" template="ErrorHandling/RequestErr.cfm"> ! <cferror type="validation" template="ErrorHandling/ValidationErr.cfm"> ! ---> ! ! <!----------------------------------------> ! <!--- Initialize Application Variables ---> ! <!----------------------------------------> ! <!--- Initiate an Exclusive lock to ensure the integrity of Application variables ---> ! <cflock timeout = "30" throwontimeout="no" type = "exclusive" scope = "APPLICATION"> ! <!--- Ensure Application Name has not Expired ---> ! <cfif NOT IsDefined("APPLICATION.name")><cfset application.name = "MyDatabase Pilot"></cfif> ! <!--- Ensure Application Version has not Expired ---> ! <cfif NOT IsDefined("APPLICATION.version")><cfset application.version = "v0.7.2(Alpha)"></cfif> ! <!--- Ensure Application Release Date has not Expired ---> ! <cfif NOT IsDefined("APPLICATION.releaseDate")><cfset application.releaseDate = "1 Jun 2003"></cfif> ! <!--- Initiate a Read Only lock to ensure the integrity of SERVER variables ---> ! <cflock timeout = "10" throwontimeout="no" type = "readonly" scope = "SERVER"> ! <cfscript> ! // Ensure isMX_Compatible is set, this is used for MX specific coding such as CFCs ! if(NOT IsDefined("APPLICATION.isMX_Compatible")){ ! if(Left(SERVER.ColdFusion.ProductVersion,1) GTE 6){ // If the product version is 6 or higher ... ! APPLICATION.isMX_Compatible = TRUE; // then CFServer is MX compatible. ! }else{ // Otherwise, ! APPLICATION.isMX_Compatible = FALSE; // CFServer is not MX compatible. ! } ! } ! </cfscript> ! </cflock> ! </cflock> ! ! <!-----------------------------------> ! <!--- Initialize Client Variables ---> ! <!-----------------------------------> ! <!--- Initiate an Exclusive lock to ensure the integrity of Client variables ---> ! <cflock name="clientDefaultSettings" timeout = "30" throwontimeout="no" type = "exclusive"> ! <!--- Used to limit number of records returned from a query ---> ! <cfparam name="CLIENT.defaultMaxRows" default=20> ! <!--- Used to repeat the table headers after specified number of rows/records ---> ! <cfparam name="CLIENT.defaultRepeatHeaders" default="50"> ! </cflock> ! ! <!------------------------------------> ! <!--- Initialize Session Variables ---> ! <!------------------------------------> ! <!--- NOTE FOR SERVER CLUSTERS: ! Since Session Variables can not be used in server clusters except those that support sticky sessions, ! this section (and anything that is dependent on Session Variables) may need to be rewritten as Client ! Variables for server clusters (We will see how many users actually run server cluster before spending ! to much time on this.)---> ! <!--- Initiate an Exclusive lock to ensure the integrity of Session variables ---> ! <cflock timeout = "30" throwontimeout="no" type = "exclusive" scope = "SESSION"> ! <!---||| Initialize connection variables used by queries to connect to the database |||---> ! <!--- If dataSource does not exist ... ---> ! <cfif NOT IsDefined("SESSION.dataSource")> ! <!--- NOTE FOR DEFAULT DATABASE USERS: ! If you choose to configure a default database, you must set the dataSource, userName and password ! variables to an actual database that you have complete access to ---> ! <!--- Initialize connection variables ---> ! <cfset SESSION.dataSource = ""> <!--- Enter default Data Source ---> ! <cfset SESSION.userName = ""> <!--- Enter default User Name ---> ! <cfset SESSION.password = ""> <!--- Enter default password ---> ! </cfif> ! ! <!---||| Ensure User is Logged In and Session has not Expired |||---> ! <!--- If session is new or has expired ... ---> ! <cfif NOT IsDefined("SESSION.loggedIn")> ! <!--- Check if default dataSource was configured ---> ! <!--- If dataSource is empty string ... ---> ! <cfif SESSION.dataSource IS ""> ! <!--- this would indicate that no default data source was provided and user is not logged into any datasource ---> ! <cfset SESSION.loggedIn = 0> ! <!--- Redirect User to login form ---> ! <cflocation url="index.cfm"> ! <cfelse> ! <!--- Otherwise user is logged in using default datasource configuration ---> ! <cfset SESSION.loggedIn = 1> ! </cfif> ! </cfif> ! ! <!---||| Initialize dbName |||---> ! <!--- If dbName does not exist, and user is logged in ... ---> ! <cfif NOT IsDefined("SESSION.dbName") AND SESSION.loggedIn IS TRUE> ! <!--- Get Database Name ---> ! <cfmodule template="Query/thisDatabaseName.cfm" ! queryName="thisDatabaseName" ! datasource="#SESSION.dataSource#" ! username="#SESSION.userName#" ! password="#SESSION.password#"> ! <!--- Set dbName Variable with result of thisDatabaseName Query ---> ! <cfset SESSION.dbName = "#thisDatabaseName.databaseName#"> ! </cfif> ! </cflock> ! ! <!---------------------------------------------------------> ! <!--- Initialize Application-Wide Local scope variables ---> ! <!---------------------------------------------------------> ! <cfset mainpage = "MyDatabasePilot.cfm"> ! <cfset currentPath = "#CGI.path_info#"> ! <!--- Set currentDir by Striping the currentPath string variable of the first occurance of the following: ! One or more alpha numeric charachters or uncerscore followed by .cfm or .CFM ---> ! <cfset currentDir = REReplace(currentPath, "[[:alnum:]_]+(.cfm|.CFM)", "", "ONE")> ! <cfset currentQueryString = "#CGI.query_string#"> ! <cfset currentPage = "#currentPath#?#currentQueryString#"> ! <!--- The Main Menu is Visible by Default ---> ! <cfset mainMenuIsVisible = TRUE> ! ! <!---------------------------------------------------------> ! <!--- Include User-Defined Functions Used on Most Pages ---> ! <!---------------------------------------------------------> ! <!--- A need for this has not yet been determined ! <cfinclude template="Functions/SomeFunction.cfm"> ---> --- 1,143 ---- ! <!---******************************************************************************************* ! * Copyright: MyDatabase Pilot is distributed under the terms of the GNU GPL license * ! * Template: Application.cfm * ! * Purpose: - Creates Client variables for personalization * ! * - Creates Session variables for connecting to database * ! * - Application wide variables, functions and errorhandling * ! ********************************************************************************************---> ! ! <!----------------------------------------------------------> ! <!--- Set application name and enable sesson variables ---> ! <!--- and enable client variables in the form of cookies ---> ! <!----------------------------------------------------------> ! <cfapplication name="MyDatabasePilot-0.7.2.a" applicationtimeout="#CreateTimeSpan(2,0,0,0)#" ! clientmanagement="yes" setclientcookies="yes" setdomaincookies="no" ! sessionmanagement="yes" sessiontimeout="#CreateTimeSpan(0,0,15,0)#"> ! ! <!-------------------------> ! <!--- Used in Debugging ---> ! <!-------------------------> ! <!---<cfsetting showdebugoutput="No"> Specifies whether to show debugging output---> ! <!---<cfsetting enablecfoutputonly="yes"> Disables output of text that is not included inside cfoutput tags---> ! <!---<cfsetting requestTimeOut = "value in seconds"> You can use this setting to increase the page time-out if your application or page frequently accesses external resources that might be particularly slow---> ! ! <!----------------------------------------------> ! <!--- Set custom global error handling pages ---> ! <!----------------------------------------------> ! <!--- This is on the ToDo list ! <cferror type="exception" template="ErrorHandling/ExceptionErr.cfm"> ! <cferror type="monitor" template="ErrorHandling/MonitorErr.cfm"> ! <cferror type="request" template="ErrorHandling/RequestErr.cfm"> ! <cferror type="validation" template="ErrorHandling/ValidationErr.cfm"> ! ---> ! ! <!----------------------------------------> ! <!--- Initialize Application Variables ---> ! <!----------------------------------------> ! <!--- Initiate an Exclusive lock to ensure the integrity of Application variables ---> ! <cflock timeout = "30" throwontimeout="no" type = "exclusive" scope = "APPLICATION"> ! <!--- Ensure Application Name has not Expired ---> ! <cfif NOT IsDefined("APPLICATION.name")><cfset application.name = "MyDatabase Pilot" /></cfif> ! <!--- Ensure Application Version has not Expired ---> ! <cfif NOT IsDefined("APPLICATION.version")><cfset application.version = "v0.7.2(Alpha)" /></cfif> ! <!--- Ensure Application Release Date has not Expired ---> ! <cfif NOT IsDefined("APPLICATION.releaseDate")><cfset application.releaseDate = "1 Jun 2003" /></cfif> ! <!--- Initiate a Read Only lock to ensure the integrity of SERVER variables ---> ! <cflock timeout = "10" throwontimeout="no" type = "readonly" scope = "SERVER"> ! <cfscript> ! // Ensure isMX_Compatible is set, this is used for MX specific coding such as CFCs ! if(NOT IsDefined("APPLICATION.isMX_Compatible")){ ! if(Left(SERVER.ColdFusion.ProductVersion,1) GTE 6){ // If the product version is 6 or higher ... ! APPLICATION.isMX_Compatible = TRUE; // then CFServer is MX compatible. ! }else{ // Otherwise, ! APPLICATION.isMX_Compatible = FALSE; // CFServer is not MX compatible. ! } ! } ! </cfscript> ! </cflock> ! </cflock> ! ! <!-----------------------------------> ! <!--- Initialize Client Variables ---> ! <!-----------------------------------> ! <!--- Initiate an Exclusive lock to ensure the integrity of Client variables ---> ! <cflock name="clientDefaultSettings" timeout = "30" throwontimeout="no" type = "exclusive"> ! <!--- Used to limit number of records returned from a query ---> ! <cfparam name="CLIENT.defaultMaxRows" default=20 /> ! <!--- Used to repeat the table headers after specified number of rows/records ---> ! <cfparam name="CLIENT.defaultRepeatHeaders" default="50" /> ! </cflock> ! ! <!------------------------------------> ! <!--- Initialize Session Variables ---> ! <!------------------------------------> ! <!--- NOTE FOR SERVER CLUSTERS: ! Since Session Variables can not be used in server clusters except those that support sticky sessions, ! this section (and anything that is dependent on Session Variables) may need to be rewritten as Client ! Variables for server clusters (We will see how many users actually run server cluster before spending ! to much time on this.)---> ! <!--- Initiate an Exclusive lock to ensure the integrity of Session variables ---> ! <cflock timeout = "30" throwontimeout="no" type = "exclusive" scope = "SESSION"> ! <!---||| Initialize connection variables used by queries to connect to the database |||---> ! <!--- If dataSource does not exist ... ---> ! <cfif NOT IsDefined("SESSION.dataSource")> ! <!--- NOTE FOR DEFAULT DATABASE USERS: ! If you choose to configure a default database, you must set the dataSource, userName and password ! variables to an actual database that you have complete access to ---> ! <!--- Initialize connection variables ---> ! <cfset SESSION.dataSource = "" /> <!--- Enter default Data Source ---> ! <cfset SESSION.userName = "" /> <!--- Enter default User Name ---> ! <cfset SESSION.password = "" /> <!--- Enter default password ---> ! </cfif> ! ! <!---||| Ensure User is Logged In and Session has not Expired |||---> ! <!--- If session is new or has expired ... ---> ! <cfif NOT IsDefined("SESSION.loggedIn")> ! <!--- Check if default dataSource was configured ---> ! <!--- If dataSource is empty string ... ---> ! <cfif SESSION.dataSource IS ""> ! <!--- this would indicate that no default data source was provided and user is not logged into any datasource ---> ! <cfset SESSION.loggedIn = 0 /> ! <!--- Redirect User to login form ---> ! <cflocation url="index.cfm" /> ! <cfelse> ! <!--- Otherwise user is logged in using default datasource configuration ---> ! <cfset SESSION.loggedIn = 1 /> ! </cfif> ! </cfif> ! ! <!---||| Initialize dbName |||---> ! <!--- If dbName does not exist, and user is logged in ... ---> ! <cfif NOT IsDefined("SESSION.dbName") AND SESSION.loggedIn IS TRUE> ! <!--- Get Database Name ---> ! <cfmodule template="Query/thisDatabaseName.cfm" ! queryName="thisDatabaseName" ! datasource="#SESSION.dataSource#" ! username="#SESSION.userName#" ! password="#SESSION.password#" /> ! <!--- Set dbName Variable with result of thisDatabaseName Query ---> ! <cfset SESSION.dbName = "#thisDatabaseName.databaseName#" /> ! </cfif> ! </cflock> ! ! <!---------------------------------------------------------> ! <!--- Initialize Application-Wide Local scope variables ---> ! <!---------------------------------------------------------> ! <cfset mainpage = "MyDatabasePilot.cfm" /> ! <cfset currentPath = "#CGI.path_info#" /> ! <!--- Set currentDir by Striping the currentPath string variable of the first occurance of the following: ! One or more alpha numeric charachters or uncerscore followed by .cfm or .CFM ---> ! <cfset currentDir = REReplace(currentPath, "[[:alnum:]_]+(.cfm|.CFM)", "", "ONE") /> ! <cfset currentQueryString = "#CGI.query_string#" /> ! <cfset currentPage = "#currentPath#?#currentQueryString#" /> ! <!--- The Main Menu is Visible by Default ---> ! <cfset mainMenuIsVisible = TRUE /> ! <!--- New Line Break: Carriage Return and Linefeed Characters used as delimiters ---> ! <cfset CRLF="#Chr(13)##Chr(10)#" /> ! ! <!---------------------------------------------------------> ! <!--- Include User-Defined Functions Used on Most Pages ---> ! <!---------------------------------------------------------> ! <!--- A need for this has not yet been determined ! <cfinclude template="Functions/SomeFunction.cfm"> ---> |