Skip to content

Resolve current menu item / page identity

This operation resolves the currently-authorized menu item (or page) for the running page, by matching the application code, category, and link against the previously loaded authorized item set.

Field Value
Operation ID OP-NC-002
Trigger Page code requesting its own menu/page identity (e.g. to control breadcrumb/help/authorization display)
Inputs Category string and/or current HttpContext.Current.Request URL
Outputs A clsMenuAuthorizedItem or Nothing
Primary components NavigationContext.GetCurrentItem, GetCurrentPage, GetItem, GetItemSeq, IsMenuItem
Entry point SAIF.Presentation.Web.Core.Infragistics103\NavigationContext.vb

Steps

  1. Derives appPath from HttpContext.Current.Request.ApplicationPath (strips /) and, for GetCurrentItem/GetCurrentPage, derives PageLink from Request.RawUrl relative to the application path.
  2. Looks up the app code via ApplicationCodes.ItemByAppPath(appPath) (cached statically the first time via clsApplicationCodeCollection.GetActiveApplicationCodes).
  3. If an app code is found, attempts an exact match first: MenuAuthorizedItems.ItemExact(AppCode, category, link, True) — enforces BR-NC-002.
  4. If no exact match, falls back to a looser MenuAuthorizedItems.Item(AppCode, category, link, True) match by category/link only.
  5. If no app code was resolved (AppCode empty): the method returns Nothing/empty result without further lookup.
  6. GetItemSeq and IsMenuItem follow the analogous app-code → item-lookup pattern to return a sequence number or a boolean existence check, respectively.

Process flow

The following diagram visualizes this operation's control flow.

flowchart TD
    Start([Request page identity]) --> S1[Derive appPath / PageLink from request]
    S1 --> S2[Look up ApplicationCode by app path]
    S2 --> D1{App code found?}
    D1 -->|No| EndNothing([Return Nothing])
    D1 -->|Yes| S3[Attempt ItemExact match]
    S3 --> D2{Exact match found?}
    D2 -->|Yes| EndExact([Return exact match])
    D2 -->|No| S4[Fall back to Item loose match]
    S4 --> EndLoose([Return loose match or Nothing])

Failure and edge-case behavior

  • If the application code itself cannot be resolved, Nothing is returned without attempting any item lookup.

Sources

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