Professional DotNetNuke® Module Programming

Published by

Wiley Publishing, Inc.

10475 Crosspoint Boulevard

Indianapolis, IN 46256

www.wiley.com

Copyright © 2009 by Wiley Publishing, Inc., Indianapolis, Indiana

Published simultaneously in Canada

ISBN: 978-0-470-17116-5

Library of Congress Cataloging-in-Publication Data is available from the publisher.

No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201) 748-6008, or online at http://www.wiley.com/go/permissions.

Limit of Liability/Disclaimer of Warranty: The publisher and the author make no representations or warranties with respect to the accuracy or completeness of the contents of this work and specifically disclaim all warranties, including without limitation warranties of fitness for a particular purpose. No warranty may be created or extended by sales or promotional materials. The advice and strategies contained herein may not be suitable for every situation. This work is sold with the understanding that the publisher is not engaged in rendering legal, accounting, or other professional services. If professional assistance is required, the services of a competent professional person should be sought. Neither the publisher nor the author shall be liable for damages arising herefrom. The fact that an organization or Web site is referred to in this work as a citation and/or a potential source of further information does not mean that the author or the publisher endorses the information the organization or Web site may provide or recommendations it may make. Further, readers should be aware that Internet Web sites listed in this work may have changed or disappeared between when this work was written and when it is read.

For general information on our other products and services please contact our Customer Care Department within the United States at (877) 762-2974, outside the United States at (317) 572-3993, or fax (317) 572-4002.

Trademarks: Wiley, the Wiley logo, Wrox, the Wrox logo, Wrox Programmer to Programmer, and related trade dress are trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its affiliates, in the United States and other countries, and may not be used without written permission. DotNetNuke, DNN, and the DotNetNuke logo are trademarks or registered trademarks of DotNetNuke Corporation. All other trademarks are the property of their respective owners. Wiley Publishing, Inc., is not associated with any product or vendor mentioned in this book.

Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not be available in electronic books.

I dedicate this book to my dad, who has had a profound impact on who I am today, and who introduced me to computers and software development at a young age. Without his support over the years, this book would not be possible.

About the Author

Mitchel Sellers is CEO/Director of Development for IowaComputerGurus, Inc., a .NET and DotNetNuke consulting firm based in Des Moines, Iowa. IowaComputerGurus has a special collection of partnerships that enables the company to offer full-solution services to handle all IT needs — from planning and development to implementation and long-term support. Sellers is a Microsoft-certified Professional with nine individual areas of specialization, including Microsoft Certified IT Professional (MCITP), Microsoft Certified Professional Developer (MCPD), and Microsoft Certified Technology Specialist (MCTS), with all certifications on .NET 2.0 and later, as well as SQL Server 2005 and later. He has also presented at various public events, including OpenForce ‘07. Sellers maintains a blog at www.mitchelsellers.com/blogs.aspx that provides helpful information about DotNetNuke development.

Credits

Acquisitions Editor

Scott Meyers

Development Editor

Kevin Shafer

Technical Editor

Jon Henning

Production Editor

Kathleen Wisor

Copy Editor

Luann Rouff

Editorial Manager

Mary Beth Wakefield

Production Manager

Tim Tate

Vice President and Executive Group Publisher

Richard Swadley

Vice President and Executive Publisher

Barry Pruett

Associate Publisher

Jim Minatel

Project Coordinator, Cover

Lynsey Stanford

Proofreader

Nancy Bell

Indexer

Robert Swanson

Acknowledgments

To start out, I would like to thank the individuals at John Wiley & Sons for the opportunity to write this book. It has been an enjoyable learning experience, and has really opened my eyes as to what goes into a book. It is hoped that this also opens a door for future writing projects.

I would like to thank Jim Minatel, Scott Meyers, Kevin Shafer, Kathleen Wisor, and the rest of the editorial staff that was involved in the writing of this book. Because this is my first book, I greatly appreciate how very cordial they have been in communications, and they were more than understanding when I didn’t know how the process worked — not to mention that their editing has transformed this book into a great overall package. It wouldn’t have been possible without them.

Jon Henning, the technical editor, deserves special acknowledgment because he took great care when reviewing the book to ensure that all the topics discussed were covered in detail, and properly worded his comments and queries to avoid any potential communication issues. His invaluable feedback helped to create the final result.

Charles Nurse and the rest of the DotNetNuke core team also deserve acknowledgment here because they have also provided useful feedback and validation about many of the items included in the book. This has been especially important because this book was written while DotNetNuke 5 was still under major development.

I would also like to take a moment to thank the DotNetNuke community for their support over the past few years — reading my blog, posting suggestions for content in this book, and encouraging me to complete it.

Lastly, I would like to thank my family, friends, and clients, all of whom have been supportive of me during the time I spent writing this book. With a busy schedule already, and this book taking a big chunk out of my remaining available time, everyone has been incredibly supportive — and that means a lot to me.

Foreword

A book on professional module development would not make much sense without a fundamental understanding and appreciation of why a modern software developer should use a modular approach to building web software rather relying on the historical practice of constructing a monolithic web application from scratch.

The fact is that the majority of web applications in existence today share a common set of business requirements and technical characteristics. This is true regardless of industry, environment, or audience. These common underpinnings represent the foundation for all production web applications. Therefore, rather than implement a brand new foundation for each new web application, it makes practical sense to re-use some of the mature functionality created for previous applications. Abstracting these components into comprehensive library, results in a robust application framework which can be used as the basis for new web applications. Over time a framework will evolve to support new technology innovations and business requirements, and benefits from broader developer usage and mission critical run-time experience.

Since it is not possible for a piece of software to solve every customer problem, a web application framework needs to be flexible so that it can be easily extended to accommodate additional functionality. Essentially a web application framework must be a platform; an operating environment where third party applications, plug-ins, add-ons, and designs can be seamlessly integrated. Most popular web application frameworks support a concept known as Modules, which are essentially mini-applications that leverage capabilities of the framework to expose custom business functionality. At run-time, modules are instantiated within the context of the web application framework and offer advanced security, consistent behavior, and a seamless user experience.

It could be said that a web application framework is essentially a collection of modules, and, for the most part, this is true. Modules are designed for a specific business purpose and are usually comprised of a user interface, business logic, and data access methodology. In technical terms this approach closely resembles the Model-View-Controller (MVC) pattern which has become synonymous with web application architecture. Simple modules may only require a very minimal implementation; whereas more advanced modules may in fact be larger and more sophisticated than the web application framework itself. Regardless of the functionality provided by modules, it is also essential that there is a packaging and distribution capability within the framework which allows for simple installation and configuration of modules at run-time.

DotNetNuke® is a web application framework designed specifically for the Microsoft technology platform. It is mature, enterprise-grade, full-featured, and freely available as an open source distribution licensed under a liberal MIT license. The framework contains a robust API and full source code, providing developers with the greatest productivity benefit and maximum flexibility. The framework is coupled with a content management system (CMS) which allows end-users to easily install and configure modules and host them in a fully functional web environment.

Over the past five years, a commercial ecosystem has emerged around the DotNetNuke platform. This ecosystem has allowed software developers from all over the world to create powerful modules and make them available for sale to users of the platform. A variety of organizations and individuals now derive all, or a substantial portion of, their revenue from this module ecosystem. In the years ahead we expect the market demand for high quality, functional modules to increase exponentially as the platform continues to gain greater business adoption.

In this book, Mitchel has done an exceptional job of explaining the various aspects of module development from a practical business perspective. His in-depth experience and knowledge of the DotNetNuke web application framework provides the reader with a powerful combination of software development principles as well as in depth guidance on how to use the DotNetNuke software platform productively and effectively. This makes Professional DotNetNuke Module Programming a must-have book for all developers of the DNN® platform, regardless of their background or past development experience.

Shaun Walker

Project Creator & Chief Architect

DotNetNuke Corporation

Introduction

This book was written to provide insight into the development techniques needed (and the options available) to work within the DotNetNuke framework. I have placed an emphasis 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.

As an active developer in the DotNetNuke community for a number of years, I have found that although existing books cover DotNetNuke concepts, no book focuses primarily on developing DotNetNuke. Most books on the market today cover development topics with a few relatively small chapters toward the tail end of the book, after spending a majority of the time on general conceptual information about how to administer the framework. This approach precludes a focus on development.

In addition to this, 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.

I wrote this book to help 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 would not be what it is today without the great support and feedback that I have received from the DotNetNuke community and especially the regular readers of my blog. This community has spoken and provided their perspective as to what this book should include. I tried to listen as closely as possible because ultimately this book was written for you, the module developer.

Who This Book Is For

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.

This book does not discuss design principals in detail. If you are a designer, I strongly recommend looking at other titles available from Wrox Press that are geared toward the creation of skins and overall designs.

What This Book Covers

As the title implies, this book primarily covers development techniques within the DotNetNuke 5.x platform. However, because DotNetNuke 5.x does not yet have a firm release date (as of this writing), 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.

How This Book Is Structured

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.

What You Need to Use This Book

In order to work through the examples in this book, you need either Visual Studio 2005/2008 Standard Edition or higher, with Service Pack 1 (SP1) installed; or you need Visual Studio 2008 Visual Web Developer Express SP1. This is because of the needed support of the Web Application Project (WAP) template that is only available in the listed versions of Visual Studio. In addition, it is necessary to either have SQL Server installed locally or have access to a remote server that can be used to create and retain the DotNetNuke database.

To follow along with all examples in the exact manner listed, it is also necessary for Internet Information Services (IIS) to be installed on the machine for the configuration of the development installation of DotNetNuke. It is possible to use various versions of Windows, with the exception of Windows XP Home Edition.

All samples and screen captures in the book were taken from either Visual Studio 2005 Standard running on 32-bit Windows Vista, or Visual Studio 2008 Pro running on 64-bit Windows Vista.

Other dependencies include Visual Studio templates and a DotNetNuke installation, although the beginning chapters of the book will walk you through their installation. However, make sure you are using a system that can have additional software elements installed.

Conventions

To help you get the most from the text and keep track of what’s happening, a number of conventions have been used throughout the book.

Boxes like this one hold important, not-to-be forgotten information that is directly relevant to the surrounding text.

Tips, hints, tricks, and asides to the current discussion are offset and placed in italics like this.

As for styles in the text:

New terms and important words are highlighted in italics when introduced.

Keyboard strokes are shown like this: Ctrl+A.

Filenames, URLs, and code within the text are shown like this: persistence.properties.

Code is presented in the following two ways:

In code examples we highlight new and important code with a gray background.

The gray highlighting is not used for code that's less important in the present

     context, or has been shown before.

Source Code

As you work through the examples in this book, you may choose either to type in all the code manually, or use the source code files that accompany the book. All of the source code used in this book is available for download at www.wrox.com. Once at the site, simply locate the book’s title (either by using the Search box or by using one of the title lists), and click the Download Code link on the book’s detail page to obtain all the source code for the book.

Because many books have similar titles, you may find it easiest to search by ISBN; the ISBN for this book is 978-0-470-17116-5.

Once you download the code, just decompress it with your favorite compression tool. Alternately, you can go to the main Wrox code download page at www.wrox.com/dynamic/books/download.aspx to see the code available for this book and all other Wrox books.

When extracting the code samples, it is important to place all extracted files into the /DesktopModules/ folder of your DotNetNuke installation to ensure that all projects open successfully. Source code download projects have all been created using Visual Studio 2008.

Errata

We make every effort to ensure that there are no errors in the text or in the code. However, no one is perfect, and mistakes do occur. If you find an error in one of our books (such as a spelling mistake or a faulty piece of code), we would be very grateful for your feedback. By sending in errata, you may save another reader hours of frustration, and at the same time you will be helping us provide even higher quality information.

To find the errata page for this book, go to www.wrox.com and locate the title using the Search box or one of the title lists. Then, on the book details page, click the Book Errata link. On this page, you can view all errata that has been submitted for this book and posted by Wrox editors. A complete book list, including links to each book’s errata, is also available at www.wrox.com/misc-pages/booklist.shtml.

If you don’t spot “your” error on the Book Errata page, go to www.wrox.com/contact/techsupport.shtml and complete the form there to send us the error you have found. We’ll check the information and, if appropriate, post a message to the book’s errata page and fix the problem in subsequent editions of the book.

p2p.wrox.com

For author and peer discussion, join the P2P forums at p2p.wrox.com. The forums are a Web-based system for you to post messages relating to Wrox books and related technologies and to interact with other readers and technology users. The forums offer a subscription feature to e-mail you topics of interest of your choosing when new posts are made to the forums. Wrox authors, editors, other industry experts, and your fellow readers are present on these forums.

At http://p2p.wrox.com, you will find a number of different forums that will help you not only as you read this book, but also as you develop your own applications. To join the forums, just follow these steps:

1. Go to p2p.wrox.com and click the Register link.

2. Read the terms of use and click Agree.

3. Complete the required information to join, as well as any optional information you wish to provide, and click Submit.

4. You will receive an e-mail with information describing how to verify your account and complete the joining process.

You can read messages in the forums without joining P2P, but in order to post your own messages, you must join.

Once you join, you can post new messages and respond to messages other users post. You can read messages at any time on the Web. If you would like to have new messages from a particular forum e-mailed to you, click the “Subscribe to this Forum” icon by the forum name in the forum listing.

For more information about how to use the Wrox P2P, be sure to read the P2P FAQs for answers to questions about how the forum software works, as well as many common questions specific to P2P and Wrox books. To read the FAQs, click the FAQ link on any P2P page.

Chapter 1

Introduction to DotNetNuke and Resources

Anyone can visit DotNetNuke.com and download a copy of the DotNetNuke development framework, but it is a very daunting task to fully understand the different versions, packages, and resources available. This chapter provides an overview of DotNetNuke versions, packages, and resources — those available via DotNetNuke.com and other community sites.

This chapter begins with an examination of the three major DotNetNuke versions available, and details a bit of the history surrounding how DotNetNuke has evolved to the framework that it is today. Technology and other requirements are discussed for key releases in recent DotNetNuke history. The discussion then examines the various download packages available from DotNetNuke.com, and the process for obtaining legacy versions, should the need arise for a noncurrent version. The chapter concludes with a quick overview of community resources available for more information on DotNetNuke and module development with DotNetNuke.

Versions Explained

A first-time visitor to the DotNetNuke website can easily be confused by all the versions of DotNetNuke. As of this writing, the DotNetNuke.com website has published links for downloading versions 4.8.4, 4.70, 4.62, and 3.3.7. This alone can be very confusing to many, as identifying the proper starting point can be a bit unclear. The following sections examine the 3.x, 4.x, and 5.x versions of DotNetNuke, with key milestones identified and details on when and why the downloads are available.

The DotNetNuke Corporation provides all historical versions for download, but they can be a bit complicated to locate. All historical version downloads can be found via the “Legacy Releases” section of the Downloads page, which can direct you to the SourceForge listings for all DotNetNuke downloads.

3.x Versions

The 3.x DotNetNuke platform is a legacy platform that is designed to work with ASP.NET 1.1. The final release of the 3.x platform was version 3.3.7, released November 30, 2006. The new use of this platform is not recommended because many security and performance enhancements have been completed in subsequent releases.

Users currently on the DotNetNuke 3.x platform can follow standard upgrade processes to upgrade installations to the most current DotNetNuke releases. In many cases, this is recommended via a multi-step upgrade process. The exact process for upgrading is beyond the scope of this book, but Appendix A provides community resources with upgrade guides.

4.x Versions

The 4.x DotNetNuke platform was the first version to be built for the .NET 2.0 framework. Releases prior to 4.3.7 were done in parallel to the 3.x platform to allow the option of running .NET 1.1 or 2.0. Starting with version 4.4.0, the 4.x version was the only supported version. During the 4.x life cycle, DotNetNuke issued many releases with greatly improved core functionality.

Following are some highlighted versions:

Version 4.4.0: Released in December 2006, Version 4.4.0 provided major performance and scalability improvements. After upgrading, many users noticed dramatic performance improvements. With this being the first .NET 2.0–only release, many 3.x users were encouraged to upgrade to this version to attain the performance benefits.

Version 4.5.0: Released in April 2007, version 4.5.0 provided many usability and performance enhancements to the framework. The most notable enhancement with this release was the inclusion of ASP.NET Ajax integration into the core framework. This integration enables module developers to implement Ajax functionality with actions as simple as checking a box to have controls automatically wrapped in an update panel.

Version 4.6.0: Released in September 2007, version 4.6.0 was announced as a stabilization release. However, it included a few somewhat hidden enhancements that enabled developers to produce more efficient modules. Most notable was the inclusion of the IHydratable interface for object hydration. (IHydratable is discussed in detail in Chapter 10.) Another key enhancement with this release was the default inclusion of the FCK editor that replaced the older FreeTextBox editor for all rich text editing inside a DotNetNuke portal.

Version 4.6.2: Released September 2007, version 4.6.2 is worth noting because it contains a mostly unknown feature, XMLMerge, which enables individuals to upgrade to any future version of DotNetNuke without manually merging web.config files. This is a major administrative benefit because the risk for failed upgrades is dramatically reduced when manual web.config changes are no longer required.

Version 4.8.0: Released December 2007, version 4.8.0 provided support for Visual Studio 2008 and Internet Information Server (IIS) 7.0 compatibility for the entire framework. The versions released between 4.5.0 and 4.8.0 were stabilization releases that helped to solidify the DotNetNuke core, and created the solid base needed to create DotNetNuke 5.0.

Security Releases: As of this writing, a number of security point releases (for example, 4.8.3 and 4.8.4) where completed to resolve security issues identified in prior versions of the framework. Because of the security issues resolved in these versions, DotNetNuke Corporation strongly recommended that users upgrade to the most current point version to resolve any potential security concerns. For detailed information regarding security notices and other security concerns, visit the DotNetNuke Security Policy page at www.dotnetnuke.com/News/SecurityPolicy/tabid/940/Default.aspx.

Version 4.9.0: Released September 2008, version 4.9.0 provided a few additional security fixes, as well as a few back-ported features from the upcoming 5.0 release. Special items to note in this release include a new default skin and an updated version of the FCK editor control providing support for the Safari browser.

5.x Versions

The DotNetNuke 5.x platform includes many major enhancements to the core DotNetNuke system. This includes a unified package system for modules, skin objects, skins, and more, as well as separation of core administration modules to provide users with greater flexibility in site management than was possible in prior versions.

As of this writing, the exact date of the first 5.x release is unknown, but it is likely to be available by the time you read this. All topics covered in this book relate to the 5.x version. Differences between the 5.x version and previous versions are pointed out where appropriate.

Packages Explained

Each version of DotNetNuke contains four different packages that may be downloaded for use. Knowing the differences between the packages and which one to use is key to successfully working with and developing for DotNetNuke. The following sections explain the differences between the packages, as well as the factors governing when each should be used.

Starter Kit

The Starter Kit is a Visual Studio Installer Package (.vsi) used to add DotNetNuke-specific templates to your Visual Studio installation. You can find more detailed information on Visual Studio Installer packages at the Microsoft Developers Network (MSDN) at http://msdn.microsoft.com/en-us/library/ms185314(VS.80).aspx.

The following template types are included with the Starter Kit:

The following descriptions discuss multiple project types and are provided for reference only. Chapter 2 provides a deeper look at the differences between project types.

DotNetNuke Web Application Framework: This template is the entire DotNetNuke solution that can be used to set up a website for development. This template should not be used because development can more easily be completed via manual installations using the Install package.

DotNetNuke Compiled Module (VB): This template will create a Web Application Project (WAP)-compiled Visual Basic (VB) module. This template creates all standard DotNetNuke module elements, including the data access layer (DAL) and multiple view controls. This is the template that is used in this book for all VB examples. It creates a module that will be compiled into a single .dll for distribution via standard build processes.

DotNetNuke Dynamic Module (VB): This template will create a Web Site Project (WSP) VB module that utilizes the app_code folder for all classes. This template creates a complete module with similar contents to the Compiled Module template, including full DAL classes. This template is recommended for users with Visual Studio Express, which prior to Visual Studio 2008 Service Pack 1 cannot support the WAP development model. Chapter 2 provides full information on Visual Studio versions and project types.

This template is implemented as an item template, and may only be added to a DotNetNuke Web Application Framework solution created via the template discussed previously.

DotNetNuke Dynamic Module (C#): This template will create a Web Site Project (WSP) C# module that utilizes the app_code folder for all classes. The created project will be exactly like that of the Dynamic VB Module, but translated to the C# language. This project template is recommended for developers who prefer C# and are using Visual Studio Express.

This template is implemented as an item template and may only be added to a DotNetNuke Web Application Framework solution created via the template discussed previously.

DotNetNuke Simple Dynamic Module (VB): This template will create a dynamic VB.NET module, but the module created will only have a single view control and the .dnn manifest. This is designed for individuals looking for a custom implementation, or those looking for a clean project to start with.

This template is implemented as an item template and may only be added to a DotNetNuke Web Application Framework solution created via the template discussed previously.

DotNetNuke Skin: The final template included in the Starter Kit creates all files needed to create a single skin and container for a DotNetNuke website. Chapter 3 discusses skins and containers in more detail.

This template is implemented as an item template and may only be added to a DotNetNuke Web Application Framework solution created via the template discussed previously.

Source Package

The source package of DotNetNuke contains all source code for the DotNetNuke framework in a fashion that can be modified right out of the box. The downloaded ZIP file contains two folders: Web site and library . The Web site portion is the same as that provided with the Install version. The library section provides all additional source code used to create the compiled DotNetNuke.*.dll files that are included in installation and upgrade versions.

Recommended Uses

The use of this package of DotNetNuke is recommended only for individuals who are interested in customizing the DotNetNuke core. Note here that modifications to the DotNetNuke core will remove an installation from the upgrade path, and all changes must be managed on a case-by-case basis during upgrade.

In my experience, I have found that it is much easier to find other ways around a core modification that enable my sites to stay on the standard upgrade path.

Benefits

Regardless of customizations to the core framework, this version will provide you with all source code for the DotNetNuke framework. Many organizations view this as a great benefit, as you have all source code available for review and/or modification, should business needs arise that require the code to be available.

Install Package

The Install package of DotNetNuke is exactly that: the minimal collection of files needed to run the DotNetNuke framework, including all core DotNetNuke modules (not all are installed by default), and compiled library assemblies. This package is used in Chapter 2 to create the development environment used throughout the remainder of the book.

Recommended Uses

This package of DotNetNuke is recommended for all production installations and all development environments that will not require modifications to the core DotNetNuke framework. Some individuals additionally use this version for upgrade purposes to ensure that core modules are upgraded at the same time as the core.

Benefits

Using this package has a number of benefits, but one of the best is that it is simply a less cluttered download. Because you only get the core files needed to install and use DotNetNuke, you are not bothered by other files that you will not modify.

Upgrade Package

The final DotNetNuke package available is the Upgrade package. This package is optimized to include only the files needed to upgrade to the specific version. This package does not contain a few key files that would cause problems with upgrades. The most notable difference is that this package does not contain a web.config file, although you do have a release.config file for reference, if needed, which is essentially a copy of the web.config file. It is named differently to avoid the accidental overwriting of an existing configuration.

Recommended Uses

The only recommended use for this package is to perform an upgrade to an existing DotNetNuke site. Note that depending on your existing DotNetNuke version, the upgrade process might not be as simple as overwriting files with the Upgrade package. See the available DotNetNuke documentation and community resources for complete information regarding DotNetNuke upgrades.

Benefits

The major benefit of this package is that it is a simple package that can be used to quickly update the core DotNetNuke framework, and associated items that need to be upgraded — namely, the Text/HTML module because it is part of the core. You will not be bothered with the extra overhead of updated core modules and install-only files. Along these same lines, this package will prevent many common errors that often occur when individuals upgrade using the Install package.

Resources

A project as large of DotNetNuke has many resources available — those provided by DotNetNuke Corporation and those provided by community members. Abundant though this information is for many people starting to develop in DotNetNuke, you may find yourself in a vexing cat-and-mouse game looking for the information specific to your needs. The following sections introduce many DotNetNuke and community resources that contain valuable tutorials and/or documentation.

DotNetNuke.com

The DotNetNuke.com website, shown in Figure 1-1, is the most commonly overlooked community resource. There is so much information on this site that many people give up before finding exactly what they need. The material presented here can help you zero in on the information you are looking for, and perhaps other items of interest.

Figure 1-1

From the home page, you can see that the navigational structure is clearly laid out for quickly getting to key items.

Downloads

Obviously, the Downloads link shown at the top of Figure 1-1 is one of the most active pages of the DotNetNuke website. Using this link, you can access downloads for all current and past versions of the DotNetNuke core and core modules. You must be registered and logged into the DotNetNuke.com website in order to view the downloads. Once you are logged in, you will notice that the downloads are divided into multiple sections:

Core Framework: You can use the Core Framework download section to locate the different versions and packages referenced earlier in this chapter. Notes regarding the specifics of each version and package are also provided to ensure that the most appropriate package is downloaded.

Supplementary Downloads: These components are downloads that are part of the core, but not part of the DotNetNuke Projects program. Items downloaded here are developed for use in the core framework, but do not have any other place for download.

DotNetNuke Projects (New Releases): Downloads in this section include the most current releases of various core DotNetNuke module projects. The key thing to note about this section is that not all module downloads are found here; only the most current releases (for modules that have had recent releases) are found here. For modules not listed here, the module’s project page is the place to go for downloads.

Legacy Releases: The Legacy Releases section contains a single link to the SourceForge.net repository for all DotNetNuke downloads. Clicking this link brings up the window shown in Figure 1-2. Following links from this page, you can drill down to find any legacy release of any DotNetNuke project. This function is a very commonly overlooked aspect of the DotNetNuke downloads section.

Figure 1-2

Forums

The DotNetNuke forums are a great technical resource. Many community members and core team members monitor the forums on a very regular basis to answer various questions and share information about numerous aspects of DotNetNuke. Typically, if you are encountering an issue when you are starting out with module development or any other task within the DotNetNuke framework, you can get a response within a day. The amount of information shared via this communication channel is quite amazing, and many new users can benefit greatly simply by reviewing past threads to learn the various tips and tricks shared.

Blogs

Blogs on DotNetNuke.com are written by core team members and project team leads. Typically, this communication channel is where you can get an idea of when the next module release is going to be, or what new features are going to be included in the next core release. Many helpful tutorials are posted, such as those from Michael Washington, Charles Nurse, and many others, which help expose the development community to sometimes little-known benefits of the DotNetNuke core.

Documentation

Documentation is available via the DotNetNuke.com website. However, as of this writing, the information contained in this section is a bit out of date, especially from a development standpoint. Nonetheless, much of it can be very helpful for those looking to understand how the core framework is put together. A few key documents include “Module Localization Guide,” “Security: Hardening Installations,” and “Security: Module Development.” These documents address three key DotNetNuke areas of concern, and provide a great deal of information in a compact and easy-to-read format.

Online Help

Another great resource, available at www.dotnetnuke.com/Resources/Knowledge/DotNetNukeOnlineHelp/tabid/787/Default.aspx, is the online help documentation for the most current DotNetNuke version. This documentation is directed more toward site administrators and content management, but many advanced topics are covered to help answer questions regarding core DotNetNuke functionality. The DotNetNuke Corporation also offers a PDF version of this documentation for those looking for an offline solution.

Sponsorship Program

The DotNetNuke sponsorship program is one final resource that is worth mentioning. This sponsorship program enables individuals to attain community recognition for supporting the DotNetNuke project, as well as attain more direct access to DotNetNuke core team members for assistance via a private discussion forum. For individuals who want a more direct communication channel for questions and answers, while supporting the open-source initiative, this is the way to participate with mutual benefits.

Community Resources

There are many community resources that provide more focused DotNetNuke tutorials, videos, training, and other general help. Some resources are available free, while others have membership costs associated with them.

Following are a few resources that are key for an individual starting with development in DotNetNuke:

dnncreative.com: This website is a subscription service that provides video tutorials related to site configuration, administration, troubleshooting, and development. Many individuals find the information contained on this site to be an invaluable resource. Membership to DNN Creative grants a user access to more than 300 historical tutorials, reviews, and more, as well as access to all upcoming content for the next year.

dotnetnuke.adefwebserver.com: This website is maintained by Michael Washington, a long-standing DotNetNuke core team member. On this site you will find guided module development tutorials, each focusing on one key element. These quick-to-read tutorials are great for refreshers, or to quickly learn how to complete a specific task.

mitchelsellers.com: This is my website, where I maintain a mostly DotNetNuke-focused blog. Any updates to this book after publication will also be included here. You will find detailed installation, upgrade, migration, backup, and development tutorials mixed in with relevant blog postings.

Appendix A contains a more comprehensive listing of available community resources.

Summary

This chapter has introduced the different versions and packages of DotNetNuke, as well as a few community resources that might help greatly along the way. Understanding the differences between the DotNetNuke versions is key to understanding dependencies and capabilities, which is a key component when distributing custom modules.

Now that you have a firm base knowledge of the DotNetNuke package options, you are ready to progress to the installation and configuration of the development environment, as well as a discussion about the available project types, all of which is covered in detail in Chapter 2.

Chapter 2

Creating the Development Environment

Creating the proper development environment for DotNetNuke module development requires administration within Microsoft Windows, Microsoft SQL Server, Microsoft Visual Studio, and DotNetNuke itself. For many people, this is a very complex task, because most developers do not play the role of systems administrator, database administrator, and integration specialist. This chapter demystifies the installation process and provides the information needed to create a proper development environment, regardless of your level of experience.

The chapter starts with a brief discussion about the two different Web development project models supported by Visual Studio 2005 and 2008, including additional information references for in-depth comparisons. The discussion then examines any limitations imposed by different versions of Visual Studio and how they might affect module development. After discussing the different project models and Visual Studio limitations, this chapter provides an examination of a guided installation of DotNetNuke, including all external configuration elements. The chapter concludes with the installation of development templates for Visual Basic and C# DotNetNuke modules.

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!