Skip to content

clsAppControllerBase

clsAppControllerBase is a thin, MustInherit extension of clsControllerBase (from SAIF.Presentation.Web.MVC, not SAIF.Framework) that adds SAIF-specific conventions used across consuming applications' own controller classes: a standard save/delete write-status enumeration, a conventional menu-control name constant, and a numeric-menu-context postback validation helper.

Purpose

  • Supply a shared WriteStatus enumeration (Failure/NoChanges/Successful) so consuming controllers report save outcomes consistently.
  • Validate that a numeric menu-context value posted back from the SAIF menu control is present and well-formed, via IsValidNumericMenuContext.

Context

  • Namespace: SAIF.Presentation.Web.Core
  • Assembly/package: SAIF.Presentation.Web.Core.Infragistics103 (merged into SAIF.BOF.Presentation.Web.Infragistics103 NuGet package)

Public members

Member Signature Purpose
WriteStatus Public Enum WriteStatus As Integer { Failure = -1, NoChanges = 0, Successful = 1 } Standard tri-state outcome used by consuming controllers to report the result of a save/write operation.
SAIFMENU Public SAIFMENU As String = "SAIFMenu1" Conventional control-name constant identifying the SAIF menu control, used as the default key for menu-context postback lookups.
New(inApplicationName, inFactory, inSupportsMultiModel) Sub New(inApplicationName As String, inFactory As clsFactoryBase, Optional inSupportsMultiModel As Boolean = True) Forwards construction arguments to the base clsControllerBase constructor unchanged.

Inherited public members

Members in this section are inherited from clsControllerBase in SAIF.Presentation.Web.MVC (not SAIF.Framework). All entries are retrieved from SAIF.Presentation.Web.MVC's own documentation and are listed here directly so this page is self-contained; see that library's clsControllerBase API reference for full detail.

From clsControllerBase (SAIF.Presentation.Web.MVC)

Member Signature Purpose Origin
ApplicationName Public ReadOnly Property ApplicationName() As String The application name this controller instance is scoped to, set at construction time.† SAIF.Presentation.Web.MVC — clsControllerBase
CurrentView Public ReadOnly Property CurrentView() As String The current request's page file name (e.g., Default.aspx), parsed from Request.Path.† SAIF.Presentation.Web.MVC — clsControllerBase
IsPostBack Public ReadOnly Property IsPostBack() As Boolean Delegates to the hosting ViewPageBase.IsPostBack().† SAIF.Presentation.Web.MVC — clsControllerBase
IsSessionTimedOut Public ReadOnly Property IsSessionTimedOut() As Boolean True when the request IsPostBack and Session.IsNewSession — the session-timeout trigger condition.† SAIF.Presentation.Web.MVC — clsControllerBase
IsInsideClient Public ReadOnly Property IsInsideClient() As Boolean True if the caller's host address matches 10.*, 131.131.*.*, or 127.0.0.1.† SAIF.Presentation.Web.MVC — clsControllerBase
Model Public ReadOnly Property Model() As clsModelBase Lazily resolves the current model, reusing the session-cached model keyed by ViewID & MODEL_SUFFIX if present, otherwise calling m_factory.GetModel().† SAIF.Presentation.Web.MVC — clsControllerBase
SupportsMultiModel Public Property SupportsMultiModel() As Boolean (setter is Private) Whether this controller was configured to support multiple concurrent model instances; gates Navigate2.† SAIF.Presentation.Web.MVC — clsControllerBase
PostBackControlName Public ReadOnly Property PostBackControlName() As String The name of the control that triggered the current postback, resolved via GetPostBackControlName().† SAIF.Presentation.Web.MVC — clsControllerBase
ViewData Public ReadOnly Property ViewData() As System.Collections.Specialized.HybridDictionary Lazily resolves the current view's session-stored data dictionary, keyed by ViewID & VIEWDATA_SUFFIX.† SAIF.Presentation.Web.MVC — clsControllerBase
GetPostBackControlName Public Function GetPostBackControlName() As String Inspects the posted form collection and current page's control tree to determine which control initiated the postback.† SAIF.Presentation.Web.MVC — clsControllerBase
Navigate Public Function Navigate(ByVal TargetApp As String, ByVal TargetView As String, Optional ByVal Popup As Boolean = False, Optional ByVal PopupFeatures As String = "height=505,width=641,left=10,top=10,location=no,menubar=no,resizable=no,scrollbars=no,titlebar=yes,toolbar=no", Optional ByVal FocusOnChild As Boolean = True, Optional ByVal inWindowName As String = "", Optional ByVal inNewModel As String = "") As Boolean Navigates to a target application/view, persisting context to the Context table when crossing application boundaries.† SAIF.Presentation.Web.MVC — clsControllerBase
Navigate2() Public Function Navigate2(Optional ByVal inPopup As Boolean = True, Optional ByVal inPopupFeatures As String = "", Optional ByVal inFocusOnChild As Boolean = True, Optional ByVal inWindowName As String = "") As Boolean Overload that calls the full Navigate2 with the current ApplicationName/CurrentView as target.† SAIF.Presentation.Web.MVC — clsControllerBase
Navigate2 (target application and view overload) Public Function Navigate2(ByVal inTargetApplication As String, ByVal inTargetView As String, Optional ByVal inPopup As Boolean = True, Optional ByVal inPopupFeatures As String = "", Optional ByVal inFocusOnChild As Boolean = True, Optional ByVal inWindowName As String = "") As Boolean Creates a brand-new model/view-data pair in session and navigates to it; requires SupportsMultiModel, otherwise throws ApplicationException.† SAIF.Presentation.Web.MVC — clsControllerBase
SecurityCheck Public Sub SecurityCheck() Verifies/establishes an authenticated clsSecurityPrincipal on Model.Context.† SAIF.Presentation.Web.MVC — clsControllerBase
Write Public Overridable Function Write() As Boolean Calls Model.Write().† SAIF.Presentation.Web.MVC — clsControllerBase
New(ApplicationName, Factory, inSupportsMultiModel) Public Sub New(ByVal ApplicationName As String, ByVal Factory As clsFactoryBase, Optional ByVal inSupportsMultiModel As Boolean = False) Stores the factory/application name, captures the current HttpContext, and configures clsLogTrace tracing from the TraceLogging/PageTraceOn/TraceUser AppSettings keys.† SAIF.Presentation.Web.MVC — clsControllerBase

Inherited protected/friend members

The following non-public members are also inherited from clsControllerBase (SAIF.Presentation.Web.MVC) and are available to clsAppControllerBase-derived controller code but are not part of the public surface.

Member Signature Purpose Origin
HandleContext Protected Friend MustOverride Sub HandleContext(ByVal inContext As Hashtable) Abstract hook the concrete controller implements to consume context values retrieved during cross-application context hand-off.† SAIF.Presentation.Web.MVC — clsControllerBase
OnNewModel Protected Friend Overridable Function OnNewModel(ByRef inNewModel As clsModelBase, ByRef inNewViewData As HybridDictionary) As Boolean Overridable hook letting the concrete controller copy state from the old model to a newly created one during Navigate2; returns True by default.† SAIF.Presentation.Web.MVC — clsControllerBase
HandleQuerystring Protected Friend Overridable Sub HandleQuerystring(ByVal inQueryString As NameValueCollection) Overridable hook for query-string processing during Initialize(); no-op by default.† SAIF.Presentation.Web.MVC — clsControllerBase
Load Protected Friend Overridable Sub Load() Overridable hook invoked during Initialize(); no-op by default.† SAIF.Presentation.Web.MVC — clsControllerBase
Retrieve Protected Friend MustOverride Sub Retrieve(ByVal inControls As Hashtable, ByVal inTargetView As String) Abstract hook the concrete controller implements to populate page controls from model data; invoked by CallRetrieve().† SAIF.Presentation.Web.MVC — clsControllerBase
HandleErrors() Protected Friend Sub HandleErrors() Overload that forwards m_HttpContext.Error to HandleErrors(ex).† SAIF.Presentation.Web.MVC — clsControllerBase
HandleErrors(inEx) Protected Friend Sub HandleErrors(ByVal inEx As Exception) Logs and e-mails the exception via clsLogError.CreateErrorWithEmail, resolves an error page, then redirects with MSG=/Return= query parameters.† SAIF.Presentation.Web.MVC — clsControllerBase
CallRetrieve Friend Sub CallRetrieve() Reflects over the current page's controls (GetInControls) and invokes the abstract Retrieve(controls, targetView) hook.† SAIF.Presentation.Web.MVC — clsControllerBase
CheckContext Protected Sub CheckContext(ByVal inAppPath As String) Derives source/current application names from the referrer and current path and, if they differ, retrieves and consumes hand-off context.† SAIF.Presentation.Web.MVC — clsControllerBase
CheckContextViewID Friend Function CheckContextViewID() As String Resolves the SAIFPID_NAME context value for the current session via clsContext.GetPID.† SAIF.Presentation.Web.MVC — clsControllerBase
Initialize Protected Friend Sub Initialize() Orchestrates the full request-initialization sequence.† SAIF.Presentation.Web.MVC — clsControllerBase
UnInitialize Protected Friend Sub UnInitialize() Persists the current Model and ViewData into Session, called from ViewPageBase.Page_Unload.† SAIF.Presentation.Web.MVC — clsControllerBase

Protected members

Member Signature Purpose
IsValidNumericMenuContext Protected Function IsValidNumericMenuContext(inControls As System.Collections.Hashtable, Optional inMenuName As String = "SAIFMenu1") As Boolean Returns True only on postback when the named menu-context control value in inControls is present, numeric, and greater than "0"; used by descendant controllers to validate the current menu-item context before proceeding.

Behavioral notes

  • IsValidNumericMenuContext performs a string comparison (inControls.Item(inMenuName).ToString > "0") rather than a numeric one after confirming IsNumeric, which is sufficient for typical positive integer menu-context values but is a lexical, not numeric, comparison*.

Constraints and usage notes

  • clsAppControllerBase is MustInherit; consuming applications define their own concrete controller classes deriving from it.
  • A source-code comment notes an intended future validator for claim-number context that has not been implemented.

Note: Statements marked with † are derived from dependency library documentation via the Legends CLI. Statements marked with * were inferred from code structure or contextual evidence. Statements marked with ** could not be confirmed; treat as unknown until verified.

Sources

  • SAIF.Presentation.Web.Core.Infragistics103\clsAppControllerBase.vb