Wiki Storage
inyoka.wiki.storage
Beside the metadata the wiki has a storage concept which is a bit simpler in terms of implementation. Basically a wiki storage is a preformatted block in a special wiki page that is know at compile time. That block is then processed by a storage class and converted into a list of tuples or a dict, or something different, depending what the class wants to have.
This is used for access control. If a page is a storage container is determined by the special ‘X-Behave’ metadata header. There can be multiple pages with the same behave header, the contents of those pages are combined afterwards.
The following behave headers are known so far:
X-Behave: Access-Control-List
This storage contains ACL information
Storage objects are read only because they combine the information from multiple pages.
It’s important to know that the storage system does not use the normal parser but a lightweight version of it that just looks for the pre tag. This is not only faster but also ensures that we don’t get bootstrapping problems.
- copyright:
2007-2024 by the Inyoka Team, see AUTHORS for more details.
- license:
BSD, see LICENSE for more details.
- class inyoka.wiki.storage.AccessControlList
This storage holds the access control lists for the whole wiki. The rules are similar to the basic expansion rules we also use for the PageList macro but they are always case sensitive.
- behavior_key = 'Access-Control-List'
the name of the behavior key this storage looks for. If it’s None this storage is abstract and useful as baseclass for concrete storages.
- combine_data(objects)
Combine multiple results.
- extract_data(text)
This is passed the text of the first preformatted node on a page where the behavior header matched. The returned object is probably post- processed by combine_data to comine multiple results.
- class inyoka.wiki.storage.BaseStorage
Abstract base class for all the storage objects that contains the shared logic like flushing the cache and storing back to it.
- behavior_key = None
the name of the behavior key this storage looks for. If it’s None this storage is abstract and useful as baseclass for concrete storages.
- combine_data(objects)
Combine multiple results.
- extract_data(text)
This is passed the text of the first preformatted node on a page where the behavior header matched. The returned object is probably post- processed by combine_data to comine multiple results.
- find_block(text)
Helper method that finds a processable block in the text.