DotNetNuke Portal Private Assembly Development

Click here to load reader

download DotNetNuke Portal Private Assembly Development

of 29

  • date post

  • Category


  • view

  • download


Embed Size (px)


DotNetNuke Portal Private Assembly Development. Stan Schultes Enterprise architect / application developer Conference speaker, mentor, trainer Contributing Editor, Visual Studio Magazine Founder - .NET Pub Club ( Microsoft MVP - PowerPoint PPT Presentation

Transcript of DotNetNuke Portal Private Assembly Development

  • DotNetNuke PortalPrivate Assembly DevelopmentStan SchultesEnterprise architect / application developerConference speaker, mentor, trainerContributing Editor, Visual Studio MagazineFounder - .NET Pub Club (

  • Presentation OutlinePortal Review and RequirementsPrivate Assembly InstallationTechnical Overview & ArchitectureData Provider ArchitectureDNN in Design ModePrivate Assembly Development ProcessDevelopment TopicsLinks and Resources

  • DNN Portal ReviewDotNetNuke = Open Source portalTabs = portal organizational unitsModules = information containersInfo access controlled by Roles and UsersData providers = implement storage in a variety of databases

  • DNN - Portal RequirementsCurrent portal version: v2.1.2Requires:Win2K, WinXP, or Win2K3IIS installed and operational.NET Framework V1.1Access or SQL Server 2000 / MSDESMTP configured if you want to use mailVS.NET 2003, or custom build environment (no SDK version available today)DNN is written in VB.NET, but you can write modules (.DLLs) in any .NET language

  • DNN - Installation ProcessInstallation Process:Unzip the code to a directory, give ASPNET/Network Service account permissions to that directoryCreate a virtual directory in IIS Manager[ Create an empty SQL database, set up DB account ]Edit web.config set data providers upBrowse to http://localhost/vdirChange Host and Admin passwords!Upgrade Process:Back up your current configuration Unzip the new code into the directory structureBrowse to the vdir

  • Demo PA InstallationPA = Private Assembly (aka Custom Module)Four PAs are distributed as samples:PageTitleSurveyUsers OnlineWhoisInstallation with Host File ManagerConfig with Host Module DefinitionsControl Types, Multiple Controls

  • DNN - Technical OverviewFramework applicationModular, extensible constructionDynamically loaded user controlsProvider modelBusiness logic / UI layers separatedOnline portal configuration by roleMulti-portal: parent or child configuration

  • Provider ModelData access based on the Whidbey Provider model (see Resources)Databases supported:Access (default), SQL Server 2000/MSDE(future) mySQL, OracleProvider model:Rich Text editingExceptions / LoggingSchedulingAuthentication (future)

  • DotNetNuke PortalPortal provides plumbing and services:MembershipRole-based securityPersonalizationManagementNavigationData accessSite & exception logging

  • DotNetNuke Architecture

  • Data Provider ArchitectureData Store MS Data Access Application BlockConcrete Data Providers built as separate .DLLs (SqlDataProvider.dll, AccessDP, etc.)Abstract Data Provider DataProvider.vbBusiness Logic Layer SuggestionsDB.vb:Abstracts the data layer from the portalCustom Business Object (CBO) helperUser Interface Layer user controls (.ascx)

  • Concrete Data ProvidersImplemented as separate componentsUse MS Data Access Application BlockSqlDataProvider.vb:

  • Abstract Data ProviderLocated in the Data Access LayerInstance method is the Data FactoryDataProvider.vb:

  • Business ComponentsLocated in the Business Logic LayerInterface structures between DB & app

  • Business Components (contd)Controller classes provide the app/DB conversion interface

  • Data Layer TopicsInstance method data factoryConfiguration Database scripts{databaseOwner} and {objectQualifier}Data transport via DataReadersCustom Business Object Helper (CBO)Null HandlingCaching

  • DNN in Design ModeDNN v2 built with VS.NET 2003Change .sln and .webinfo file if not default DotNetNuke vdirRelease mode vs. Debug modeAll standard modules are integrated in .slnBuild private modules in any language as separate project.

  • Project OrganizationDirectory structure:Root few .aspxs, http handler, global.asaxAdmin user controls for all system pagesComponents business logic for portalControls title, header, footer, skin controlsDesktopModules module add-ins Portals\n\ content directories by portalProviders separate projects

  • PA DevelopmentPA = Private Assembly / Custom ModuleDevelop PAs in any .NET languageDevelopment Overview:Project SetupBuild the Data LayerCreate the User ControlsPackage the PA for InstallationDeployment

  • PA Dev Project SetupTip: find a similar module and copy itCreate a new directory under DesktopModules: VBNetExpert.SuggestionsCreate new project in that directory:Clear Root NamespaceSet build output path to DNN \bin directorySet ReferencesCreate \Providers\DataProviders subdirs:\SqlDataProvider\AccessDataProviderThese will also become separate projects

  • PA Dev Build the Data LayerDesign your modules logicBuild one data provider at a timeCreate the required database table(s) Create and test all Stored ProceduresCreate abstract data layer (DataProvider.vb)Create & build project for concrete data provider (SqlDataProvider.vb)Create business objects (SuggestionsDB.vb)

  • PA Dev Create User ControlsThis is the portal Presentation LayerDNN V2 allows multiple user controls per module (V1 allowed two: Edit & Display)In control sources: Imports DotNetNukeAll controls inherit from PortalModuleControl:Main control (Suggestions)Edit control (EditSuggestions)Module options (EditSuggestionsOptions)Other as required (DisplaySuggestions)

  • PA Dev Packaging for InstallCreate DB install & uninstall scriptsCreate .dnn file (installation manifest)Folder contents & module stringsModules & ControlsFiles deployed (ascx, dll, sql, etc.)Package additional files in .zip (images & icons, help & readme files, etc.)Package everything into master .zip for upload to portalTest!

  • PA Dev DeploymentPA deployed & managed through the Host accountAll related Modules are included as definitions in Host Module DefinitionsPortal database tables affected:DesktopModulesModuleDefinitionsModuleControls Sql files need to be in UTF-8 format

  • Converting Modules from V1Convert data calls to Provider modelNo longer share edit & module options with panel controlsDont include DesktopModuleTitle controlModule registration changes:Module tables have changedNo .sql script for controls registration.dnn file structure defines module registrationsPMC.Actions.Add for referencing controlsArrayLists for data bindingUse EditURL and NavigateURL methods

  • Development TopicsRoles & Permissions how to detect them in the codePortalModuleControlModuleID, TabIDComponents\configuration.vbObjectBrowser is your friend!

  • Development Topics (contd)Development tools:CodeSmith with templatesSkinningSecurityModifying the core code

  • Questions?

  • ResourcesDotNetNuke: www.dotnetnuke.comFW 1.1: Model: My V1 modules column: magazine/columns/gettingstarted/ DNN docs: site documentation subfolderDNN help: Resource portals:, Developer portal: Free modules list:

    Tabs appear as the menu structure of the portal.

    Modules are sited on tabs and contain portal content.

    Module options provide specific customizationsUse SQL Developer Edition on non-server OSData Provider model now supports Access, soon to support mySQL, OracleEliminated the requirement for Mobile Internet ToolkitSQL Database only needed if using SQL Server otherwise, creates Access DB from templateSQL Scripting processUpgrade process assumes you havent changed the core code To upgrade, I often create a new directory, copy in previous contents, unzip new over it, change vdir & visit it.

    Private Assembly module for DNN which is built & packaged as a separate add-in component

    Install Suggestions

    Multiple modules appear within Host->Module Definitions under the definitions dropdownProvider - Provider Model: an architected interface that allows optional or replacement features to be plugged in. Aka Factory Design Pattern.Create a generic interface or API as a contract, plug-ins conform to that contract (like COM)CBO uses reflection to fill the BO from DataReaders returned from the Data layer

    Any field that can contain a Null value in the DB needs to be wrapped with the GetNull function.

    Calls into DAABs are hardwired here.Youll see the Instance method in a minuteSee the four types of query statements: scalar returnNo value returnedSingle record (loaded into Info structure)Table type returned to ArrayList (for data binding)

    Above this layer is the UIInstance method supports runtime determination of which concrete data class to load via config file. Store in cache once loaded.Key point: can add another DB implementation without rebuilding the business logic.Configuration custom attributes in web.configDatabase Scripts Named according to module version and providerProvides for dynamic substitution of tags, can override this for your own (security & naming)objectQualifier lets you work in a hosting environment where one SQL server is shared with all web apps in your accountTransport iDataReader = base interface lets us pass data between layers without concern for actual data access implementation.Custom Business Objects technique for encapsulating data in user defined structures. CBO helper routines do the work w/ reflection.Null abstracts Null concept from DB implementations, lets us encode/decode nulls between layers.Caching for performance, cache timeout specified in portal configuration.Modify .sln and .vbproj.webinfo files if not using the default