EditImportant
The ideas on the page below have resulted in a paper written by Maximilian Gärber.
Download content abstraction paper
EditDefinition
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.
EditArchitecture
EditDomain
EditIContentItem
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
EditFileResource
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 ...
EditRelated Services
EditContentItemService (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.
EditFileResourceService (Done)
Transactional file management to leviate all file related operations.
EditCategoryService (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.
EditVersioningService (Todo)
Ability to save and restore different versions of the content.
Implementation Notes: