1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Use the Generic Content Module or not...?

Use the Generic Content Module or not...?

4 posts, 0 answered
  1. Jeff Vail
    Jeff Vail avatar
    5 posts
    Registered:
    20 Jan 2005
    03 Jun 2009
    Link to this post
    I need to write a customized discussion forum as a Sitefinity module.  I have read the arguments on building a new module based on the Generic Content module, and they are pretty compelling (the re-use of built-in functionality: categories, tags, security, etc.).  All of which I will want.

    Would a discussion forum fit the Generic Content module format?  I have see the products and people examples and those are great, but they are for a single, what I would traditionally call, "table" of data.  When a discussion forum will have topics, messages, message scores, attachments per message, etc., will it fit the Generic Content mold?  Or, would each be a module, and they would all interact together?  If I remember reading correctly, the canned forums module is not using the Generic Content module...is this why?

    Slight tangent, is there a place to go to see (and maybe download) modules others have created?  I learn best by example.  ;)

    Jeff

  2. Dido
    Dido avatar
    149 posts
    Registered:
    24 Sep 2012
    04 Jun 2009
    Link to this post
    Hello Jeff Vail,

    You can view the new architecture's documentation on Ivan's blog. There are sample modules on his blog as well.

    Generally, building a forums module on top of GC is a very good idea.

    Here is a sample structure:

    • A post is a IContent item, containing either
    • Forum threads are tags (or metafields)
    • Forum categories are categories

    or
    • First post is a thread (IContent)
    • Comments are posts in a thread
    • Forum categories are  categories (again)

    If you use GC-based module, you might end up with (almost) no data layer at all! Well, except for a web service for client-side data binding, perhaps.

    I advice you to use GC for a custom forums module.

    Regards,
    Dido
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Jeff Vail
    Jeff Vail avatar
    5 posts
    Registered:
    20 Jan 2005
    07 Jun 2009
    Link to this post
    Thanks, Dido.

    "you might end up with (almost) no data layer at all!"

    I like that!  :)

    Now, when more data elements come into play...is there an equally graceful way to handle that?  Let's say, for example, that each message in a thread can be scored for usefulness (so a 1-message to many-scores relationship).  Each of those scores can have a comment/justification and a couple other attributes.

    I can't use a meta field (right?) because it is just an extra field added to the record.  Or can a meta field be a collection of some sort (like the comments are?)?

    Thanks for your help in understanding these archtectural choices!

  4. Dido
    Dido avatar
    149 posts
    Registered:
    24 Sep 2012
    08 Jun 2009
    Link to this post
    Hello Jeff Vail,

    Consider this structure, then:

    • Forum groups are implemented with Categories
    • You have additional metafields:
      • ForumItemType (of type ShortText)
      • Rating (of type Integer)
    • Forum threads are implemented with IContent,
      • ParentID property is Guid.Empty
      • ForumItemType is ForumThread
    • Posts are implemented with IContent
      • ParentID property is the id of the ForumThread
      • ForumItemType is ForumPost
    • Rating is implemented with comments for a blog post + metafield

    Every post can be commented and rated. If you comment/rate the first post, you will comment/rate the forum thread.

    I would advice you to plan this way:
    • On a sheet of paper, write down the end-user requirements
    • On another sheet of paper, write down (with a diagram, preferably) how the UI will look like (transitions from one element to another is a nice plus)
    • On yet another sheet of paper, with UML (or any other graphical representation) design your objects and how they will interact
    • Once you have this structure, programming and further design will be a lot easier, because at any time you will have a firm goal and a vision how to achieve it.

    When you know how things will behave and look like, I will be able to give you better answers regarding the Sitefinity implementation of your idea.

    Greetings,
    Dido
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Register for webinar
4 posts, 0 answered