Where to go next

Topics: Developer Forum
Jun 10, 2013 at 11:35 AM
I have downloaded the latest version, and looked through the dinamico demo project.

And I can find lots of technical pages about specific aspects of N2. But what I really want is a basic guide to creating a 'hello world' type site using MVC. Is there one anywhere? (I know it sounds basic, but my first site I want to use N2 on is a very basic site, proabably only 3 templates in total, so I'd like to find basic tutorials to match my goals :-)
Coordinator
Jun 11, 2013 at 3:29 AM
I'm afraid a lot of the document has yet to be written. You could start here... https://n2cmsdocs.atlassian.net/wiki/display/N2CMS/Management

We can help you along the way via the forum, I suppose. I'm not sure anyone has the time right now to fill in the wiki... :-(
Jun 11, 2013 at 1:48 PM
Edited Jun 11, 2013 at 1:50 PM
Well so far today has been a complete write off.

I have spent several hours now just trying to get a basic N2 cms integrated with a brand new MVC site. No matter what I do I can't install even the bare bones of the cms into the project. Its frustrating as Im sure this is me :-)

So is there even a basic guid to setting up an MVC 4 Site using N2. I have tried installign it manually, adding it via NuGet, and copying files from the demo that works. All to no avail. I want to try N2 as it is lighterweight than Umbraco, but so far I have to say that Umbraco is winning on ease of installation of a new site :(

So can anyone give me brief instructions for adding N2 to a New MVC website in visual studio 2012?

Just found more resources on this, so hopefully I'll be back with good news shortly..
Jun 11, 2013 at 3:04 PM
Ok, here is what I have just done;

This is a blank site, and the model / controller was set up as per https://n2cmsdocs.atlassian.net/wiki/display/N2CMS/Integrate+N2+into+an+Existing+MVC+Site

1) Create Brand new MVC project (Basic one)
2) Add in N2 CMS Library
3) This copies a config file and a zip file into a folder called N2 in the project
4) Extract those files, and add them all to the solution under an N2 Folder
5) Add the following lines to the root config
<sectionGroup name="n2" type="N2.Configuration.SectionGroup, N2">
  <section name="host" type="N2.Configuration.HostSection, N2" requirePermission="false" restartOnExternalChanges="true" />
  <section name="engine" type="N2.Configuration.EngineSection, N2" requirePermission="false" restartOnExternalChanges="true" />
  <section name="database" type="N2.Configuration.DatabaseSection, N2" requirePermission="false" restartOnExternalChanges="true" />
  <section name="edit" type="N2.Configuration.EditSection, N2" requirePermission="false" restartOnExternalChanges="true" />
</sectionGroup>
6) In App settings add
<add key="ValidationSettings:UnobtrusiveValidationMode" value="None" />

7) As this is a bare bones MVC, there is no login control yet, so set forms authentication to false
8) Now can navigate to <site>/N2/Installation/begin/
9) When installation complete re edit the N2/Config file to add in security

And now when I try to navigate to <site>/N2/ I get an {"Unauthorized"} N2.Security.PermissionDeniedException

It appears that this is becasue my root and homepage are pointing to the same model. Changing the name of one of them lets me go to the N2/Login.aspx page anyway. (Maybe this shouldnt be allowed, or have I done somethign wrong here?

Now I can get to the login page, but cannot log in. I have tried Admin, changeme, and admin, changeme neither of which works.

so;
1) What is the correct un / pwd
2) Should there only be 5 tables in the database?
3) I don't see a table in the database for setting up users / names / passwords

Thanks
Jun 11, 2013 at 3:08 PM
Yes, only 5 tables in the database (it was four until recently :)

If you performed installation, like wiki suggests in last step, then you must have been asked for password, and you typed it before you were able to install?

When you search web.config for "admin", do you see it?
Jun 11, 2013 at 3:09 PM
Btw, it would be great if you could compare Ben's wiki and your experience and extend that post with missing steps.
Jun 11, 2013 at 3:20 PM
Hi. I was not asked to enter an admin password at any stage.

As soon as I went to setup, it went straight into create a database connection. I used my Local SqlServeer not the default option. It went through setting up the connection string using integrated / sspi, ran the scripts to create the 5 tables and then set the config file to disable installation.

Thats all it did.

Restarting and goign to /N2/ presents me with the configuration screen again, and suggests that I might need to add the key checkInstallationStatus="false" to the config.

I have done that, and now it is complaining about a class (the one I had to create to get round the security exception.)

So I assume I haven't got to the admin password section yet, and it looks liek I need to create a root class, and map it to the same controller. That or start all over again, and this time tell it that I want to use the same class for root and index nodes.

Any more thoughts or pointers as to where I have gone wrong?



Jun 12, 2013 at 1:20 PM
milicicd wrote:
Btw, it would be great if you could compare Ben's wiki and your experience and extend that post with missing steps.
To be honest Im giving up. I have spent 2 days on this, and I can't justify any further time with it. I'll have to report back that its not suitable for our needs and we should either look to roll our own cms or keep on with Umbraco, even if it is a little heavy for this project.
Jun 12, 2013 at 1:33 PM
Started again, went through what I did yesterday with a brand new instance.
gets to the same point and fails.
I have to disable forms security to be able to run the isntallation;
If I don't do this I can navigate to http://localhost:36785/n2/installation/begin/ and see the start screen. But clicking on any of those links takes me away from that page (which explicitly allows all users), it tries to find a login screen from the root of my application.

From there I can set up the database happily (and it does create it I have checked in sql). When I get to Finishing touches and tell it to modify the config file it does this.

When I then click on update config file, it does this (checking it later on shows this has happened), and then fails on a security error PermissionDenied at http://localhost:36785/N2/Content/#Finish

I assume that at this point it should be asking me to create a default admin account, or it should have created one automatically?

I would need to download the sourcecode to dig deeper into the issue, and whilst I would like to get invovled in an open source project as it would improve my abilities and give something back, Im not sure that my boss would agree :-)
Coordinator
Jun 13, 2013 at 2:36 AM
Hi Kalisto, can you try using the N2.Management.NoZip rather than the ZIP distribution? There are a number of issues with the Zip distribution at this time.

Thanks,
Ben
Coordinator
Jun 13, 2013 at 2:38 AM
Also have you tried using the sample VS project on the download page?
Jun 13, 2013 at 7:32 AM
I'll try if I get time, but like I said, its hard to justify throwing more time after it..

Jun 13, 2013 at 7:33 AM
The sample project worked, but we decided that rather than try to remove all the stuff that was there and retrofit our project into it, it ought to be better to start form scratch once we appreciated what we could do with N2.

Jun 13, 2013 at 11:31 AM
Edited Jun 13, 2013 at 11:33 AM
bherila wrote:
Hi Kalisto, can you try using the N2.Management.NoZip rather than the ZIP distribution? There are a number of issues with the Zip distribution at this time.

Thanks,
Ben
Right, its quiet, so I'll give this a go.
Jun 13, 2013 at 1:32 PM
Hi Ben (and others).

Ok, I have got something working after a fashion. (Well it installed the database now, adn asked me for user name and so on correctly.

Now it is at the point where it needs to add some content.

I can avoid adding in the demo package, but it gives me 2 pages for root and start nodes.

There are 3 sites we want to trial this on. All will be english language only.

so;

1) Do I need to define new root and start pages that are different to the language intersection, or can I just create my site under the Language intersection, and manage routing to avoid the language aspect of the url?
2) Can I set it up so that one copy of N2 can manage several sites, and then restrict content editors each to their own site, or will I be better off having one copy per site?

thanks for the help so far..
Coordinator
Jun 13, 2013 at 9:37 PM
You want a root node and a language intersection (even though you are going English only), and a start page. Look in the navigation tree and mouse over the root node and the start node until you see the tooltip, and note down the Root page ID and the Start page ID (e.g. #2, #1, etc.) Then crack open App_Host.config and set the root page ID and the start page ID. You do not want the language intersection to be the start page ID. This will cause the __start page __to map to ~/ (rather than the Language Intersection)

You can make one copy of N2 manage several sites, but the permissions will be a bit tricky if you want to restrict content editors to their own site. I'm actually not sure how to go about creating extra roles etc., and I'm not sure if it is possible to hide content in the admin panel from users who don't have permission. (They will be able to see it is there but potentially not access it)

-Ben
Coordinator
Jun 13, 2013 at 9:38 PM
Also the sample project does NOT have any extra stuff other than installing the NuGet packages.

You would want to install the following packages:
  • N2.Dinamico
  • N2.Management.NoZip
All other required packages will be pulled in by dependency. You can download the NuGet packages in a ZIP file from the Downloads page here on Codeplex and then use the -Source argument on Install-Package to install the NuGet package from the downloaded release, rather than from NuGet.org, which is out of date. If Cristian gives me permissions on the CoApp packages on NuGet.org, I can update them to the latest release that is here on Codeplex.