Previous | Next Main Index:   Frames | No Frames
Document:   Frames | No Frames
 
 

Configure WS Editor Setup File

 
WS Editor's setup file, /Web_store/Databases/outlet_editor.setup, contains variables specific to ws_editor.cgi.
 
Variables used by all scripts are located in /Web_store/ws_global.setup.
 
$default_setup_file = 'outlet_editor.setup';
If you change the filename of outlet_editor.setup, change the value of $default_setup_file located in the DEFINE VARIABLES section at the top of ws_editor.cgi to reflect the file's new name.
 
$default_setup_file is the setup file used if the URL pointing to ws_editor.cgi does not contain a name=value pair for setup= in the query string:   ws_editor.cgi?setup=outlet_editor
 
 
If you use ws_editor.cgi to maintain more than one database, each database must have a unique editor setup file defining the database's filename in $data_file and it's field structure in %FIELDS.
 
If the filename(s) of additional editor setup files ends in _editor.setup, ws_editor.cgi will print a drop down select element listing these setup files, allowing you to switch between databases (and their corresponding setup file).
 
To easily determine which database you are working with, each editor setup file should define a different document color scheme in $bgcolor or $background, $header_bkg_clr, and $header_fnt_clr.
 
WS Editor prints the database filename in table headers.
 
 
General Settings
 
$data_file
$global_page_title
@store_files
$max_items
$ascending_sort
$sort_buttons
$single_spacing
$return_link_url | $return_link_title
$email_link_url  | $email_link_title
 
Database of Items for Sale
 
%FIELDS
$category_fld_num
 
Security
 
$user_security
$allow_register | $email_register
$generate_password
$allow_search
$duplicate_check
 
Statistics
 
$log_file | $log_file_size | $log_delimiter
$stat_file | $stat_file_size | $stat_delimiter
 
HTML Display
 
$BORDER | $CELLPADDING | $CELLSPACING
$background | $bgcolor - $alink_color
$header_bkg_clr | $header_fnt_clr
$message_fnt_clr
$error_fnt_clr
$extc_fnt_clr
$html_fnt_clr
 
 
Top of Page
 
 
General Settings
 
 
$data_file = 'outlet.data';
$data_file is the pipe delimited database file containing your store's inventory that is being edited.
 
 
Index
 
$global_page_title = 'Database Editor';
$global_page_title is used in the <TITLE> of all HTML pages, in the Subject and Body of generated email messages when a new user registers, and on the 'Logon' form submission button.
 
 
Index
 
@store_files = ('ws400CS.cgi:E', 'outlet', 'No_Frames');
@store_files is an array listing the WebStore's script name in element zero followed by a listing of all WebStore store setup files which reference the database listed in $data_file.
 
When the database listed in $data_file is sorted, WS Editor will update @categories in each store setup file listed in @store_files.
 
When the name of your WebStore script is placed in element zero, an HTML page of WebStore query string links, one for each database category, will be created in the /Databases sub-directory named product.database.html ($data_file.html). If element zero ends in :E, the HTML file created will contain two query string links for each database category. The second link for each category will have extended characters converted, allowing you to cut and paste these links directly into your WebStore's HTML pages from a web browser when viewing outlet.data.html.
 
@categories in a WebStore setup file is a listing of database categories used to print the drop down select element in WebStore's search engine.
 
$category_fld_num in this file must be set to the same database field number as $category_fld_num in the WebStore setup file(s) listed in @store_files.
 
WS Editor will add the extension .setup to each file name listed in @store_files if a file name does not end in .setup.
 
If a WebStore store setup file listed in @store_files does not exist, WS Editor will bypass the file name. No error is generated when this occurs.
 
If you do not use WebStore's search engine or you do not want WS Editor to update WebStore's setup file(s), set @store_files = ();
 
 
Index
 
$max_items = '5';
$max_items is the maximum number of items returned per page to the client's web browser. It's value must be numeric and greater than zero. $max_items defaults to 5 if mis-configured.
 
 
Index
 
$ascending_sort = '1';
If $ascending_sort = 1, sort drop down selects are intially set to perform ascending alpha sorts of the records in the database.
 
If $ascending_sort = 0, sort drop down selects are intially set to perform descending alpha sorts of the records in the database.
 
 
Index
 
$sort_buttons = '1';
If $sort_buttons = 0, do not print Sort/Add and Sort/Remove buttons.
Setting $sort_buttons = ''; disables printing of the Sort/Add and Sort/Remove buttons.
 
The Sort/Add and Sort/Remove functions assign sequential database item id numbers after sorting database records by their category name. If you use item id query strings on the HTML pages of your WebStore, you should not use these functions to sort the records in the database. Removing the Sort/Add and Sort/Remove buttons from WS Editor will prevent accidental submissions of these functions.
 
 
Index
 
$single_spacing = '1';
If $single_spacing = 1, reduce multiple imbedded spaces to one space in database fields for all functions which modify the database.
 
If $single_spacing = 0, ignore multiple imbedded spaces in database fields.
 
WS Editor always removes leading and trailing whitespace from all fields.
 
 
Index
 
$return_link_url = $script_url.'/ws400CS.cgi';
$return_link_url is an absolute URL link printed at the bottom of all pages in WS Editor whose format is:
$return_link_url = 'http://www.YourDomain.xxx/AnyDirectories/Filename.html';
$script_url is internal to WS Editor, derived from the value of $main_script_url set in ws_global.setup.
 
Setting $return_link_url = ''; disables printing of $return_link_url.
$return_link_title = 'Test WebStore';
$return_link_title is the absolute URL's description.
 
 
Index
 
$email_link_url = "WebStore\@YourDomain.xxx";
$email_link_url is an email link printed at the bottom of all pages in WS Editor.
 
Setting $email_link_url = ''; disables printing of $email_link_url.
$email_link_title = 'Mail to: '.$email_link_url;
$email_link_title is the email link's description.
 
 
Index
 
 
Database of Items for Sale
 
 
NOTE: First element of an array is 0 (zero).
Database Fields in outlet.data
0| 1| 2| 3| 4| 5| 6| 7| 8| 9
 Color | Size | Shipping | Item | Category | Price | Name | Description| Image | Id 
 
%FIELDS = (

#  KEYS    zero           one         two                            Field
  '00' => ['Color',       'text',     'SIZE="20" MAXLENGTH="100"' ], # 0
  '01' => ['Size',        'text',     'SIZE="20" MAXLENGTH="100"' ], # 1
  '02' => ['Shipping',    'text',     'SIZE="20" MAXLENGTH="100"' ], # 2
  '03' => ['Item',        'text',     'SIZE="32" MAXLENGTH="100"' ], # 3
  '04' => ['Category',    'text',     'SIZE="68"'                 ], # 4
# '04' => ['Category',    'select',   'Outer Wear:Shirts:Sweaters'], # 4
  '05' => ['Price',       'text',     'SIZE="20" MAXLENGTH="30"'  ], # 5
  '06' => ['Name',        'text',     'SIZE="68"'                 ], # 6
  '07' => ['Description', 'textarea', 'ROWS="4" COLS="58"'        ], # 7
  '08' => ['Image',       'text',     'SIZE="68"'                 ], # 8
  '09' => ['Id',          'id_field'],                               # 9

); # DO NOT REMOVE - terminates %FIELDS
%FIELDS is a hash of arrays defining each database field and it's corresponding field input for the search engine forms used in WS Editor.
 
The numeric KEYS permit ascending, sequential sorting of the arrays in %FIELDS in the order of occurrence in database records. For example, KEYS 00, 01, 02 correspond to database fields 0, 1, and 2.
 
The field arrays in %FIELDS must be listed in the order of the field's occurrence in the database with the field array for 'Id' defined as the last array in %FIELDS.
 
The 'Id' field array in %FIELDS must have 'Id' as element zero's value and 'id_field' as element one's value.
 
The Id field must be defined and it's attribute value of id_field MUST NOT BE CHANGED.
 
Valid INPUT types are select, text, and textarea.
 
<INPUT TYPE="text">    select    textarea

Elements of $FIELDS{00}:

KEY      zero      one      two
'00' => ['Color',  'text',  'SIZE="20" MAXLENGTH="100"' ],
zero    Descriptive <TABLE> header text and <INPUT NAME="name">
For INPUT NAME, WS Editor replaces spaces with _ (underscore) and switches all characters to lowercase.
one    <INPUT TYPE="text">
two    Attributes for the <INPUT TYPE> (size, maxlength, etc.).
<INPUT TYPE="textarea">    select    text

Elements of $FIELDS{07}:

KEY      zero           one         two
'07' => ['Description', 'textarea', 'ROWS="4" COLS="58"'],
zero    Descriptive <TABLE> header text and <INPUT NAME="name">
For INPUT NAME, WS Editor replaces spaces with _ (underscore) and switches all characters to lowercase.
one    <INPUT TYPE="textarea">
two    Attributes for the <INPUT TYPE> (size, maxlength, etc.).
<INPUT TYPE="select">    text    textarea

Elements of $FIELDS{04}:

KEY      zero        one       two
'04' => ['Category', 'select', 'Outer Wear:Shirts:Sweaters'],
'04' => ['Category', 'select', 'Option1:Option2:Option3'],
zero    Descriptive <TABLE> header text and <INPUT NAME="name">
For INPUT NAME, WS Editor replaces spaces with _ (underscore) and switches all characters to lowercase.
one    <INPUT TYPE="select">
two    Colon delimited listing of options. Leading and trailing whitespace are removed from each option. Whitespace strings embedded within options are reduced to one space. Options may be listed on multiple lines:
'04' => ['Category', 'select',
         'Option1:
          SELECTED~Option2:
          Option3'
        ],
To select a specific option as <OPTION SELECTED>, precede the the option with SELECTED~
'04'  =>  [ 'Category',   'select',   'Option1:SELECTED~Option2:Option3' ],
Option2 will be printed as the <OPTION SELECTED>.
 
Index
 
$category_fld_num = '4';
$category_fld_num is the array index number or field number of the Category field within all database records of outlet.data.
 
NOTE: First element of an array is 0 (zero).
Database Fields in outlet.data
0| 1| 2| 3| 4| 5| 6| 7| 8| 9
 Color | Size | Shipping | Item | Category | Price | Name | Description| Image | Id 
 
 
Index
 
 
Security
 
 
$user_security = 'add delete modify';
$user_security is the security group assigned to all users when they register. Security levels can be modified for any user listed in the user file by removing "add, delete, or modify" from the user's record.
 
Valid security attributes are   add   delete   modify   or   admin.
 
admin   gives full permissions and is equal to   add   delete   modify.
 
Security attributes may be listed in any order.
 
 
Index
 
$allow_register = '1';
$email_register = '0';
If $allow_register = 0, new user registration is not allowed. $email_register and $generate_password are also disabled, regardless of their values in this setup file.
 
If $allow_register = 1 and $email_register = 0, new user registration is allowed and users are added immediately to the user database.
 
If $allow_register = 1 and $email_register = 1, new user registration is allowed. New user's details are emailed to the database administrator and must be manually added to the user's database. Add the line from the administrative email containing the encrypted password which is labeled "Database Record:" to the user's database.
 
 
Index
 
$generate_password = '0';
If $generate_password = 1, WS Editor uses it's password and encryption routines to generate new user passwords. Password is emailed to the new user and must be retrieved by the user before logging in.
 
If $generate_password = 0, new users are allowed to enter a password of their choice and may logon immediately.
 
 
Index
 
$allow_search = '1';
If $allow_search = 1, allow users to search for usernames.
 
If $allow_search = 0, username search is disabled.
 
 
Index
 
$duplicate_check = '1';
If $duplicate_check = 1, WS Editor checks for the possible duplication of a user's details before registering a user.
 
If $duplicate_check = 0, duplicate checking is disabled.
 
 
Index
 
 
Statistics
 
 
$log_file = 'WSEditor_Access.stats';
$log_file is the name of the statistics log file stored in the /Statistics sub-directory.
 
Maintain a formatted or | (pipe) delimited log file for the first access to WS Editor consisting of:
Date and Time of access    21/Dec/1998 12:54:03 PM
$ENV{'HTTP_USER_AGENT'}    Type of Browser
$ENV{'HTTP_REFERER'}       Referring web page
$ENV{'REMOTE_ADDR'}        Remote address
$ENV{'REMOTE_HOST'}        Remote host
Setting $log_file = '' disables the statistics log file routine.
 
 
Index
 
$log_file_size = '25000';  (log file size = 25K)
$log_file_size equals the maximum size of the statistics log file before overwrite occurs.
 
Setting $log_file_size = '' disables overwrite of the log file. You must manually delete the log file.
 
 
Index
 
$log_delimiter = '';
Setting $log_delimiter = 'Y' will | (pipe) delimit the fields of each record written to the log file defined in $log_file.
 
Setting $log_delimiter = '' disables pipe delimited fields. Fields are separated by four spaces.
 
 
Index
 
$stat_file = 'WSEditor_Query.stats';
$stat_file is the name of the query stat file stored in the /Statistics sub-directory.
 
Maintain a formatted or | (pipe) delimited query stat file consisting of:
Access Date and Time    21/Dec/1996 12:54:03 PM
Setup File              Setup filename (file extension truncated)
Request                 Primary Request (query name=value pair)
$ENV{'REMOTE_ADDR'}     Remote address
Process ID              Script process ID
Query String            name=value pairs present in form POST submissions.
                        Values for login, password, username, and any
                        field beginning with cc or chk are replaced with
                        * (asterisks).  Field names are case insensitive.
Setting $stat_file = '' disables the query stat file routine.
 
 
Index
 
$stat_file_size = '50000';  (stat file size = 50K)
$stat_file_size equals the maximum size of the query stat file before overwrite occurs.
 
Setting $stat_file_size = '' disables overwrite of the query stat file. You must manually delete the stat file.
 
 
Index
 
$stat_delimiter = '';
Setting $stat_delimiter = 'Y' will | (pipe) delimit the fields of each record written to the query stat file defined in $stat_file.
 
Setting $stat_delimiter = '' disables pipe delimited fields. Fields are separated by four spaces.
 
 
Index
 
 
HTML Display
 
 
$data_font and $data_face, set in ws_global.setup, are used with $extc_fnt_clr, $error_fnt_clr, $html_fnt_clr, and $message_fnt_clr to develop opening <FONT> tags for use in table data rows.
 
$header_font and $header_face, set in ws_global.setup, are used with $header_fnt_clr to develop an opening <FONT> tag for use in table header rows.
 
 
$BORDER      = '4';
$CELLPADDING = '3';
$CELLSPACING = '0';
Dimensions of the table's borders, space between text and columns, and width of borders between rows can be modified by adjusting the values of $BORDER, $CELLPADDING, and $CELLSPACING.
 
Setting $BORDER = 0 disables border display.
 
 
Index
 
# $background  = 'image.jpg';
  $bgcolor     = '#F0F8FF';  # Aliceblue
# $text_color  = '#000000';  # Black
# $link_color  = '#0000FF';  # Blue
# $vlink_color = '#0000A0';  # Dark Blue
# $alink_color = '#FF0000';  # Red
Values for background, bgcolor, text, link, visited link, and active link are set using $background, $bgcolor, $text_color, $link_color, $vlink_color, $alink_color respectively.
 
These variables are set globally in ws_global.setup for use by all scripts in the WebStore application.
 
To configure specific colors for WS Editor, remove the # (pound sign) from column 1 and set to the desired value. Any combination of these variables may be uncommented (pound sign removed).
 
$background is the filename of the background image stored in the /Web_store/Graphics sub-directory.
 
The script determines whether to precede $backgound with $graphics_url or $ssl_graphics_url depending on the setting of $ssl_url and by including a name=value pair for 'use_ssl' in the query string of the URL accessing ws_editor.cgi: ws_editor.cgi?use_ssl=Y. Under most conditions, WS Editor is accessed without the use of SSL.
	$graphics_url/$background   OR   $ssl_graphics_url/$background
Setting any of these variables = ''; disables printing their respective attribute within the opening <BODY> tag of WS Editor generated HTML pages.
 
 
Index
 
$header_bkg_clr = '#0000A0'; Darkblue
$header_fnt_clr = '#CCCCCC'; Lightgray
$header_bkg_clr and $header_fnt_clr are the background color and font color used in table header rows to display table page headers.
 
Setting $header_bkg_clr = ''; disables $header_bkg_clr.
Setting $header_fnt_clr = ''; disables $header_fnt_clr.
Colors default to <BODY BGCOLOR or BACKGROUND> and <BODY TEXT> attributes.
 
 
Index
 
$message_fnt_clr = '#0000A0'; Darkblue
$message_fnt_clr is the font color used in table header rows to display helpful messages to users.
 
Setting $message_fnt_clr = ''; disables $message_fnt_clr. Text color defaults to <BODY TEXT> attribute.
 
 
Index
 
$error_fnt_clr = '#C00000'; Darkred
$error_fnt_clr is the font color used in table header rows to display user key entry error messages or additional information concerning the function just performed (or submitted) by the user.
 
Setting $error_fnt_clr = ''; disables $error_fnt_clr. Text color defaults to <BODY TEXT> attribute.
 
 
Index
 
$extc_fnt_clr = '#0000FF'; Blue
$extc_fnt_clr is the font color used in all "Modify Item" functions to display the extended HTML character set (&nbsp;, &copy;, etc.).
 
$extc_fnt_clr must be defined and can not be disabled. $extc_fnt_clr defaults to  '#0000FF'  if mis-configured.
 
 
Index
 
$html_fnt_clr = '#FF0000'; Red
$html_fnt_clr is the font color used in all "Modify Item" functions to display <HTML> tags.
 
$html_fnt_clr must be defined and can not be disabled. $html_fnt_clr defaults to  '#FF0000'  if mis-configured.
 
 
1; # DO NOT REMOVE IN outlet_editor.setup

# End of file
 
Index | Top of Page