Professional DotNetNuke® Module Programming

Book description

This book was written to provide insight into the development techniques needed (and the options available) to work within the DotNetNuke framework. Emphasis is placed on the available methods to extend the framework, as well as the situations and rules governing when each respective extension model should be used. Along with this emphasis on selecting the right extension method, the book stresses the importance of leveraging the framework in as many areas as possible, and ultimately using the framework to the advantage of the developer, rather than merely working with it.

One current weakness of the DotNetNuke framework is developer documentation. The framework provides developers with numerous amazing methods to extend the framework and build truly robust applications, but as of this writing, minimal API documentation exists, and overall development topics are scattered all over the Internet. Many community members have helped to supplement this lack of developer content by writing blog articles and technical tutorials to help teach the individual concepts, but because there is no central repository, it can be tedious and difficult to find just what you need.

This book helps truly identify and document some excellent new features that are supported starting with DotNetNuke 5.0. The inclusion of jQuery exposes developers to a great JavaScript library that will enable interactive and animated interfaces to be created easily. The new Module Packaging system (discussed in detail in Appendix D) provides module developers and skin designers with many much-needed options when it comes to deploying applications. This book was written to expose this information, and to function as a key resource for the development community.

This book assumes that the reader has a working knowledge of standard ASP.NET development techniques and terminologies. Samples in the book are provided in both C# and Visual Basic (VB) to enable readers with diverse backgrounds to fully understand the concepts presented. Users do not need to have a comprehensive understanding of DotNetNuke prior to using this book because the early chapters discuss the configuration of both DotNetNuke and the development environment, and careful consideration has been taken to ensure that DotNetNuke-specific terminology is explained as the book progresses.

Readers already familiar with DotNetNuke 4.x development will find this book valuable because it introduces many of the new features of the latest software version, although some of the beginning chapters for these readers will be redundant because the overall concepts of environment configuration and basic interface elements have not changed from 4.x to 5.x. Differences between versions 4.x and 5.x are pointed out as appropriate.

As the title implies, this book primarily covers development techniques within the DotNetNuke 5.x platform. The chapters point out similarities and differences between the 4.x and 5.x platforms, enabling readers to apply some newer concepts to the older technology. Although this book primarily focuses on the concept of module development, it discusses other extension models as well, such as skin objects and authentication providers. Also covered in this book are recommended practices for successful integration with the framework.

This book begins with an introduction to development within DotNetNuke. The discussions walk you through DotNetNuke setup, terminology, development environment setup, and options for .NET project setup.

The book then presents a scenario-based model to introduce basic concepts of module development. This is accomplished by building a simple guestbook module that demonstrates how individual portions interact with one another. The discussion lays the foundation for the most basic elements of development within DotNetNuke. Later in the book, you learn about the more advanced module programming concepts, such as optional interfaces and DotNetNuke user controls. This discussion additionally introduces other extension methods, such as authentication providers and skin objects, as well as best practices.

In short, the main content of the book creates a working model that guides you through the most common development scenarios; at the same time, it provides the detail needed to tightly integrate custom code with the framework.

The appendixes provide supplemental information to what is contained in the chapters. This is material that, while not critical to an understanding of the individual chapters, is nonetheless important. The appendixes include items such as community resources and general DotNetNuke configuration items, as well as a detailed look at the new module manifest and a few key integration API points that are not well documented overall.

Table of contents

  1. Copyright
  2. About the Author
  3. Credits
  4. Acknowledgments
  5. Foreword
  6. Introduction
    1. Who This Book Is For
    2. What This Book Covers
    3. How This Book Is Structured
    4. What You Need to Use This Book
    5. Conventions
    6. Source Code
    7. Errata
    8. p2p.wrox.com
  7. 1. Introduction to DotNetNuke and Resources
    1. 1.1. Versions Explained
      1. 1.1.1. 3.x Versions
      2. 1.1.2. 4.x Versions
      3. 1.1.3. 5.x Versions
    2. 1.2. Packages Explained
      1. 1.2.1. Starter Kit
      2. 1.2.2. Source Package
        1. 1.2.2.1. Recommended Uses
        2. 1.2.2.2. Benefits
      3. 1.2.3. Install Package
        1. 1.2.3.1. Recommended Uses
        2. 1.2.3.2. Benefits
      4. 1.2.4. Upgrade Package
        1. 1.2.4.1. Recommended Uses
        2. 1.2.4.2. Benefits
    3. 1.3. Resources
      1. 1.3.1. DotNetNuke.com
        1. 1.3.1.1. Downloads
        2. 1.3.1.2. Forums
        3. 1.3.1.3. Blogs
        4. 1.3.1.4. Documentation
        5. 1.3.1.5. Online Help
        6. 1.3.1.6. Sponsorship Program
      2. 1.3.2. Community Resources
    4. 1.4. Summary
  8. 2. Creating the Development Environment
    1. 2.1. Development Models
      1. 2.1.1. Web Site Projects (WSP)
      2. 2.1.2. Web Application Projects (WAP)
      3. 2.1.3. WSP Versus WAP Features
    2. 2.2. Selecting a Visual Studio Edition
      1. 2.2.1. Express Editions
      2. 2.2.2. Other Editions
    3. 2.3. Installing DotNetNuke
      1. 2.3.1. Configuring SQL Server
      2. 2.3.2. Configuring DotNetNuke Files
      3. 2.3.3. Configuring File Permissions
      4. 2.3.4. Configuring Internet Information Services (IIS)
        1. 2.3.4.1. IIS7 Configuration (Windows 2008 and Vista)
        2. 2.3.4.2. IIS5 and IIS6 Configuration (Windows 2000 and XP)
      5. 2.3.5. Executing DotNetNuke Installation
    4. 2.4. Installing Development Templates
      1. 2.4.1. Installing VB.NET Templates
      2. 2.4.2. Installing C#.NET Templates
    5. 2.5. Summary
  9. 3. Under the DotNetNuke Hood
    1. 3.1. Tabs
      1. 3.1.1. Key Data Elements
      2. 3.1.2. Integration Points
    2. 3.2. Modules
      1. 3.2.1. Key Data Elements
        1. 3.2.1.1. ModuleId
        2. 3.2.1.2. TabModuleId
      2. 3.2.2. Integration Points
    3. 3.3. Skins
      1. 3.3.1. Skin Objects
      2. 3.3.2. Containers
    4. 3.4. Users
      1. 3.4.1. Default User Types
      2. 3.4.2. DotNetNuke Roles/Permissions
      3. 3.4.3. Key Data Elements
    5. 3.5. Portals
      1. 3.5.1. Parent Portals
      2. 3.5.2. Child Portals
      3. 3.5.3. Key Data Elements
    6. 3.6. Localization
    7. 3.7. Scheduled Tasks
    8. 3.8. Settings
      1. 3.8.1. Host Settings
      2. 3.8.2. Portal Settings
      3. 3.8.3. Module Settings
    9. 3.9. Summary
  10. 4. Guestbook Module Requirements
    1. 4.1. Guestbook Module Requirements
      1. 4.1.1. Overview
      2. 4.1.2. Guestbook Settings Control
      3. 4.1.3. View Guestbook Control
      4. 4.1.4. Sign Guestbook Settings Control
      5. 4.1.5. Sign Guestbook Control
      6. 4.1.6. Database Structure
      7. 4.1.7. Requirements Summary
    2. 4.2. Data Isolation
      1. 4.2.1. Portal-Level Isolation
      2. 4.2.2. Module-Level Isolation
      3. 4.2.3. User-Data Isolation
    3. 4.3. Key Requirements-Gathering Information
    4. 4.4. Summary
  11. 5. Starting the Module Creation Process
    1. 5.1. Creating the Module Project
    2. 5.2. Creating the GuestbookCS Module
      1. 5.2.1. Creating the Project
      2. 5.2.2. Configuring the Project
    3. 5.3. Creating the GuestbookVB Module
      1. 5.3.1. Creating the Project
      2. 5.3.2. Configuring the Project
    4. 5.4. What Was Created?
    5. 5.5. Summary
  12. 6. Investigating DotNetNuke Components
    1. 6.1. DotNetNuke Data Access Layer (DAL)
      1. 6.1.1. DataProvider(.cs/.vb)
      2. 6.1.2. SqlDataProvider(.cs/.vb)
        1. 6.1.2.1. Private Data Members
        2. 6.1.2.2. Constructor
        3. 6.1.2.3. Public Properties
        4. 6.1.2.4. Private Methods
        5. 6.1.2.5. Public Override Methods
      3. 6.1.3. xx.xx.xx.SqlDataProvider Files
        1. 6.1.3.1. Replacements
        2. 6.1.3.2. Creating Tables
        3. 6.1.3.3. Creating Stored Procedures
    2. 6.2. DotNetNuke UI Base Classes
      1. 6.2.1. PortalModuleBase
      2. 6.2.2. ModuleSettingsBase
    3. 6.3. DotNetNuke Module Manifest (.dnn) File
      1. 6.3.1. Guestbook Manifests
      2. 6.3.2. Manifest Components
        1. 6.3.2.1. Manifest Beginning
        2. 6.3.2.2. Package Information
        3. 6.3.2.3. Components Node
    4. 6.4. Summary
  13. 7. Creating the Module Back End
    1. 7.1. Data Methods Needed
    2. 7.2. Creating the DataProvider(.cs/.vb) File
    3. 7.3. Creating the SqlDataProvider (.cs/.vb) File
    4. 7.4. Creating the Information Object Class
    5. 7.5. Creating the Controller Class
    6. 7.6. Creating the 01.00.00.SqlDataProvider Script
    7. 7.7. Creating the Uninstall.SqlDataProvider File
    8. 7.8. Summary
  14. 8. Creating the Localized Module Interface
    1. 8.1. DotNetNuke Localization
      1. 8.1.1. DotNetNuke Resource Files
      2. 8.1.2. Localized Controls and Classes
    2. 8.2. Creating Settings.ascx
      1. 8.2.1. User Control Markup
      2. 8.2.2. Code Behind
      3. 8.2.3. Localization File
    3. 8.3. Creating ViewSettings.ascx
      1. 8.3.1. User Control Markup
      2. 8.3.2. Code Behind
      3. 8.3.3. Localization File
    4. 8.4. Creating ViewGuestbook(CS/VB).ascx
      1. 8.4.1. User Control Markup
      2. 8.4.2. Code Behind
      3. 8.4.3. Localization File
    5. 8.5. Creating EditGuestbook(CS/VB).ascx
      1. 8.5.1. User Control Markup
      2. 8.5.2. Code Behind
      3. 8.5.3. Localization File
    6. 8.6. Creating SignGuestbook.ascx
      1. 8.6.1. User Control Markup
      2. 8.6.2. Code Behind
      3. 8.6.3. Localization File
    7. 8.7. Final Module Manifest Additions
      1. 8.7.1. Adding Module Definitions
      2. 8.7.2. Adding a File Listing
    8. 8.8. Modules and CSS
    9. 8.9. Summary
  15. 9. Packaging, Installing, and Debugging the Module
    1. 9.1. Module Installation
      1. 9.1.1. Import Module Manifest
      2. 9.1.2. Manually Execute SqlDataProvider files
    2. 9.2. Testing the Module
    3. 9.3. Packaging the Module
      1. 9.3.1. Manual File Creation
      2. 9.3.2. Batch File Creation
      3. 9.3.3. DotNetNuke-Generated Packages
      4. 9.3.4. Other Options
    4. 9.4. Debugging
    5. 9.5. Distribution and Testing Considerations
    6. 9.6. Summary
  16. 10. Implementing Optional DotNetNuke Interfaces
    1. 10.1. IPortable
      1. 10.1.1. Implementation
    2. 10.2. IHydratable
      1. 10.2.1. Implementation
    3. 10.3. ISearchable
      1. 10.3.1. Implementation
    4. 10.4. IUpgradable
      1. 10.4.1. Implementation
    5. 10.5. IActionable
      1. 10.5.1. Implementation
    6. 10.6. IPropertyAccess
      1. 10.6.1. Implementation
      2. 10.6.2. Usage
    7. 10.7. Summary
  17. 11. DotNetNuke Scheduled Tasks
    1. 11.1. Scheduling System Overview
    2. 11.2. Considerations with Scheduled Tasks
    3. 11.3. Sample Task Creation
    4. 11.4. Working with the Scheduler
    5. 11.5. Summary
  18. 12. DotNetNuke User Controls
    1. 12.1. Registering the Controls
    2. 12.2. CAPTCHA Control
    3. 12.3. TextEditor Control
    4. 12.4. SectionHead Control
    5. 12.5. Paging Control
    6. 12.6. Url and UrlTracking Controls
    7. 12.7. Other Controls
    8. 12.8. Summary
  19. 13. Module Navigation and Communication
    1. 13.1. Module Navigation
      1. 13.1.1. NavigateUrl
      2. 13.1.2. EditUrl
        1. 13.1.2.1. EditUrl()
        2. 13.1.2.2. EditUrl(string)
        3. 13.1.2.3. EditUrl(string, string, string)
        4. 13.1.2.4. EditUrl(string, string, string ParamArray string())
    2. 13.2. Module Isolation
      1. 13.2.1. Dynamically Loaded Controls
      2. 13.2.2. MultiView Control
      3. 13.2.3. Multiple User Controls
    3. 13.3. Inter-Module Communication
      1. 13.3.1. IModuleCommunicator
      2. 13.3.2. IModuleListener
      3. 13.3.3. Considerations
    4. 13.4. Summary
  20. 14. Third-Party Components and Controls
    1. 14.1. Compatibility
    2. 14.2. Deployment/Maintenance Issues
      1. 14.2.1. Incompatible Assembly Versions
      2. 14.2.2. Removed Assembly Files
    3. 14.3. Developer Responsibility
    4. 14.4. Summary
  21. 15. DotNetNuke, Modules, and Ajax Functionality
    1. 15.1. ASP.NET Ajax
      1. 15.1.1. Enabling by Control
      2. 15.1.2. Manually Enabling
      3. 15.1.3. Considerations When Using ASP.NET Ajax
    2. 15.2. ASP.NET Ajax Control Toolkit
      1. 15.2.1. Considerations with Ajax Control Toolkit
    3. 15.3. jQuery Support
      1. 15.3.1. jQuery Configuration
      2. 15.3.2. jQuery Usage
    4. 15.4. Summary
  22. 16. Creating Skin Objects
    1. 16.1. When to Use Skin Objects
    2. 16.2. Creating a "Current Time" Skin Object
      1. 16.2.1. Cleaning the Solution
      2. 16.2.2. Coding the Object
        1. 16.2.2.1. Adding Elements to ViewCurrentTimeSkinObject.ascx.resx
        2. 16.2.2.2. Coding ViewCurrentTimeSkinObject.ascx
        3. 16.2.2.3. Coding ViewCurrentTimeSkinObject.ascx (.cs/.vb)
      3. 16.2.3. Completion of the Code
    3. 16.3. Installing the Skin Object (Locally)
    4. 16.4. Creating the Installation Package
    5. 16.5. Adding a Skin Object to a Skin
    6. 16.6. Summary
  23. 17. Creating Authentication Providers
    1. 17.1. What Is an Authentication Provider?
    2. 17.2. Example of Authentication Provider Use
    3. 17.3. Items to Consider When Creating a Provider
      1. 17.3.1. Providing Only Authentication
      2. 17.3.2. Can Co-exist with Other Providers
    4. 17.4. Investigating Provider Code
      1. 17.4.1. Code Location and Project Setup
      2. 17.4.2. Interface Code
        1. 17.4.2.1. Login.ascx
        2. 17.4.2.2. Login.ascx.cs
        3. 17.4.2.3. Settings.ascx
        4. 17.4.2.4. Settings.ascx.cs
        5. 17.4.2.5. Logoff.ascx
        6. 17.4.2.6. Logoff.ascx.cs
        7. 17.4.2.7. Interface Summary
      3. 17.4.3. DotNetNuke Manifest
      4. 17.4.4. Installation Package
    5. 17.5. Installation Differences (Versions 4.6.x Versus 5.x)
    6. 17.6. Administration Differences (Versions 4.6.x Versus 5.x)
    7. 17.7. Summary
  24. 18. DotNetNuke Development Best Practices
    1. 18.1. Things to Do
      1. 18.1.1. Pick a Minimum Supported Version and Enforce It
      2. 18.1.2. Use the DotNetNuke API
      3. 18.1.3. Reuse Common Controls
      4. 18.1.4. Test, Test, and Test Again
      5. 18.1.5. Support Localization and Globalization
    2. 18.2. Things to Avoid
      1. 18.2.1. Modification of web.config
      2. 18.2.2. Modifying Core Components
      3. 18.2.3. Requiring Nonstandard Implementation
    3. 18.3. Summary
  25. A. Community Resources
    1. A.1. General Resources
      1. A.1.1. DNN Creative Magazine
      2. A.1.2. DotNetNukeBlogs.com
      3. A.1.3. Michael Washington's DotNetNuke Tutorials
      4. A.1.4. Mitchel Sellers' DotNetNuke Blog/Forums
      5. A.1.5. Seablick Consulting DotNetNuke Blog
      6. A.1.6. SearchDotNetNuke.com
      7. A.1.7. Snapsis DotNetNuke Tips and Tricks
    2. A.2. Skinning Resources
      1. A.2.1. DNN Creative Magazine
      2. A.2.2. SkinCovered
      3. A.2.3. Think of Design Skinning Tools and Reference
  26. B. Additional web.config Options
    1. B.1. appSettings
    2. B.2. httpRuntime
    3. B.3. Data Provider
    4. B.4. Further Information
  27. C. Distributing Modules
    1. C.1. DotNetNuke Module Review Program
      1. C.1.1. Review Criteria
        1. C.1.1.1. Required Criteria
        2. C.1.1.2. Elective Criteria
        3. C.1.1.3. Optional Criteria
      2. C.1.2. Benefits of Review
      3. C.1.3. Costs
    2. C.2. Distribution Channels
    3. C.3. Licensing Considerations
      1. C.3.1. Ensure the License Can Be Loaded by Admin
      2. C.3.2. Ensure the License Is Not Tied to Hardware
      3. C.3.3. Provide Flexible License Options
  28. D. Additional .DNN Manifest Options
    1. D.1. Manifest Opening
    2. D.2. package Node
    3. D.3. component Node
      1. D.3.1. assembly Component Type
      2. D.3.2. file Component Type
      3. D.3.3. Cleanup Component Type
      4. D.3.4. script Component Type
      5. D.3.5. authenticationSystem Component Type
      6. D.3.6. module Component Type
      7. D.3.7. SkinObject Component Type
      8. D.3.8. container Component Type
      9. D.3.9. Provider and Library Components
      10. D.3.10. skin Component Type
      11. D.3.11. config Component Type
      12. D.3.12. dashboardInstaller Component Type
    4. D.4. Summary
  29. E. Working with DotNetNuke Entities
    1. E.1. DotNetNuke.Entities.Modules
      1. E.1.1. Interfaces
      2. E.1.2. Classes
        1. E.1.2.1. ModuleController
        2. E.1.2.2. ModuleInfo
    2. E.2. DotNetNuke.Entities.Portals
      1. E.2.1. PortalSettings Class
      2. E.2.2. PortalController Class
    3. E.3. DotNetNuke.Entities.Tabs
      1. E.3.1. TabController Class
      2. E.3.2. TabInfo Class
    4. E.4. DotNetNuke.Entities.Users
      1. E.4.1. UserController Class
      2. E.4.2. Creating a User
    5. E.5. Summary

Product information

  • Title: Professional DotNetNuke® Module Programming
  • Author(s): Mitchel Sellers
  • Release date: February 2009
  • Publisher(s): Wrox
  • ISBN: 9780470171165