xerte online toolkits. xerte online toolkits – internals and externals pat lockley is learning...

of 29 /29
Xerte Online Toolkits

Author: heather-mckenzie

Post on 28-Dec-2015

219 views

Category:

Documents


0 download

Embed Size (px)

TRANSCRIPT

  • Xerte Online Toolkits

  • Xerte Online Toolkits internals and externalsPat LockleyIS Learning Team17/4/2009

  • StructureThe InstallerThe databaseThe file systemStyle SheetsIndex.phpThe AJAX / JavascriptSite standardsQuestions

  • The installerAll of this lives in the setup folderPeople, unless XAMPPing on windows need to set the write permissionshttp://url/toolkits/setup/ to start the install processVarious calls to ini_getNo variables are changed, and at no point is the install stoppedNo direct support as of yet for integration in the installer

  • The setup folderThe folder contains all the files need to run the installer itselfDatabase.txt becomes database.php (and is moved to the root folder)Unless you XAMPP, in which case xampp_database.txt is usedBasic.sql and xampp.txt contain the MySQL queries used in the installAll creates apart from three insert queries

  • Setting up the databaseSetup 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

  • Database tablesThe database is MySQL, and is only limited by the fact thats the PHP I have usedNo stored proceduresNothing to fancy in terms of database structureNo explicit naming convention

  • 1 Additional_sharingHandles peer review and XML sharing (not limited to this)Stores a sharing type variable at present either Peer or XMLExtra variable is either the peer password, or the xml host to limit too

  • 2- Folder_detailsAll folders including the recycle binAll folders have IDsLogin_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

  • 3- originaltemplatesdetailsHandles the blank templatesIDFramework (still xerte)Template_name (equivalent to the folder)DescriptionDate uploadedDisplay nameDisplay_id (Id of the example, set to 0 if none)Access rights (* is unlimited, can mask)Active (Can hide if want to)

  • 4 - play_security_detailsHandles additional security options on the access panelSecurity setting is the nameSecurity info the extra text for the properties panelSecurity Data is either a series of ip ranges (can mask any class) or a HTTP it cannot do both.

  • 5 - sitedetailsHandles pretty much the entire configuration of the siteVariables are relatively self explanatory

  • 6 syndicationlicenses and syndicationcategoriesHandles the creative commons licenses and the areas for the syndication panel

  • 8 templatedetailsHolds details for each templateCreator_idTemplate_type_idTemplate_nameDate_modifiedDate_AccessedNumber_of_usesAccess_to_whom

  • 9 templaterightsHolds sharing information for templatesUser_idRoleFolderNotes

  • 10 templatesyndicationHandles the syndication of a template to RSS, Export or DCMDDescriptionKeywordsRssExportSyndicationCategoryLicense

  • The File SystemKeep the root cleanSeparate modulesSeparate webcode from xerte codeKey folders at root levelWebsite_code contains all the code for running the site (unless in root)User-files where templates are storedModules where xerte code lives (mostly)Import where files are imported tooFeedback handles the feedback pageError_logs where error_logs live

  • Example -The play pageStarts out in the root folderUse several php libraries from website_code/phpFinds out what template framework we are usingIncludes a file from that frameworkThen executes a function from within that framework

  • The xerte moduleNote in modules there is a folder called Xerte, all the xerte code lives hereThe php is the framework code for the various functionsNot all functions are modularised yet

  • Xerte module foldersScorm contains files for inclusion with scorm and exportTemplates is the xml and media folderParent_templates contains the RLT and the XWDSame folder names inside these folders for 1 projectEngine 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.

  • Website code folderStyles all the cssScripts all the javascript apart from rloObject.js and swfobject.jsPhp all the php libraries and ajax queries live in hereImages all the site picturesFiles within this area are HTML stubs containing parts of the pages.

  • The PHP folderCode in this folder are library functions (try not to have functions inside other pieces of PHP)Workspaceproperties code from that panelVersioncontrol lock file handler and the publish updaterTemplates queries to perform actions (delete, create etc.) for templatesPublish code to publish a template (e.g write preview.xml over data.xml)Properties code for that panelPeer code for peer reviewManagementImportFoldersFolderpropertiesError_log (empty)

  • The Scripts folderAjax management ajax object creationFile system the file actions (drag drop)Folder_propertiesFolders queries on foldersImport all the import codeLogout basic logging out codeManagement all the code for management ajax queriesOpencloseedit Peer peer reviewProperties_tabScreen_display selection and setting up the screenTemplate_management edit / play / previewValidation user entry checkingworkspaceproperties

  • Style sheetsStyle sheet per page Style sheet per panelStyle 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

  • Index.phpThis 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

  • Index.phpThis 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

  • AJAXfunction 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;} } }}

  • 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;

    }}}

  • Site standardsCommenting is PHP doc, even in JSTry to comment each if branch if not obviousTry not to code for successUse error log calls when applicableName the PHP file after the name of the Javascript function when ajaxingAssume modularity Work on the basis of putting all constants into variablesStyle sheet and Javascript per page

    **