Click here to Skip to main content
15,894,540 members
Articles / Web Development / ASP.NET

Eucalypto - ASP.NET CMS Library using NHibernate

Rate me:
Please Sign up or sign in to vote.
4.84/5 (36 votes)
10 Jun 2009MIT24 min read 321K   4.6K   260  
An ASP.NET server library for creating CMS website (forums, articles/wiki, news, users/roles, ...), using NHibernate for data access.
using System;
using System.Collections.Generic;
using System.Configuration.Provider;

namespace Eucalypto.Forum
{
    /// <summary>
    /// ForumProvider abstract class.
    /// Defines the contract that Eucalypto implements to provide forum services using custom forum providers.
    /// Using this class you can insert, delete or read forum category, topic and messages.
    /// The main implementations is provided by the EucalyptoForumProvider class.
    /// </summary>
    public abstract class ForumProvider : ProviderBase
    {
        #region Forum category
        public abstract Category CreateCategory(string category, string displayName);

        public abstract void UpdateCategory(Category category);

        public abstract void DeleteCategory(Category category);

        public abstract Category GetCategory(string id);

        public abstract Category GetCategoryByName(string name, bool throwIfNotFound);

        public abstract IList<Category> GetAllCategories();
        #endregion


        #region Forum topic
        /// <summary>
        /// Create the topic and the relative root message.
        /// </summary>
        /// <param name="category"></param>
        /// <param name="owner"></param>
        /// <param name="title"></param>
        /// <param name="body"></param>
        /// <param name="attachment">Use null if you don't have any attachment</param>
        /// <param name="topic">Returns the topic created</param>
        /// <param name="rootMessage">Returns the message created</param>
        public abstract void CreateTopic(Category category, string owner, 
                                          string title, string body, Attachment.FileInfo attachment,
                                          out Topic topic,
                                          out Message rootMessage);

        public abstract void DeleteTopic(Topic topic);

        public abstract Topic GetTopic(string id);

        public abstract IList<Topic> GetTopics(Category category, DateTime fromDate, DateTime toDate);

        public abstract IList<Topic> GetTopics(Category category, PagingInfo paging);
        #endregion

        #region Messages
        /// <summary>
        /// 
        /// </summary>
        /// <param name="topic"></param>
        /// <param name="idParentMessage"></param>
        /// <param name="owner"></param>
        /// <param name="title"></param>
        /// <param name="body"></param>
        /// <param name="attachment">Use null if you don't have any attachment</param>
        /// <returns></returns>
        public abstract Message CreateMessage(Topic topic, string idParentMessage, string owner, string title, string body, Attachment.FileInfo attachment);

        /// <summary>
        /// Get a list of messages for the specified topic ordered by InsertDate
        /// </summary>
        /// <param name="idTopic"></param>
        /// <returns></returns>
        public abstract IList<Message> GetMessagesByTopic(Topic topic);

        public abstract int MessageCountByTopic(Topic topic);
        
        public abstract void DeleteMessage(Message message);

        public abstract Message GetMessage(string id);

        public abstract IList<Message> FindMessages(Filter<string> categoryName,
                                           Filter<string> searchFor,
                                           Filter<string> owner,
                                           Filter<string> tag,  
                                           DateTime? fromDate, DateTime? toDate,
                                           PagingInfo paging);
        #endregion
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The MIT License


Written By
Software Developer
Italy Italy
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions