Building websites with dotnetnuke 5 - Pdf 13


Building Websites with
DotNetNuke 5
Quickly build and deploy your own feature-rich website
with DotNetNuke 5, VB.NET, C#, and Silverlight
Michael Washington
Ian Lackey

BIRMINGHAM - MUMBAI
Building Websites with DotNetNuke 5
Copyright © 2010 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval
system, or transmitted in any form or by any means, without the prior written
permission of the publisher, except in the case of brief quotations embedded in
critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy
of the information presented. However, the information contained in this book is
sold without warranty, either express or implied. Neither the authors, nor Packt
Publishing, and its dealers and distributors will be held liable for any damages
caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the
companies and products mentioned in this book by the appropriate use of capitals.
However, Packt Publishing cannot guarantee the accuracy of this information.
First published: April 2010
Production Reference: 1310310
Published by Packt Publishing Ltd.
32 Lincoln Road
Olton
Birmingham, B27 6PA, UK.
ISBN 978-1-847199-92-8
www.packtpub.com

About the Authors
Michael Washington is a website developer and an ASP.NET, C#, and Visual
Basic programmer. He is a Microsoft MVP in Silverlight. He has served as a
DotNetNuke Core member for many years. He is the author of the Custom Module
Development chapter in Building Websites with VB.NET and DotNetNuke 4
(Packt Publishing).
He has authored over 100 pages of tutorials on his sites at
http://ADefWebserver.
com
and http://OpenLightGroup.net, covering DotNetNuke and Silverlight.
He is one of the founding members of the Southern California DotNetNuke Users
group (
www.socaldug.org). He is also the author of The DotNetNuke 4 Module
Development Guide, as well as numerous popular DotNetNuke modules such as
http://ADefHelpdesk.com.
He has a son, Zachary, and resides in Los Angeles with his wife, Valerie.
I would like to dedicate this book to my Valerie and my son Zachary.
I do it all for you!
Ian Lackey worked as a systems engineer for a St. Louis-based ISP from
1999 to 2002. At that time, he began developing web applications using ASP
and migrated to ASP.NET shortly before the 2.0 release. Ian now works as a
full-time programmer analyst II for Washington University in St. Louis Medical
School - Department of Pediatrics. He also runs a small business, DigitalSnap Inc.
(http://www.digitalsnap.net) that provides complete DotNetNuke solutions as
well as individual modules (http://www.itlackey.net).
Currently Ian is involved in community-driven areas such as the OpenLight Group
(
http://www.openlightgroup.net), which manages open source projects including
several DotNetNuke modules and many Silverlight-based applications. He will also
be speaking at the St. Louis .NET user group (http://www.ineta.org) meetings

then to the three most important people in my life, my father, my
mother, and Rmi (my brother).
Andrew The ("The" is his last name, pronounced Tay) currently works as a
developer and system engineer for the Los Angeles County of Education in Los
Angeles, CA. Andrew started programming in Oracle's PL/SQL on Sun Solaris.
Since then, he has worked with various platforms, databases, and languages (AIX,
Perl, Korn Shell, DB2, HTML, SQL Server, and C#). He now primarily works with
the Microsoft stack (Windows, .NET, and SQL Server).

Table of Contents
Preface 1
Chapter 1: What is DotNetNuke? 7
Open source web portals 7
What is a web portal? 8
Common portal features 8
Why DotNetNuke? 10
PHP-Nuke 11
Joomla! 11
DotNetNuke 11
Benefits of using an established program 14
The DotNetNuke community 14
Core team 14
The DotNetNuke discussion forum 15
The bug tracker 15
The DotNetNuke project Roadmap team 16
The license agreement 16
Coffee Connections 16
Determining client needs 17
What is a user story? 17
Advantages of using user stories 18

Administering pages 81
Summary 82
Chapter 4: Standard DotNetNuke Modules 83
DotNetNuke modules 84
Adding a module 84
Module Settings 85
Editing a module 85
Importing and exporting
content 86
Syndicate information 86
Help and Online Help documentation 86
Editing module functionality 86
Changes to the organization of modules 90
Standard modules 91
Account Login module 91
Practical purposes 91
Administration and modification 91
Special features 92
Banner module 93
Console module 93
Administration and modification 93
Feed Explorer module 94
Administration and modification 94
HTML module 95
Practical purposes 95
Table of Contents
[ iii ]
Administration and modification 95
Special features and additional
information 95

Special features and additional
information 106
Feedback module 106
Practical purposes 106
Administration and modification 106
Special features and additional information 107
Form and List module 107
Practical purposes 107
Administration and modification 107
Special features and additional information 108
Forums module 108
Practical purposes 108
Administration and modification 109
Gallery module 109
Practical purposes 110
Administration and modification 110
Help module 111
Table of Contents
[ iv ]
Practical purposes 111
Administration and modification 111
IFrame module 112
Practical purposes 112
Administration and modification 112
Special features and additional information 113
Links module 113
Practical purposes 113
Administration and
modification 114
Special features and additional information 115

Practical purposes 125
Administration and modification 126
Special features and additional information 126
Third-party modules 126
Commercial modules 126
Developers and vendors 127
Table of Contents
[ v ]
Open source modules 128
Developers and vendors 129
Summary 130
Chapter 5: Host and Admin Tools 131
The difference between host and admin 131
Admin tools 132
Site Settings 133
Basic Settings 133
Advanced Settings 136
Stylesheet Editor 138
Pages 139
Extensions 139
Languages 140
Skins 140
Security Roles 140
User Accounts 140
Vendors 141
Site Log 141
Newsletters 142
File Manager 145
Recycle Bin 148
Event Viewer 148

Working with the configuration files 181
The web.config file 182
Configuring the providers used in DotNetNuke 182
Handling the providers 185
HTTP modules 190
Application settings 195
The global files 196
Global.asax.vb 196
Application_Start 196
Examining Application_BeginRequest 199
The Globals.vb file 200
Putting it all together 201
Summary 206
Chapter 7: Custom Module Development 207
The Coffee Shop Listing module 207
The development environment 209
Creating the view control 210
Displaying the module 214
View control summary 217
The module folder structure 217
Inheriting from PortalModuleBase 218
Module configuration 219
Diagnosing errors using the Log Viewer 219
Navigation 220
NavigateURL 220
IActionable 222
Updating the configuration 224
Navigating from ShopList to EditShopList 224
Navigation summary 225
NavigateURL 225

The ShopList code behind file 257
SetProfile/GetProfile 261
GetModuleSettings 263
The remaining methods for ShopList 264
Summary 264
Chapter 9: Silverlight Coffee Shop Viewer 265
Silverlight and DotNetNuke 265
Creating the web service 266
Getting coffee shops 267
Getting last used zip code 270
Creating the WebService.asmx entry point 271
The Silverlight application 273
Adding reference to System.Windows.Controls.Data 275
The web service proxy 276
The Application_Startup page 278
The Silverlight Coffee Shop Viewer UI 279
The Silverlight Coffee Shop Viewer code 282
Building the Silverlight project and moving the .XAP 286
Table of Contents
[ viii ]
Altering Coffee Shop Viewer to launch the Silverlight application 287
The ShopList UI 288
The ShopList code 289
Packaging the module 291
Deploying the module 292
Summary 292
Chapter 10: Creating Multiple Portals 293
Multiple portals 294
Parent portals versus child portals 296
Setting up a parent portal 296

the portal is installed.
Chapter 3, Users, Roles, and Pages covers the concepts of users, roles, and pages. This
should lay a foundation for the rest of the information we cover in this book. Most of
the concepts we will cover will deal with one or all of these items.
Preface
[ 2 ]
Chapter 4, Standard DotNetNuke Modules discusses the administration, common
features, and settings of modules in a DotNetNuke portal. This includes how to add
modules to a page, how to adjust layout options, and permission modules. It also
covers the standard modules that come prepackaged with DotNetNuke, their basic
uses as well as situations they may be used in. It gives a brief overview of all of the
modules developed by the DotNetNuke team of developers. These modules range
from simple content display to fully interactive forums and e-commerce solutions.
After discussing the modules available from the DotNetNuke team, this chapter
discusses third-party commercial and open source modules. After covering the pros
and cons of using commercial and open source modules, it reviews a brief list of
vendors from both of these groups.
Chapter 5, Host and Admin Tools covers a variety of information. It gives you, as the
administrator of a DotNetNuke portal, the skills needed to maintain your website.
Chapter 6, Understanding the DotNetNuke Core Architecture explains how the core of
DotNetNuke works. It gives a general overview, examining important pieces of the
framework, and nally follows a request through its paces.
Chapter 7, Custom Module Development covers many important concepts that you
will most likely use in every module you create. In addition to navigation and
localization, it also covers exception handling that will aid you in your module
development.
Chapter 8, Connecting to the Database explains how to set up our development
environment, create controls, and the data access layer.
Chapter 9, Silverlight Coffee Shop Viewer explains the UI and the Silverlight application.
It also shows how to package the module so that it can be distributed to another

AutoEventWireup="true"
CodeFile="Settings.ascx.vb"
Inherits="CoffeeShopVB.Settings" %>





Preface
[ 4 ]
New terms and important words are shown in bold. Words that you see on the
screen, in menus or dialog boxes for example, appear in the text like this: "If this
option is selected, an additional option Add to new pages only is displayed is
also shown".
Warnings or important notes appear in a box like this.
Tips and tricks appear like this.
Reader feedback
Feedback from our readers is always welcome. Let us know what you think about
this book—what you liked or may have disliked. Reader feedback is important for
us to develop titles that you really get the most out of.
To send us general feedback, simply send an e-mail to
[email protected],
and mention the book title via the subject of your message.
If there is a book that you need and would like to see us publish, please
send us a note in the SUGGEST A TITLE form on
www.packtpub.com or
e-mail [email protected].
If there is a topic that you have expertise in and you are interested in either writing
or contributing to a book on, see our author guide on
www.packtpub.com/authors.

[email protected] with a link to the suspected
pirated material.
We appreciate your help in protecting our authors, and our ability to bring you
valuable content.
Questions
You can contact us at [email protected] if you are having a problem with
any aspect of the book, and we will do our best to address it.

What is DotNetNuke?
From company intranets to mom and pop shops, to local chapters of the 4-H club,
most organizations are looking to have a presence on the World Wide Web. Open
source web portals answer this demand by providing easy to install and use website
frameworks that are not only extremely functional but are also freely available.
Whether it is to sell services or to have a place to meet, web portals play an
important role in communication on the Web.
In this chapter, we will discuss the following topics:
What web portals are and what the successful web portals have in common
Different types of open source web portals and why we selected DotNetNuke
for our project over other available web portals
The benets gained by using an established framework and the benets of
using DotNetNuke specically
An introduction to Coffee Connections, our ctional client
A brief overview of Coffee Connections, determining the specic
requirements for its website and gathering the requirements using
user stories
This will give you a general overview of what to expect from this book and how to
make the most of it depending on your role and experience with web portals and
.NET development.
Open source web portals
So what does it actually mean to have a web portal? We begin this chapter with an

Let us rst briey discuss the difference between a portal and a standard or
content-based website. The majority of the sites that you use on a daily basis are
designed to provide information on a particular topic or similar topics. The standard
sites usually do not provide a great deal of interactivity and have a limited number
of services. For example, many sites contain a blog, but not a forum. Generally, a
portal not only contains content, but also several interactive services or areas of
the site.
Please keep in mind that these are generalizations and are not always clearly
dened, and the differences cannot be easily identied. In fact, the difference
between a portal and a standard site is pretty much a philosophical discussion,
which can be debated from multiple positions. To get the most out of this book,
it is important for us to know the concepts outlined in the previous paragraph. It
is also important to know that the DotNetNuke framework is more than capable
of supporting a portal-oriented or a more standard website. With that said, our
example for this book is going to focus more on a portal.


Nhờ tải bản gốc

Tài liệu, ebook tham khảo khác

Music ♫

Copyright: Tài liệu đại học © DMCA.com Protection Status