Relationship between N2.Edit and N2 Core

Topics: Developer Forum, Project Management Forum, User Forum
Feb 24, 2009 at 9:20 AM
Edited Feb 25, 2009 at 9:49 AM
Hi
I recently started my internship at a local web development company.
My current assignment is to create a basic website using N2 starting from scratch (without using the templates project).
My experience with web applications as big as N2 is rather low however.

What I currently am trying to understand is how does N2.Edit relates to the “Core”. As far as I understand both N2.Edit and N2.Templates are not part of the core.
So far I started with the the C# example and tried to remove all unnecessary stuff.
Instead of using the dll references I added the following projects to my solution to be able to debug and understand N2 a little bit better. (see screenshot). 

ImageHost.org

Can someone explain how the Edit folders in the screenshot relate to each other?

What if you want to change something (or perhaps everything) about the editor interface.
I suspect this is possible by changing the files in the Edit folder but what would you do when the editor interface changes with an n2 update. In that case you would have to manually adjust your own “Edit” folder every time to reflect changes of the n2 update? Is it possible to customize the edit interface without modifying the original files.
In other words can you change the interface in a certain way retaining compatibility with future updates to N2 so you don’t have to update your own code each time?

Also, on the n2 website the solution overview doesn’t mention anything about N2.Extensions and N2.Security. N2.Security does seem to be necessary to run the C# example though.
Could somebody clarify this a little bit as well?

About references and dll’s… why is there a reference to Castle.Core in every project in my solution. It appears to me that a single reference to Castle.Core should be sufficient. Then by referencing to the N2 project from the other projects would be enough for them to be able to “access” it?

Thanks for your help.

Koen
Coordinator
Feb 24, 2009 at 6:26 PM
From your screenshot it looks like you have a copy of the interface files in the N2.Edit project in your web site project (wwwroot). The system is designed not to require any customization of these files. There are a number of extension points that allows you to hook into the interface without changing it. If you really need to change something the best way to do it would be creating a new extension point and submitting it as a patch.

N2.Security contains membership providers you can use if you want to store users as content items in the node hierarchy.

Castle.Core contains an interface used by some of the projects. Try removing the reference and the compiler will explain.

Good luck
Feb 25, 2009 at 10:10 AM
The screenshot above from the solution:
The "wwwroot project" contains the files from the Simple C# Example.
I removed the N2, N2.Edit, N2.Security dll's from that project and included references to the N2 and N2.Security projects instead (which can be found in the "src" folder from the full source code.)

Why is there no "N2.Edit" folder under "src"?
I copied "src > wwwroot > Edit" folder to a different folder together with the N2.Edit project file... also found under wwwroot.
Then I referenced that project in my solution.
I want to seperate the Edit folder from my wwwroot project in the screenshot. How can I do this?
Also what does the "Edit" folder under "N2" do?


Coordinator
Feb 25, 2009 at 4:35 PM
If you want to access the editing functionality you cannot separate it from the site. If you use the "web application project" you can avoid seeing it in your project. The folder under N2 contains the aspx, js etc for the said editing functionality. The files are copied to the various examples that use it.
Feb 26, 2009 at 8:44 AM
As you can see, I'm really having a hard time understanding N2. Partially due to a lack of programming experience.


So far I came to the same conclusion concerning separation but don't you mean that the examples contain a copy of the files in "src > wwwroot > Edit" folder?
If this is true, why are there a whole bunch of .cs  files (codebehinds) missing in the examples Edit folder?
What is the function of the N2.Edit dll in the example projects and why is it necessary there and not in the full source code > N2.Templates project?

Thanks a lot for your patience.
Coordinator
Feb 27, 2009 at 10:04 PM
The .cs codebehind files are not needed in the examples since they are compiled into n2.edit.dll which is deployed in /bin.

The web application project model may be a bit confusing but it's very useful as the solution grows. It also allows to include assisting classes in a more natural manner. The web site project model (used in that examples) becomes awfully slow after a certain number of files.