DOIP Client Library - JavaScript Version
    Preparing search index...

    Class DigitalObjectUtil

    Convenience functions for manipulating DigitalObjects and Elements.

    Index

    Properties

    getAttribute: (obj: Element | DigitalObject, attr: string) => undefined | Json

    Type declaration

      • (obj: Element | DigitalObject, attr: string): undefined | Json
      • Gets an attribute from a DigitalObject or Element.

        Parameters

        • obj: Element | DigitalObject

          The DigitalObject or Element

        • attr: string

          The name of the attribute to retrieve

        Returns undefined | Json

        The value of the attribute, or undefined if missing

    setAttribute: (obj: Element | DigitalObject, attr: string, value: Json) => void

    Type declaration

      • (obj: Element | DigitalObject, attr: string, value: Json): void
      • Sets a top-level attribute on a DigitalObject or Element.

        Parameters

        • obj: Element | DigitalObject

          The DigitalObject or Element

        • attr: string

          The name of the attribute to set

        • value: Json

          The value to set the attribute to

        Returns void

    getElementById: (obj: DigitalObject, id: string) => undefined | Element

    Type declaration

      • (obj: DigitalObject, id: string): undefined | Element
      • Function

        Gets an element from a DigitalObject by the element id.

        Parameters

        • obj: DigitalObject

          The DigitalObject

        • id: string

          The identifier of the Element

        Returns undefined | Element

        The Element, or undefined if missing