xerte online toolkits. xerte online toolkits – internals and externals pat lockley is learning...
TRANSCRIPT
![Page 1: Xerte Online Toolkits. Xerte Online Toolkits – internals and externals Pat Lockley IS Learning Team 17/4/2009](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649e665503460f94b6137a/html5/thumbnails/1.jpg)
Xerte Online Toolkits
![Page 2: Xerte Online Toolkits. Xerte Online Toolkits – internals and externals Pat Lockley IS Learning Team 17/4/2009](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649e665503460f94b6137a/html5/thumbnails/2.jpg)
Xerte Online Toolkits – internals and externals
Pat LockleyIS Learning Team
17/4/2009
![Page 3: Xerte Online Toolkits. Xerte Online Toolkits – internals and externals Pat Lockley IS Learning Team 17/4/2009](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649e665503460f94b6137a/html5/thumbnails/3.jpg)
Structure
• The Installer• The database• The file system• Style Sheets• Index.php• The AJAX / Javascript• Site standards• Questions
![Page 4: Xerte Online Toolkits. Xerte Online Toolkits – internals and externals Pat Lockley IS Learning Team 17/4/2009](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649e665503460f94b6137a/html5/thumbnails/4.jpg)
The installer
• All of this lives in the setup folder• People, unless XAMPPing on windows need to
set the write permissions• http://url/toolkits/setup/ to start the install
process• Various calls to ini_get• No variables are changed, and at no point is
the install stopped• No direct support as of yet for integration in
the installer
![Page 5: Xerte Online Toolkits. Xerte Online Toolkits – internals and externals Pat Lockley IS Learning Team 17/4/2009](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649e665503460f94b6137a/html5/thumbnails/5.jpg)
The setup folder
• The folder contains all the files need to run the installer itself
• Database.txt becomes database.php (and is moved to the root folder)
• Unless you XAMPP, in which case xampp_database.txt is used
• Basic.sql and xampp.txt contain the MySQL queries used in the install
• All creates apart from three insert queries
![Page 6: Xerte Online Toolkits. Xerte Online Toolkits – internals and externals Pat Lockley IS Learning Team 17/4/2009](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649e665503460f94b6137a/html5/thumbnails/6.jpg)
Setting up the database
• Setup asks for an account which can modify the database (create and insert rights required)
• Then for user account for the database (select, delete, update, insert rights required)
• The queries are hardcoded, except for the dollar to allow for modifying the database prefix (shared hosts).
• During setup only page4.php inserts user input, all other database inserts are fixed
![Page 7: Xerte Online Toolkits. Xerte Online Toolkits – internals and externals Pat Lockley IS Learning Team 17/4/2009](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649e665503460f94b6137a/html5/thumbnails/7.jpg)
Database tables
• The database is MySQL, and is only limited by the fact that’s the PHP I have used
• No stored procedures• Nothing to fancy in terms of database
structure• No explicit naming convention
![Page 8: Xerte Online Toolkits. Xerte Online Toolkits – internals and externals Pat Lockley IS Learning Team 17/4/2009](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649e665503460f94b6137a/html5/thumbnails/8.jpg)
1 – Additional_sharing
• Handles peer review and XML sharing (not limited to this)
• Stores a sharing type variable – at present either Peer or XML
• Extra variable is either the peer password, or the xml host to limit too
![Page 9: Xerte Online Toolkits. Xerte Online Toolkits – internals and externals Pat Lockley IS Learning Team 17/4/2009](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649e665503460f94b6137a/html5/thumbnails/9.jpg)
2- Folder_details
• All folders including the recycle bin• All folders have IDs• Login_id (the owner)• A parent (set to 0 if the bin or the root folder)• A name (spaces replaced by underscores)• And a date created
![Page 10: Xerte Online Toolkits. Xerte Online Toolkits – internals and externals Pat Lockley IS Learning Team 17/4/2009](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649e665503460f94b6137a/html5/thumbnails/10.jpg)
3- originaltemplatesdetails
• Handles the blank templates• ID• Framework (still xerte)• Template_name (equivalent to the folder)• Description• Date uploaded• Display name• Display_id (Id of the example, set to 0 if none)• Access rights (* is unlimited, can mask)• Active (Can hide if want to)
![Page 11: Xerte Online Toolkits. Xerte Online Toolkits – internals and externals Pat Lockley IS Learning Team 17/4/2009](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649e665503460f94b6137a/html5/thumbnails/11.jpg)
4 - play_security_details
• Handles additional security options on the access panel
• Security setting is the name• Security info the extra text for the properties panel• Security Data is either a series of ip ranges (can
mask any class) or a HTTP – it cannot do both.
![Page 12: Xerte Online Toolkits. Xerte Online Toolkits – internals and externals Pat Lockley IS Learning Team 17/4/2009](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649e665503460f94b6137a/html5/thumbnails/12.jpg)
5 - sitedetails
• Handles pretty much the entire configuration of the site
• Variables are relatively self explanatory
![Page 13: Xerte Online Toolkits. Xerte Online Toolkits – internals and externals Pat Lockley IS Learning Team 17/4/2009](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649e665503460f94b6137a/html5/thumbnails/13.jpg)
6 – syndicationlicenses and syndicationcategories
• Handles the creative commons licenses and the areas for the syndication panel
![Page 14: Xerte Online Toolkits. Xerte Online Toolkits – internals and externals Pat Lockley IS Learning Team 17/4/2009](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649e665503460f94b6137a/html5/thumbnails/14.jpg)
8 – templatedetails
• Holds details for each template• Creator_id• Template_type_id• Template_name• Date_modified• Date_Accessed• Number_of_uses• Access_to_whom
![Page 15: Xerte Online Toolkits. Xerte Online Toolkits – internals and externals Pat Lockley IS Learning Team 17/4/2009](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649e665503460f94b6137a/html5/thumbnails/15.jpg)
9 – templaterights
• Holds sharing information for templates• User_id• Role• Folder• Notes
![Page 16: Xerte Online Toolkits. Xerte Online Toolkits – internals and externals Pat Lockley IS Learning Team 17/4/2009](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649e665503460f94b6137a/html5/thumbnails/16.jpg)
10 – templatesyndication
• Handles the syndication of a template to RSS, Export or DCMD
• Description• Keywords• Rss• Export• Syndication• Category• License
![Page 17: Xerte Online Toolkits. Xerte Online Toolkits – internals and externals Pat Lockley IS Learning Team 17/4/2009](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649e665503460f94b6137a/html5/thumbnails/17.jpg)
The File System
• Keep the root clean• Separate modules• Separate webcode from xerte code• Key folders at root level• Website_code – contains all the code for running the
site (unless in root)• User-files – where templates are stored• Modules – where xerte code lives (mostly)• Import – where files are imported too• Feedback – handles the feedback page• Error_logs – where error_logs live
![Page 18: Xerte Online Toolkits. Xerte Online Toolkits – internals and externals Pat Lockley IS Learning Team 17/4/2009](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649e665503460f94b6137a/html5/thumbnails/18.jpg)
Example -The play page
• Starts out in the root folder• Use several php libraries from website_code/php• Finds out what template framework we are using• Includes a file from that framework• Then executes a function from within that framework
![Page 19: Xerte Online Toolkits. Xerte Online Toolkits – internals and externals Pat Lockley IS Learning Team 17/4/2009](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649e665503460f94b6137a/html5/thumbnails/19.jpg)
The xerte module
• Note in modules there is a folder called Xerte, all the xerte code lives here
• The php is the framework code for the various functions
• Not all functions are modularised yet
![Page 20: Xerte Online Toolkits. Xerte Online Toolkits – internals and externals Pat Lockley IS Learning Team 17/4/2009](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649e665503460f94b6137a/html5/thumbnails/20.jpg)
Xerte module folders
• Scorm contains files for inclusion with scorm and export
• Templates is the xml and media folder• Parent_templates contains the RLT and the XWD• Same folder names inside these folders for 1 project• Engine contains the wizard (and the drawing tool)
and the php the wizard needs to upload, save the file and check a file exists before previewing.
![Page 21: Xerte Online Toolkits. Xerte Online Toolkits – internals and externals Pat Lockley IS Learning Team 17/4/2009](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649e665503460f94b6137a/html5/thumbnails/21.jpg)
Website code folder
• Styles – all the css• Scripts – all the javascript apart from rloObject.js and
swfobject.js• Php – all the php libraries and ajax queries live in
here• Images – all the site pictures• Files within this area are HTML stubs containing parts
of the pages.
![Page 22: Xerte Online Toolkits. Xerte Online Toolkits – internals and externals Pat Lockley IS Learning Team 17/4/2009](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649e665503460f94b6137a/html5/thumbnails/22.jpg)
The PHP folder
• Code in this folder are library functions (try not to have functions inside other pieces of PHP)
• Workspaceproperties – code from that panel• Versioncontrol – lock file handler and the publish updater• Templates – queries to perform actions (delete, create etc.) for
templates• Publish – code to publish a template (e.g write preview.xml over
data.xml)• Properties – code for that panel• Peer – code for peer review• Management• Import• Folders• Folderproperties• Error_log (empty)
![Page 23: Xerte Online Toolkits. Xerte Online Toolkits – internals and externals Pat Lockley IS Learning Team 17/4/2009](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649e665503460f94b6137a/html5/thumbnails/23.jpg)
The Scripts folder
• Ajax management – ajax object creation• File system – the file actions (drag drop)• Folder_properties• Folders – queries on folders• Import – all the import code• Logout – basic logging out code• Management – all the code for management ajax queries• Opencloseedit • Peer – peer review• Properties_tab• Screen_display – selection and setting up the screen• Template_management – edit / play / preview• Validation – user entry checking• workspaceproperties
![Page 24: Xerte Online Toolkits. Xerte Online Toolkits – internals and externals Pat Lockley IS Learning Team 17/4/2009](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649e665503460f94b6137a/html5/thumbnails/24.jpg)
Style sheets
• Style sheet per page • Style sheet per panel• Style sheet for the folder pop up
Some sharing between different sheetsNo separation of structure and colourLots of fixed valuesSome code has embedded styles in certain parts
![Page 25: Xerte Online Toolkits. Xerte Online Toolkits – internals and externals Pat Lockley IS Learning Team 17/4/2009](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649e665503460f94b6137a/html5/thumbnails/25.jpg)
Index.php
• This is key page for the site• It handles logging in and self posts to setup the i
nterface• From here on in everything is using javascript / php
and MySQL• Most of the queries use AJAX (so page never
changes)• Iframe for the import code
![Page 26: Xerte Online Toolkits. Xerte Online Toolkits – internals and externals Pat Lockley IS Learning Team 17/4/2009](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649e665503460f94b6137a/html5/thumbnails/26.jpg)
Index.php
• This is key page for the site• It handles logging in and self posts to setup the i
nterface• From here on in everything is using javascript / php
and MySQL• Most of the queries use AJAX (so page never
changes)• Iframe for the import code
![Page 27: Xerte Online Toolkits. Xerte Online Toolkits – internals and externals Pat Lockley IS Learning Team 17/4/2009](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649e665503460f94b6137a/html5/thumbnails/27.jpg)
AJAX
function setup_ajax(){
try{
xmlHttp=new XMLHttpRequest();
}catch (e){ // Internet Explorer
try{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}catch (e){
try{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}catch (e){
alert("Your browser does not support AJAX!");return false;
} } }
}
![Page 28: Xerte Online Toolkits. Xerte Online Toolkits – internals and externals Pat Lockley IS Learning Team 17/4/2009](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649e665503460f94b6137a/html5/thumbnails/28.jpg)
AJAX (2)
function properties_ajax_send_prepare(url){
xmlHttp.open("post",properties_ajax_php_path + url,true);xmlHttp.onreadystatechange=properties_stateChanged;xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
}
function properties_stateChanged(){
if (xmlHttp.readyState==4){
if(xmlHttp.responseText!=""){
document.getElementById('dynamic_area').innerHTML = xmlHttp.responseText;
}}
}
![Page 29: Xerte Online Toolkits. Xerte Online Toolkits – internals and externals Pat Lockley IS Learning Team 17/4/2009](https://reader035.vdocuments.us/reader035/viewer/2022062407/56649e665503460f94b6137a/html5/thumbnails/29.jpg)
Site standards
• Commenting is PHP doc, even in JS• Try to comment each if branch if not obvious• Try not to code for success• Use error log calls when applicable• Name the PHP file after the name of the Javascript
function when ajaxing• Assume modularity • Work on the basis of putting all constants into
variables• Style sheet and Javascript per page