mlstdbNet configuration - Tips
- Customize the look of the pages
- Speed up searching
- Search for isolates from within the profiles database
- Restrict users to different database views
Customize the look of the pages
- Formatting is done using CSS. The software looks for a stylesheet called stylesheet.css within the WEBROOT/DBASE_NAME directory, or, failing that, within the WEBROOT directory. Modify the provided file to change colours, fonts etc.
- The software will also look for a header.html and a footer.html file within the WEBROOT/DBASE_NAME directory. If it finds these, it will insert the contents of the header.html file in to the top of the page and the contents of the footer.html page into the bottom of the page.
- If you include a banner.html file in this directory, this will be inserted prominently on the database contents page.
Speed up searching
- You can speed up the script considerably by running it under mod_perl. The databases on the pubmlst.org primary site use this.
Search for isolates from within the profiles database
- Make sure your profiles database contains a table called 'clients'. If it doesn't, use the createClientTable.sql SQL script (found in the upgrade directory of the archive) within psql to create it, e.g.
psql dbase_name
\i createClientTable.sqlYou now need to enter the details of any isolate databases that exist on your system that you'd like to be searched following display of a ST information page. The fields of the clients table are: id, name, xml, description and hostscript. The 'id' must be a unique integer, 'name' is the system name of the isolate database, 'xml' is the name of the XML file that describes the isolate database - this needs to be in the same directory as the mlstdbnet.pl script, 'description' is used to describe the database within the web page and 'hostscript' is the URL to the mlstdbnet.pl script if the database is hosted on another domain, e.g. 'http://neisseria.org/cgi-bin/mlstdbnet/mlstdbnet.pl' (the database must exist on your system though). So from within psql, add something like the following
INSERT INTO clients VALUES (1,'nm_isolates','pub-nm_isolates.xml','PubMLST isolate database','');
- Within the XML file of your profiles database, add 'clienttable="yes"' as an attribute within <system>.
Restrict users to different database views
- Create a 'views' table with id (varchar) and description (varchar) fields within the isolates database, e.g. from within psql
CREATE TABLE views (id varchar, description varchar);
- Create database views which filter the results by some criteria, e.g. from within psql
CREATE VIEW uk AS SELECT * FROM isolates WHERE country='UK';
- Enter the name of the views and descriptions in to the 'views' table, e.g.
INSERT INTO views VALUES ('uk','Isolates from the UK');
- Within the XML description file <system> tag, add a 'multiviews="multiviews"' attribute.
- Add a field to the users table called 'viewid', e.g.
ALTER TABLE users ADD COLUMN viewid varchar;
- Using the curation interface, you can now set the view for each of your users.
- Set up apache HTTP authentication so that users have to enter a username and password to enter the site. The username is passed to the software to ensure that the correct view is used.