Presentation is loading. Please wait.

Presentation is loading. Please wait.

DEV306 ASP.NET Portal Starter Kit Under The Hood Gunther Beersaerts Technical Specialist Microsoft Corporation.

Similar presentations


Presentation on theme: "DEV306 ASP.NET Portal Starter Kit Under The Hood Gunther Beersaerts Technical Specialist Microsoft Corporation."— Presentation transcript:

1 DEV306 ASP.NET Portal Starter Kit Under The Hood Gunther Beersaerts Technical Specialist Microsoft Corporation

2 ASP.net Starter Kits Portal Architecture Portal Modules Extending the Portal Portal Configuration Portal Security Resources Agenda

3 ASP.NET Starter Kits Five ASP.NET sample apps Free downloadable Community Reports Time Tracker Commerce Portal Share common code practices Available @ http://www.asp.net/starterkits http://www.asp.net/starterkits Community Reports Time Tracker Commerce Portal

4 Sample Portal application Pluggable framework 10 basic portal modules Extendable with custom portal modules Online Administration XML based definition of portal layout Roles-based security Mobile support using ASP.NET Mobile Controls Available in VB.NET and C# VS and SDK (WebMatrix) ASP.NET Starter Kits Portal Starter Kit

5 Walk-Through demo demo

6 ASP.net Starter Kits Portal Architecture Portal Modules Extending the Portal Portal Configuration Portal Security Resources Agenda

7 Data Access Layer Portal Architecture N-Tier Business Logic Layer Data Store Presentation Layer Business Objects Mobile UI Desktop UI Data Objects SQL Server

8 Portal Directory Structure - Web.Config - Global.asax - 3.ASPX Pages - 3.ASCX User Controls - PortalCfg.xml + Class + /Admin/ + /Components/ + /Data/ + /DesktopModules/ + /MobileModules/ + /SourceViewer/ + /Bin/ + /Docs/ + /Images/

9 Portal Architecture Default.aspx DesktopDefault.aspx MobileDefault.aspx DesktopPortal Banner.ascx SignIn.ascx *.ascx Data Access Classes Database PortalCfg.xml

10 A Day in The Life of the Portal… - or - Let’s start with Loading Settings

11 PortalSettings() Keeping Track... Application_BeginRequest() PortalSettings()... Dim DesktopTabs As New ArrayList() Dim MobileTabs As New ArrayList() Dim ActiveTab As New TabSettings() TabStripDetails() class TabSettings() class... Dim Modules As New ArrayList() New PortalSettings(tabIndex, tabId) ModuleSettings()

12 PortalSettings() Application_BeginRequest Executes on each web request Obtains current TabIndex and TabId from querystring Stored in Application’s Context object  available to all pages Sub Application_BeginRequest(...) ' Add the PortalSettings object to the context Context.Items.Add("PortalSettings", New PortalSettings(tabIndex, tabId)) End Sub

13 PortalSettings() PortalSettings() Class Encapsulates all settings and configuration settings required to execute the current tab view Public Fields: Public PortalId As Integer Public PortalName As String Public AlwaysShowEditButton As Boolean Public DesktopTabs As New ArrayList Public MobileTabs As New ArrayList Public ActiveTab As New TabSettings

14 PortalSettings() TabStripDetails PortalSettings Class instantiate DesktopTabs and MobileTabs fields ArrayLists Type Contain TabStripDetails instances: Public Class TabStripDetails Public TabId As Integer Public TabName As String Public TabOrder As Integer Public AuthorizedRoles As String End Class

15 PortalSettings Class exposes ‘ActiveTab’ public field Instance of TabSettings() Class Public Class TabSettings Public TabIndex As Integer Public TabId As Integer Public TabName As String Public TabOrder As Integer Public MobileTabName As String Public AuthorizedRoles As String Public ShowMobile As Boolean Public Modules As New ArrayList() End Class PortalSettings() TabSettings

16 TabSettings Class exposes Modules public field ArrayLists Type Contain ModuleSettings instances PortalSettings() ModuleSettings Public Class ModuleSettings Implements IComparable Public ModuleId As Integer Public ModuleDefId As Integer Public TabId As Integer Public CacheTime As Integer Public ModuleOrder As Integer Public PaneName As String Public ModuleTitle As String Public AuthorizedEditRoles As String Public ShowMobile As Boolean Public DesktopSrc As String Public MobileSrc As String End Class

17 Retrieving PortalSettings() demo demo

18 A Day in The Life of the Portal… - or - Let’s show some UI

19 DesktopDefault.aspx Tab Strip Mapped to DesktopPortalBanner.ascx UC Up to Three columns LeftPane ContentPane RightPane Page_Init Event Handler Dynamically populate the columns with User Controls (= Modules) using: Page.LoadControl(string srcFile) method Retrieves PortalSettings instance from HTTPContext

20 DesktopPortalBanner.ascx Goal = Display Tabs DataList Page_Load Event Handler Dynamically populate DataList Retrieves PortalSettings instance from HTTPContext

21 DesktopDefault.aspx DesktopPortalBanner.ascx demo demo

22 ASP.net Starter Kits Portal Architecture Portal Modules Extending the Portal Portal Configuration Portal Security Resources Agenda

23 Module Architecture Implemented as User Controls (*.ascx) Inherit PortalModuleControl() base class Defines additional custom methods and properties specific to portals Example Properties: PortalId, ModuleId, IsEditable, ModuleConfiguration [Optional] Use DesktopModuleTitle.ascx helper control to provide consistent UI Render title Edit Link [Optional] Use seperate data object

24 demo demo TechEd Attendees Module Write User Control (.ascx) Inherit from PortalModuleControl() Consume XML Web Service Add module to Portal Framework

25 ASP.net Starter Kits Portal Architecture Portal Modules Extending the Portal Portal Configuration Portal Security Resources Agenda

26 Extending the Portal Stylesheet customization Consistent look across the Portal Single CSS stylesheet: “ASPNETPortal.css” Direct Code modification Custom Module Development ASP.NET Portal Starter Kit

27 demo demo Custom TechEd Stylesheet Customize ASPNETPortal.css

28 Building Portal Modules Example Announcements.ascx Desktop Module User Control AnnouncementsDB.vb Component encapsulating data access EditAnnouncements.aspx Edit page for portal module that enables adding/editing/deleting announcements

29 TechEd Session Module demo demo Add a database table Add SPROC’s Write Data Access component Write User Control (.ascx) Write Admin page Add module to Portal Framework

30 ASP.net Starter Kits Portal Architecture Portal Modules Extending the Portal Portal Configuration Portal Security Resources Agenda

31 Database Schema

32 Portal Configuration Drill-down GetSiteSettings Method Reads PortalCfg.xml from filesystem or Cache Configuration.vb Class encapsulates configuration settings Global.asax Uses configuration class to fetch config at beginning of each request and store/flow with request context Sub Application_BeginRequest(...)... ' Read the configuration info from the XML file ‘ or retrieve from Cache Dim config As Configuration = New Configuration() Context.Items.Add("SiteSettings", config.GetSiteSettings()) End Sub

33 PortalCfg.xsd

34 ASP.net Starter Kits Portal Architecture Portal Modules Extending the Portal Portal Configuration Portal Security Resources Agenda

35 Portal Authentication ASP.NET Portal Starter Kit supports two modes of application authentication: Forms based authentication Usernames/passwords stored in database Windows authentication NTLM challenge/response protocol Authentication mode controlled by web.config configuration file User.Identity.Name property encapsulates user name access

36 Portal Authorization Role based security used to control whether or not user has access rights Tabs/Modules maintain role ACL lists Users can be grouped within many roles Examples: Devs, Admins, VPs, Friends Role mappings stored within database Not tied to NT Domains/Active DS UserDB.GetRoles(User as String) stored in ‘ portalroles ’ Ticket + populate Context.User

37 DB Schema

38 Role Checks Current user’s role mappings set for request within Global.asax Application_AuthenticateRequest event Context.User = New GenericPrincipal(roles) Encrypted Http cookie caches DB role lookup User.IsInRole can be used to verify whether current user is in role Works from all pages, controls, classes If (User.IsInRole(“Admin”)) Then …

39 Windows Authentication demo demo

40 Portal Extension Idea’s Home Work Data Access Helper Block Centralize connection management Expose methods for CRUD operations Microsoft Data Access Application Block Download from msdn.microsoft.com/practices Role-based Authorization based on AD System.DirectoryServices Extend Modules Overwrite default Caching (0) Personalization on Module Level Personalization In Mobile Modules...

41 Summary ASP.NET Starter Kits Sample ASP.NET Applications Download www.asp.net/StarterKitswww.asp.net/StarterKits Feel to reuse code – impress your boss! ASP.NET Portal Starter Kit Pluggable framework 10 basic portal modules Extendable with custom portal modules Forms/Windows Authentication + Roles-based Authorization Online Admin VB.NET and C# versions available

42 Resources ASP.net www.asp.net ASP.net Starter Kits Download the Portal kit here www.asp.net/starterkits ASP.NET Portal Starter Kit Forum http://www.asp.net/StarterKits/StarterKitRedirect.aspx?Item=PortalForum Hosting your Starter Kits www.hostbasket.com and others Third party sites www.snowcovered.com www.dotnetnuke.com Feedback guntherb@microsoft.com

43 Ask The Experts Get Your Questions Answered Check out Visual Studio.NET Booth Get your ASP.NET Questions answered Get your ASP.NET Portal Starter Kit Questions answered. C U there on Thu July 3 13:00h -15:00h

44 Community Resources http://www.microsoft.com/communities/default.mspx Most Valuable Professional (MVP) http://www.mvp.support.microsoft.com/ Newsgroups Converse online with Microsoft Newsgroups, including Worldwide http://www.microsoft.com/communities/newsgroups/default.mspx User Groups Meet and learn with your peers http://www.microsoft.com/communities/usergroups/default.mspx

45 evaluations evaluations

46 © 2003 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS SUMMARY.

47 Boneyard slides

48 Multiple Device Support

49 Client Support ASP.NET Portal Starter Kit supports two broad categories of visiting clients: Desktop Browsers Internet Explorer, Netscape, Opera, etc Mobile Devices Pocket PC, WAP/WML Phones, iMode, etc Portal Module implementations are typically written for one client category Different screen real-estate requirements Separate desktop and mobile user controls share same classes and data model

50 Mobile Portal Modules Mobile Modules are implemented as ASP.NET User Controls (.ascx files) Use mobile internet toolkit server controls aka ASP.NET Mobile User Controls Inherit MobilePortalModuleControl custom control base class Defines additional custom methods and properties specific to portals Example Properties: PortalId, ModuleId, IsEditable, ModuleConfiguration Optionally use helper control to provide consistent UI

51 Building Mobile Modules Drill-down Default.aspx Master portal page that makes desktop vs. mobile device check MobileDefault.aspx Page responsible for dynamically loading and populating user controls for mobile devices Contacts.ascx Mobile Module User Control


Download ppt "DEV306 ASP.NET Portal Starter Kit Under The Hood Gunther Beersaerts Technical Specialist Microsoft Corporation."

Similar presentations


Ads by Google