Upload
sheena-booker
View
220
Download
1
Embed Size (px)
Citation preview
DotNetNuke PortalDotNetNuke PortalPrivate Assembly Private Assembly DevelopmentDevelopment
Stan SchultesStan Schultes Enterprise architect / application developerEnterprise architect / application developer Conference speaker, mentor, trainerConference speaker, mentor, trainer Contributing Editor, Visual Studio MagazineContributing Editor, Visual Studio Magazine Founder - .NET Pub Club (netpubclub.net)Founder - .NET Pub Club (netpubclub.net) Microsoft MVPMicrosoft MVP www.vbnetexpert.comwww.vbnetexpert.com [email protected]@vbnetexpert.com
Presentation OutlinePresentation Outline
Portal Review and RequirementsPortal Review and Requirements Private Assembly InstallationPrivate Assembly Installation Technical Overview & ArchitectureTechnical Overview & Architecture Data Provider ArchitectureData Provider Architecture DNN in Design ModeDNN in Design Mode Private Assembly Development ProcessPrivate Assembly Development Process Development TopicsDevelopment Topics Links and ResourcesLinks and Resources
DNN – Portal ReviewDNN – Portal Review
DotNetNuke = Open Source portalDotNetNuke = Open Source portal Tabs = portal organizational unitsTabs = portal organizational units Modules = information containersModules = information containers Info access controlled by Roles and Info access controlled by Roles and
UsersUsers Data providers = implement storage Data providers = implement storage
in a variety of databasesin a variety of databases
DNN - Portal RequirementsDNN - Portal Requirements
Current portal version: v2.1.2Current portal version: v2.1.2 Requires:Requires:
Win2K, WinXP, or Win2K3Win2K, WinXP, or Win2K3 IIS installed and operationalIIS installed and operational .NET Framework V1.1.NET Framework V1.1 Access or SQL Server 2000 / MSDEAccess or SQL Server 2000 / MSDE SMTP configured if you want to use mailSMTP configured if you want to use mail VS.NET 2003, or custom build environment VS.NET 2003, or custom build environment
(no SDK version available today)(no SDK version available today) DNN is written in VB.NET, but you can write DNN is written in VB.NET, but you can write
modules (.DLLs) in any .NET languagemodules (.DLLs) in any .NET language
DNN - Installation ProcessDNN - Installation Process
Installation Process:Installation Process: Unzip the code to a directory, give ASPNET/Network Unzip the code to a directory, give ASPNET/Network
Service account permissions to that directoryService account permissions to that directory Create a virtual directory in IIS ManagerCreate a virtual directory in IIS Manager [ Create an empty SQL database, set up DB account ][ Create an empty SQL database, set up DB account ] Edit web.config – set data providers upEdit web.config – set data providers up Browse to Browse to http://localhost/vdirhttp://localhost/vdir Change Host and Admin passwords!Change Host and Admin passwords!
Upgrade Process:Upgrade Process: Back up your current configuration Back up your current configuration Unzip the new code into the directory structureUnzip the new code into the directory structure Browse to the vdirBrowse to the vdir
Demo – PA InstallationDemo – PA Installation
PA = Private Assembly (aka Custom PA = Private Assembly (aka Custom Module)Module)
Four PAs are distributed as samples:Four PAs are distributed as samples: PageTitlePageTitle SurveySurvey Users OnlineUsers Online WhoisWhois
Installation with Host Installation with Host File Manager File Manager Config with Host Config with Host Module Definitions Module Definitions Control Types, Multiple ControlsControl Types, Multiple Controls
DNN - Technical OverviewDNN - Technical Overview
Framework applicationFramework application Modular, extensible constructionModular, extensible construction Dynamically loaded user controlsDynamically loaded user controls Provider modelProvider model Business logic / UI layers separatedBusiness logic / UI layers separated Online portal configuration by roleOnline portal configuration by role Multi-portal: parent or child Multi-portal: parent or child
configurationconfiguration
Provider ModelProvider Model
Data access based on the Whidbey Data access based on the Whidbey Provider model (see Resources)Provider model (see Resources)
Databases supported:Databases supported: Access (default), SQL Server 2000/MSDEAccess (default), SQL Server 2000/MSDE (future) mySQL, Oracle(future) mySQL, Oracle
Provider model:Provider model: Rich Text editingRich Text editing Exceptions / LoggingExceptions / Logging SchedulingScheduling Authentication (future)Authentication (future)
DotNetNuke PortalDotNetNuke Portal
Portal provides plumbing and Portal provides plumbing and services:services: MembershipMembership Role-based securityRole-based security PersonalizationPersonalization ManagementManagement NavigationNavigation Data accessData access Site & exception loggingSite & exception logging
DotNetNuke ArchitectureDotNetNuke Architecture
Data Provider ArchitectureData Provider Architecture
Data Store – MS Data Access Application BlockData Store – MS Data Access Application Block Concrete Data Providers – built as Concrete Data Providers – built as
separate .DLLs (SqlDataProvider.dll, separate .DLLs (SqlDataProvider.dll, AccessDP, etc.)AccessDP, etc.)
Abstract Data Provider – DataProvider.vbAbstract Data Provider – DataProvider.vb Business Logic Layer – SuggestionsDB.vb:Business Logic Layer – SuggestionsDB.vb:
Abstracts the data layer from the portalAbstracts the data layer from the portal Custom Business Object (CBO) helperCustom Business Object (CBO) helper
User Interface Layer – user controls (.ascx)User Interface Layer – user controls (.ascx)
Concrete Data ProvidersConcrete Data Providers
Implemented as separate componentsImplemented as separate components Use MS Data Access Application BlockUse MS Data Access Application Block SqlDataProvider.vb:SqlDataProvider.vb:
Abstract Data ProviderAbstract Data Provider
Located in the Data Access LayerLocated in the Data Access Layer Instance method is the Data Instance method is the Data
FactoryFactory DataProvider.vb:DataProvider.vb:
Business ComponentsBusiness Components
Located in the Business Logic Located in the Business Logic LayerLayer
Interface structures between DB & Interface structures between DB & appapp
Business Components Business Components (cont’d)(cont’d)
Controller classes provide the Controller classes provide the app/DB conversion interfaceapp/DB conversion interface
Data Layer TopicsData Layer Topics
Instance method – data factoryInstance method – data factory Configuration Configuration Database scriptsDatabase scripts
{databaseOwner} and {objectQualifier}{databaseOwner} and {objectQualifier} Data transport via DataReadersData transport via DataReaders Custom Business Object Helper (CBO)Custom Business Object Helper (CBO) Null HandlingNull Handling CachingCaching
DNN in Design ModeDNN in Design Mode
DNN v2 built with VS.NET 2003DNN v2 built with VS.NET 2003 Change .sln and .webinfo file if not Change .sln and .webinfo file if not
default DotNetNuke vdirdefault DotNetNuke vdir Release mode vs. Debug modeRelease mode vs. Debug mode All standard modules are integrated in All standard modules are integrated in
.sln.sln Build private modules in any language Build private modules in any language
– as separate project.– as separate project.
Project OrganizationProject Organization
Directory structure:Directory structure: Root – few .aspx’s, http handler, global.asaxRoot – few .aspx’s, http handler, global.asax Admin – user controls for all system pagesAdmin – user controls for all system pages Components – business logic for portalComponents – business logic for portal Controls – title, header, footer, skin controlsControls – title, header, footer, skin controls DesktopModules – module add-ins DesktopModules – module add-ins Portals\n\ – content directories by portalPortals\n\ – content directories by portal Providers – separate projectsProviders – separate projects
PA DevelopmentPA Development
PA = Private Assembly / Custom PA = Private Assembly / Custom ModuleModule
Develop PAs in any .NET languageDevelop PAs in any .NET language Development Overview:Development Overview:
Project SetupProject Setup Build the Data LayerBuild the Data Layer Create the User ControlsCreate the User Controls Package the PA for InstallationPackage the PA for Installation DeploymentDeployment
PA Dev – Project SetupPA Dev – Project Setup Tip: find a similar module and copy itTip: find a similar module and copy it Create a new directory under DesktopModules: Create a new directory under DesktopModules:
VBNetExpert.SuggestionsVBNetExpert.Suggestions Create new project in that directory:Create new project in that directory:
Clear Root NamespaceClear Root Namespace Set build output path to DNN \bin directorySet build output path to DNN \bin directory Set ReferencesSet References
Create \Providers\DataProviders subdirs:Create \Providers\DataProviders subdirs: \SqlDataProvider\SqlDataProvider \AccessDataProvider\AccessDataProvider These will also become separate projectsThese will also become separate projects
PA Dev – Build the Data PA Dev – Build the Data LayerLayer
Design your module’s logicDesign your module’s logic Build one data provider at a timeBuild one data provider at a time Create the required database table(s) Create the required database table(s) Create and test all Stored ProceduresCreate and test all Stored Procedures Create abstract data layer (DataProvider.vb)Create abstract data layer (DataProvider.vb) Create & build project for concrete data Create & build project for concrete data
provider (SqlDataProvider.vb)provider (SqlDataProvider.vb) Create business objects (SuggestionsDB.vb)Create business objects (SuggestionsDB.vb)
PA Dev – Create User PA Dev – Create User ControlsControls
This is the portal Presentation LayerThis is the portal Presentation Layer DNN V2 allows multiple user controls per DNN V2 allows multiple user controls per
module (V1 allowed two: Edit & Display)module (V1 allowed two: Edit & Display) In control sources: Imports DotNetNukeIn control sources: Imports DotNetNuke All controls inherit from All controls inherit from
PortalModuleControl:PortalModuleControl: Main control (Suggestions)Main control (Suggestions) Edit control (EditSuggestions)Edit control (EditSuggestions) Module options (EditSuggestionsOptions)Module options (EditSuggestionsOptions) Other as required (DisplaySuggestions)Other as required (DisplaySuggestions)
PA Dev – Packaging for PA Dev – Packaging for InstallInstall
Create DB install & uninstall scriptsCreate DB install & uninstall scripts Create .dnn file (installation manifest)Create .dnn file (installation manifest)
Folder contents & module stringsFolder contents & module strings Modules & ControlsModules & Controls Files deployed (ascx, dll, sql, etc.)Files deployed (ascx, dll, sql, etc.)
Package additional files in .zip (images & Package additional files in .zip (images & icons, help & readme files, etc.)icons, help & readme files, etc.)
Package everything into master .zip for Package everything into master .zip for upload to portalupload to portal
Test!Test!
PA Dev – DeploymentPA Dev – Deployment
PA deployed & managed through the PA deployed & managed through the Host accountHost account
All related Modules are included as All related Modules are included as “definitions” in Host “definitions” in Host Module Module DefinitionsDefinitions
Portal database tables affected:Portal database tables affected: DesktopModulesDesktopModules ModuleDefinitionsModuleDefinitions ModuleControls ModuleControls
Sql files need to be in UTF-8 format…Sql files need to be in UTF-8 format…
Converting Modules from Converting Modules from V1V1
Convert data calls to Provider modelConvert data calls to Provider model No longer share edit & module options with No longer share edit & module options with
panel controlspanel controls Don’t include DesktopModuleTitle controlDon’t include DesktopModuleTitle control Module registration changes:Module registration changes:
Module tables have changedModule tables have changed No .sql script for controls registrationNo .sql script for controls registration .dnn file structure defines module registrations.dnn file structure defines module registrations
PMC.Actions.Add for referencing controlsPMC.Actions.Add for referencing controls ArrayLists for data bindingArrayLists for data binding Use EditURL and NavigateURL methodsUse EditURL and NavigateURL methods
Development TopicsDevelopment Topics
Roles & Permissions – how to Roles & Permissions – how to detect them in the codedetect them in the code
PortalModuleControlPortalModuleControl ModuleID, TabIDModuleID, TabID Components\configuration.vbComponents\configuration.vb ObjectBrowser is your friend!ObjectBrowser is your friend!
Development Topics Development Topics (cont’d)(cont’d)
Development tools:Development tools: CodeSmith with templatesCodeSmith with templates
SkinningSkinning SecuritySecurity Modifying the core codeModifying the core code
Questions?Questions?
ResourcesResources DotNetNuke: DotNetNuke: www.dotnetnuke.comwww.dotnetnuke.com FW 1.1: FW 1.1: http://www.asp.net/download-1.1.aspxhttp://www.asp.net/download-1.1.aspx Provider Model: Provider Model:
http://msdn.microsoft.com/library/en-us/dnaspnet/html/asp021http://msdn.microsoft.com/library/en-us/dnaspnet/html/asp02182004.asp82004.asp
My V1 modules column: My V1 modules column: http://www.fawcette.com/vsm/2003_12/magazine/columns/gethttp://www.fawcette.com/vsm/2003_12/magazine/columns/gettingstarted/tingstarted/
DNN docs: site documentation subfolderDNN docs: site documentation subfolder DNN help: DNN help: http://www.dotnetnukehelp.comhttp://www.dotnetnukehelp.com Resource portals: Resource portals: http://www.dnn.com.auhttp://www.dnn.com.au, , http://http://
dnnjungle.vmasanas.netdnnjungle.vmasanas.net// Developer portal: Developer portal: http://www.dotnetnuke.dkhttp://www.dotnetnuke.dk Free modules list: Free modules list: http://http://www.cathal.co.uk/Default.aspx?tabidwww.cathal.co.uk/Default.aspx?tabid
=28=28