DotNetNuke development is always an interesting for me. New developers come to the forums posting same silly questions again and again, and guys out there on the forums give them a gentle reply with some guidelines. This happens always everyday on DotNetNuke Forums. Sometimes i think is it really hard to find what we want from DotNetNuke source and DotNetNuke web app?
Understanding the way DotNetNuke works:
I think developers should start learning DotNetNuke from the basic understanding about portals, tabs, modules, skins, skin objects etc. Don't start your development before understanding these terms. I am not going to introduce or summarize these terms as you will find many web logs regarding this.
Getting started with development:
Once you get basic understanding about this, you will be able to understand how DotNetNuke development will go for you. Once you are done with this, whenever you need to write a code that you don't have ask this questions to your self: Is DotNetNuke doing this? How DotNetNuke is doing this? For instance, if you are looking for code to dynamically create a tab in dotnenuke. you should ask, is DotNetNuke creating dynamic tabs? and the answer is obviously yes. Second question is how it is creating the tab? This is a hard question for new developer. Basically, all the DotNetNuke admin related stuff can be found in admin directory. If you look at ~/Admin/Tabs/ManageTabs.ascx, You will see the page that is used to create a new tab from DotNetNuke UI. Click on update link and you can easily find the code written in vb. You just need to find a part of code you basically want. You can also convert this code to c#.
How to search the code i want?
Well its really depends upon what code you want. But if you think like the way I demonstrated above, you will probably find the code you want after some trial and errors. The big help will be from the DotNetNuke UI and the way the directory structure is provided. Let's take another example of updating a user. So for finding that code, if you look at admin folder, you will find ~/Admin/Users where we think the code can be. Let's try that folder first. Opps! looking at the folder increases the problems, we have many controls in it unlike tabs folder. So let's try the controls one by one. Just open the ascx control on by one in design mode and see if you can find update button on it. Well the control ~/Users/User.ascx controls a floppy icon which is obviously a universal icon for save in DotNetNuke . so let's see what is written in the code of the click event of it. Well it contains a code to create a new user as well as update an existing user. Am I right? Ok, so this code says UserController.UpdateUser() is a method you can use to update the user. Just pass userportalid and userinfo object to it, and it will update the stuff. So if you want to implement a custom user profile update page, you just need to get the userInfo object from UserController.GetUserByName and assign the new values to the object properties and UserUser Method of the UserController class. An you are done.
So basically DotNetNuke has all the code you want. You just need to guests where can i find the code and just go through the code and you will definately find the code you want. Accessing source code is more complecated than accessing web application because you don't have UIs to compare with, but once you got familiar with DotNetNuke , you will find your required code in the source code also. I think DotNetNuke documentation is also helpful finding the right code as well as if you understand the way DataProvider and SqlDataProvider implemented, it will be fun digging into the code.
Best luck with your DotNetNuke code review and hope you will find the code you need from DotNetNuke .