= ARSF Documentation = == ARSF Status Page Documentation == Documentation for web files can be generated using PHPDoc and JSDoc as they contain comments which can be converted into HTML documentation. The gist of the status web stuff is that the edit/{index,order}.php and progress/index.php files send AJAX queries to the API I created and that returns data back to the page. The API essentially consists of a regular expression which matches the URL that the AJAX calls, and then passes that to a class which returns the data back to the browser. Look at the code, its relatively simple. There is a database class which does all the heavy lifting, basically it just runs queries on tables and views. Even then the actual database does the majority of work, due to my awesome, yet evil-looking SQL code. PHPDoc command to generate documentation. JSDoc command is similar, there are a few ways to get JSDoc so I wont document the command here. {{{ phpdoc run --title "ARSF Status Documentation" --visibility "public,protected,private" --sourcecode -p -t OUTPUT_DIRECTORY -d WEBFILES_DIRECTORY }}} == ARSF Status Database = Ok I will have hopefully attached an up-to-date entity relationship diagram to show the layout of the database, don't believe it wholeheartedly, check the actual database (pgsql.npm.ac.uk AKA hodgson.npm.ac.uk) for actual column names etc... The majority of the database is self explanatory. PIs are associated with projects, a flight can be related to many projects (as defined in project_flights). A flight can have flight_sensors (basically what sensor was used on that flight) and each flight sensor can have many sensor_statuses (this keeps track of the progress, I like to think of it as an audit trail, keeps track of what everyone has done). That is basically it. Now '''do not touch my database unless you are sure you know what you are doing!''' The following info is only useful to those already fluent in SQL === SQL Explanation === This explanation might not always be up-to-date but should be rather close. This needs to be run as the superuser on the database, normally `postgres` {{{ #!sql CREATE EXTENSION tablefunc; }}}