HOWTO: Modifying the conf files
General Overview
A lot of mySiteMaker's flexibility comes from your ability to modify the
configuration (conf) files for each mySite. Editing a configuration
file simply involves opening it with the text editor of your choice and
changing things. Configuration files are stored in the "conf"
directory which can be found in the same place that the mySiteMaker
CGIs are stored. Configuration files themselves are named after the
table and database that the mySite was created for. For example, if
you created a mySite for a table named "addresses" in a database named
"personnel", the configuration file would be named
"personnel_addresses.conf"
It is advised that every column name be in the form table_name.column_name, even if otherwise shown
here.
Below is a description of all of the configuration file parameter
names. NOTE: Not all configuration files will come with all
of the parameters listed below. If a parameter is missing from the
file and you would like to add its functionality, just add the
parameter name to the file on a new line and put a white space between
it and its values.
Parameter Names
-
SITE_NAME - The value that follows
this parameter gives a name to your mySite. For example, possible
values for this are "ITLab" and "Medical University of SC".
Example:
SITE_NAME ITLab
-
DB_TYPE - The value that follows
this parameter is the type of database that the mySite has been
built for. For example, possible values for this are "mysql" and
"postgres". Example:
DB_TYPE mysql
-
DB_NAME - The name of the
database that the mySite has been created for, followed by a colon
(':') followed by the hostname of the host that is serving the
database. For example:
DB_NAME personnel:server.test.com
-
DB_TABLE - The name of the table
that the mySite has been created for. For example:
DB_TABLE addresses
-
PRIMARY_KEY - The name of the column
in the database table specified by DB_NAME and DB_TABLE that
contains the primary key for the table. For example:
PRIMARY_KEY record_id
-
USERNAME - The username for a user
that has, at the very least (and hopefully, at the very most),
SELECT privileges for that database table specified by DB_NAME and
DB_TABLE.
-
PASSWORD - The password for a user
that has, at the very least (and hopefully, at the very most),
SELECT privileges for that database table specified by DB_NAME and
DB_TABLE.
-
{INSERT|UPDATE|DELETE|SELECT}_ALLOW
- These are actually 4 different parameters:
INSERT_ALLOW
UPDATE_ALLOW
DELETE_ALLOW
SELECT_ALLOW
.
Each takes a space-separated list of usernames. Use these if you
want fixed roles for insert/edit/delete/view and don't want the end
user to enter anything. You must secure your mySiteMaker CGI access
if you use these. mySiteMaker will use the Apache environment
variable REMOTE_USER. To allow select (view) access to everyone,
leave the parameter out. Including a parameter with an empty list
of usernames denies access to that function to everyone. Note that
using any of these requires the database user (as specified by
USERNAME and PASSWORD) to have the corresponding
privilege in the database.
-
NEW_RECORDS - This parameter
controls whether or not a link to "Add a new record" appears on the
HTML results screens. If it is set to zero ('0') or has no value,
then the link will not appear. If it is set to anything else, the
link will appear. For example, to allow for the "Add a new record"
link, you would want:
NEW_RECORDS 1
-
EDIT_RECORDS - This parameter
controls whether or not a link to "Edit" appears at the end of each
row on the HTML results screens. If it is set to zero ('0') or has
no value, then the link will not appear. If it is set to anything
else, the link will appear. For example, to allow for the "EDIT"
link, you would want:
EDIT_RECORDS 1
-
DELETE_RECORDS - This parameter
controls whether or not a link to "Delete" appears at the end of
each row on the HTML results screens. If it is set to zero ('0')
or has no value, then the link will not appear. If it is set to
anything else, the link will appear. For example, to allow for the
"Delete" link, you would want:
DELETE_RECORDS 1
-
SEARCH_URL - This parameter should
be set to the path from the base HTML directory to the search page
for your mySite. For example:
SEARCH_URL /mySiteMaker/dbName_tableName_search.html
-
REL_HTML - This parameter should be
set to the path from the base HTML directory to the directory that
contains the mySiteMaker HTML. Example:
REL_HTML /mySiteMaker/
-
RELATIVE_CGI_DIR - This parameter
should be set to the path from the base CGI-BIN directory to the
directory that contains the mySiteMaker CGIs. For example:
RELATIVE_CGI_DIR /cgi-bin/mySiteMaker/
-
LOG_FILE - See the file: LOGGING-HOWTO.html for a full
description of what this parameter controls and how to make use of
it. Briefly, this parameter holds the name of a file that
mySiteMaker should use to log queries for this mySite. OBSOLETE
-
COLUMN_NAMES - This a list of column
names that can be queried by mySiteMaker. The column names are
formatted so that the table name, plus a dot ('.') character are
prepend to name of the column. For example:
table_name.colum_nname. A colon character (':') is
used to separate each column name in the list. For example:
COLUMN_NAMES table_a.column_a:table_a.column_b:table_b.column_a
-
COLUMN_HEADERS - Use this to display
"pretty" headers on the columns. A colon character (':') is used to
separate each column name in the list. Only works with HTML mode.
For example:
COLUMN_HEADERS Department:Employee name:Address
-
NO_EDIT - This is a list of column
names that are not allowed to be edited, even if editing data in a
general sense is permitted (see the EDIT_RECORDS parameter).
The column names are formatted and listed the same way they are for
the COLUMN_NAMES parameter. For example:
NO_EDIT table_a.column_a:table_a.column_d
-
URLS - This parameter holds a string
that dictates which columns in the HTML output will contain URL
hyperlinks. The basic format is a list of column names separated
by a space, the column names as they appears in the results screen.
This can be repeated for as many columns as you wish as long as
there is a space between the column names. For example:
URLS column_a column_b
-
EMAILS - This parameter holds a
string that dictates which columns in the HTML output will contain
email hyperlinks. The basic format is a list of column names
separated by a space, the column names as they appears in the
results screen. This can be repeated for as many columns as you
wish as long as there is a space between the column names. For
example:
EMAILS column_a column_b
-
INPUT_OPTIONS - The value for this
parameter is a list of triplets separated by colon characters
(':'). Each triplet contains three values separated by equals
characters ('='). The first value in each triplet is the column
name in the table described by DB_NAME and DB_TABLE that is to have data input
(for new records as well as when editing existing records) via a
pulldown menu, radio buttons, checkboxes or a multi-select menu.
The second value in each triplet is the column name that contains
the values that are used to populate the pulldown menus,
checkboxes, etc. The third value of each triplet contains the
input method. Possible values for input method are
- pulldown (for pulldown menu - single choice drop-down)
- multi (for multi-select menu - multiple choice pseudo-drop-down)
- radio (for radio buttons - single choice)
- checkbox (for checkboxes - multiple choice)
NOTE: Each
triplet must have a corresponding entry for the INDIRECT_RELATIONS or
DiRECT_RELATIONS
parameters. If the input method is checkbox or multi, then there
needs to be an entry in INDIRECT_RELATIONS. If the input method is
radio or pulldown, then there needs to be an entry in
DIRECT_RELATIONS.
Also, column names must be proceeded by the table name and a dot
('.').
For example:
INPUT_OPTIONS table_a.column_name_x=table_b.column_name_y=pulldown
-
INDIRECT_RELATIONS - The value for
this parameter is a list of 6-tuples that are separated with colon
characters (':'). The values in the 6-tuples are separated with
equals characters ('='). The values in each 6-tuple should be:
-
r_table: the table in the relation that holds the data we are
interested in joining into the results from our query to the
main table.
- int_table: the intermediate table that simply holds key values from the
two tables that hold interesting data that we want to join
- main_key: a column in the main table that holds key values. In this case
the key values are the primary key values for the main table
- int_main_key: the column in int_table that holds values from main_key
- r_key: the column in r_table that holds the key values
- int_r_key: the column in int_table that holds values from r_key
-
DIRECT_RELATIONS - See the file: JOINING_TABLES-HOWTO.html
for a full description of what this parameter controls and how to
make use of it. Briefly this is a list of value pairs separated by
colon characters (':'). The two values in the pair are separated
with an equals character ('='). The first value is the name of a
column in the table described by DB_NAME and DB_TABLE that stores foreign keys for
rows in another table. The second value is the name of the column
in the other table that stores primary key values for that table.
If this parameter is being used in conjunction with INPUT_OPTIONS then the first value in
the DIRECT_RELATIONS pair should
match the first value in the INPUT_OPTIONS triplet.
For example:
DIRECT_RELATIONS main_table.foreign_keys=other_table.record_id
For direct and indirect relations, see the Joining Tables documentation.