Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • ViewBase
    • FeatureDescriptionPresenterView

Index

Constructors

constructor

Properties

Private _descFormats

_descFormats: object

Type declaration

  • [descFormat: string]: string

Protected _isDestroyed

_isDestroyed: boolean

Private _uris

_uris: string[]

Protected _xssHtmlValidator

_xssHtmlValidator: XssHtmlValidator

Validator which sanitizes HTML strings.

app

Private bindingSetupDelegates

bindingSetupDelegates: function[]

bindingTree

bindingTree: BindingNode

The tree of binding nodes represented in the markup.

bound

bound: boolean

Whether or not this view has been bound.

childRegions

childRegions: RegionAdapterBase[]

Regions belonging to (hosted in) this view.

configuration

configuration: any

Configuration materials.

contentField

contentField: string

A string for the name of the field that we will use for the template. This should be "description" or "longDescription" If not specified, the system will default to the long description.

description

description: Observable<string>

The Observable description of the view.

Private disposableBindings

disposableBindings: DisposableBinding[]

hostView

hostView: ViewBase

A reference to the view that hosts the region that contains this view (if any)

iconUri

iconUri: Observable<string>

The Observable icon URI of the view.

id

id: string

initiallyBound

initiallyBound: boolean

Indicates whether this view has been initialized and bound for the first time.

isActive

isActive: boolean

Whether or not this view is active.

isBusy

isBusy: Observable<boolean>

The Observable isBusy flag of the view.

isManaged

isManaged: boolean

Whether or not this view is allowed to be managed by some sort of view management component.

libraryId

libraryId: string

markupResource

markupResource: string

Resource name of the markup for this view (if any).

parentView

parentView: ViewBase

The parent view of this view, if this view is the result of a collection binding.

regionName

regionName: string

The name of the region that this view is hosted in.

root

root: HTMLElement

The root DOM element of this view.

title

title: Observable<string>

The Observable title of the view.

typeName

typeName: string

The type name of this view.

viewModel

viewModel: any

The View Model backing this view. Does not necessarily have to be a formal instance of ViewModelBase.

Methods

Protected _extractCommandHyperlinks

  • Extract command hyperlinks and replace them with placeholders.

    Parameters

    • html: string

    Returns CommandHyperlinkPlaceholderState

Protected _injectCommandHyperlinks

  • Inject command hyperlinks back into the subject of a previous extraction.

    Parameters

    Returns string

Protected _sanitizeHtml

  • _sanitizeHtml(html: string): Promise<string>
  • Sanitize a string of HTML.

    Parameters

    • html: string

    Returns Promise<string>

activated

  • activated(): void
  • Called when the view has been activated.

    Returns void

addDisposableBinding

  • addDisposableBinding(observable: Observable<any>, token: string): void
  • Adds an Observable binding that will be disposed of when the view is destroyed.

    Parameters

    • observable: Observable<any>

      The Observable to bind to.

    • token: string

      The token received from binding to the observable.

    Returns void

added

  • added(widgetViewHost?: ViewBase): void
  • Called when the view has been added to a region or as another view in the form of a widget.

    Parameters

    Returns void

applyBinding

  • Applies a binding expression to a DOM node based on the type name of the binding.

    Parameters

    • el: HTMLElement

      The element being bound.

    • binding: BindingExpression

      The binding expression.

    • currentContext: any

      The current data context.

    • bindingNode: BindingNode

      The binding node to apply.

    Returns boolean

applyDescriptiveTemplate

  • applyDescriptiveTemplate(feature: Feature, viewRoot: HTMLElement): Promise<any>
  • Renders a feature description into the provided HTML element, injecting command hyperlinks and image loading handlers.

    Parameters

    • feature: Feature

      The feature what we would like to get the description for

    • viewRoot: HTMLElement

      The HTML element to assign the description to.

    Returns Promise<any>

attach

  • attach(viewModel: Feature): Promise<void>
  • inherited

    Parameters

    Returns Promise<void>

auto

  • auto(arg0: any, arg1: any, arg2: any): void
  • Binds a handler to an Observable or to a dojo.connect. Binding to an Observable:

    ``` this.auto(someObservable, function (newValue) { });

    with explicit scope:

    this.auto(someObservable, this, function (newValue) { });

    Alternately, pass an event name as a string to use dojo.connect:

    this.auto(window, "onclick", function () { }); ```

    Parameters

    • arg0: any

      Either an Observable (for observable bindings) or a regular object (if arg1 is a string)

    • arg1: any

      If arg0 is an Observable, a function or scope object. Otherwise, an event name (to use with dojo.connect).

    • arg2: any

      If arg0 is an Observable, a function handler.

    Returns void

buildAttributeBinding

  • buildAttributeBinding(el: HTMLElement, binding: BindingExpression, currentContext: any, directAttach?: boolean): boolean
  • Builds a DOM attribute binding, binding a DOM attribute to a view model property or attaching directly to the DOM object.

    Parameters

    • el: HTMLElement

      The element being bound.

    • binding: BindingExpression

      The binding expression.

    • currentContext: any

      The current data context.

    • Optional directAttach: boolean

      Whether or not to directly modify the actual DOM element's own properties. Defaults to false.

    Returns boolean

buildClassBinding

  • buildClassBinding(el: HTMLElement, binding: BindingExpression, currentContext: any): boolean

buildDisabledBinding

  • buildDisabledBinding(el: HTMLElement, binding: BindingExpression, currentContext: any): boolean
  • Builds an enabled/disabled binding, simulating a cascading enabled/disabled state.

    Parameters

    • el: HTMLElement

      The element being bound.

    • binding: BindingExpression

      The binding expression.

    • currentContext: any

      The current data context.

    Returns boolean

buildDomBinding

  • buildDomBinding(el: HTMLElement, binding: BindingExpression, currentContext: any): boolean
  • Builds a one-time DOM binding, binding to a DOM element in the view codebehind.

    Parameters

    • el: HTMLElement

      The element being bound.

    • binding: BindingExpression

      The binding expression.

    • currentContext: any

      The current data context.

    Returns boolean

buildEventBinding

  • buildEventBinding(el: HTMLElement, binding: BindingExpression, currentContext: any): boolean
  • Builds an event binding, binding a DOM event to an event handler in the view.

    Parameters

    Returns boolean

buildSourceBinding

  • Builds a complex binding between a source and template element. Allows binding to collections of complex objects or singular complex objects.

    Parameters

    • el: HTMLElement

      The element being bound.

    • binding: BindingExpression

      The binding expression.

    • currentContext: any

      The current data context.

    • bindingNode: BindingNode

      The current binding node in the binding tree.

    Returns boolean

buildStyleBinding

  • buildStyleBinding(el: HTMLElement, binding: BindingExpression, currentContext: any): boolean
  • Builds an inline CSS style binding.

    Parameters

    • el: HTMLElement

      The element being bound.

    • binding: BindingExpression

      The binding expression.

    • currentContext: any

      The current data context.

    Returns boolean

buildTextBinding

  • buildTextBinding(el: HTMLElement, binding: BindingExpression, currentContext: any): boolean
  • Builds a sanitized text binding. Strips out unsafe characters, and allows direct referencing of language keys.

    Parameters

    • el: HTMLElement

      The element being bound.

    • binding: BindingExpression

      The binding expression.

    • currentContext: any

      The current data context.

    Returns boolean

buildTree

  • buildTree(): any
  • Builds a tree of all binding expressions in this view and hooks up binding events as it goes. This method will recursively descend the DOM structure of its visual root and resolve binding expressions.

    Returns any

buildValueBinding

  • buildValueBinding(el: HTMLElement, binding: BindingExpression, currentContext: any): boolean
  • Builds a two-way binding between a form control and an Observable.

    Parameters

    • el: HTMLElement

      The element being bound.

    • binding: BindingExpression

      The binding expression.

    • currentContext: any

      The current data context.

    Returns boolean

buildVarBinding

  • buildVarBinding(el: HTMLElement, binding: BindingExpression, currentContext: any): void
  • Builds a var binding, creating a variable in the view that references a DOM element.

    Parameters

    • el: HTMLElement

      The element being bound.

    • binding: BindingExpression

      The binding expression.

    • currentContext: any

      The current data context.

    Returns void

buildVisibilityBinding

  • buildVisibilityBinding(el: HTMLElement, binding: BindingExpression, currentContext: any): boolean
  • Builds a visibility binding.

    Parameters

    • el: HTMLElement

      The element being bound.

    • binding: BindingExpression

      The binding expression.

    • currentContext: any

      The current data context.

    Returns boolean

buildWidgetBinding

  • buildWidgetBinding(el: HTMLElement, binding: BindingExpression, currentContext: any): boolean
  • Builds a (one-time) widget binding.

    Parameters

    • el: HTMLElement

      The element being bound.

    • binding: BindingExpression

      The binding expression.

    • currentContext: any

      The current data context.

    Returns boolean

cleansedFormatForFormat

  • cleansedFormatForFormat(descFormat: string): string
  • Creates a cleansed copy of a format with any command hyperlinks replaced with click handlers

    deprecated

    2.6 Use insertLinkAndImageBindings instead.

    Parameters

    • descFormat: string

    Returns string

deactivated

  • deactivated(): void
  • Called when the view has been deactivated.

    Returns void

decodeHtmlAmpersands

  • decodeHtmlAmpersands(input: string): string
  • Returns Html encoded ampersands to their non-html forms

    Parameters

    • input: string

      the string to replace the ampersands to non html ampersands

    Returns string

    String

decodeHtmlQuotes

  • decodeHtmlQuotes(input: string): string
  • Returns Html encoded quotes to their non-html forms

    Parameters

    • input: string

      the string to replace the quotes to non html quotes

    Returns string

    String

descriptionApply

  • descriptionApply(feature: Feature, viewRoot: HTMLElement): Promise<any>
  • Renders a feature description into the provided HTML element, injecting command hyperlinks and image loading handlers.

    deprecated

    2.6 Use applyDescriptiveTemplate instead.

    Parameters

    • feature: Feature

      The feature what we would like to get the description for

    • viewRoot: HTMLElement

      The HTML element to assign the description to.

    Returns Promise<any>

descriptionGet

  • descriptionGet(feature: Feature): Promise<string>
  • Returns a description for the given feature capable of performing commands in hyperlinks. To be used with features that do not have relationships.

    deprecated

    2.6 Use getDescriptionContent instead.

    Parameters

    • feature: Feature

      The feature what we would like to get the description for

    Returns Promise<string>

destroy

  • destroy(): void

destroyBindings

  • destroyBindings(): void
  • Destroys all of this view's bindings, and by extension any views bound under this one. The primary purpose of this is to remove event subscriptions due to binding as well as dereferencing expensive DOM nodes so that they may be discarded.

    Returns void

getBindingTarget

  • Returns the target of a binding expression, taking into consideration Observables and pseudo-targets.

    Parameters

    Returns any

getContentFieldFormat

  • getContentFieldFormat(feature: Feature): string
  • Parameters

    Returns string

getDescriptionContent

  • getDescriptionContent(feature: Feature, descriptionFormat?: string): Promise<string>
  • Returns a description for the given feature. The description is populated with unbound command hyperlinks and image load handlers for handling layout changes. Consumers must bind this content themselves. Note that all anchor tags are converted to command hyperlinks that open the URLs only after verification via a ContentPolicy.

    Parameters

    • feature: Feature

      The feature what we would like to generate the descriptive content for.

    • Optional descriptionFormat: string

      Optional parameter. If provided, will override the descriptionFormat for the feature - to be used for eg. when relationship replacement tokens resolve asynchronously.

    Returns Promise<string>

getResource

  • getResource(resourceKey: string, locale?: string): string
  • Gets a language resource from the Application's resource dictionary, given a key, and optional locale. Returns null if the resource does not exist.

    Parameters

    • resourceKey: string
    • Optional locale: string

      The locale of the resource to fetch. Defaults to the current application locale.

    Returns string

handleHyperlinkClick

  • handleHyperlinkClick(event: Event, element: HTMLAnchorElement, context: any): boolean
  • A click handler for hyperlinks embedded in the descriptions returned from descriptionGet/descriptionApply

    Parameters

    • event: Event

      The event object that was fired with the click

    • element: HTMLAnchorElement
    • context: any

      The feature that is related to the description the click occurred in

    Returns boolean

    Boolean if the event should propogate up

handleImgLoad

  • handleImgLoad(evt: HTMLImageElement): void
  • Override this method to add custom behavior on image load.

    Parameters

    • evt: HTMLImageElement

    Returns void

hasContent

  • hasContent(): boolean
  • Returns a boolean indicating if the content field of the attached feature is populated

    Returns boolean

ignoreEvent

  • ignoreEvent(event: Event, el: HTMLElement, context: any): boolean
  • An event handler handler designed to stop events from propagating to overzealous parent views.

    Parameters

    • event: Event

      The event object that was fired with the click

    • el: HTMLElement

      The element where the click occurred

    • context: any

      The feature that is related to the description the click occurred in

    Returns boolean

    False. If this was embedded, we never want our parents notified

insertLinkAndImageBindings

  • insertLinkAndImageBindings(descFormat: string): string
  • Inserts command hyperlinks and image load handlers, the latter for the purpose of handling layout changes.

    Parameters

    • descFormat: string

    Returns string

isDestroyed

  • isDestroyed(): boolean

keyForUri

  • keyForUri(uri: string): number
  • Finds the id for the given command hyperlink. If one is not found, creates one and returns that.

    Parameters

    • uri: string

    Returns number

    Number

onDestroy

  • onDestroy(): void
  • Override or attach to provide custom clean-up behaviour.

    Returns void

parseArguments

  • parseArguments(parameter: string, paramType: string, context: any): (string | Geometry | Graphic | Promise<string> | Feature | object)[]
  • Attempts to parse the parameter string given into one with the given type. Also performs Token replacements

    Parameters

    • parameter: string

      the parameter string you are attempting to parse

    • paramType: string

      the type that you would like to get the parameter in.

    • context: any

      the context to use for any token replacements

    Returns (string | Geometry | Graphic | Promise<string> | Feature | object)[]

    Either a single raw parameter value or a named dictionary of such.

pulseAll

  • pulseAll(): void
  • Performs the initial data bind of the UI.

    Returns void

reattach

  • reattach(viewModel: Feature): Promise<void>
  • Clears the bindings on the current view model and reattaches the view to a new one. To be used when changing the feature in this view.

    Parameters

    Returns Promise<void>

removed

  • removed(): void
  • Called when a view has been removed from a region.

    Returns void

resolveBindingTemplate

  • Given a binding expression and a view model, resolves the correct template to use.

    Parameters

    • binding: BindingExpression

      The binding being satisfied.

    • viewModel: any

      The view model participating in the binding.

    Returns any

resolveWidget

  • Override this method to resolve widgets by ID and context. Return a {@link geocortex.framework.config.WidgetConfig}, or null.

    Parameters

    • widgetId: string

      The ID of the widget to resolve.

    • context: any

      The data context (view model) to bind the widget view to.

    • Optional binding: BindingExpression

      The binding expression that triggered this call to resolveWidget.

    Returns any

runCommand

  • runCommand(commandName: string, parameter: any, context: Feature): void
  • Runs the command named with the given parameters and context

    Parameters

    • commandName: string

      The name of the command we would like executed

    • parameter: any

      The parameter to be fed to the command. Encoded in either JSON or Query String format.

    • context: Feature

      The feature context that should be used for token replacements

    Returns void

setBindingTargetValue

  • Sets the value of the target of a binding expression, taking into consideration Observables and pseudo-targets.

    Parameters

    • binding: BindingExpression

      The binding whose target should be resolved.

    • value: any

      The value to set.

    Returns void

trackCommandHandler

  • trackCommandHandler(command: any, token: any): void
  • Tracks a subscription to an {@link geocortex.framework.commands.Command}, disposing it when this object is disposed with the destroy method.

    Parameters

    • command: any
    • token: any

    Returns void

trackSubscription

  • trackSubscription(event: any, token: any): void
  • Tracks a subscription to an {@link geocortex.framework.events.Event}, disposing it when this object is disposed with the destroy method.

    Parameters

    • event: any
    • token: any

    Returns void

tryPerformTokenSubstitution

  • tryPerformTokenSubstitution(token: string, feature: Feature, output: object): boolean
  • Replaces any instances of the given token string with the attributes of a given feature, and returns if we any such substitutions occurred. Please note that unlike the 'formatTemplateStringAsync' method used when formatting template strings this method can also return objects if they represent valid parameters to a command.

    Parameters

    • token: string

      The token string you would like to replace

    • feature: Feature

      The feature that should be used as a context for the token replacements

    • output: object

      An object whose value parameter will contain the substituted output if the token substitution succeeds

    Returns boolean

    Boolean