TOP LINUX LINKS YOU MUST CLICK ON


Rapid Module Development for DotNetNuke
Instant DotNetNuke modules

Now we can run NAnt to build the module and package it for installation into your portal. There is one quirk that must be dealt with prior to building in NAnt. First, open up the DNN manifest file, which was created in the module folder using notepad.

Find the line:

<businesscontrollerclass>CompanyName.ProjectName.ProjectName.BusinessController,
CompanyName.ProjectName</businesscontrollerclass>

and change it to read:

<businesscontrollerclass>CompanyName.ProjectName.ProjectNameBusinessController,
CompanyName.ProjectName</businesscontrollerclass>

(and remove the extra period before BusinessController). Now you can go to the command prompt in Windows and type "Nant -buildfile:" and then open up a new window, browse to the folder that you just generated, and drag the file named CompanyName.ProjectName.build into the command prompt window. Just click enter and NAnt should produce a complete, compiled, and packaged module for you with the source and install packages placed into the same folder as your module code.

Designing the View and Edit Controls
DotNetNuke modules consist of a View screen that represents the public or outward-facing UI element of your module. All privately accessible edit screens or administrative screens are accessible by a variety of ways. The first and most common is through the admin menu within the module container, which appears once you are logged into a role within your portal that has edit access for this module. This is called the module actions menu. When you generate the module using the ATGen SDK, these screens are determined by the tables that you've selected during the CRUD creation phase. The Create, retrieve, update, and delete functionality is visibly displayed through the use of a generic yet quite powerful series of screens for each table in the schema.

The Add screen is shown in the module actions menu as well as at the bottom of the container. Some containers may not expose this control; therefore if this functionality is desired, then ensure that your selected container for the module admin container includes the links token.

The list screens show a datagrid of the entries for that particular table, with the ability to edit, delete, or add to the table. A few really handy features of this screen are that you can select numerous items and delete them, and this list includes full integration of the DotNetNuke pager control for simplified paging and sorting of the results.

The links on the listed items in each table can be selected and can display a detailed edit screen, thereby allowing you to alter the selected item. The edit and add screens are actually composed from the same user control, so the bulk of your development work for the administration screens lies within this area.

Although this module can be installed and placed onto a page out of the box, there are several areas that need further customization. The admin screens are created using only textboxes for the corresponding data entry areas for each table. You will need to define some of these as drop-down lists if they represent a foreign key or a series of values, or as a checkbox for Boolean fields. This part will generally consume a fair amount of the development time required to create your module.

You will notice that the default View screen that is visible when you first place the module on a page is blank. You will need to specify what to show to viewers of this module. Because the entire administration, data, and business layers are already created, you can leverage these elements to substantially create the View screen that is presented. Other than customizing the admin screens, this is essentially the only major part of the module that will need to be created by a developer. In this screen there is no definitive example because the display essentially comprises the outward-facing elements of your module. This screen could be an advanced calendar as the central part of a detailed booking system, or a complete human resources system - this is really where you, as the developer, become empowered.

Deploying the Module
If you have NAnt installed and you've created your module using the ATGen SDK, you can easily build a deployment package for your module by using the build scripts provided. If not, the other method is a bit more laborious, but it is important to understand. The folder structure of DotNetNuke is designed to place all installed modules in their own folder under the DesktopModules folder in your Web site root. Your deployment package requires a DNN manifest file to be included so that the module installer can determine what to do with the package. The DNN manifest file defines the folder name for the module, the files, the control definitions for view, settings and edit controls, as well as the interfaces that this module implements. If you are making changes to the DNN file, it is imperative to preserve the integrity of the XML Schema. You can find an explanation of this schema in the DNN source or install packages.

As you can see from the aforementioned steps, the creation and deployment of the fabric of your new custom module can be dramatically improved by utilizing ATGen SDK, thus leaving your precious development time better spent doing more productive things like playing games on your Xbox.

Happy coding.

Resources

About Mark Hoskins
Mark Hoskins is the founder of KodHedZ Software Development, Inc. (www.KodHedZ.net) based out of Victoria, BC, Canada, where he has been developing ASP.NET Business Management, eCommerce, and Dynamic Internet Applications for over four years, primarily using DotNetNuke as the development platform since its conception in December 2002. In addition to desktop, mobile and Web applications, Mark Hoskins has authored many articles and tutorials for developers on implementing and developing solutions using DotNetNuke and provides a wealth of resources at his flagship domain, www.KodHedZ.net.

  Subscribe to our RSS feeds now and receive the next article instantly!
In It? Reprint It! Contact advertising(at)sys-con.com to order your reprints!
ADS BY GOOGLE
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS