Changes between Initial Version and Version 1 of BluePrint/PrePopulate


Ignore:
Timestamp:
06/29/11 16:04:01 (14 years ago)
Author:
Michael Howden
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • BluePrint/PrePopulate

    v1 v1  
     1= Pre-Populate =
     2
     3== Introduction ==
     4We need to
     5
     6== Types of Data ==
     7 * Item Catalogue
     8 * Organisation List
     9 * Assets
     10 * Warehouse Supplies
     11 * Human Resources (Staff & Volunteers)
     12
     13== Methods ==
     14=== URL Import ===
     15Data can be imported using URL calls:
     16{{{
     17http://127.0.0.1:8000/eden/supply/item/create.s3csv
     18?filename=/home/web2py/applications/eden/static/formats/s3csv/eric.csv
     19&transform=/home/web2py/applications/eden/static/formats/s3csv/eric.xsl
     20}}}
     21
     22However this mehtod isn't easily automated[[BR]]
     23
     24Also see: UserGuidelinesImporter
     25=== Python Script ===
     26This offers us better options to automate the import of data.
     27{{{
     28# Function to handle conflicts
     29s3mgr.resolve = response.s3.item_deduplicate
     30resource = s3mgr.define_resource("supply", "item")
     31resource.import_xml(open("/home/web2py/applications/eden/static/formats/s3csv/eric.csv", "r"),
     32                    format="csv",
     33                    stylesheet="/home/web2py/applications/eden/static/formats/s3csv/eric.xls")
     34}}}
     35Should we have a wrapper function for this which is easily accessed from the CLI?
     36
     37== Location for Pre-populate Data ==
     38=== Proposal ===
     39/private/
     40 * transform (ALL xsl files. Any CSV should automatically use the xsl with the same name in the same directory in this folder. If multiple csv files need to use the same xsl transfor give the a "__XXX" double underscore suffix, eg. {{{eric__complete.csv}}}, {{{eric__sample.csv}}} can both use  {{{supply/eric.xls}}} )
     41  * module 0
     42  * ...
     43  * module n
     44 * prepopulate
     45  * demo
     46   * module 0
     47   * ...
     48   * module n
     49  * regression
     50   * module 0
     51   * ...
     52   * module n
     53  * user (private prepopulate data - not shared in bzr branch)
     54   * module 0
     55   * ...
     56   * module n
     57  * drrpp (deployment with data which can be shared)
     58   * module 0
     59   * ...
     60   * module n
     61 * ... (other deployments with public data)
     62   * module 0
     63   * ...
     64   * module n
     65
     66/static/prepopulate /
     67 * templates (csv files with header row only)
     68  * module 0
     69  * ...
     70  * module n
     71
     72Rational:
     73 * Should separate csv from xsl (xsl could very easily confuse semi-technical users)
     74 * CSV templates should be easily downloaded - prepopulate data should not (always) be
     75 * All XLS should be in trunk (even if it is for private data) and have a matching CSV Template
     76 * Then a configuration file can be created where you can just list the CSV file names which you want to be imported when Sahana Eden is initialized. Copies of this files could be saved in the private/prepopulate/<deployment>/ directory then a config setting could select which file to use, to make it easy to set up Sahana Eden to have different types of data in it.
     77
     78 
     79