Content Model

sensenet organizes content into content repositories, that allows you to group all the related content for one or even multiple project together. Since everything is a content is sensenet this repository includes documents, workspaces, users, settings, workspaces and many more.

Each repository has a content model, a schema that represents the content types you create.

Content type hierarchy

Content types are organized into a hierarchy according to inheritance. Any content type may inherit from another one. The topmost content type in the inheritance hierarchy is the GenericContent (with handler SenseNet.ContentRepository.GenericContent), every content type must inherit from this, or any of its descendant. When a child content type is inherited from a parent content type it means that the child content type contains all the fields of the parent, even if they are not defined in the child CTD - and also they share common implemented logic.

Multiple inheritance is not allowed so content types are arranged in a simple tree.

Content naming

Every content in the content repository is not only identified by its unique ID but also its path. If you move a content to another folder, thus changing its path, the system keeps track of the changes, making it possible to use the path as a link to the content. For example, the Path of the IT workspace is /Root/Content/IT, which means it is in the Content container: a child of the Root folder. This way the workspace is accessible through the /Root/Content/IT URL. The content is represented in the Path by its Name, which is a field of every content which means you can freely modify it but note that this will also change its path (e.g. /Root/Content/MyContent to /Root/Content/NewName) Name should not be set every time, in cases when no Name is given the repository automatically generates it from the content's type and creation date. (e.g. User-20200902075644) Uploaded files will automatically be named by the file's name (e.g. lorem-ipsum.docx Name will be lorem-ipsum.docx after it is uploaded to the repository). Another useful feature for naming files is incremental naming, with which you can set that if a user uploads a file to a folder where a file with a same name exists, the older file will not be overridden, but the new one will be uploaded with a slightly changed name (e.g. lorem-ipsum.docx and lorem-ipsum(1).docx) These feature (allow incremental naming) is by default switched on and can be switched off for content types in the content type definition.

<ContentType name="" handler="" parentType="" xmlns="http://schemas.sensenet.com/SenseNet/ContentRepository/ContentTypeDefinition">
...
<AllowIncrementalNaming>false</AllowIncrementalNaming>
...

GenericContent

The content repository contains many different types of content. Content vary in structure and even in function. Different types of content contain different fields. GenericContent is the ancestor of all types so it represents the base of the content model in sensenet content repository. All of the fields that are defined on GenericContent's CTD (Content Type Definition) are available on all the content types in the repository whether they are built-in ones or created by you.

Fields on GenericContent

FieldTypeDescriptionRead-only
IdIntegerUnique identifier of the contentRead-only
ParentIdIntegerId of the content's parentRead-only
NameShortTextUrl name of the content
DisplayNameShortTextDisplayed name of the content
DescriptionLongTextDescription of the content
OwnerIdIntegerId of the content's owner userRead-only
OwnerReferenceOwner user
CreatedByReferenceCreator userRead-only
CreatedByIdIntegerId of the creator userRead-only
VersionCreatedByReferenceCreator of a version of the contentRead-only
CreationDateDateTimeDate when the content was createdRead-only
VersionCreationDateDateTimeDate when the version was createdRead-only
ModifiedByReferenceModifier userRead-only
ModifiedByIdIntegerId of the last modifier userRead-only
VersionModifiedByReferenceModifier of a version of the contentRead-only
ModificationDateDateTimeDate when the content was modifiedRead-only
VersionModificationDateDateTimeDate when the version was modifiedRead-only
VersionIdIntegerId of the content's current versionRead-only
TypeNodeTypeContent type of the contentRead-only
TypeIsNodeTypeAncestor content types of the node in the repositoryRead-only
IconShortTextName of the icon of the contentRead-only
HiddenBooleanIndicates whether the content is hidden or not
IndexIntegerIndex number of the content
LockedBooleanIndicates wether the content is checked-out by someone or notRead-only
CheckedOutToReferenceUser who checked out the contentRead-only
VersionVersionVersion number of the contentRead-only
VersionsReferenceList of versions of a contentRead-only
CheckInCommentsLongTextCheck-in comments for a version of a content
Reject reasonLongTextReject reason for a version of a content
PathShortTextFull path of the contentRead-only
DepthIntegerContent level in the treeRead-only
InTreeShortTextAncestor pathsRead-only
InFolderShortTextParent path of the contentRead-only
IsSystemContentBooleanIndicated whether the content is a system content or notRead-only
IsFolderBooleanIndicated whether the content is a container or notRead-only
EnableLifespanBooleanSwitches lifespan filtering on or off
ValidFromDateTimeValidation from date
ValidTillDateTimeValidation from date
AllowedChildTypesAllowedChildTypesContains list of allowed types
EffectiveAllowedChildTypesAllowedChildTypesContains list of effective allowed types
VersioningModeVersioningModeVersioning mode of the content
InheritableVersioningModeVersioningModeInheritable versioning mode of the content
ApprovingModeApprovingModeApproving mode of the content
InheritableApprovingModeApprovingModeInheritable approving mode of the content
TrashDisabledBooleanIndicated whether on the content trash feature is disabled or not
WorkspaceReferenceClosest workspace where the content is storedRead-only
SharingSharingSharing info of a content
SharedWithSharingUser(s) with whom the content is sharedRead-only
SharedBySharingUser by whom the content is sharedRead-only
SharingModeSharingSharing mode of the contentRead-only
SharingLevelSharingSharing level of the contentRead-only

These fields are freely available on all the types, both on built-in and you custom types. You can take advantages of the type inheritance in many ways. You can inherit your custom type from the GenericContent or from an inherited built-in type such as User or File. These built-in type have additional type related fields that are also available to use in your custom type.