Library
The content manager or library is a software solution responsible to deal with available content offline&online. In the library, there are contents (books), which are for example ZIM files. Each book may have a lot of details about the ZIM file like title, number of page, size, infos about how to download it, corresponding index path, etc.
Use cases
Simple installed instance
User has installed Kiwix, so no local content. Kiwix has to synchronize with the online version(s) of the library and propose to download new books. Downloaded content should be "marked as local" and not proposed anymore to download. Newly index book should also now where are the search index directories.
Simple portable instance
User has a portable version of Kiwix with a local library. Reopening this local instance of Kiwix should always display the same things also if the user use this Kiwix instance to download new content. New content and indexed content should be saved in the profile, but never take the priority on the local library.
Local & installed instances
By running the local instance, this should work like a local instance only scenario. By running the installed instance, this should ignore the local instance.
Location
Library XML files should be located in specific locations (related to Kiwix binary path).
All platforms:
- In Kiwix profile (~/.www.kiwix.org on POSIX systems or .../Application Data/www.kiwix.org on Windows) at library.xml
- ../data/library/*.xml
On Linux:
- ../../share/kiwix/data/library/*xml
Implementation
The content manager is a c++ class which deals with one or many XML library files. For Kiwix you have the corresponding XPCOM which is called by the javascript module "library".