Partition
The Partition module provides a basis on which to build versioning systems of a kind where content is divided into a defined number of spaces.
Setting up the partition module
The partition module requires adding the PartitionId and CanonicalPartitionId fields to the ContentItems table. This can be done by running the script at /Areas/Lynicon.Base/Admin/SQL/PartitionInit.sql.
Configuring the partition module
The Partition module has the following settings:
- GetDefaultPartition: a function from an IPartitioned container to a nullable int. Â Returns the default partition in which the container should belong (or null if unknown)
- IsPartitioned: a function from a Type to a bool which returns true if the content type is partitioned, i.e. doesn't always exist in all the partitions.
- GetCurrentPartition: a function which returns the current partition id or null if none specific.
- Partitions: an array of PartitionInfo describing all the allowed partitions.
Ensuring a content type can be partitioned
A content type can be partitioned if:
- Its container type implements IPartitioned
- When input to the IsPartitioned function, the content type returns true