23,50 €
DotNetNuke is an open source Content Management System and web application framework. It has taken the Microsoft world by storm and now at version 5, its community has grown to over 200,000 users. Revised and updated for DotNetNuke 5, this renowned book is your indispensable guide to creating content-rich websites with DotNetNuke, as quickly as possible.
With this book in hand, you will be able to get your DotNetNuke website up and running. Concisely written and with clear explanations, this book covers installation, administration, deployment, site creation and all of the basic built-in DotNetNuke modules. For developers, it also covers the core architecture and custom modules, including module development using Linq to SQL and Silverlight, to give you the skills to customize and extend your site.
The book starts off by giving you a deep understanding of working with basic DotNetNuke sites, guiding you through the features and giving you the confidence to create and manage your site. After that, you will journey to the heart of DotNetNuke, and learn about its core architecture. Always concise, relevant and practical, you will find out what makes DotNetNuke tick, and from there, you will be ready to customize DotNetNuke. Developers will enjoy the detailed walk-through of creating new custom modules. Special emphasis is given to using Linq to SQL and Silverlight to invigorate your module development.
You will master all of this as you leap into the development of a DotNetNuke 5 site!
A practical guide that shows you how to build your own DotNetNuke website and develop new modules using Visual Studio 2010 in VB.NET and C#, using the latest technologies.
This book is a practical tutorial with step-by-step instructions and clear, concise explanations. Illustrative screenshots are used for better understanding at every step. You will learn how to set up and administer an example site, stepping through all the tasks to ease your learning. The emphasis is not on becoming a better VB.NET or C# programmer but on taming DotNetNuke.
This book has been written both for beginners wanting to set up a website and also for ASP.NET developers with a grasp of VB.NET and C# who want a deeper understanding of how to work with DotNetNuke. To work with the DotNetNuke code, you will need access to Visual Web Developer Express or Visual Studio .NET 2010. No prior knowledge of DotNetNuke is assumed.
Sie lesen das E-Book in den Legimi-Apps auf:
Seitenzahl: 367
Veröffentlichungsjahr: 2010
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
Cover Image by John M. Quick (<[email protected]>)
Authors
Michael Washington
Ian Lackey
Reviewers
Rahul Singla
Andrew The
Acquisition Editor
Dilip Venkatesh
Development Editor
Mayuri Kokate
Technical Editor
Smita Solanki
Indexer
Monica Ajmera Mehta
Editorial Team Leader
Aanchal Kumar
Project Team Leader
Lata Basantani
Project Coordinator
Joel Goveya
Proofreader
Lynda Sliwoski
Graphics
Geetanjali Sawant
Production Coordinator
Shantanu Zagade
Cover Work
Shantanu Zagade
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 this year.
Ian currently lives in a small town in Illinois, just East of St. Louis, with his wife Julie (http://www.calljulie.info) and two daughters, Britney and Brooklynn.
To everyone in my family, especially Loven and my little B's, thank you so much for your love and support through many long nights behind a laptop. You all are my greatest blessing. Love you forever and always.
Rahul Singla is a software professional (often filling the additional roles of Business Analyst and Project Manager) based in Karnal (India).
A university topper in his college during graduation and post graduation, he currently operates a software firm, called Imbibe Inc., and a technical training institute, Imbibe Knowledge Enterprise. His work has ranged from developing proof-of-concept JME applications to end-to-end solutions for organizations. He often freelances on medium to large scale projects, has had some popular articles on CodeProject published, and also maintains a CVS account at drupal.org.
Particularly fond of sharing his development experiences with his students, he likes to indulge in micro-flying, travelling, and just lying around in his vacant time. Pretty wary of his schedule, and his inability to spend time with his family, his newborn nephew is his new attraction.
You can find more about Rahul at his portal http://www.rahulsingla.com. You might also want to check out his technical blog at http://www.rahulsingla.com/blog, where you can find free DotNetNuke 4.x/5.x modules. You can contact him at <[email protected]>.
As always, I will dedicate my work first to the Almighty, who gave me the strength, perseverance, and opportunity to reach here, and 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).
The book starts off by giving you a deep understanding of working with basic DotNetNuke sites, guiding you through the features and giving you the confidence to create and manage your site.
After that, you will journey to the heart of DotNetNuke and learn about its core architecture. Always concise, relevant, and practical, you will find out what makes DotNetNuke tick, and from there, you will be ready to customize DotNetNuke. Developers will enjoy the detailed walkthrough of creating new custom modules. Special emphasis is given to using Linq to SQL and Silverlight to invigorate your module development.
You will master all of this as you leap into the development of a DotNetNuke 5 site.
Chapter 1, What is DotNetNuke? explains the meaning and purpose of web portals, what successful web portals have in common, the different types of open source web portals, and also discusses why we selected DotNetNuke. In this chapter, we introduce our fictional client Coffee Connections, and using user stories, gather the requirements to build a site for it.
Chapter 2, Installing DotNetNuke explains how easy it is to set up a DotNetNuke site on your local workstation. This process has become much easier with each release of DNN, and we expect to continue to see improvements in this area as new versions are released. Some of the new features included in the installation wizard allow you to get your site up and running without needing to modify additional settings once 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.
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 finally 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 DotNetNuke website.
Chapter 10, Creating Multiple Portals explains how to create multiple portals that can all be hosted from one account. It shows how to create and use templates, how to use the Site Wizard to upgrade your site, and how to manage these portals once they have been set up. Not only will this functionality allow you to create multiple portals, but as all of the information is stored in one database, backing up them is simple.
This book has been written for both the beginner wanting to set up a website and also ASP.NET developers with a grasp of VB.NET and C# who want a deeper understanding of how to work with DotNetNuke. To work with the DotNetNuke code, you will need access to Visual Web Developer Express or Visual Studio .NET 2010. No prior knowledge of DotNetNuke is assumed.
In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.
Code words in text are shown as follows: "We will place them in the Coffee Shop Listing folder that is under the DesktopModules folder."
A block of code is set as follows:
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.
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.
Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.
Downloading the example code for the book
Visit http://www.packtpub.com/files/code/9928_Code.zip to directly download the example code.
The downloadable files contain instructions on how to use them.
Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the let us know link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.
Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.
Please contact us at <[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.
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.
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:
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.
So what does it actually mean to have a web portal? We begin this chapter with an explanation of what a web portal is and then go on to the features of a web portal and the reasons for selecting open source web portals.
You have decided to start a web portal and first need to find out what makes a web portal. Does creating a few web pages with links to different topics make it a web portal? A web portal, in its most basic sense, aims to be an entry point to the World Wide Web. Portals will typically offer services, such as search engines, links to useful pages, news, forums, e-mails, and so on, depending on their targeted audience, all in an effort to draw users to their site. In most cases, portals provide these services for free, in hope that users will make the site their home page or at least come back often. A couple of successful examples include Yahoo! and MSN. These sites are horizontal portals because they typically attract a wide audience and primarily exist to produce advertising income for their owners. Other web portals may focus on a specific group of users or be part of a corporate intranet. Most often, they will concentrate on one particular subject like gardening or sports. These types of portals are vertical portals as they focus inward and cater to a selected group of people.
The type of portal you create depends on the target audience you are trying to attract. You may discover that the portal you create is a combination of both horizontal and vertical portals so as to address specific needs, while simultaneously giving a broader range of services to your visitors. Regardless of the type of portal you decide on, horizontal or vertical, they both share certain key characteristics and functionalities that will increase the probability of users returning to your site.
Let us first briefly 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 defined, and the differences cannot be easily identified. 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.
So, what makes a great portal? Is it a free prize giveaway, local weather forecasts, or sports scores for the teams you watch? While this package of extras might attract some users, you will certainly miss a large group of people who have no interest in these offerings. You can choose from a large number of web portals that are as many in number as the programming languages they are written in. However, one thing is certain, that in order to make your web portal successful and attract a wide audience, there are particular services that it should incorporate. They are as follows:
One of the most interesting ways to express your opinions or communicate your ideas to others on a web portal is to use a blog. A blog (also known as a web log) is sort of like a diary on the Web, except that you do not lock it when you have finished writing it. Instead, you make all your thoughts and observations available to the world. These blogs range in topic from personal and comical (http://entlib.codeplex.com/) to technical (http://weblogs.asp.net/scottgu) and, in recent years, have exploded on the scene as the de facto way to communicate on the Internet. Most web portals will offer at least one of these ways to communicate.
Security and administration: Web portal security not only manages who can access particular sections of the site, but also enables administrators to access, add, and change content on the site. Having users authenticate with the portal allows you to tailor the site to individuals so that they can customize their experience.When the time comes to decide how you want to build your portal, you will have to make many decisions: Do I create my portal from scratch? If not, which web portal framework should I use? What type of hardware and software do I have available to me? Moreover, what is my skill level on any particular platform? In this section, we will discuss some of the better-known portals that are available.
For our portal, we have decided that it would be counterproductive to start from scratch. So, we will be using an already-developed framework for designing our portal. We will have many options to select from. We will discuss a few of our options and determine why we believe DotNetNuke fits us best.
The grandfather of DotNetNuke (in name at least) is most likely PHP-Nuke (http://www.phpnuke.org). PHP-Nuke is a web portal that uses PHP (a recursive acronym for Hypertext Preprocessor) pages to create dynamic web pages. You can use it in a Windows environment, but it is most flexible in a Linux/Unix environment. PHP is an open source HTML-embedded scripting language, which is an alternative to Microsoft's Active Server Pages (ASP)—the precursor to ASP.NET, which is the programming language used in DotNetNuke. PHP-Nuke, like DotNetNuke, is a modular system that comes with prebuilt standard modules and allows you to enhance the portal by creating custom modules. As we will be using a Windows platform and are more comfortable using ASP.NET, this choice would not fit our needs.
Joomla! is another open source content management system available to those looking to create a website. Joomla! also claims to be easy to use to create a website. However, like PHP-Nuke, Metadot runs primarily on the Linux operating system (although it supports Windows as well), Apache web server, and a MySQL database. For the same reasons as PHP-Nuke, this framework will not fit our needs.
Why did we select DotNetNuke as the web portal for this book? Well, here are a few reasons for selecting DotNetNuke:
Whether you are building a website to gather information about your soccer club or putting up a department website on your company's intranet, one thing is certain—to write your web portal from scratch, you should plan on coding for a long time. Just deciding on the structure, design, and security of your site will take you months. After all this is complete, you will still need to test and debug. At this point, you still haven't begun to build the basic functionality of your web portal.
So why start from scratch when you have the ability to build on an existing structure? Just as you would not want to build your own operating system before building a program to run on it, using an existing architecture allows you to concentrate on enhancing and customizing the portal to your specific needs. If you are like me and use Visual Studio for developing your website, then you already adhere to this concept. There is no need for you to create the basic building blocks of your application (forms, buttons, textboxes, and so on); instead, you take the existing building blocks and assemble (and sometimes enhance) them to suit your needs.
The DotNetNuke community has one of the most active and dynamic support forums and over 740,000 users are registered on the DotNetNuke website.
The core team comprises individuals invited to join the team by Shaun Walker, whom they affectionately call the "Benevolent Dictator". Their invitations were based on their contributions and their never-ending support from others in the DotNetNuke forum. Each team member has a certain area of responsibility based on his or her abilities. From database functionality and module creation to skinning, they are the ones who are responsible for the continued advancement of the framework. However, not being a member of the core team does not mean that you cannot contribute to the project. There are many ways for you to provide help for the project. Many developers create custom modules that they make freely available to the DotNetNuke community. Other developers create skins that they freely distribute. Still others help answer the many questions in the DotNetNuke forum. You can also be a contributor to the core architecture. You're welcome to submit code improvements to extend and/or expand the capabilities of DotNetNuke. These submissions will be evaluated by the core team and could possibly be added to the next version.
When the DotNetNuke project started, one of the things that helped to propel its popularity forward was the fact that its forums were housed on the ASP.NET forums website. With over 200,000 individual posts in the main DotNetNuke forum alone, it was one of the most active and attentive forums on the ASP.NET forums website (http://www.asp.net/forums/). Beginning sometime after the version 3.x release, the DotNetNuke team puts its finishing touches to its own forum module. It now utilizes this module for DotNetNuke discussions (http://www.dotnetnuke.com/tabid/795/Default.aspx). The DotNetNuke forum is the best place to find help for any issue you may be having in DotNetNuke.
The main forum is where you will find most of the action, but there is also a subforum that covers topics such as core framework, resources, getting started, and custom modules. You can search and view posts in any of the forums but will need to register if you want to post your own questions or reply to other users' posts. The great thing about these forums is that you will find the core team hanging out there. Who could be better to answer questions about DotNetNuke other than those who created it? However, don't be shy, because if you know the answer to someone else's question, then feel free to post an answer. That is what the community is all about, helping people through challenging situations.
Like any application, there are bound to be a few bugs that creep into the application now and then. To manage this occurrence, the DotNetNuke core team uses a third-party bug tracking system called Gemini, by CounterSoft. The bug tracker is not for general questions or setup and configuration errors; questions of that nature should be posted in the discussion forum. You can view the status of current bugs at the Gemini site (http://support.dotnetnuke.com), and you can also add new bugs to the system. Before submitting a bug to the tracker, please review the guidelines currently posted on the DotNetNuke website (http://www.dotnetnuke.com/Support/ReportABug/tabid/645/Default.aspx).
To summarize, you need to first search the bug tracker to make sure that it has not already been reported. If you cannot find it in the system, then you will need to supply the details including what you did, what you expected to happen, and what actually happened. Also, if you are going to include code to reproduce the bug, then be sure to limit the code to 10 lines or less. Verified bugs will be assigned to core team members to track down and repair.
If you want to find out what is in the works for future releases of DotNetNuke, then you should check out the DotNetNuke project Roadmap (http://www.dotnetnuke.com/Development/Roadmap/tabid/616/Default.aspx). The main purpose of this document is, as a communication vehicle, to inform users and stakeholders of the project's direction. The Roadmap accomplishes this by allowing users to submit enhancement requests. The priority of the enhancements depends on both the availability of resources (core team) and the perceived demand for the feature, based on the number of votes it receives.
The license type used by the DotNetNuke project is a modified version of the Berkeley Software Distribution (BSD) license. As opposed to the more restrictive GNU General Public License (GPL) used by many other open source projects, the BSD license is very permissive and imposes very few conditions on what a user can do with the software. These conditions include charging clients for binary distributions, with no obligation to include source code. If you have further questions on the specifics of the license agreement, then you can find information in the documents folder of the DotNetNuke application or on the DotNetNuke website.
Wherever your travels take you, from sunny Long Beach, California, to the cobblestone streets of Hamburg, Germany, chances are that there is a coffee shop nearby. Whether it is a Starbucks (located on just about every corner) or a local coffee shop tucked neatly in between all the antique stores on the main street, they all have one thing in common—coffee. Right? Well yes, they do have coffee in common, but more importantly, they are places for people with shared interests to gather, relax, and enjoy their coffee while taking in the environment around them. Coffee shops offer a wide variety of services in addition to coffee, from Wi-Fi to poetry readings to local bands. They keep people coming back by offering them more than just a cup o' Joe.
