Hide

YetaWF.Core Package Documentation

Display
Print

YetaWF.Core.Support.YetaWFManager Class

An instance of this class is associated with each HTTP request.

An instance of this class contains information about the current HTTP request. Most of it is obtained as needed (lazy loading). Important items such as logged on user, global information, etc. is accessible through this instance.

The instance can be retrieved using the static property YetaWFManager.Manager (YetaWF.Core.Support.YetaWFManager.Manager). Controllers, modules and components and many others provide an accessor in their base classes.

I can hear the Dependency Injection crowd moaning that this is not a good pattern. Sometimes getting things done is more important than technical perfection, which ultimately doesn't make the result any better, or user friendly. Sometimes things are really just global. And really, who cares.

Because of the abstraction provided by YetaWF with the YetaWFManager, it is possible to write simple console applications that use all the services of YetaWF, including data providers. These are not .NET based, they are "plain old" console applications.

Namespace: YetaWF.Core.Support
Assembly: YetaWF.Core

Inheritance

Syntax

public class YetaWFManager;

Constructors

This class cannot be instantiated.

Properties

PublicActiveDevice(not specified)
PublicAddOnManagerReturns the instance of AddOnManager associated with the current HTTP request.
PublicAddonsCustomSiteFolderThe physical location (path) of the site's custom addons folder.
PublicAntiForgeryTokenHTMLCache rendered HTML for anti-forgery token.
PublicStaticCacheBusterReturns a string that can be used in generated URLs as "cache buster", i.e., to defeat client-side caching.
PublicStaticCanUseCDNReturns whether a CDN can be used for website data.
PublicStaticCanUseCDNComponents(not specified)
PublicStaticCanUseStaticDomain(not specified)
PublicComponentsDataThis property can be used by a component rendering package to save information for the current HTTP request. It is not used by YetaWF.
PublicCssManagerReturns the instance of CssManager associated with the current HTTP request.
PublicCurrentContext(not specified)
PublicCurrentModule(not specified)
PublicCurrentModuleEdited(not specified)
PublicCurrentPageThe current page.
PublicCurrentRequest(not specified)
PublicCurrentRequestUrlDescribes the current URL requested. CurrentRequestUrl may not match the full page URL in UPS requests.
PublicCurrentResponse(not specified)
PublicCurrentSession(not specified)
PublicCurrentSessionId(not specified)
PublicCurrentSiteThe current site definition. The current site is identified based on the URL of the current request.
PublicCurrentUrlDescribes the current URL (path and query string only) requested, as shown by browser, which matches the page URL. CurrentRequestUrl may not match the full page URL in UPS requests.
PublicStaticDataFolderThe physical location (path) of the Data folder (not site specific).
PublicStaticDefaultSiteNameReturns the default site name used for this instance of YetaWF.
PublicStaticDeployedDefines whether the currently running instance of YetaWF is a deployed instance or not.
PublicStaticDiagnosticsModeDefines whether the currently running instance of YetaWF is using additional run-time diagnostics to find issues, typically used during development.
PublicEditMode(not specified)
PublicForceModuleActionLinks(not specified)
PublicHasSuperUserRole(not specified)
PublicHaveCurrentContext(not specified)
PublicHaveCurrentRequest(not specified)
PublicHaveCurrentSession(not specified)
PublicHaveCurrentSiteReturns whether information about the current site is available. This may return false during startup or before processing the current HTTP request has started.
PublicStaticHaveManagerDetermines whether a YetaWFManager instance is available.
PublicHaveReturnToUrl(not specified)
PublicHaveUser(not specified)
PublicHostPortUsedThe port used to access this website.
PublicHostSchemeUsedThe scheme used to access this website.
PublicHostUsedThe host used to access this website.
PublicStaticHttpContextAccessorA global instance of Microsoft.AspNetCore.Http.IHttpContextAccessor. For internal framework use only.
PublicImportChunksNonSiteSpecificsDefines whether non-site specific data is also imported when importing packages
PublicInPartialViewTrue while processing a partial view (usually a partial form/ajax)
PublicStaticIsBatchModeReturns whether the current application is running in batch mode.
PublicStaticIsDemoDefines whether the current YetaWF instance runs in demo mode.
PublicIsDemoUserDefines whether the current user has the "Demo" role.
PublicIsGetRequest(not specified)
PublicIsHeadRequest(not specified)
PublicStaticIsHTTPSiteDefines whether the domain uses http:// only (overrides site/page settings)
PublicIsInPopupReturns whether we're in a popup.
PublicIsLocalHostDefines whether localhost/127.0.0.1 was used to access this website.
PublicIsPostRequest(not specified)
PublicIsRenderingPane(not specified)
PublicStaticIsServiceModeReturns whether the current application is a service application (API).
PublicIsStaticSiteDefines whether the current request is for the static site. A static site URL can be defined using Admin > Settings > Site Settings, CDN tab, Static Files Domain.
PublicIsTestSiteDefines whether the test domain was used to access this website.
PublicLastUpdatedContains the page's last date/time updated while rendering a page.
PublicStaticLicenseFolderThe physical location (path) of the product license folder (not site specific). This is used by third-party licensed products only.
PublicLinkAltManagerReturns the instance of LinkAltManager associated with the current HTTP request.
PublicLocalizationSupportEnabled(not specified)
PublicStaticManagerReturns the instance of the YetaWFManager class associated with the current HTTP request.
PublicStaticMemoryCacheA global instance of Microsoft.Extensions.Caching.Memory.IMemoryCache. For internal framework use only.
PublicMetatagsHtmlUsed by skin modules to retrieve all meta tags as an HTML string.
PublicMetatagsManagerReturns the instance of MetatagsManager associated with the current HTTP request.
PublicStaticModeDefines the current run-time mode. Currently defined are batch mode and service mode. Is neither is set, this is a web application.
PublicModeCss(not specified)
PublicNeed2FACurrently logged on user is authenticated but needs to set up two-step authentication.
PublicNeed2FARedirect(not specified)
PublicNeed2FAState(not specified)
PublicNeedNewPasswordCurrently logged on user is authenticated but needs to define a new password.
PublicNestedComponentPrefix(not specified)
PublicOriginListSaved URL where we came from (e.g. used for return handling after Save). TODO: This needs some rework.
PublicPageControlShownReturns whether the page control module is visible.
PublicPageTitleThe current page title. Modules can override the page title (we don't use the title in the page definition, except to set the default title).
PublicPageTitleHtml(not specified)
PublicPaneRenderedThe current pane being rendered.
PublicQueryReturnToUrlReturns the last entry of the OriginList without removing it.
PublicReferrerUrl(not specified)
PublicRenderContentOnlySet when rendering content only (UPS)
PublicRenderingUniqueModuleAddons(not specified)
PublicRenderingUniqueModuleAddonsAjax(not specified)
PublicRenderStaticPageIndicates whether the current page being rendered is actually rendered as a static page.
PublicRequestFormReturns the current HTTP request's form information.
PublicRequestQueryStringReturns the current HTTP request's query string.
PublicReturnToUrlReturns the Url to return to, including origin list and other querystring parms.
PublicStaticRootFolderThe physical location (path) of the website's root folder (wwwroot on .NET - MVC).
PublicStaticRootFolderSolutionThe physical location (path) of the Solution (*.sln) root folder.
PublicStaticRootFolderWebProjectThe physical location (path) of the Website project (Website.csproj) root folder.
PublicStaticRootSitesFolderReturns the folder containing all sites' file data.
PublicScriptManagerReturns the instance of ScriptManager associated with the current HTTP request.
PublicStaticServiceProviderA global instance of System.IServiceProvider. For internal framework use only.
PublicSessionSettings(not specified)
PublicSiteCreationTemplateActive(not specified)
PublicSiteDomainThe current site's domain - E.g., softelvdm.com, localhost, etc.
PublicSiteFolderThe physical location (path) containing the current site's file data.
PublicSkinInfoReturns skin information for the skin used by the current page.
PublicStaticStaticCacheDuration(not specified)
PublicStaticPageManagerReturns the instance of StaticPageManager associated with the current HTTP request.
PublicUniqueIdCounters(not specified)
PublicUserAuthorizedUrls(not specified)
PublicUserEmail(not specified)
PublicUserHostAddressReturns the user's IP address. If none is available, an empty string is returned.
PublicUserId(not specified)
PublicUserLanguage(not specified)
PublicUserName(not specified)
PublicUserNotAuthorizedUrls(not specified)
PublicUserObject(not specified)
PublicUserRoles(not specified)
PublicUserSettingsObject(not specified)
PublicStaticVaultFolderThe physical location (path) of the Vault folder (not site specific).
PublicStaticVaultPrivateFolderThe physical location (path) of the Vault private folder (not site specific).
PublicWantFocus(not specified)

Fields

PublicStaticBATCHMODEDefines the run-time mode used by console applications.
PublicComponentPackagesSeen(not specified)
PublicComponentsSeen(not specified)
PublicStaticSERVICEMODEDefines the run-time mode used by service application (API).

Methods

PublicAddUrlArgAdd a temporary (non-visible) URL query string argument to the current page being rendered. This is mainly used to propagate selections from one module to another (top-down on page only). Other modules must use TryGetUrlArg or GetUrlArg to retrieve these arguments as they're not part of the actual query string/URL. TO BE REMOVED.
PublicInherited from System.ObjectEqualsDetermines whether the specified object is equal to the current object.
ProtectedInherited from System.ObjectFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
PublicGetCDNUrl(not specified)
PublicGetCultureInfo(not specified)
PublicInherited from System.ObjectGetHashCodeServes as the default hash function.
PublicGetPackageDataRetrieves saved data for a package.
PublicStaticGetRequestedDomainUsed by the framework during HTTP request startup to determine the requested domain. For internal framework use only.
PublicGetTimeZoneInfo(not specified)
PublicInherited from System.ObjectGetTypeGets the Type of the current instance.
PublicGetUrlArgUsed to retrieve URL query string arguments (outside of a controller).
PublicGetUserLanguage(not specified)
PublicStaticInitCalled during application startup to save some environmental information. For internal framework use only.
PublicStaticIsSyncReturns whether requests must be made synchronously (i.e., no async).
PublicStaticMakeInitialThreadInstanceAttaches a YetaWFManager instance to the current thread. For internal framework use only. This is only used by console applications.
PublicStaticMakeInstanceCreates an instance of the YetaWFManager class for a site. For internal framework use only. This is only used by the framework during request startup as soon as the site URL has been determined.
PublicStaticMakeThreadInstanceCreates an instance of the YetaWFManager - used for non-site specific threads (e.g., scheduler). For internal framework use only. Can only be used once MakeInitialThreadInstance has been used.
ProtectedInherited from System.ObjectMemberwiseCloneCreates a shallow copy of the current Object.
PublicNeedUser(not specified)
PublicNextUniqueIdPrefix(not specified)
PublicPageCssAdds the page's or popup's css classes (the current edit mode, the current page's defined css and other page css).
PublicStaticInherited from System.ObjectReferenceEqualsDetermines whether the specified Object instances are the same instance.
PublicStaticRemoveThreadInstanceRemoves the YetaWF instance from the current thread. For internal framework use only.
PublicRestartSite(not specified)
PublicSetPackageDataSaves data for a package. The saved data is only available during the current HTTP request.
PublicStaticSetStaticCacheInfo(not specified)
PublicSetSuperUserRole(not specified)
PublicSetUserLanguageAsync(not specified)
PublicStartNestedComponent(not specified)
PublicStaticSyncifyRuns synchronously and returns the return value of the async body within its scope.
PublicInherited from System.ObjectToStringReturns a string that represents the current object.
PublicTryGetUrlArgUsed to retrieve URL query string arguments (outside of a controller).
PublicUniqueIdReturns a unique HTML id.

Enums

ProtectedDeviceSelectedThe selected rendering mode for this site

See Also YetaWF.Core Overview