Zim

Fields contentkey and childrenkey in database

Asked by Cy Brown

Hi,

I would like to use the data from my zim's notebooks in another application, and I am importing the files and the database.
There are no problem reading the content without knowing what contentkey and childrenkey in the database are used for, but when I use the notebook back in zim, it doesn't take the last modification with null values in those rows.

It would be nice if someone could give me a clue how those columns are used.

Cy Brown.

Question information

Language:
English Edit question
Status:
Solved
For:
Zim Edit question
Assignee:
No assignee Edit question
Solved by:
Jaap Karssenberg
Solved:
Last query:
Last reply:
Revision history for this message
Best Jaap Karssenberg (jaap.karssenberg) said :
#1

On Fri, Nov 2, 2012 at 2:41 AM, Cy Brown
<email address hidden> wrote:
> I would like to use the data from my zim's notebooks in another application, and I am importing the files and the database.
> There are no problem reading the content without knowing what contentkey and childrenkey in the database are used for, but when I use the notebook back in zim, it doesn't take the last modification with null values in those rows.
>
> It would be nice if someone could give me a clue how those columns are used.

For these kind of implementation questions please mail me directly
instead of using this questions sections.

What is happening is that the index asks the "store" for those keys,
if they do not match, the index needs updating. For the file based
storage it maps to the modification times of the corresponding file
and folder. So in theory not setting these should trigger the index to
update. Would have to look more in detail what you are doing to
understand why it isn't picked up.

In general I would say that you should not worry about putting data
into the index. The index is considered an internal cache that may
change it's format without warning between versions. If you modify the
file structure with an external application, zim should pick that up
automatically when you next start it (or after running "Tools ->
update index").

If that is not working that should be fixed in zim.

Regards,

Jaap

Revision history for this message
Cy Brown (cy-brown59) said :
#2

Thank you very much for your answer.

As a test for an future project about zim, I've modified an index file to change a parent's page to another, and I thought that those fields where mandatory for zim to reconize the new path.

As you've said, they are in fact recomputed when the workbook is open, so they weren't the cause of my issue.

On the other hand, the field haschildren seems to be set to 1 for Zim to see any children, even if they exist in the filesystem.

Thank you for your help, and for your great software.

Revision history for this message
Cy Brown (cy-brown59) said :
#3

Thanks Jaap Karssenberg, that solved my question.