Options
All
  • Public
  • Public/Protected
  • All
Menu

External module ODataHelper

description

Helper methods for OData Operations

Index

Variables

DATA_ROOT

DATA_ROOT: "OData.svc" = "OData.svc"

ODATA_PARAMS

ODATA_PARAMS: string[] = ['select', 'expand', 'orderby', 'top', 'skip', 'filter', 'format', 'inlinecount']

Functions

buildUrlParamString

  • Method to build proper parameter string to OData requests based on the given option Object.

    Checks whether a given parameter is standard OData param or not and based on this information this params get the '$' sign.

    If there's no select param given, or it is empty 'Id' is the default, so only this field will be on the content in the JSON result. To get all the field values, without selection, set it to 'all', but please avoid this if it's possible.

    Type parameters

    Parameters

    • config: SnConfigModel
    • Optional options: IODataParams<T>

      Represents an ODataOptions obejct based through the IODataOptions interface. Holds the possible url parameters as properties.

    Returns string

    String with the url params in the correct format e.g. '$select=DisplayName,Index'&$top=2&metadata=no'.

combineODataFieldParameters

  • Type parameters

    Parameters

    Returns keyof T | keyof T[]

getContentURLbyPath

  • getContentURLbyPath(path: string): string
  • Method that gets the URL that refers to a single item in the Sense/Net Content Repository

    Parameters

    • path: string

      Path that you want to format.

    Returns string

    Path in entity format e.g. /workspaces('project') from /workspaces/project

getContentUrlbyId

  • getContentUrlbyId(id: number): string
  • Method that gets the URL that refers to a single item in the Sense/Net Content Repository by its Id

    Parameters

    • id: number

      Id of the Content.

    Returns string

    e.g. /content(123)

isItemPath

  • isItemPath(path: string): boolean
  • Method that tells if a path is an item path.

    Parameters

    • path: string

      Path that you want to test.

    Returns boolean

    Returns if the given path is a path of a Content or not.

joinPaths

  • joinPaths(...args: string[]): string
  • Method that allows to join paths without multiple or missing slashes

    Parameters

    • Rest ...args: string[]

      The list of the paths to join

    Returns string

Generated using TypeDoc