PDB Carbohydrate Classification Documentation 1 File Hierarchy Max Nanis

advertisement
PDB Carbohydrate Classification Documentation
Max Nanis
August 12, 2011
1
File Hierarchy
• /summer - root dir
– application - web app
∗ bootstrap.php - config/routing of application
∗ classes - logic of application
· controller - logic of the code
*
api/v1.php
* public - logic for pages seen on the site
* templates - loading all css/js/html metadata into the boiler plate
· helper - “global” functions (do not need to instantiate the class)
· model - commonly used sql queries
∗ config - the safe way to do global vars/constants
∗ views - templates for html of the site
· api/sugar
· blocks - reused sections of html
· pages - what gets loaded as the html for a controller (organized by folder)
· templates - html boilerplate for site to pass content into
– apps - all ruby & backend
∗ assets - keeping all the sql dumps and txt files/spread sheets that were used throughout the
project
∗ config - program configuration files using .yml (primarily to define db access)
∗ extensions - extend data-mapper and other common functionality that isn’t build in
∗ models - used by data-mapper to define mysql fields/table structure and field types
∗ run.rb - start of app (takes two parameters = cif or count)
∗ utils - modules of application that separate out their function (now pdb is exclusively used)
– css - front end stylesheets
– images - front end images
– index.php - front/starting point of entire kohana system
– js - front end javascript
∗ script.js - onbody load
– modules - kohana 3 specific modules (primarily db access)
∗ /libs/krumo_0.2.1a
– system - kohana 3 core system files
1
2
Dependencies
2.1
Installing
/opt/ruby-1.9.2/bin/gem install data_mapper
/opt/ruby-1.9.2/bin/gem install dm-mysql-adapter
/opt/ruby-1.9.2/bin/gem install nokogiri
2.2
Including
require ’rubygems’
require
require
require
require
require
require
require
require
3
’dm-core’
’dm-validations’
’dm-migrations’
’dm-aggregates’
’yaml’
’open-uri’
’nokogiri’
"erb"
Components
3.1
Front end
3.1.1
Requirements
PHP5
/www/summer/application/cache & /www/summer/application/logs must be writable by system
mod_rewrite must be enabled for apache2
3.1.2
Show all votes for a ligand
SELECT reviewed, reviewer FROM ligand_votes WHERE ligand_id = ’chemical component id’;
3.1.3
Executing backend
The two backend jobs (count & cif) are done using the services api at
/api/v1/service/count & /api/v1/service/cif
3.2
Back end
3.2.1
Execution
/opt/ruby-1.9.2/bin/ruby /www/summer/apps/run.rb count
/opt/ruby-1.9.2/bin/ruby /www/summer/apps/run.rb cif
2
Download