MonoRail


Table of Contents

1. Introduction
1.1. Overview
1.2. Background
1.2.1. What is MVC
Model
View
Controller
1.3. Why Use MonoRail
1.3.1. Convention Over Configuration
1.3.2. Container support
1.3.3. Testability
1.4. How It Works
1.5. Licence Information
1.6. Support
2. Getting Started
2.1. Introduction
2.2. Requirements
2.3. Creating the Project Skeleton
2.3.1. Using the MonoRail Project Wizard
2.3.2. Creating the Project Manually
Create the Project
Reference the MonoRail Assemblies
Create the Project Folders
Configuration
2.4. Controllers, Actions and Views
2.4.1. Your First Controller
2.4.2. The Index Action and View
2.4.3. Setting the Layout and Rescue
2.4.4. Creating the Layout
2.4.5. Seeing the Results
2.4.6. Passing Values to a View
2.4.7. Creating a Rescue
2.5. Data Binding
2.5.1. Simple Parameters
2.5.2. Complex Objects
2.6. Integrating with ActiveRecord
2.6.1. Adding Assemblies
2.6.2. Configuration
2.6.3. Building the Model
2.6.4. Initializing the Handler
2.6.5. ActiveRecord Scaffolding
Adding Assemblies
Creating the Controller
Viewing the Result
2.6.6. Creating CRUD Pages Using DataBind
Presenting the List
Creating
Updating
Deleting
2.7. Final Comments
3. Installation
3.1. Introduction
3.2. Running Under IIS
3.3. Using Casini
3.4. Mono with XSP
3.5. Mono with Apache
3.5.1. Configuration
3.5.2. Apache Httpd2
3.5.3. Application Deployment
3.6. Deploying to a Shared Host
4. Configuration
4.1. Introduction
4.2. Formal Definition
4.2.1. The monorail Node
4.2.2. The controllers Node
4.2.3. The viewcomponents Node
4.2.4. The viewEngine Node
The additionalSources Node
4.2.5. The services Node
4.2.6. The extensions Node
4.2.7. The routing Node
5. Controllers
5.1. Introduction
5.2. Naming Convention
5.3. Areas
5.4. Actions
5.4.1. Default Action
5.5. Redirecting
5.6. Other Useful Properties
5.7. Data Binding
5.7.1. The SmartDispatchController
5.7.2. Simple Parameter Binding
DateTime Properties
Nullable Support
Array Support
5.7.3. Custom Binding
The DataBind Attribute
Nested Objects
Array Support
Generic Lists
Setting the Binding Source
Defining Accessible Properties
Binding Errors
BindObject and BindObjectInstance
Supported Types
FormHelper
5.8. Wizards
5.8.1. Wizard Controllers
5.8.2. Wizard Action Provider
5.8.3. Steps
5.8.4. Nested Actions
5.8.5. DoNavigate
5.8.6. Conditional Steps
5.8.7. The WizardHelper
5.8.8. Windsor Integration
6. Views
6.1. Introduction
6.2. Folder Structure Convention
6.3. Selecting a View to Render
6.4. Passing Values to a View
6.4.1. The PropertyBag
6.4.2. Flash
6.5. Shared Views
6.6. Cancelling a View
6.7. Accessing Values Passed by the Controller
6.8. Javascript and Ajax
6.8.1. Javascript Generation
6.8.2. JSON
6.8.3. The JSON Binder
7. View Components
7.1. Introduction
7.2. Creating a View Component
7.3. Using View Components
7.4. Passing Parameters
7.5. Block and Nested Sections
7.6. Built In View Components
7.6.1. CaptureFor
7.6.2. SecurityComponent
7.6.3. DiggStylePaginationComponent
Basic Usage
Customizing Captions
Suppressing Display
Changing Link Styles
Changing the Number of Links Displayed
Customizing Actions
7.6.4. ColumnRenderer
7.6.5. AuthenticatedContent
7.6.6. ChildContentComponent
7.6.7. UpdatePage and UpdatePageTag
7.6.8. Validator
8. View Engines
8.1. Introduction
8.2. View Engine Comparison
8.3. NVelocity
8.3.1. NVelocity files
8.3.2. Layouts
8.3.3. Configuration
8.3.4. Macros
8.3.5. Fancy foreach Loops
8.3.6. NVelocityViewEngine Variables
8.3.7. Accessing the PropertyBag
8.3.8. ViewComponent Support
Passing Parameters in a Dictionary
Key/Value Pairs
Data Type Handling
A Simple Example
8.4. WebForms
8.4.1. Layouts
8.5. Brail
8.5.1. Getting Started
Referencing Assemblies
Configuration
Using It
8.5.2. Principal of Least Surprise
8.5.3. Configuration
8.5.4. Code Separators
8.5.5. Output Methods
8.5.6. Using Variables
8.5.7. Sub Views
8.5.8. Importing Content From Files
8.5.. Principle of Least Surprise
8.5.10. Common Scripts
8.5.11. Symbols and Dictionaries
8.5.12. Layouts
8.5.13. Performance
Referencing Assemblies
Auto Imports
8.5.14. ViewComponent Support
8.5.15. Troubleshooting
8.5.16. Code Separators
8.5.17. How Brail Works
Processing Requests
Compiling Scripts
BrailBase Class
8.6. Composite View Engine
8.7. Working With Multiple View Engines
9. Filters
9.1. Introduction
9.2. Creating a Filter
9.3. Ordering
9.4. Skipping Filters
9.5. Passing Parameters
10. Layouts
10.1. Introduction
10.2. Using Layouts
11. Rescues
11.1. Introduction
11.2. Using Rescues
12. Authentication and Authorization
12.1. Introduction
12.2. Forms Authentication
12.3. Filters
12.4. Using PrincipalPermission
12.5. The SecurityView Component
13. Helpers
13.1. Introduction
13.2. Creating Customer Helpers
13.3. Built In Helpers
13.3.1. FormHelper
Getting Started
Complex Objects
Arrays
Working with Sets
Generating Selects
Creating Checkbox Lists
13.3.2. UrlHelper
Generating URLs
Generating Links
Generating Button Links
13.3.3. AjaxHelper
Common Parameters
Using It
Using the Behavior Library
Javascript Action Proxies
LinkToFunction and ButtonToFunction
LinkToRemote and ButtonToRemote
Remote Form
Observers
Periodical Updates
Autocompletion
13.3.4. Behavior Helper
13.3.5. ScriptaculousHelper
13.3.6. PaginationHelper
Standard Paging
Cached Paging
13.3.7. WizardHelper
13.3.8. TextHelper
13.3.9. Effects2Helper
13.3.10. DateFormatHelper
14. Resources and Localization
14.1. Introduction
14.2. Using Resources
14.3. Setting Up the Current Culure
14.4. Localization
15. Validation Support
16. Sending Email
17. Unit Testing
17.1. Introduction
17.2. The TestSupport Assembly
17.3. Setting Up a Test Project
17.3.1. A simple example from MonoRail test case
18. Integrations
18.1. Introduction
18.2. ActiveRecord
18.2.1. The Main Players
ARSmartDispatcherController
ARDataBindAttribute and ARDataBinder
ARFetchAttribute
18.2.2. DataBinding with ActiveRecord
DataBinding Issues
Possible Solutions
18.3. ActiveRecord Scaffolding
18.3.1. Required Assemblies
18.3.2. ScaffoldingAttribute
18.3.3. List
18.3.4. Add
18.3.5. Edit
18.3.6. Remove
18.3.7. Complex Models
18.4. Windsor Container
18.4.1. Benefits
18.4.2. Required Assemblies
18.4.3. Configuration
18.4.4. Exposing the Container
18.4.5. Initializing
19. Advanced Topics
19.1. Introduction
19.2. Security
19.3. Routing
19.3.1. Configuration
19.3.2. Root Directory Mapping Workaround
19.3.3. Another Approach
19.3.4. Additional Information
19.4. Caching Support
19.5. Transformation Filters
19.6. Dynamic Actions
19.6.1. Dynamic Action Providers
19.7. Scaffolding
19.8. Extensions
19.8.1. Creating Custom Extensions
19.8.2. Built In Extensions
Custom Session Extension
Exception Chaining Extension
19.9. Service Architecture
19.9.1. How It Works
19.9.2. Lifecycle Interfaces
19.9.3. Registering Services
19.9.4. Built-In Services
MonoRailConfiguration
ExtensionManager
IViewSourceLoader
IViewEngine
IScaffoldingSupport
IControllerFactory
IViewComponentFactory
IFilterFactory
IResourceFactory
IEmailSender
IEmailTemplateService
IControllerDescriptorProvider
IResourceDescriptorProvider
IRescueDescriptorProvider
ILayoutDescriptorProvider
IHelperDescriptorProvider
IFilterDescriptorProvider
IControllerTree
ICacheProvider
19.10. Custom Bindable Parameters
19.11. Using Resources to Store Views
19.12. Enabling Logging