Changes between Version 24 and Version 25 of UserGuidelines/Importer


Ignore:
Timestamp:
12/04/10 20:27:50 (14 years ago)
Author:
Fran Boon
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • UserGuidelines/Importer

    v24 v25  
    55
    663 options available:
     7 * Open Office (preferred)
    78 * CSV
    8  * Open Office
    99 * Excel via interactive UI (incomplete)
     10
     11=== Open Office ===
     12Can import data from spreadsheets in .fods format (e.g. created by Open Office).
     13
     14This is best as it handles complex resources.
     15
     16via web:
     17 * http://myhost.com/eden/hms/hospital/create.fods?filename=myhospitals.fods
     18
     19or from Web2Py CLI:
     20{{{
     21resource = s3xrc.resource("hms", "hospital")
     22template = os.path.join(request.folder, resource.XSLT_PATH, "fods", "import.xsl")
     23resource.import_xml("myhospitals.fods", template=template)
     24}}}
     25
     26Structure of the file should be as follows:
     27 * Sheet name = resource name
     28 * First row = attribute/field names
     29 * Other rows = attribute/field values
     30
     31==== References ====
     32 1. Insert another sheet with the entries of the referenced table, this sheet must have the same name as the referenced table and a column "uuid"
     33 2. Insert a column in the main sheet with a column title like:
     34{{{
     35reference:<fieldname>:<referenced_table>
     36}}}
     37e.g. "reference:organisation_id:org_organisation"
     38 3. fill in this column with the UUIDs of the respective entries
     39   in the referenced table
     40
     41==== Components: ====
     42 1. Insert another sheet with the entries of the component table, this sheet must have a name like:
     43{{{
     44<main-table-name>+<component-table-name>
     45}}}
     46e.g. "hms_hospital+hms_hactivity"
     47 2. Insert a column into the component sheet with a name like:
     48{{{
     49<main-table-name>.<key-field>
     50}}}
     51e.g. "hms_hospital.gov_uuid"[[BR]]
     52=> the key field must be present in the main table[[BR]]
     53=> the key field must be unique (primary key) in the main table[[BR]]
     54 3. Fill in this column with the respective values of the key field in the parent entry of the main table
     55
    1056
    1157=== CSV ===
     
    2268or Web UI (''to be checked''):
    2369 * http://myhost.com/eden/vol/person/create.csv?filename=myvols.csv
    24 
    25 === Open Office ===
    26 Can import data from spreadsheets in .fods format (e.g. created by Open Office).
    27 
    28 This is best as it handles complex resources best.
    29 
    30 via web:
    31  * http://myhost.com/eden/hms/hospital/create.fods?filename=myhospitals.fods
    32 
    33 or from Web2Py CLI:
    34 {{{
    35 resource = s3xrc.resource("hms", "hospital")
    36 template = os.path.join(request.folder, resource.XSLT_PATH, "fods", "import.xsl")
    37 resource.import_xml("myhospitals.fods", template=template)
    38 }}}
    3970
    4071=== Excel via interactive UI ===