Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

Real - World ASP .NET—Building a Content Management System - StephenR. G. Fraser

.pdf
Скачиваний:
67
Добавлен:
24.05.2014
Размер:
4.59 Mб
Скачать

Figure 9-25: The Note Web page

Figure 9-26: Submitting content

Figure 9-27: Listing the editor's content

Figure 9-28: Withdrawing as the editor

Figure 9-29: Returning content to the author

Figure 9-30: Listing the approver's content

Figure 9-31: Canceling content

Figure 9-32: The deployer's content list

Figure 9-33: Deploying the content

Figure 9-34: Updating priorities

Figure 9-35: Starting and stopping the Web site

Figure 9-36: Your first CMS.NET story

Chapter 10: Initializing CMS.NET

Figure 10-1: The administration Web page stub

Figure 10-2: Setup/setup.aspx

Figure 10-3: Setup/setup2.aspx

Figure 10-4: Setup/setup3.aspx

Figure 10-5: The CMSNET Account table

Figure 10-6: The CMSNET AccountProperty table

Figure 10-7: Setup/setup4.aspx

Chapter 11: Getting Content into the System

Figure 11-1: Standard Web page frames

Figure 11-2: The Select a Frameset Template dialog box

Figure 11-3: The Select Page dialog box

Figure 11-4: Your CMS.NET Administration Web page

Figure 11-5: The AutList Web page when empty

Figure 11-6: The AutList Web page with content

Figure 11-7: The AutCreate Web page

Figure 11-8: .NET's error page of shame

Figure 11-9: The AutUpdate Web page

Figure 11-10: The AutView Web page

Figure 11-11: The AutView Web page

Figure 11-12: The AutRemove Web page

Figure 11-13: The AutSubmit Web page

Chapter 12: Cookies, Authentication, Authorization, and Encryption

Figure 12-1: CMS.NET's security flow Figure 12-2: The login Web page

Figure 12-3: The Logout button on the NavBar Figure 12-4: The AdmAcntList Web page Figure 12-5: The AdmAcntCreate Web page Figure 12-6: The AdmAcntUpdate Web page Figure 12-7: The AdmAcntRemove Web page Figure 12-8: The AdmAcntView Web page

Chapter 13: Displaying Dynamic Content

Figure 13-1: Developer Content domain zones

Figure 13-2: Management Content domain zones

Figure 13-3: Managed C++ book story

Figure 13-4: "The page cannot be found" error

Figure 13-5: The "I'm changing" page

Figure 13-6: The AdmShutdown Web page

Figure 13-7: Domain database for CMS.NET

Figure 13-8: Zone database for CMS.NET

Figure 13-9: Distribution database for CMS.NET

Figure 13-10: The standard Web page layout

Figure 13-11: The CMS.NET home page

Figure 13-12: The Content Web form

Figure 13-13: The Zone Web form

Figure 13-14: The Story Web form Figure 13-15: The Deploy Web page

Chapter 14: Using a Workflow to Enter Content

Figure 14-1: The content development workflow Figure 14-2: The Elaborate Web page

Figure 14-3: The NotesList Web page Figure 14-4: The AutList Web page Figure 14-5: The EdList Web page Figure 14-6: The EdEdit Web page Figure 14-7: The EdWithdraw Web page Figure 14-8: The EdReturn Web page Figure 14-9: The AppList Web page

Figure 14-10: The AppApprove Web page Figure 14-11: The AppReturn Web page Figure 14-12: The AppDiscont Web page Figure 14-13: The DeployList Web page Figure 14-14: The DeployDeploy Web page

Chapter 15: Registered Users and Protected Content

Figure 15-1: The Register Web page Figure 15-2: The Login User Control Figure 15-3: Login for Administration

Figure 15-4: Login for Web site user authentication Figure 15-5: The Logout User Control

Figure 15-6: Updating the Domain database table

Figure 15-7: The HomePg Web page with Login User Control Figure 15-8: The HomePg Web page with Logout User Control

List of Tables

Chapter 6: ASP.NET, C#, and Visual Studio .NET

Table 6-1: Intrinsic Controls in Listing 6-1

Chapter 7: Database Development and ADO.NET

Table 7-1: Authors Database Column Descriptions

Table 7-2: Content Database Column Descriptions Table 7-3: Author Data

Table 7-4: Content Data

Table 7-5: Dynamic Content CMA Design

Chapter 11: Getting Content into the System

Table 11-1: Content Database Table Design

Chapter 12: Cookies, Authentication, Authorization, and

Encryption

Table 12-1: AccountRoles Database Table Design

Chapter 13: Displaying Dynamic Content

Table 13-1: Domain Database Table Design Table 13-2: Zone Database Table Design Table 13-3: Distribution Database Table Design

Chapter 14: Using a Workflow to Enter Content

Table 14-1: The ContentNotes Database Table Design

Chapter 15: Registered Users and Protected Content

Table 15-1: The Protected Database Column

List of Listings

Chapter 5: Basics of Web Architecture

Listing 5-1: The HTTP Request

Listing 5-2: The HTTP Response Listing 5-3: Some Basic HTML

Chapter 6: ASP.NET, C#, and Visual Studio .NET

Listing 6-1: DCViewer.aspx

Listing 6-2: The Default DCViewer.cs

Listing 6-3: Fix the Headline get Statement in Content.cs Listing 6-4: Fix the Story get Statement in Content.cs Listing 6-5: Update the Content Constructor in Content.cs Listing 6-6: Content.cs

Listing 6-7: Declaring an Array of Stories

Listing 6-8: Loading the Array of Stories

Listing 6-9: Loading a Drop-Down List Using <asp:ListItem>

Listing 6-10: Loading a Drop-Down List Using the DataSource Property Listing 6-11: Loading a Drop-Down List Using the Items Property Listing 6-12: Displaying the Selected Story Using a Label

Listing 6-13: Displaying the Selected Story Using a Label Listing 6-14: DCViewer.cs

Chapter 7: Database Development and ADO.NET

Listing 7-1: Getting Data from Two Tables Listing 7-2: Default Stored Procedure Code Listing 7-3: Setting the Parameters

Listing 7-4: InsertAuthor Stored Procedure Listing 7-5: ADOToList.cs

Listing 7-6: ADOToGrid.cs Listing 7-7: ADOToGrid.aspx Listing 7-8: DCCMA.aspx

Listing 7-9: Populating the Author Drop-Down List in DCCMA Listing 7-10: Clearing a Web Form

Listing 7-11: The InsertContent Stored Procedure Listing 7-12: DCCMA.cs

Listing 7-13: DCViewer.aspx Listing 7-14: DCViewer.cs

Chapter 8: XML

Listing 8-1: Content.xml

Listing 8-2: ReadXML.cs

Listing 8-3: WriteXML.cs

Listing 8-4: Authors.xml

Listing 8-5: The UpdateXML Codebehind Listing 8-6: The XML Menu Structure Listing 8-7: MainMenu.xml

Listing 8-8: Menu.cs

Chapter 10: Initializing CMS.NET

Listing 10-1: Admin.aspx

Listing 10-2: The Admin.Page_Load Method

Listing 10-3: The setup.bnContinue_Click Method

Listing 10-4: CMS.NET's web.config <appSettings>

Listing 10-5: The Namespaces and AppEnv Constructor Method Listing 10-6: The AppEnv.GetAppSetting Method

Listing 10-7: The AppEnv.GetConnection Method Listing 10-8: The Setup3.Page_Init Method Listing 10-9: The Setup3.Page_Load Method

Listing 10-10: The Setup3 ProcessAdministratorName Method Listing 10-11: The Account Constructor Method

Listing 10-12: The Account.Insert() Method

Listing 10-13: The Account.Update() Method Listing 10-14: The Account.Exist() Method

Listing 10-15: The Account_Insert Stored Procedure

Listing 10-16: The UpdateAccount Stored Procedure

Listing 10-17: The AccountProperty Constructor Method

Listing 10-18: The AccountProperty.Insert() Method

Listing 10-19: The AccountProperty.Update() Method

Listing 10-20: The AccountProperty_Insert Stored Procedure

Listing 10-21: The UpdateAccountProperty Stored Procedure

Listing 10-22: The setup4.Page_load Method

Listing 10-23: The setup4.btnLogin_Click Method

Chapter 11: Getting Content into the System

Listing 11-1: CMAMenu.xml

Listing 11-2: Adding Target to the Hyperlink Listing 11-3: The AutList.aspx Header Design Listing 11-4: The AutList.cs Empty Content Code Listing 11-5: The AutList.cs Content List Code

Listing 11-6: The AutList.cs BuildImageButton Code Listing 11-7: The AutList.cs btn_Click Code

Listing 11-8: The AutCreate Web Form

Listing 11-9: The AutCreate Page_Load Method

Listing 11-10: The Content Database Helper Insert and NextContentID Methods Listing 11-11: The Revised AutCreate's Page_Load Method

Listing 11-12: The AutUpdate Web Design

Listing 11-13: The AutUpdate Web Page Codebehind

Listing 11-14: The Update and GetContentForID Content Database Helper Methods Listing 11-15: The AutView Web Design

Listing 11-16: The AutView Loading View Table

Listing 11-17: The AutView's BuildPage Method Listing 11-18: The AutRemove Web Design

Listing 11-19: The AutRemove Web Page Codebehind

Listing 11-20: The Content Database Table Helper RemoveContent Listing 11-21: The AutSubmit Web Design

Listing 11-22: The AutSubmit bnSubmit_Click Method

Listing 11-23: The Content Database Table Helper SetStatus

Chapter 12: Cookies, Authentication, Authorization, and Encryption

Listing 12-1: Root Directory web.config Authentication Updates Listing 12-2: Subdirectory-Specific web.config

Listing 12-3: The Login Web Page

Listing 12-4: The Login Codebehind Page_Load Method

Listing 12-5: The Account.Authenticated Database Helper Method Listing 12-6: The NavBar Codebehind bnLogout_Click Method Listing 12-7: The web.config Authorization Element

Listing 12-8: Changes to Admin.aspx to Add Authorization Listing 12-9: CMSNET.Common.AuthorizedPage

Listing 12-10: The AccountRoles.Authorization Method

Listing 12-11: The Setup3 Codebehind Page_Load Method Authorization Changes Listing 12-12: The New Setup3 Codebehind ProcessAccountRoles Method

Listing 12-13: The AccountRoles Database Helper Insert Method Listing 12-14: SHA1 Password-Encrypted Credentials

Listing 12-15: Account Database Helper Insert Method with Encryption Listing 12-16: Account Database Helper Update Method with Encryption

Listing 12-17: Account Database Helper Authenticated Method with Encryption Listing 12-18: Updated CMAMenu.xml with Authorization

Listing 12-19: NavBar Updated Codebehind with Authorization

Listing 12-20: The AdmAcntList Codebehind for Administrator Scenarios Listing 12-21: The Multiselect List Box

Listing 12-22: The AdmAcntCreate Codebehind

Listing 12-23: The AdmAcntUpdate Codebehind

Listing 12-24: The AccountProperty Database Table Helper GetValue Method

Chapter 13: Displaying Dynamic Content

Listing 13-1: The Default.aspx Codebehind

Listing 13-2: The AdmShutdown Page_Load Method Listing 13-3: The AdmShutdown bnStartStop_Click Method Listing 13-4: The Header User Control Design Code

Listing 13-5: The Header User Control Codebehind Page_Load Method Listing 13-6: The Header User Control Codebehind Level Property Listing 13-7: The NavBar User Control Design Code

Listing 13-8: The NavBar User Control Codebehind

Listing 13-9: The Footer User Control Design Code

Listing 13-10: The Footer User Control Codebehind Listing 13-11: The Home Page Design Code

Listing 13-12: The Home Page ASP.NET Codebehind

Listing 13-13: The HeadlineTeaser User Control Design Code Listing 13-14: The HeadlineTeaser User Control Codebehind Listing 13-15: The Content Page Design Code

Listing 13-16: The Content Web Page Codebehind Listing 13-17: The Zone Page Design Code Listing 13-18: The Zone Web Page Codebehind Listing 13-19: The Story Page Design Code Listing 13-20: The Story Web Page Codebehind

Chapter 14: Using a Workflow to Enter Content

Listing 14-1: The Elaborate Web Page's HTML Listing 14-2: The EmailAlert Class

Listing 14-3: Restricting Content to the Current Author Only

Listing 14-4: Content Database Helper GetHeadlinesForAuth Method Listing 14-5: The AutList Web Page Drop-Down List

Listing 14-6: User-Determined Reduction of Visible Content in the AutList Method Listing 14-7: Adding the Status to AutList Web Page

Listing 14-8: The StatusCodes Common Utility Class Listing 14-9: The AutSubmit New Codebehind Listing 14-10: The EdList Web Page Drop-Down Box Listing 14-11: The EdList Codebehind

Listing 14-12: Content Database Helper GetHeadlinesForEdit Method Listing 14-13: The EdEdit Codebehind

Listing 14-14: The Content Database Helper SetEditor Method Listing 14-15: The EdWithdraw Codebehind

Listing 14-16: The EdReturn Codebehind Listing 14-17: The AppApprove Codebehind Listing 14-18: The AppDiscont Codebehind Listing 14-19: The DeployList Codebehind Listing 14-20: The DeployDeploy Codebehind

Chapter 15: Registered Users and Protected Content

Listing 15-1: The CMS.NET Privacy Policy Listing 15-2: The Register Codebehind Listing 15-3: The Login User Control Design

Listing 15-4: The Login User Content Codebehind Listing 15-5: The Login Web Page Design

Listing 15-6: The Login Web Page Codebehind Listing 15-7: The Logout User Content Codebehind

Listing 15-8: The DeployDeploy Codebehind, Protecting Content by the Zone's Protection Value

Listing 15-9: The Zone Database Helper Methods Checking for a Protected Row Listing 15-10: The CDA/Protected web.config File

Listing 15-11: The HomePg Web Page Design

Listing 15-12: The HomePg Codebehind for Viewing Login and Logout User Controls Listing 15-13: The NavBar Codebehind for Referencing Protected domains

Listing 15-14: The StoryPg Codebehind for Verifying Content Protection

Соседние файлы в предмете Программирование