Refdb

Check-in [6bb4196217]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Added auto-creation of sheet sxml file if not existing
Timelines: family | ancestors | descendants | both | v1.01
Files: files | file ages | folders
SHA1:6bb4196217ec1c4ed1500da2a47031b579cf75bb
User & Date: mrwellan 2014-08-12 15:34:19
Context
2014-08-12
16:05
Added support for creating non-existing sheets check-in: 1da5afe233 user: mrwellan tags: v1.01
15:34
Added auto-creation of sheet sxml file if not existing check-in: 6bb4196217 user: mrwellan tags: v1.01
06:04
Merging transpose feature check-in: 63e144b876 user: matt tags: v1.01
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to refdb-module.scm.

370
371
372
373
374
375
376
377



378
379
380
381
382
383
384
(define (refdb->sxml dbdir #!key (record 'col)) ;; record 'col or 'row
  (let* ((sht-names (read-file (conc dbdir "/sheet-names.cfg")  read-line))
	 (wrk-rem   (file->sxml (conc dbdir "/sxml/_workbook.sxml")))
	 (sht-rem   (file->sxml (conc dbdir "/sxml/_sheets.sxml")))
	 (sheets    (fold (lambda (sheetname res)
			    (let* ((sheetdat (read-dat (conc dbdir "/" sheetname ".dat") record: record))
				   (cells    (dat->cells sheetdat))
				   (sht-meta (file->sxml (conc dbdir "/sxml/" sheetname ".sxml"))))



			      (cons (cons (car sht-meta) 
					  (append (cons (list 'http://www.gnumeric.org/v10.dtd:Name sheetname)
							(cdr sht-meta))
						  cells))
				    res)))
			  '()
			 (reverse  sht-names))))







|
>
>
>







370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
(define (refdb->sxml dbdir #!key (record 'col)) ;; record 'col or 'row
  (let* ((sht-names (read-file (conc dbdir "/sheet-names.cfg")  read-line))
	 (wrk-rem   (file->sxml (conc dbdir "/sxml/_workbook.sxml")))
	 (sht-rem   (file->sxml (conc dbdir "/sxml/_sheets.sxml")))
	 (sheets    (fold (lambda (sheetname res)
			    (let* ((sheetdat (read-dat (conc dbdir "/" sheetname ".dat") record: record))
				   (cells    (dat->cells sheetdat))
				   (meta-fname (conc dbdir "/sxml/" sheetname ".sxml"))
				   (sht-meta (begin
					       (make-sheet-meta-if-needed meta-fname)
					       (file->sxml meta-fname))))
			      (cons (cons (car sht-meta) 
					  (append (cons (list 'http://www.gnumeric.org/v10.dtd:Name sheetname)
							(cdr sht-meta))
						  cells))
				    res)))
			  '()
			 (reverse  sht-names))))

Changes to testrefdb/sheet-names.cfg.

1

Sheet1


>
1
2
Sheet1
Sheet2

Changes to testrefdb/sxml/_sheets.sxml.

29
30
31
32
33
34
35
36

37
38
39
40
41
42
43
   (http://www.gnumeric.org/v10.dtd:Item
     (http://www.gnumeric.org/v10.dtd:name "application")
     (http://www.gnumeric.org/v10.dtd:val-string "gnumeric"))
   (http://www.gnumeric.org/v10.dtd:Item
     (http://www.gnumeric.org/v10.dtd:name "author")
     (http://www.gnumeric.org/v10.dtd:val-string "matthew.r.welland")))
 (http://www.gnumeric.org/v10.dtd:SheetNameIndex
   (http://www.gnumeric.org/v10.dtd:SheetName "Sheet1"))

 (http://www.gnumeric.org/v10.dtd:Geometry (@ (Width "1440") (Height "647")))
 (http://www.gnumeric.org/v10.dtd:UIData (@ (SelectedTab "0")))
 (http://www.gnumeric.org/v10.dtd:Calculation
   (@ (MaxIterations "100")
      (ManualRecalc "0")
      (IterationTolerance "0.001")
      (EnableIteration "1"))))







|
>

|





29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
   (http://www.gnumeric.org/v10.dtd:Item
     (http://www.gnumeric.org/v10.dtd:name "application")
     (http://www.gnumeric.org/v10.dtd:val-string "gnumeric"))
   (http://www.gnumeric.org/v10.dtd:Item
     (http://www.gnumeric.org/v10.dtd:name "author")
     (http://www.gnumeric.org/v10.dtd:val-string "matthew.r.welland")))
 (http://www.gnumeric.org/v10.dtd:SheetNameIndex
   (http://www.gnumeric.org/v10.dtd:SheetName "Sheet1")
   (http://www.gnumeric.org/v10.dtd:SheetName "Sheet2"))
 (http://www.gnumeric.org/v10.dtd:Geometry (@ (Width "1440") (Height "647")))
 (http://www.gnumeric.org/v10.dtd:UIData (@ (SelectedTab "1")))
 (http://www.gnumeric.org/v10.dtd:Calculation
   (@ (MaxIterations "100")
      (ManualRecalc "0")
      (IterationTolerance "0.001")
      (EnableIteration "1"))))