FLUX.NET Community

Community site for the FLUX.NET Enterprise content management community.
Welcome to FLUX.NET Community Sign in | Join | Help
in Search

Development Blog

  • How to do multi-site with FLUX

    Flux supports publishing multiple web sites from one implementation. The core of this is provided through the "Website mappings" tool within the "Content and Asset Management" menu group;

    image

    This tool allows you to define any domain names that will be responded to from this flux installation and provide flux with information about where to get it's content from for the domain and which item of content should act as it's homepage. The form for defining an entry is shown below;

    image

    As you can see, you specify which node contains the domains content (root node) and which node should be the homepage. For this to work correctly you will need to define a content type that acts as a container for other content. This can be called "website" or "channel" (or in fact anything that makes sense to you). You define the content type purely to act as a container and then add content into this. You then create your content within these containers;

    image

    In the example above, I would then specify "Main Website" as the root node and "Homepage" as the home node in my website domain mapping.

    This all integrates as standard to the URL re-writer engine, so accessing flux from various domains works out of the box. However, you do have to do a bit of extra work when it comes time to building any menus as you'll need to work out where your navigation starts from. IE: Site A - we'd want top level menus from within the defined root of Site A, whilst Site B would need entries from Site B and so on.

    To do this, you can use code similar to that below;

    public static ContentObject GetRoot()
    {
        // First, see if our page is within a known mapping path
        // for the domain we're using....IE: If localhost is mapped to /1/2/3
        // and our page is /1/2/3/4 we know the mapping holds a valid root.
        string DomainName = HttpContext.Current.Request.ServerVariables["SERVER_NAME"];
        DomainMappings dm = new DomainMappings();
        DomainMapping m = dm.GetByDomain(DomainName);
    
        if (m != null)
        {
            ContentObject rootPage = m.Rootpage_Live;
            if (rootPage != null)
            {
                if (RequestCache.NodeObject.PK_ID == -1) return rootPage;
                string rootPath = rootPage.NodePath + rootPage.NodeName;
                if (RequestCache.NodeObject.NodePath.StartsWith(rootPath))
                    return rootPage;
            }
        }
    
        // Search up the tree until we find a channel type
        ContentObject trav = RequestCache.NodeObject.ParentLive;
        while (trav != null)
        {
            if (trav.FK_STypeID == "channel") return trav;
            trav = trav.ParentLive;
        }
    
        return null;
    }

    In this instance, RequestCache.NodeObject returns the ContentObject of the page we're rendering and we've defined our container type as having a type code of "channel". Let's walk through the code;

    string DomainName = HttpContext.Current.Request.ServerVariables["SERVER_NAME"];
    DomainMappings dm = new DomainMappings();
    DomainMapping m = dm.GetByDomain(DomainName);

    This is just asking the domain mapping system to give us information about the domain the website is presently being accessed as. This will tell us the ID for the homepage and the content container.

    if (m != null)
    {
        ContentObject rootPage = m.Rootpage_Live;
        if (rootPage != null)
        {
            if (RequestCache.NodeObject.PK_ID == -1) return rootPage;
            string rootPath = rootPage.NodePath + rootPage.NodeName;
            if (RequestCache.NodeObject.NodePath.StartsWith(rootPath))
                return rootPage;
        }
    }

    If we were able to find a mapping record for the domain we're accessing the site at, we try to get the rootpage from the mapping record. Provided we get a root page we then ensure that the page we're rendering sits within the container specified by the mapping. It's possible that you have multiple containers, not all of which correspond to a domain and you allow users to navigate across these containers - for this reason we ensure that the page we're rendering sits within the container the mapping record states is the content container. If it's not, we drop through to the next part of the code, but if it is, then we know that the root node specified by the mapping is the correct one and return it.

    There is one strange looking line of code in that part though;

    if (RequestCache.NodeObject.PK_ID == -1) return rootPage;

    What's this all about? How can you have a node object with an ID of -1? Well, conventionally you can't, but in the implementation that this code is taken from we have some non-CMS portions of the site that still use the same master page templates and user controls etc, even though these parts of the site aren't controlled by the CMS. In these instances, the request cache is initialised with dummy content so that we can still get back a valid menu etc. In the line of code above, we're basically saying if our content being rendered isn't pulled from CMS, then trust the mapping record for the domain for where to get content from etc.

    Ok, next - if we didn't get a mapping record or if our rendered page is outside of the container that the mapping record says we should use, we try to intelligently find what the container node is;

    // Search up the tree until we find a channel type
    ContentObject trav = RequestCache.NodeObject.ParentLive;
    while (trav != null)
    {
        if (trav.FK_STypeID == "channel") return trav;
        trav = trav.ParentLive;
    }

    This starts by looking at the parent of the template we're rendering and keeps traversing up the tree until it finds a node that is a channel node type (our prescribed content container) - when it finds one, it uses this as the root irrespective of any mapping records etc.

    Hope this helps.

  • We need your help - Flux.NET News - October 2008

    You may be aware that flux.net v3 is presently in development and it's a complete re-write this time, taking a whole new approach to content management. We're hoping to have a beta available by Christmas, but we're looking for some feedback from the current user base on what direction to take and also whether or not to continue supporting the v2 code base.

    Why not read about the upcoming v3 changes in the blog and let us know your thoughts through the following polls;

    Out of the box CMS, or CMS framework.
    We're interested to know what you're looking for in FLUX. When you first downloaded the product, were you looking for something that just did everything you needed out of the box, or were you looking for a CMS framework that required implementation on the part of a developer?

    Cast your vote here: http://www.fluxcms.co.uk/forums/96/ShowThread.aspx

    V2 codebase - continuing support?
    When V3 is released, it will be taking a dramatic turn away from the framework approach of V2 which required a developer to implement content types and other features. The up-side of V2 was that you could use flux to power any kind of website you could imagine and could pull the content out in any way you saw fit. V3 will still be as powerful and will offer a substantial framework for developers, but will be a little more prescriptive and uses a different paradigm for content. Our next question for the users is - would you like to see the V2 codebase continue development as a seperate product to the V3 solution?

    Cast your vote here: http://www.fluxcms.co.uk/forums/97/ShowThread.aspx

    Would implementation partners be useful?
    We're thinking of starting a directory of implementation partners. These are people who register themselves as being able to implement websites using flux. Initially this will be open to everyone and will be searchable by visitors to the community site (www.fluxcms.co.uk). Eventually we may offer some form of certification for specialist implementors, but before we even consider this, we want to know if you think it would be useful to have a directory of implementation partners;

    Cast your vote here: http://www.fluxcms.co.uk/forums/98/ShowThread.aspx

    Finally, have you done anything interesting with Flux lately?
    We want to hear about anything interesting you've built with Flux. We hear about implementations from a few of you via email and suchlike, but we want you to show off anything you've done with flux to the wider community.

    Tell us about your implementations here: http://www.fluxcms.co.uk/forums/thread/99.aspx

  • Approach to managing database change and source control

    It's not 100% specific to flux, but with the new V3 code base, the way in which the database is managed is changing. I've detailed the approach and the tools in these two posts on my blog;

    The approach:
    http://www.deepcode.co.uk/archive/2008/06/19/database-schema-in-source-control.aspx

    The tools and source:
    http://www.deepcode.co.uk/archive/2008/07/02/database-schema-and-source-control-the-tools.aspx

  • Major overhaul for v3

    image

    Version 3 of the flux.net platform is presently in development, and it's taking a whole new approach to how we traditionally manage content. V2 and earlier always worked on the premise that a page was an item of content, V3 is changing this paradigm and is considering content to be individual pieces of functionality that consume data. A page therefore won't be "written" per-se, as it is in v2, it will instead be composed from elements that make up the whole.

    The content management piece of the application will focus on the structural management of the site - the templates that make up the site, the page relationships and structure. From there, the pages will be composed by placing web-parts in the different publishing zones, with different web-parts available for different functions. Content pages no longer have the concept of type specific data structures, instead content is created within different modules of the application and exposed to the content management facility through web-parts. This allows for greater content re-use and re-purposing.

    An example might explain this more clearly. Lets say we have a simple corporate site with;

    • a home page
      • will list the latest 5 press releases
      • will display with some general content
    • a news page
      • will list all of the companies press releases in a paged format
      • allows user to drill into a news article to read the full body.

    To create this in v2, you'd create multiple content types for homepage, news aggregation page and news detail page and code all of the appropriate functionality into the rendering templates for the content type. This makes it a little difficult to re-use content as needed, moving the responsibility to the developer to create the render templates correctly and adequately define taxonomies. In v3 however content is separated from the actual templates completely - to create this site in v3, one would;

    • Define an ASPX template that governs the look and feel of the web site, exposing various content zones where content can be placed. (Of course many different templates could be created)
    • Define 3 pages in the content management system using this template, and the following hierarchical structure;
      • Homepage
      • News Listing
        • News Detail (not shown on menus)
    • On the homepage, add a "Generic content" web-part for the general content and use the HTML editor it provides to write the general content on the site. Also add a "News summary" web-part and configure it to show the latest 5 news articles - also set it's "detail" link to the news detail page.
    • On the news listing page, add a "News Listing" web-part to display a paged list of all news articles - set it's "detail" link property to the news detail page.
    • On the news detail page, add a "News detail" web-part to display the details of a selected news article.
    • Use the news module to create news articles.

    The data that makes up the various parts of the site is managed through vertically oriented modules, and then exposed via the web-parts engine. The initial set of modules planned for v3 includes;

    • News Articles - define categorised press releases and news items to appear on the site.
    • Blogs - multiple blogs will be able to be exposed through the site
    • Events - let people know what's going on and when
    • Files - share downloads with site users
    • Membership - a core membership system for the site users and administrators, extensible by other modules. Send emails, updates and notices etc.
    • Forums - let your members talk to each other.
    • Surveys - ask users to feedback on different things and capture statistics.
    • Images - define image galleries
    • Lists - anything that can be described as a list (links, favourite sites, FAQs) can be defined in this module and exposed to the site

    Of course flux wouldn't be flux without massive extensibility, and v3 is no exception. The development framework that all of the above is built upon will allow developers to extend flux to meet every need they have. When this is finished, I'm hoping that flux will continue to be the powerful platform that it is today, whilst offering a lot of functionality out of the box tied to excellent opportunities to extend and enhance.

  • Quick Installation Guide

    To begin with, get yourself a copy of the distribution from here:

    1. Extract the zip to a new directory on your machine - we'll call this DISTROOT
    2. Create a directory for your website we'll call this SITEROOT
    3. Create a virtual directory or website in IIS and map it to SITEROOT
    4. Create a child virtual directory mapping in IIS called admin and map it to DISTROOT\src\Deepcode.Flux.Admin
      • a. Make sure your /admin mapping doesn't have a separate application configuration.
    5. Ensure you have a mapping at the root of your webserver called flux_client and map it to DISTROOT\src\flux_client
    6. Copy either formsWeb.config or windowsWeb.config to web.config in your SITEROOT. As the names imply one config is for forms based authentication and the other is for windows based authentication. Choose the appropriate one.
    7. In VS.NET open the website and add a reference to Deepcode.Flux.Core.dll from the /admin/bin directory. (alternatively you could create the bin directory and copy Deepcode.Flux.Core.dll into it).
    8. Open http://yoursite/yourvdir/admin/Setup/Install and follow the prompts
    Posted 18 March 2007 22:54 by tonyj | 0 Comments
    Filed under:
  • FLUX.NET Licencing **IMPORTANT**

     FLUX.NET is licenced under the standard open source GPL - GNU General Public License, which we have adopted with the following restrictions:

    Guidelines

    • FLUX.NET may only be distributed as a whole. No part of the application may be seperated from the main body of the application or used to create another stand alone application. This could involve using parts of the UI, the custom controls or creating another CMS solution.
    • You may NOT rebrand FLUX.NET. The UI and all branding must remain in place on all deployments and installations.
    • Any extensions, applications or tools created to run within FLUX.NET or that link to any FLUX.NET assembly or otherwise require FLUX.NET in order to run must also be licenced and distributed under the GPL as well.
    • If you have any doubts about the licencing of FLUX.NET, please contact us before using the software. We do offer commercial licences outside the GPL and white label licences to allow you to do more things outside of the scope of the GPL, but these all involve fees. Please get in touch for more details.

    Remember FLUX.NET is free....

    • But to ensure the continual development of the product we respectfully request that any commercial usage of the software (eg by companies, agencies or consultants) a 5% donation of the project price.
    • All donations and contributions are used to improve the software!
    • Ensure your implementation partner is following this recommendation - it's the only way to keep FLUX.NET free.
    • If you wish to donate to the project, please get in touch.

    And finally:
    Please respect the work being done by the FLUX.NET team and support the FLUX community.

  • FLUX.NET v2.0 Released

    Beer Pass the beer! I'm pleased to report that today, Sunday 4th March 2007, I've finally made FLUX.NET ECMS available to the public. Whilst this is version 2.0, this is the first public release as an open source platform.

    Flux has been in development for what seems like an age now and if I hadn't made the decision to cut-off now and release, we'd of been here for another year. So get yourself a copy of the framework and start building powerful content managed websites in less time than before!

    Even though it's out, we're not stopping on the development.

Powered by Community Server (Personal Edition), by Telligent Systems