/* * Copyright 2005 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ using System.Collections; using Agility.Core; using Nexus.Core.Helpers; using Nexus.Core.Tables; namespace Nexus.Core { /// /// Extend ICatalog to automatically set IFieldTable, /// IMessageTable and provide convenience methods [OVR-8]. /// /// public interface IRequestCatalog : ICatalog { /// /// Provide the FieldTable for this Catalog. /// ///

/// The GetRequest methods "stamp" the Context /// with a reference to the FieldTable, /// among other things. ///

IFieldTable FieldTable { get; set; } /// /// Execute before a Command called via ExecuteView. /// ///

/// Of course, a IRequestChain may be used here too. ///

/// IRequestCommand PreOp { get; set; } /// /// Execute after a Command called via ExecuteView. /// ///

/// Of course, a IRequestChain may be used here too. ///

/// IRequestCommand PostOp { get; set; } /// /// Default IViewHelper instance for this Catalog. /// ///

/// Set in catalogs for applications that use ViewHelpers. /// The object should be a non-singleton instance ("protype"). /// Used by GetHelperFor. ///

/// IViewHelper ViewHelper { get; set; } /// /// Obtain an object for ID. /// /// Our object ID /// object for name object GetObject(string name); /// /// Obtain a default IViewHelper instance, /// configured for the specified command. /// /// The Command ID /// Helper instance for command IViewHelper GetHelperFor(string command); /// /// Obtain Command and verify that instance is a IRequestCommand. /// /// Command ID /// IRequestCommand instance for name /// /// Throws Exception if name is null, /// name is not in catalog, /// or if instance for name is not a IRequestCommand /// IRequestCommand GetRequestCommand(string command); /// /// Obtain a IRequestContext for command ID, /// including embedded resources like the FieldTable, /// /// Our command ID /// IRequestContext with embedded resources. /// IRequestContext GetRequestContext(string name); /// /// Obtain a IRequestContext for command ID, /// including embedded resources like the FieldTable, /// and process string-based input. /// /// Our command ID /// Our input values /// IRequestContext with embedded resources. /// IRequestContext GetRequestContext(string name, IDictionary input); /// /// Obtain a IRequestContext for the command, /// including embedded resources. /// /// Our command /// IRequestContext with embedded resources. /// IRequestContext GetRequestContext(IRequestCommand command); /// /// Obtain and execute a IRequestContext. /// /// Our command ID /// Context after execution /// IRequestContext ExecuteRequest(string name); /// /// Execute a IRequestContext. /// /// Context to execute /// void ExecuteRequest(IRequestContext context); /// /// Execute a IRequestContext as part of a chain /// created with the PreOp and PostOp commands (if any). /// ///

/// Among other things, the PreOp/PostOp chain may transfer /// data between the Criteria and the root Context. ///

/// The PreOp/PostOp chain acts as a Front Controller /// in that it ensures certain tasks are perform /// upon every request. ///

/// IViewHelper implementations are expected to /// call ExecuteView to "invoke the Helper's command". ///

/// Context to execute /// void ExecuteView(IRequestContext context); } }