Cuyahoga logo

Content abstraction

Modified: 2008/05/28 17:06 by martijnb - Categorized as: Development
Edit

Important

The ideas on the page below have resulted in a paper written by Maximilian Gärber.

Download content abstraction paper

Edit

Definition

Everything is content.

To reduce the amount of repeated code and to ease the module infrastructure from performing common operations on content, a content base class is needed.

Edit

Architecture

Edit

Domain

Edit

IContentItem

Interface to implement to make use of common content handling. An abstract base class ContentItem is available, too.



public interface IContentItem { long Id {get; set;} Guid GlobalId {get; set;} string Title {get; set;} string Description {get; set;} int Version {get; set;} string TypeInfo {get; set;} DateTime CreatedAt {get; set;} DateTime PublishedAt {get; set;} DateTime ModifiedAt {get; set;} User CreatedBy {get; set;} User PublishedBy {get; set;} User ModifiedBy {get; set;} Section Section {get; set;} IList Categories {get; set;} }


TypeInfo: Identifies the concrete type the content represents. For custom classes it is the fully qualified class name, for files it is the file extension.

Categories: Get a list of associated categories

Edit

FileResource

Inherits from ContentItem and can be used for all file related operations. A dicionary of user attributes is integrated.



public class FileResource : ContentItem { private string name; private string physicalPath; private long length; private string mimeType; private int downloadCount; private IList downloadRoles; private IDictionary userAttributes; ... etc ...


Edit

Related Services

Edit

ContentItemService (Done)

Search and retrieval based on the IContentItem interace. At the moment, only simple queries are supported, e.g. FindByCreationDate or similar. Since NHibernate has good support for dynamic query building a more sophisticated implementation is desired.

Edit

FileResourceService (Done)

Transactional file management to leviate all file related operations.

Edit

CategoryService (Todo)

Manage categories for content and attach it to sites, nodes or sections.

Implementation Notes:

Simple category tree, each category being specifid through a name, description and maybe an icon.

Edit

VersioningService (Todo)

Ability to save and restore different versions of the content.

Implementation Notes:

ScrewTurn Wiki version 2.0.31. Some of the icons created by FamFamFam.