Click here to Skip to main content
15,884,298 members
Articles / Operating Systems / Windows

Installation of DotNetNuke in Step by Step Manner

Rate me:
Please Sign up or sign in to vote.
4.67/5 (5 votes)
24 May 2009CPOL12 min read 58.2K   29  
An article on how to install DotNetNuke in a step by step manner

Introduction to DotNetNuke

The current version is 5.x. It was written in VB.NET, but the custom module can be written in any .NET supported language, i.e. C# also. It has built in support for SqlServer provider but has to extend custom provider for supporting other databases. DotNetNuke has good support for Server Operating systems. But it can be installed in XP too.

Different DotNetNuke Versions

DotNetNuke 3.x was built on .NET Framework 1.1 and DotNetNuke 4.x was built on .NET Framework 2.0.

  1. DotNetNuke 3.x – 4.2  supports  .NET Framework 1.1
  2. DotNetNuke 4.6 – 4.4  supports  .NET Framework 2.0
  3. DotNetNuke 4.09 – 5.1(current)  supports  .NET Framework 3.5

DotNetNuke Supports

  • Silverlight
  • Ajax
  • Web 2.0 concepts

From DotNetNuke market place we can buy third party modules for cheaper rates. Even so many free modules are available.

DotNetNuke Feature List

  1. Adsense
  2. Documents
  3. Feedback
  4. HTML
  5. Map
  6. NewsFeeds
  7. Store
  8. UsersOnline
  9. Announcements
  10. Events
  11. Forum
  12. IFrame
  13. MarketShare
  14. Reports
  15. Survey
  16. Wiki
  17. Blog
  18. FAQs
  19. Help
  20. Links
  21. Media
  22. Repository
  23. User Defined Table
  24. XML

Benefits

  • It’s open source.
  • It was built on .NET Framework.
  • Large community support and good support from the DotNetNuke portal guys.
  • Gets response within 1 business day for our queries in DotNetNuke forums. It is very active.
  • Continual stable version releases.
  • Includes new features in all the releases.
  • Large number of custom modules (both free and commercial) available in DotNetNuke Market Place.
  • At reasonable prices we can get best modules. Let's say www.bring2mind.net and from http://marketplace.DotNetNuke.com we can get Tagging, Content & Publishing module, Document versioning.
  • Our expertise benefits we have more expertise on .NET. It will help us in using the existing resources effectively instead of learning a new language.

High Level Approach

How to extend DotNetNuke?

  1. Existing modules (out of the box custom installation)
  2. Free modules available on the internet
  3. Paid modules available in DotNetNuke Market Place
  4. Custom module development

DotNetNuke Control Panel enables us to perform the below actions

  1. Page Functions like adding pages, import, export functionalities
  2. Add New module, add Existing module
  3. Common tasks like user, roles, files, site configuration tasks
  4. Apart from that, there is a setting for each module to perform some more tasks

There are three types of users provided by DotNetNuke:

  1. Host User for adding custom modules, either a third party module or our own developed module.
  2. Portal Admin user for performing tasks like Add new modules on the site and giving permissions to the relevant users.
  3. General users who are registered on the site who have very less permissions.

We can download DotNetNuke from sourceforge.net.

Installation & Configuration

  • For installation, we have to download install.zip file.
  • For upgrade, download upgrade.zip file.
  • For custom development, download source.zip file and install starter kit. Install starter kit installs DotNetNuke templates in Visual Studio.

Here we are extracting install.zip file into a folder named ‘dnn4install’.

Create empty database in SqlServer.

Right click on the folder ‘dnn4install’ and select properties. In Security tab, add “Network” and “Network Service” and give full permissions to both for Windows Server 2003. For Windows Server 2000, select “ASPNET” in security tab.

Open the web.config file and change the connectionstring and appsettings to point to the database.

Type inetmgr in RUN. Right click on Default WebSite and create New Virtual Directory, say 'dnn4install’.

In browser, open http://localhost/dnn4install/install/install.aspx.

It shows typical and custom installation modes.

With Typical installation only some default modules like Links, HTML comes. LiveID, OpenID authentication providers come.

Select custom installation mode so that Wiki, blogs, forums, etc. in-built modules are seen in DotNetNuke.

With “Auto” installation mode: It bypasses the wizard completely.

Apart from LiveID, OpenID authentication providers, Active Directory, CardSpace comes in Custom installation mode.

Note: You may face a problem if Active Directory authentication mode was selected.

Configure host user and portal administration. Remember the portal administrator username and password.

Working with DotNetNuke

Adding Custom Third Party Modules

Login with Host credentials

AddingCustomModules.JPG

Click on Host -> Module Definitions.

On the screen, click on “Install New Module” link.

InstallNewModule.JPG

On the next screen, browse the zip file and click on “Install New Module” link.

Then all the files in the module are extracted and installed automatically.

“Installation Successful” message appears at the end.

ModuleSuccessful.JPG

Create a New Tab

See the “control panel”. Select “Edit” mode.

Control Panel.JPG

In “Page Functions”, click on “Add”.

See the below picture.

Give some name to Page Name, Page Title fields.

Select “None Specified” for “Parent Page” if there is no parent page for the newly added one or select a page from the dropdown list if it has parent page.

Check the checkbox “Include in Menu”.

Give the required permissions for the users.

And click on “Update” link.

PageManagement.JPG

Stay in your newly created page.

Now in the control panel which is at the top, select “Add New Module” radio button.

Select the newly added module in the “Module” dropdown list.

Select “Pane”, “Insert” and “Align” as per your requirements and click on “Add” link.

The new module appears in the page.

Create Menu

Click on Add link in Page Functions in Control Panel.

Give Menu12 for ‘Page Name’ and ‘Page Title’.

Menu.JPG

Select the page ‘Test’ in “Parent Page” dropdown. So Menu12 comes under ‘Test’ tab. Click on update link.

Add SubMenu

Click on Add link in Page Functions in Control Panel.

Give ‘Sub Menu1’ for ‘Page Name’ and ‘Page Title’.

Select the page ‘Menu12’ in “Parent Page” dropdown. So ‘Sub Menu1’ comes under ‘Menu12’ menu.

SubMenu.JPG

Don't forget to check ‘Include in Menu’ checkbox.

Finally it looks like below:

SubMenuFinal.JPG 

There is no limitation on the creation of submenus. But the user interface gets disturbed as shown in the screens below.

SubMenuLadder.JPG

Issue

SubMenuLadderIssue.JPG

Limitation: If number of tabs increases, then Admin, Host won't appear and the newly added ones also. There is no restriction on the number of tabs created but one can display 8 tabs (including Host, Admin tabs).

Add Leftside, Right side Links

Select “Add New Module” from Control Panel.

Select “Links” in Module dropdown.

Select “LeftPane” in Pane dropdown.

Click on Add link.

In the left side “Links” module appears. Click on “Add Link”.

Give Menu1 for Title.

Select ”Page” in LinkType.

Select “Menu1” from the “Select A Web Page From Your Site” drop down.

Give description and click on update.

Link.JPG

Again click on “Add link” and repeat the process.

And the final output looks like this:

LeftSideLinks.JPG

Repeat the same for right side pane too as per the requirement.

Creating New User

Admin -> User Accounts

Adding New Skins

Host-> Skins

How to Hide a Menu

Click on the menu.

Admin -> Pages

It will display list of existing pages.

Click on Settings in Actions at the right side.

Then in the new screen, check the checkbox “Include in Menu”.

How to Go to Market Place

Common Tasks in Control Panel

Click on Solutions

How to Develop our own Custom Module

Environment

  • Visual Studio 2005
  • VB.NET 
  • SqlServer 2005  
  • IIS 
  • DotNetNuke 4.09 version

Here we are extracting ‘DotNetNuke_04.09.00_Source.zip’ file into a folder by name ‘dnn4Source’. Note that ‘website’ folder is present in ‘dnn4Source’’.

Create empty database ‘Dnn4Source_DB’ in SqlServer.

Right click on the folder ‘dnn4Source’ and select properties. 

In Security tab, add “Network” and “Network Service” and give full permissions to both for Windows Server 2003. For Windows Server 2000, select “AspNet” in security tab.

Type inetmgr in RUN. Expand Web Sites. Right click on Default WebSite.

Select New -> Virtual Directory.

Give Virtual Directory Alias name as ‘dnn4Source‘ and browse dnn4Source\website folder for path.

Note: Create virtual directory for website in the above step.

Open DotNetNuke.sln file in Notepad.

First two lines are like this:

Microsoft Visual Studio Solution File, Format Version 9.00

# Visual Studio 2005

Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "http://localhost/DotNetNuke_Maintenance/", "http://localhost/DotNetNuke_Maintenance", "{79D3BA0F-F76F-4A84-AE7F-C6A01EC247F9}"

Just change the virtual directory name from “DotNetNuke_Maintenance”  to “dnn4Source”.

Microsoft Visual Studio Solution File, Format Version 9.00

# Visual Studio 2005

Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "http://localhost/dnn4Source /", "http://localhost/ dnn4Source ", "{79D3BA0F-F76F-4A84-AE7F-C6A01EC247F9}"

Save it.

Then double click ‘DotNetNuke.sln’ to open the Visual Studio solution.

It has this project's structure.

SolutionExplorer.JPG

Locate the file release.config (under http://localhost/dnn4Source) and rename to web.config.

Open the web.config file. Default web.config file looks like the one below:

webconfig.JPG

Change Connectionstring tag and appSettings tag to point to the new database settings.

Use SQL Server 2000/2005 in both Connection String and App Settings tags.

newwebconfig.JPG

In browser, open http://localhost/dnn4Source/install/install.aspx.

It shows typical and custom installation modes.

First.JPG

With Typical installation, only some default modules like Links, HTML come. LiveID, OpenID authentication providers come.

Select custom installation mode so that Wiki, blogs, forums, etc.  in-built modules are seen in DotNetNuke.

With “Auto” installation mode: It bypasses the wizard completely.

Select Next.

Select “Test Permission”. “Your site passed the permissions check” should appear.

second.JPG

Click Next.

Select SqlServer 2000/2005. Give database name. Give credentials. Give dnn4(say) for Object Qualifier. It helps in identifying the custom tables and sps of DotNetNuke. Their names starts with this dnn4.

Click “Test Database Connection”.

“Connection Success” message should appear.

Third.JPG

Click Next.

Fourth.JPG

Then Click Next. Configure host. Remember the host username and password.

Fifth.JPG

Click Next.

Default modules are HTML and Links.

Sxith.JPG

Click Next.

Apart from LiveID, OpenID authentication providers Active Directory, CardSpace comes in Custom installation mode.

But you face a problem when selecting Active Directory authentication mode.

Seventh.JPG

Click Next.

Eigth.JPG

Click Next.

ninth.JPG

Click Next.

Configure portal administration. Remember the portal administrator username and password.

Tenth.JPG

Click Next.

Eleventh.JPG

Install DotNetNuke_04.09.00_StarterKit.vsi starter kit which creates the following templates in Visual Studio editor.

  • DotNetNuke Dynamic Module
  • DotNetNuke Simple Dynamic Module
  • DotNetNuke Skin.

Open ‘dnn4Source’ solution.

AssemblyInfo.vb and Global.asax.vb files present under “App_Code” in “http://localhost/dnn4Source/” folder.

Right click on http://localhost/dnn4Source/ in the solution explorer and Select “Add New Item”.

Select “DotNetNuke Dynamic Module” template and Visual Basic as the language. Give “SampleModule” for Name. Click Add. “SampleModule” is the module name for the DotNetNuke site.

DotNetNukeDynamicModule.JPG

Observe the App_Code folder in “http://localhost/dnn4Source/” folder.

It has created ‘ModuleName’ folder having DataProvider.vb, SampleModuleController.vb, SampleModuleInfo.vb and SqlDataProvider.vb files. It means it has created business logic layer and database logic layer files.

DataProvider.vb and SqlDataProvider.vb files are for database logic layer.

SampleModuleController.vb and SampleModuleInfo.vb files are for business logic layer.

One more change is:

Under ‘DeskTopModules’ folder, it has created “ModuleName’ folder which contains App_LocalResources, Documentation, EditSampleModule.ascx, Settings.ascs, ViewSampleModule.ascx, 01.00.00.SqlDataProvider and SampleModule.dnn. It means presentation layer files are created automatically by the DotNetNuke portal engine.

01.00.00.SqlDataProvider file contains the queries to create tables and stored procedures.

SampleModule.dnn file is required to add this module into DotNetNuke.

Read the help page given after adding the module.

It instructs to rename /App_Code/ModuleName to /App_Code/SampleModule, and rename /DesktopModules/ModuleName to /DesktopModules/ SampleModule.

Right click on ‘ModuleName’ of App_Code and DesktopModules in the Solutions Explorer and rename them to ‘SampleModule’.

SampleModule.JPG

Build the solution. It should build successfully.

Set http://localhost/dnn4Source/ as the start up project and default.aspx as startup page.

Run it. DotNetNuke website comes up. Login with host credentials.

Click on Host -> SQL.

SQL.JPG

Switch back to ‘dnn4Source’ Visual Studio solution. Open  01.00.00.SqlDataProvider file under DesktopModules/SampleModule under http://localhost/dnn4Source/ and copy the content of 01.00.00.SqlDataProvider file.

Switch back to the DotNetNuke website and paste the script into the window, check the "Run as Script" box and click EXECUTE.

SQL
if not exists (select * from dbo.sysobjects where id = _
	object_id(N'{databaseOwner}[{objectQualifier}YourCompany_SampleModule]') _
	and OBJECTPROPERTY(id, N'IsTable') = 1)
       BEGIN
              CREATE TABLE {databaseOwner}[{objectQualifier}YourCompany_SampleModule]
              (
                     [ModuleID] [int] NOT NULL,
                     [ItemID] [int] NOT NULL IDENTITY(1, 1),
                     [Content] [ntext] NOT NULL,
                     [CreatedByUser] [int] NOT NULL,
                     [CreatedDate] [datetime] NOT NULL
              )
 
              ALTER TABLE {databaseOwner}[{objectQualifier}YourCompany_SampleModule] _
		ADD CONSTRAINT [PK_{objectQualifier}YourCompany_SampleModule] _
		PRIMARY KEY CLUSTERED  ([ItemID])
              CREATE NONCLUSTERED INDEX [IX_{objectQualifier}YourCompany_SampleModule] _
		ON {databaseOwner}[{objectQualifier}YourCompany_SampleModule] _
		([ModuleID])

              ALTER TABLE {databaseOwner}[{objectQualifier}YourCompany_SampleModule] _
		WITH NOCHECK ADD CONSTRAINT [FK_{objectQualifier}_
		YourCompany_SampleModule_{objectQualifier}Modules] _
		FOREIGN KEY ([ModuleID]) REFERENCES {databaseOwner}_
		[{objectQualifier}Modules] ([ModuleID]) _
		ON DELETE CASCADE NOT FOR REPLICATION
       END
GO


/** Drop Existing Stored Procedures **/

if exists (select * from dbo.sysobjects where id = _
	object_id(N'{databaseOwner}[{objectQualifier}YourCompany_GetSampleModules]') _
	and OBJECTPROPERTY(id, N'IsProcedure') = 1)
       drop procedure {databaseOwner}{objectQualifier}YourCompany_GetSampleModules
GO

/** Create Stored Procedures **/

create procedure {databaseOwner}{objectQualifier}YourCompany_GetSampleModules

       @ModuleId int

as

select ModuleId,
       ItemId,
       Content,
       CreatedByUser,
       CreatedDate
from {objectQualifier}YourCompany_SampleModule with (nolock)
left outer join {objectQualifier}Users on {objectQualifier}_
	YourCompany_SampleModule.CreatedByUser = {objectQualifier}Users.UserId
where  ModuleId = @ModuleId

GO

Observe the bold statements. They are meant for creating tables and stored procedures in the backend.

RunAsScript.JPG

It creates tables and stored procedures in the backend.

Note:     To manually execute this script, you must   *****/

/*****   performs a search and replace operation     *****/

/*****   for {databaseOwner} and {objectQualifier}  *****/

databaseOwner is generally dbo.

objectQualifier is Dnn4 which was created during installation of dnn4source.

Object Qualifier.JPG

It follows this naming convention:

CREATE TABLE {databaseOwner}[{objectQualifier}YourCompany_SampleModule]

It creates Dnn4_YourCompany_SampleModule table in db.

5 Stored procedures like this pattern:

create procedure {databaseOwner}{objectQualifier}YourCompany_
				{operation_name}{Module_Name}

Here:

operation_name is Add, Delete, Get, Update (it creates for all CRUD operations).

Module_Name is SampleModule.

In this case:

  • Dnn4_YourCompany_AddSampleModule
  • Dnn4_YourCompany_DeleteSampleModule
  • Dnn4_YourCompany_GetSampleModule
  • Dnn4_YourCompany_GetSampleModules
  • Dnn4_YourCompany_UpdateSampleModule

Now click on Host -> Module Definitions.

Down:

Click on “Import  Module Definitions” link.

Import Module Definition.JPG

In the “Import Module Definition” screen, select “SampleModule.dnn” in Manifest drop down.

Import Manifest.JPG

Then click on “Import Manifest” link.

Then it should appear in “Module” drop down in Control Panel.

Select “Add New Module” radio button and select the “SampleModule” from Module drop down and select a pane and click on Add to a page.

If any error comes like this,

error.JPG

then check the database to see whether the tables and stored procedures are created or not.

If there are no errors, then click on “Add Content” link in the newly added module.

After adding the content in the module, the final output appears as below:

Final Output.JPG

This completes the custom module development.

Check the table (Dnn4_YourCompany_SampleModule) structure in the database:

Table.JPG

It has one column for adding the content.

Now append some more columns in the db and execute the generated script “01.00.00.SqlDataProvider” in SqlServer or DotNetNuke (Host->SQL) site.

Make the corresponding changes in business logic, domain logic and presentation layers files which are:

DataProvider.vb and SqlDataProvider.vb files are for database logic layer.

SampleModuleController.vb and SampleModuleInfo.vb files are for business logic layer.

Under ‘DeskTopModules’ folder, it has created “ModuleName’ folder which contains App_LocalResources, Documentation, EditSampleModule.ascx, Settings.ascx and ViewSampleModule.ascx files. It means presentation layer files.

References

  1. DotNetNuke mirrors
  2. Upgrade DotNetNuke 3x to 4x
  3. Videos
  4. Module programming
  5. For sending new post to DotNetNuke Forums
  6. DotNetNuke module development for beginners
  7. Workflow
  8. Other References

Links to Other CMS Installations

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
India India
I am Sreedhar Ambati working as a developer. I am having 6+ yrs of experience in Microsoft technologies like ASP,VB,ASP.Net, Vb.Net, C#.Net, Microsoft Dynamics CRM and Sharepoint Server 2007.
I used to blog at: http://ambatisreedharworks.wordpress.com and http://ambatisreedhar.spaces.live.com

Comments and Discussions

 
-- There are no messages in this forum --