= Developer Guidelines = [[TOC]] == Getting Started == * [wiki:DeveloperGuidelines/Basics The Basics] * [wiki:Domain Understanding the Domain] * [wiki:DeveloperGuidelines/Tutorial Tutorial] == Development Enviroment == * [wiki:InstallationGuidelines Install a Development Enviroment] * [wiki:DeveloperGuidelines/Git Using git] Version Control == Development Process == We define requirements: * [wiki:Projects] * '''[wiki:BluePrint BluePrints]''' Designs should focus on Usability: * [wiki:DeveloperGuidelines/Usability Usability] We write Tests: * [wiki:DeveloperGuidelines/Testing Testing] We keep code conventions to maximise readability & consistency: * [wiki:DeveloperGuidelines/CodeConventions Code Conventions] Code should be able to perform well at scale: * [wiki:DeveloperGuidelines/Optimisation Optimisation] Debugging Tips: * [wiki:DeveloperGuidelines/Tips#Pythondebugging Debugging] == Framework == * [wiki:DeveloperGuidelinesS3Framework Sahana Eden Framework: S3] * '''[wiki:S3 S3 API Guide]''' * [wiki:DeveloperGuidelinesNewModule How to add a new Module?] * [wiki:DeveloperGuidelines/GIS GIS] - Mapping * [wiki:DeveloperGuidelines/Internationalisation Internationalization] * [wiki:DeveloperGuidelines/Messaging Messaging] * [wiki:DeveloperGuidelines/SVG SVG] - One way of producing Charts * [wiki:DeveloperGuidelines/Templates Templates] for instance configuration * [wiki:DeveloperGuidelines/Themes Themes] === Javascript === * W3Schools' basic JS: http://www.w3schools.com/js/ * jQuery is used for client-side business logic (hiding fields, opening up tabs, etc): * Tutorial 1: http://docs.jquery.com/Tutorials:How_jQuery_Works * Tutorial 2: http://docs.jquery.com/Tutorials:Getting_Started_with_jQuery * Main reference: http://docs.jquery.com * We use some plugins: http://plugins.jquery.com * & some Widgets: http://jqueryui.com * ExtJS is used for some advanced widgets: * http://www.sencha.com * http://dev.sencha.com/deploy/ext-4.0.0/examples/ * API: http://www.extjs.com/deploy/dev/docs/ * S3 includes a cross-browser debug utility (only shows up when ?debug=1): {{{ s3_debug('message', value); }}} All global variables should be in the S3 namespace: * http://yuiblog.com/blog/2006/06/01/global-domination/ Private variables should be protected, e.g. using the Module Pattern: * http://yuiblog.com/blog/2007/06/12/module-pattern/ * http://www.adequatelygood.com/2010/3/JavaScript-Module-Pattern-In-Depth Can test out the performance of different options to achieve a task using: * http://jsperf.com Can check quality using JSLint: * http://www.javascriptlint.com/online_lint.php ==== Deployment ==== Browsers default to only downloading 2 files from the same origin at a time, so many files is very slow on high latency links. We therefore consolidate into fewer, larger files when running in Production mode. Although, note that iPhone 3.x cannot cache files larger than 15kb and in iPhone 4 the limit is 25kb. And this is the size before gzipping. Since GIS is a specialised app which requires many files, it's JS is loaded separately when required. The build script is {{{static/scripts/tools/build.sahana.py}}} It needs to be run as a web2py script: {{{ python web2py.py -S eden -M -R applications/eden/static/scripts/tools/build.sahana.py }}} There is also a convenience wrapper for Windows to run this: {{{static/scripts/tools/build.cmd}}} You must have an internet connection to run the build script unless you have a local version of the Compiler. Our build process is based on the one used by !OpenLayers * http://trac.openlayers.org/wiki/Profiles This uses Google's Closure compiler to compress the JS. This is done using their web service, however for !OpenLayers itself we need to download the jar file & place in the tools folder since this is over 1Mb: * http://closure-compiler.googlecode.com/files/compiler-latest.zip !ToDo: Investigate using other options instead: * http://developer.yahoo.com/yui/compressor/ * http://www.crowproductions.de/repos/main/public/packer/jspacker.py !ToDo: Download/execute scripts asynchronously: * Projects/Advanced/Optimisation === Mobile === * [wiki:DeveloperGuidelines/Mobile/Android Android] - Android clients === XSLT === * [http://codespeak.net/lxml/tutorial.html lxml Tutorial] * [wiki:XsltTemplates XSLT] - Stylesheets for XML & JSON !Import/Export == FAQ == * [wiki:DeveloperGuidelines/FAQ FAQ] == Other Resources == * [wiki:DeveloperGuidelinesSahana2Migration Help for Developers Migrating from Sahana PHP] * [wiki:DeveloperGuidelinesDjangoMigration Help for Developers Migrating from Django] * [wiki:DeveloperGuidelines/Tips Tips] - useful links to explore * [wiki:DeveloperGuidelines/Architecture Architecture] * [wiki:DeveloperGuidelinesDocumentation Documentation] == Uncategorized == These pages need to be sorted into their appropriate category on this page. ([wiki:DeveloperGuidelines]) * [wiki:DeveloperGuidelinesCreateReadUpdateDelete] * [wiki:DeveloperGuidelinesCron] * [wiki:DeveloperGuidelines/CustomPages] * [wiki:DeveloperGuidelinesDataTables] * [wiki:DeveloperGuidelinesDatabaseSynchronization] * [wiki:DeveloperGuidelinesDeletableList] * [wiki:DeveloperGuidelines/DeploymentSettings] * [wiki:DeveloperGuidelines/Eclipse] * [wiki:DeveloperGuidelinesLibraries] * [wiki:DeveloperGuidelines/Logistics] * [wiki:DeveloperGuidelines/Menus] * [wiki:DeveloperGuidelines/Messaging] * [wiki:DeveloperGuidelines/Organisations] * [wiki:DeveloperGuidelinesPopup] * [wiki:DeveloperGuidelines/PrePopulate] * [wiki:DeveloperGuidelines/SaveSearchAndSubscription] * [wiki:DeveloperGuidelines/Scheduler] * [wiki:DeveloperGuidelines/Search] * [wiki:DeveloperGuidelinesSubmenus] * [wiki:DeveloperGuidelinesSubtypes] * [wiki:DeveloperGuidelinesSurvey] * [wiki:DeveloperGuidelines/UserManagement] * [wiki:DeveloperGuidelinesWebServices] * [wiki:DeveloperGuidelines/WebSetup] * [wiki:DeveloperGuidelines/de] * [wiki:DeveloperGuidelinesCRUDManual] * [wiki:DeveloperGuidelinesGISInAction] * [wiki:DeveloperGuidelinesRESTCustomisation] * [wiki:DeveloperQuickstart]