This project is read-only.

doubts with Multisite Installation

Topics: Developer Forum, User Forum
Sep 8, 2008 at 1:27 AM
Edited Sep 8, 2008 at 1:29 AM
Hi All,$0This is myfirst post in the Forum. My goal today, with this post, is find some help forunderstand better the N2 framework. $0$0I’m lookingfor a CMS system for one project that I will start. This project will be a placewhere stores can show their products. Every store will be able to manager itsown website with its name and his products, example:$0$0store 1: www.Store1.mysite.com$0$0store 2: www.Store2.mysite.com$0$0store 3:www. Store3.mysite.com $0$0Each storecan see only the own contents, documents and products. The store can’t see anyinformation about the others stores.$0$0Is possibledo this with N2 framework or will be need required develop some code to dothis. I see this functionality on mojoportal(www.mojoportal.com)but N2 cms seems to be more easy to implement new features, and truly have an administrationinterface much more friendly. $0
Sep 8, 2008 at 7:10 AM
Edited Sep 8, 2008 at 7:10 AM
Hi,It's exactly what I'm trying to do with N2. Unfortunately that functionality doesn't supported (i hope yet).But there are some extension points which allows to implement that. Look at my posts at this forum. I'm not succeded in 100% yet, still having problems with file manager (files need's to be uploaded in separate folders for each instance of N2), with trash and there are some other problems.
Sep 8, 2008 at 7:38 AM
$0Why do you want multiple sites with multiple users all in one technical framework?$0$0I suppose you believe it will be a better manageble setup, I believe it will not...$0$0$0$0$0imho I would never do a setup like that. It is not (wel enough) scalable (always one database), one problem will result in problems for everyone and no exceptions in functionality are possible..$0$0I would always set this up on different web application installations and seperate databases (preferrably on different servers).$0$0$0$0$0But, if you must... ;-)$0$0I do believe you can with N2.$0$0You can manage which groups have access to specific pages in the edit module.$0$0You can implement multi-site/-domain .$0$0And with some creativity you can deploy webshop-functionaluty (I did).$0$0$0$0$0You will need "some code" to do this however. N2 is not a framework for non-programmers.$0
Sep 8, 2008 at 10:40 AM
Martijn,$0It's useful when hosting many typical sites, for example - blogs. Each blog can have users which are allowed to post, spearated file storage, etc.$0And a new blog can be registered on the fly, so it's very hard to setup a new web application for each new blog.$0As about scaling, it's another problem, which can be solved using web farms, db distribution, etc.
Sep 8, 2008 at 11:32 AM
Martijn, The clients has the same type of products and the same necessities. I believe that, in this scenario "multiple sites with multiple users all in one technical framework" is valid. About the sentence "N2 is not a framework for non-programmers." Thank you to open my mind for that. I passed some time thinking about what is N2 CMS, now I know it's a framework, not a Portal system. About " non-programmers." i'm happy to say that it will NOT be a problem :-D
Sep 8, 2008 at 11:53 AM
Maqdev, I have 1 idea for Multisite Installation, but I think it will sue a big change in the framework. I don't know the N2 code, but seems to be all based on 4 tables. I strong believe that, if we add 1 more table, called "n2Site", and put 1 reference in the others table, we can solve 1/2 of the Multisite Installation, and about the file manager using the "n2site" table will be possible put 1 folder "Data" and for each site create a new folder under "data" folder  example: data\<id_n2site>\               What you think? Is it a good ideia?
Sep 8, 2008 at 12:23 PM
tiagojesus, adding new table is not neccessary and doesn't helps. The main problems are with code itself, because it's built with assumption that there is only one root of sites (see IHost.CurrentSite, DefaultSite). All other data including sites and users are bound to that root item. The good news is that N2 is very flexible and open to the extensions (based on IOC pattern), so I'm trying to create an extension module which will allow the usage of many root's which are inserted into n2Item table. It's looks like working, but some problems are still. If you are interested in that module i can upload it within a couple of days (need to eliminate dependecies from other my code).
Sep 8, 2008 at 12:32 PM
@maqdev 11:40: sure, but blogs and webshops are somewhat different...$0$0$0$0@tiagojesus 12:32:  Then there is indeed a usefull need! Glad you are a programmer, "or will be need required develop some code to dothis" threw me on a different track. N2 is very powerfull, when you can code :-)$0$0$0$0$0@tiagojesus & maqdev 1:32: $0$0N2 does have a multiple sites option, did you check it out?$0$0http://www.n2cms.com/Documentation/Advanced-topics/Multiple-sites.aspx The biggest problem is making sure not everyone can see all the pages.$0$0$0But, it is possible to restrict pages for users / admins, I have not used it, but it might work I guess.$0
Sep 8, 2008 at 1:36 PM
maqdev, I will appreciate if you share your code with us. But I still believe that the addition of 1 more table will increase the maintainability and extensibility. Maqdev, I will see the link you sent me, tks.
Sep 8, 2008 at 3:44 PM
A table is not necessary...the data structure allows master-detail relations in the n2item and n2detail table...that should suffice..
What is wrong with the proposed method in dthe documentation for multiple sites?
Sep 8, 2008 at 3:54 PM
MartijnRasenberg,$0$0$0$0As for me, i need to provide fully independent CMS engines for users within one application (they should have separated file storage, design, users), but all applications have some similar behavior. Every user could edit only some fixed sites, and doesn't have access to the others.$0$0$0$0$0In some approache it's looks like a blog's hosting, for example livejournal.com $0
Sep 8, 2008 at 4:43 PM
maqdev, I saw your point of view about not include a new Table. Like you said before, it's possible develop one extension for isolate the site for each other. After read some documentations and studied some parts of n2 code, I complete agree with you.               However, I would like to know how you did to integrate your code for make "the n2's extensions" behave like your's Multisite extension. Example: how the wiki  will know which site owner the Text?
Sep 8, 2008 at 5:04 PM
At the moment each site supports unique start and root nodes but I hadn't thought about upload. Moving this to the site could open for interesting usages.

The initial motivation for not having a site concept in the database is that adding sites probably involves multiple external steps such as configuring IIS and DNS anyway. Having this dynamic would complicate things and call for an additional UI.

The general idea is to separate code (model + behaviour) abd data (pages). In between there's configuration (stuff where an UI doesn't help much such as sites). I understand that the boundary between each vary with the point of view.

Personally I'd opt for Martijn's approach and avoid mixing different customer's data in the same tables. Sharing the application is better in that respect. A table naming scheme or database users within the same database could do it.
Sep 8, 2008 at 7:08 PM
libardo, about "The initial motivation for not having a site concept in the database is that adding sites probably involves multiple external steps such as configuring IIS and DNS anyway. Having this dynamic would complicate things and call for an additional UI." We could use internal folders for this, like www.site.com/client1/ , www.site.com/client2/ could be diferents websites. The configuring IIS and DNS, in my opinion, is not a good option. Need to be done by someone extra the cms. The CMS will only configure only the websites configuration .
Sep 11, 2008 at 8:13 AM
Hi!

I have created new issue, where i've described some problems with multi instance support http://www.codeplex.com/n2/WorkItem/View.aspx?WorkItemId=18456
Also there is attached file with source code i've promised for tiagojesus, where i've tried to solve some of that problems.

"The initial motivation for not having a site concept in the database is that adding sites probably involves multiple external steps such as configuring IIS and DNS anyway. Having this dynamic would complicate things and call for an additional UI."

libardo,
I guess most of work could be automated, so if somebody doesn't uses multi instance configuration it wouldn't require additional configuration.

I see that you are made some changes to support separate uppload folders, that very nice, thank you a lot!
Sep 11, 2008 at 11:07 AM
Thank you, maqdev... I will see you code.