Step 4: Prepare the Module to Be Installed
Now comes the moment you have been waiting fortesting to see if all this work pays off. Before you can test a module you first need to upload it to a DNN 2.0 site. The process of installing a private assembly, (ExamTracker is a private assembly) is fairly straightforward. But what is a private assembly? A private assembly can only be used by a single application as opposed to a global assembly which you can use across multiple applications.
The DNN 2.0 development team has made installing custom modules (private assemblies) very easy. First, zip up all the files that make up the module. Next, log in as Host and upload the zip file through the File Manager. That's all there is to it. I'll walk you through the steps.
|Figure 12. ExamTracker Module: Here's the complete ExamTracker module displayed in the DotNetNuke solution.|
- Right-click on the Installation folder in the YourCompanyNameHere.ExamTracker project, select Add, select Add New Item..., select XML file and name the file ExamTracker.dnn. The .dnn extension indicates that the file is the installation manifest file.
- Use Listing 10 as a reference for the ExamTracker.dnn file. The file contains all the information required by DNN when the module is installed. Typical information contained in the file are the name of the module, a friendly name to make it easier for the user to understand which module they are using, the names of the user interface files (.ascx), and a list of all the files being uploaded with the module. The Type setting for an .ascx determines whether or not the control is used to display information or act as an editor. In this case Type for the viewExamTracker.ascx file is set to View while the Type for the editExamTracker is set to Edit.
file contains the T-SQL code to create all the necessary database objects required by the module. I scripted the ExamTracker table and the related stored procedures to create the 01.00.00.SqlDataProvider
file. The Uninstall.SqlDataProvider
is the SQL code to drop the stored procedures and the ExamTracker.
Table 1: Files to Add to ExamTracker.zip
- Create the 01.00.00.SqlDataProvider and Uninstall.SqlDataProvider files and store them in the Installation folder.
- Create an ExamTracker.zip file in the Installation folder and add the files listed in Table 1.
File to add
- You are now ready to install the module. See Figure 12 for a look at the completed project displayed in the Solution Explorer.
- Run the project to display the DotNetNuke portal (I assume you configured the portal when you installed DNN 2.0).
- Log in as Host.
- Select File Manager from the Host menu.
- Click on the pencil next to the File Manager title and select Upload New File(s).
- Select Custom Module and click Browse. Locate your ExamTracker.zip file and click Open.
- Click Add to select the file to be uploaded.
- Click Upload File(s) to complete the process. You should see a confirmation form telling you the install is complete.