Show / Hide Table of Contents

Class Portal

Represents a web portal that controls the mapping of types and themes within the site. Portals allow to host differently-looking/behaving sites in the same web application

Inheritance
System.Object
DisposableObject
ApplicationComponent
Portal
Implements
IApplicationComponent
System.IDisposable
INamed
IInstrumentable
IExternallyParameterized
Inherited Members
ApplicationComponent.AllComponents
ApplicationComponent.GetAppComponentBySID(UInt64)
ApplicationComponent.GetAppComponentByCommonName(String)
ApplicationComponent.ComponentSID
ApplicationComponent.ComponentStartTime
ApplicationComponent.ComponentCommonName
ApplicationComponent.ComponentDirector
DisposableObject.DisposeAndNull<T>(T)
DisposableObject.DisposeStarted
DisposableObject.Disposed
DisposableObject.EnsureObjectNotDisposed()
DisposableObject.Dispose()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: NFX.Wave
Assembly: NFX.Wave.dll
Syntax
public abstract class Portal : ApplicationComponent, IApplicationComponent, IDisposable, INamed, IInstrumentable, IExternallyParameterized

Constructors

Portal(IConfigSectionNode)

Makes portal from config. Due to the nature of Portal object there is no need to create other parametrized ctors

Declaration
protected Portal(IConfigSectionNode conf)
Parameters
Type Name Description
IConfigSectionNode conf

Fields

CONFIG_CONTENT_SECTION

Declaration
public const string CONFIG_CONTENT_SECTION = "content"
Field Value
Type Description
System.String

CONFIG_DEFAULT_ATTR

Declaration
public const string CONFIG_DEFAULT_ATTR = "default"
Field Value
Type Description
System.String

CONFIG_DESCR_ATTR

Declaration
public const string CONFIG_DESCR_ATTR = "description"
Field Value
Type Description
System.String

CONFIG_DISPLAY_NAME_ATTR

Declaration
public const string CONFIG_DISPLAY_NAME_ATTR = "display-name"
Field Value
Type Description
System.String

CONFIG_LOCALIZATION_SECTION

Declaration
public const string CONFIG_LOCALIZATION_SECTION = "localization"
Field Value
Type Description
System.String

CONFIG_MSG_FILE_ATTR

Declaration
public const string CONFIG_MSG_FILE_ATTR = "msg-file"
Field Value
Type Description
System.String

CONFIG_OFFLINE_ATTR

Declaration
public const string CONFIG_OFFLINE_ATTR = "offline"
Field Value
Type Description
System.String

CONFIG_PARENT_NAME_ATTR

Declaration
public const string CONFIG_PARENT_NAME_ATTR = "parent-name"
Field Value
Type Description
System.String

CONFIG_PRIMARY_ROOT_URI_ATTR

Declaration
public const string CONFIG_PRIMARY_ROOT_URI_ATTR = "primary-root-uri"
Field Value
Type Description
System.String

CONFIG_RECORD_MODEL_SECTION

Declaration
public const string CONFIG_RECORD_MODEL_SECTION = "record-model-generator"
Field Value
Type Description
System.String

CONFIG_THEME_SECTION

Declaration
public const string CONFIG_THEME_SECTION = "theme"
Field Value
Type Description
System.String

LOC_ANY_FIELD_KEY

Declaration
public const string LOC_ANY_FIELD_KEY = "--ANY-FIELD--"
Field Value
Type Description
System.String

LOC_ANY_SCHEMA_KEY

Declaration
public const string LOC_ANY_SCHEMA_KEY = "--ANY-SCHEMA--"
Field Value
Type Description
System.String

Properties

DefauISOCurrency

Returns default currency ISO code for this portal

Declaration
public abstract string DefauISOCurrency { get; }
Property Value
Type Description
System.String

Default

If true, matches this portal when no other suites

Declaration
[ExternalParameter(new string[]{"web"})]
public bool Default { get; set; }
Property Value
Type Description
System.Boolean

DefaultISOCountry

Returns default country ISO code for this portal

Declaration
public abstract string DefaultISOCountry { get; }
Property Value
Type Description
System.String

DefaultLanguageISOCode

Returns default language ISO code for this portal

Declaration
public abstract string DefaultLanguageISOCode { get; }
Property Value
Type Description
System.String

DefaultTheme

Returns the default theme used

Declaration
public Theme DefaultTheme { get; }
Property Value
Type Description
Theme

Description

English/primary language description

Declaration
public string Description { get; }
Property Value
Type Description
System.String

DisplayName

Primary site display name in primary language

Declaration
public string DisplayName { get; }
Property Value
Type Description
System.String

DumpLocalizationErrors

Set to true to capture the localization errors in log - used for development

Declaration
[Config]
[ExternalParameter(new string[]{"web", "log"})]
public bool DumpLocalizationErrors { get; set; }
Property Value
Type Description
System.Boolean

ExternalParameters

Returns named parameters that can be used to control this component

Declaration
public virtual IEnumerable<KeyValuePair<string, Type>> ExternalParameters { get; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String, System.Type>>

InstrumentationEnabled

Implements IInstrumentable

Declaration
[Config(Default = false)]
[ExternalParameter(new string[]{"web", "instrumentation"})]
public bool InstrumentationEnabled { get; set; }
Property Value
Type Description
System.Boolean

Name

Globally-unique portal name/ID

Declaration
public string Name { get; }
Property Value
Type Description
System.String

Offline

If true, does not get matched per request

Declaration
[ExternalParameter(new string[]{"web"})]
public bool Offline { get; set; }
Property Value
Type Description
System.Boolean

Parent

Returns parent portal as identified by ParentName or null. Makes sure that there is no cycle in portal derivation

Declaration
public Portal Parent { get; }
Property Value
Type Description
Portal

ParentName

Points to the parent portal instance where some settings can be cloned (i.e. localization strings)

Declaration
public string ParentName { get; }
Property Value
Type Description
System.String

PrimaryRootUri

Primary root URL used to access this portal

Declaration
public Uri PrimaryRootUri { get; }
Property Value
Type Description
System.Uri

RecordModelGenerator

Returns record model generator that creates JSON for WV.JS library form server-supplied metadata

Declaration
public RecordModelGenerator RecordModelGenerator { get; }
Property Value
Type Description
RecordModelGenerator

Themes

Themes tha this portal supports

Declaration
public IRegistry<Theme> Themes { get; }
Property Value
Type Description
IRegistry<Theme>

Methods

AmountToString(Amount, Portal.MoneyFormat, ISession)

Converts financial amount to string per portal

Declaration
public abstract string AmountToString(Amount amount, Portal.MoneyFormat format = Portal.MoneyFormat.WithCurrencySymbol, ISession session = null)
Parameters
Type Name Description
Amount amount
Portal.MoneyFormat format
ISession session
Returns
Type Description
System.String

AmountToString(Decimal, Portal.MoneyFormat, ISession)

Converts financial amount in portals.default currency to string per portal

Declaration
public virtual string AmountToString(decimal amount, Portal.MoneyFormat format = Portal.MoneyFormat.WithCurrencySymbol, ISession session = null)
Parameters
Type Name Description
System.Decimal amount
Portal.MoneyFormat format
ISession session
Returns
Type Description
System.String

CountryISOCodeToLanguageISOCode(String)

Converts country code into language code per this portal

Declaration
public abstract string CountryISOCodeToLanguageISOCode(string countryISOCode)
Parameters
Type Name Description
System.String countryISOCode
Returns
Type Description
System.String

DateTimeToString(DateTime, Portal.DateTimeFormat, ISession)

Converts datetime to string per portal

Declaration
public abstract string DateTimeToString(DateTime dt, Portal.DateTimeFormat format = Portal.DateTimeFormat.LongDateTime, ISession session = null)
Parameters
Type Name Description
System.DateTime dt
Portal.DateTimeFormat format
ISession session
Returns
Type Description
System.String

Destructor()

Declaration
protected override void Destructor()
Overrides
ApplicationComponent.Destructor()

DoLocalizeRecordModel(String, String, String, String)

Localizes record model schema:field:value

Declaration
protected virtual string DoLocalizeRecordModel(string schema, string field, string value, string isoLang)
Parameters
Type Name Description
System.String schema
System.String field
System.String value
System.String isoLang
Returns
Type Description
System.String

DoLookupLocalizationValue(String, String, String, String, out Boolean)

Declaration
protected virtual string DoLookupLocalizationValue(string isoLang, string schema, string field, string value, out bool exists)
Parameters
Type Name Description
System.String isoLang
System.String schema
System.String field
System.String value
System.Boolean exists
Returns
Type Description
System.String

ExternalGetParameter(String, out Object, String[])

Gets external parameter value returning true if parameter was found

Declaration
public virtual bool ExternalGetParameter(string name, out object value, params string[] groups)
Parameters
Type Name Description
System.String name
System.Object value
System.String[] groups
Returns
Type Description
System.Boolean

ExternalParametersForGroups(String[])

Returns named parameters that can be used to control this component

Declaration
public virtual IEnumerable<KeyValuePair<string, Type>> ExternalParametersForGroups(params string[] groups)
Parameters
Type Name Description
System.String[] groups
Returns
Type Description
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String, System.Type>>

ExternalSetParameter(String, Object, String[])

Sets external parameter value returning true if parameter was found and set

Declaration
public virtual bool ExternalSetParameter(string name, object value, params string[] groups)
Parameters
Type Name Description
System.String name
System.Object value
System.String[] groups
Returns
Type Description
System.Boolean

GetCMSContext(IFileSystemVersion)

Retrieves the CMS context that "sees" the particular CMS file system version. The ICMSContext instance is disposable and should be released after the use

Declaration
public virtual ICMSContext GetCMSContext(IFileSystemVersion version = null)
Parameters
Type Name Description
IFileSystemVersion version

The version that the context "sees". Pass null for the latest approved version. See PortalHub.Instance.CMS.Version*

Returns
Type Description
ICMSContext

GetLanguageISOCode(WorkContext)

Tries to determine session/work context lang and returns it or DefaultLanguageISOCode

Declaration
public virtual string GetLanguageISOCode(WorkContext work = null)
Parameters
Type Name Description
WorkContext work
Returns
Type Description
System.String

GetLocalizableContent()

Override to add localizable system content blocks. Each block has a key of the form: 'keyname_isoLang'. I.e. {"mnuStart_deu", "Anfangen"}...

Declaration
protected abstract Dictionary<string, string> GetLocalizableContent()
Returns
Type Description
System.Collections.Generic.Dictionary<System.String, System.String>

ToString()

Declaration
public override string ToString()
Returns
Type Description
System.String
Overrides
System.Object.ToString()

TranslateContent(String, String, WorkContext)

Translates the named content into desired language trying to infer language from work context/locality/session. The search is first done in this portal then in inherited portals. Returns an empty string if no translation is possible

Declaration
public virtual string TranslateContent(string contentKey, string isoLang = null, WorkContext work = null)
Parameters
Type Name Description
System.String contentKey
System.String isoLang
WorkContext work
Returns
Type Description
System.String

Implements

IApplicationComponent
System.IDisposable
INamed
IInstrumentable
IExternallyParameterized

Extension Methods

MiscUtils.NonNull<T>(T, Func<Exception>, String)
ObjectValueConversion.AsString(Object, String, ConvertErrorHandling)
ObjectValueConversion.AsNonNullOrEmptyString(Object)
ObjectValueConversion.AsLaconicConfig(Object, ConfigSectionNode, String, ConvertErrorHandling)
ObjectValueConversion.AsJSONConfig(Object, ConfigSectionNode, String, ConvertErrorHandling)
ObjectValueConversion.AsXMLConfig(Object, ConfigSectionNode, ConvertErrorHandling)
ObjectValueConversion.AsChar(Object, Char, ConvertErrorHandling)
ObjectValueConversion.AsNullableChar(Object, Nullable<Char>, ConvertErrorHandling)
ObjectValueConversion.AsByte(Object, Byte, ConvertErrorHandling)
ObjectValueConversion.AsNullableByte(Object, Nullable<Byte>, ConvertErrorHandling)
ObjectValueConversion.AsSByte(Object, SByte, ConvertErrorHandling)
ObjectValueConversion.AsNullableSByte(Object, Nullable<SByte>, ConvertErrorHandling)
ObjectValueConversion.AsShort(Object, Int16, ConvertErrorHandling)
ObjectValueConversion.AsNullableShort(Object, Nullable<Int16>, ConvertErrorHandling)
ObjectValueConversion.AsUShort(Object, UInt16, ConvertErrorHandling)
ObjectValueConversion.AsNullableUShort(Object, Nullable<UInt16>, ConvertErrorHandling)
ObjectValueConversion.AsInt(Object, Int32, ConvertErrorHandling)
ObjectValueConversion.AsNullableInt(Object, Nullable<Int32>, ConvertErrorHandling)
ObjectValueConversion.AsUInt(Object, UInt32, ConvertErrorHandling)
ObjectValueConversion.AsNullableUInt(Object, Nullable<UInt32>, ConvertErrorHandling)
ObjectValueConversion.AsLong(Object, Int64, ConvertErrorHandling)
ObjectValueConversion.AsNullableLong(Object, Nullable<Int64>, ConvertErrorHandling)
ObjectValueConversion.AsULong(Object, UInt64, ConvertErrorHandling)
ObjectValueConversion.AsNullableULong(Object, Nullable<UInt64>, ConvertErrorHandling)
ObjectValueConversion.AsDouble(Object, Double, ConvertErrorHandling)
ObjectValueConversion.AsNullableDouble(Object, Nullable<Double>, ConvertErrorHandling)
ObjectValueConversion.AsFloat(Object, Single, ConvertErrorHandling)
ObjectValueConversion.AsNullableFloat(Object, Nullable<Single>, ConvertErrorHandling)
ObjectValueConversion.AsDecimal(Object, Decimal, ConvertErrorHandling)
ObjectValueConversion.AsNullableDecimal(Object, Nullable<Decimal>, ConvertErrorHandling)
ObjectValueConversion.AsBool(Object, Boolean, ConvertErrorHandling)
ObjectValueConversion.AsNullableBool(Object, Nullable<Boolean>, ConvertErrorHandling)
ObjectValueConversion.AsGUID(Object, Guid, ConvertErrorHandling)
ObjectValueConversion.AsNullableGUID(Object, Nullable<Guid>, ConvertErrorHandling)
ObjectValueConversion.AsDateTime(Object)
ObjectValueConversion.AsDateTime(Object, DateTime, ConvertErrorHandling)
ObjectValueConversion.AsNullableDateTime(Object, Nullable<DateTime>, ConvertErrorHandling)
ObjectValueConversion.AsGDID(Object)
ObjectValueConversion.AsGDID(Object, GDID, ConvertErrorHandling)
ObjectValueConversion.AsNullableGDID(Object, Nullable<GDID>, ConvertErrorHandling)
ObjectValueConversion.AsGDIDSymbol(Object)
ObjectValueConversion.AsGDIDSymbol(Object, GDIDSymbol, ConvertErrorHandling)
ObjectValueConversion.AsNullableGDIDSymbol(Object, Nullable<GDIDSymbol>, ConvertErrorHandling)
ObjectValueConversion.AsTimeSpan(Object)
ObjectValueConversion.AsTimeSpan(Object, TimeSpan, ConvertErrorHandling)
ObjectValueConversion.AsNullableTimeSpan(Object, Nullable<TimeSpan>, ConvertErrorHandling)
ObjectValueConversion.AsEnum<TEnum>(Object, TEnum, ConvertErrorHandling)
ObjectValueConversion.AsNullableEnum<TEnum>(Object, Nullable<TEnum>, ConvertErrorHandling)
ObjectValueConversion.AsUri(Object, Uri, ConvertErrorHandling)
JSONExtensions.ToJSON(Object, JSONWritingOptions)
JSONExtensions.ToJSON(Object, TextWriter, JSONWritingOptions)
JSONExtensions.ToJSON(Object, Stream, JSONWritingOptions, Encoding)
ErlObject.ToErlObject(Object)
ErlObject.ToErlObject(Object, ErlTypeOrder, Boolean)
Back to top Copyright © 2006-2018 Agnicore Inc
Generated by DocFX