qof_book_get_guid deprecated?

Derek Atkins warlord at MIT.EDU
Fri Dec 31 10:24:57 EST 2004


Neil Williams <linux at codehelp.co.uk> writes:

> 1. Is there a replacement for qof_book_get_guid to be used by QofBackend 
> instead?
>
> Is it just deprecated for non-Backend uses (not that I can think of any)?
>
> (I'm using it for QSF so that an exported XML file can contain a GUID for the 
> original book.)

Oh, just use qof_entity_get_guid(QOF_ENTITY(book)) if you don't want to
use the qof_book_get_guid() api.

> 2. As QSF supports partial books, (by using references), if a user selects a 
> range of transactions, or a range of accounts including transactions between 
> dates, or all invoices for a customer over x months, etc., this can be passed 
> to the QofBackend via a second QofSession and the data will be written out 
> without the need for any hierarchies or AccountGroups or other components of 
> a full QofBook in GnuCash. (via the clipboard?).
>
> Should the QSF file then use the ORIGINAL QofBook for the GUID of the book 
> written into the QSF file? All the objects themselves will retain the same 
> GUID as the original book (which will make it easy to merge the partial book 
> back into the original). The temporary QofBook in the second session will 
> only live as long as the export is in progress but I can use that GUID if 
> that would be better. (i.e. versions, time delays, multiple QSF files with 
> the same book-guid, . . )
>
> Is the export an independent book or a derivative?

Good question.  I have no idea.  What are the ramifications of either
choice.  If a user imports it, will the merge code notice that the
book guid is the same and therefore not import anything?  Or does the
merge code ignore the book guid?

> If it's a derivative, I can add some code to the QSF importer that makes it 
> smoother to merge the partial QSF data back into the full book, as necessary 
> - a simple schema validation + book GUID comparison, then to qof_book_merge.
>
> Every QSF import will go via qof_book_merge to provide user intervention and 
> collision handling.

ok.

I wonder -- how does the merge code know whether a GUID should be
created during the merge vs. when it should use the original GUID?
E.g. File -> New File needs to create new GUIDs in the accounts it
creates.

-derek

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord at MIT.EDU                        PGP key available


More information about the gnucash-devel mailing list