Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Utils Service

Table of contents
  1. buildDataServiceUrl
  2. Encrypt
  3. Decrypt
  4. DeepCopy
  5. EvalScript
  6. evaluate
  7. CopyInto
  8. FilterToXPath
  9. GetEditorExpressions
  10. ExamValue
  11. ExtraValue
  12. ToSaveValue
  13. ToSaveResource
  14. NavigateToIdentity
  15. GetSearchDef
  16. ToMomentFormat
  17. IsGuid
  18. IsDateString
  19. sortDictionaryByKey
  20. sortDictionaryByValue
  21. toXPathQuery
  22. parseComponentConfig
  23. stringifyComponentConfig

buildDataServiceUrl

builds data service url with controller and method name

Parameter Datatype Description
baseUrl string url of the data service
controllerName string controller name in the data service
methodName? string method name in the data service
serviceType? string service type of web api
paths? string service type of web api

Example: buildDataServiceUrl(this.baseUrl,'resources/${id}');

Encrypt

encrypt string with a given key

Parameter Datatype Description Default value
message string string to encrypt  
key? string encryption key OCGDESecurityAES

Decrypt

decrypt string with a given key

Parameter Datatype Description Default value
message string decrypt to encrypt  
key? string decryption key OCGDESecurityAES

DeepCopy

copies object with all its properties

Parameter Datatype Description
obj any object to be copied

EvalScript

gets resources with the given query

Parameter Datatype Description
text string xpath query to search resources

Example: getResourceByQuery('/Person[starts-with(DisplayName,'A')]', ['ObjectID']) Remark: this function returns Observable<ResourceSet>

evaluate

gets resources with the given query

Parameters Datatype Description Default Value
query string xpath query to search resources  
attributes? string[] = [] attributes to fetch if not specified, only DisplayName will be fetched
pageSize int page size of the returned resources ??
index int starting index in the whole result queue ??
resolveRef? bool if set to true, reference attributes will be represented as object instead of guid false
orderBy string[] = [] sorting attributes definition ??
adminMode bool   false

Example: getResourceByQuery('/Person[starts-with(DisplayName,'A')]', ['ObjectID']) Remark: this function returns Observable<ResourceSet>

CopyInto

Description: gets resources with the given query Parameters:

  • query: string - xpath query to search resources
  • attributes: string[] = [] - attributes to fetch, if not specified, only DisplayName will be fetched
  • pageSize = 0 - page size of the returned resources
  • index = 0 - starting index in the whole result queue
  • resolveRef = false - if set to true, reference attributes will be represented as object instead of guid
  • orderBy: string[] = [] - sorting attributes definition
  • adminMode = false

Example: getResourceByQuery(‘/Person[starts-with(DisplayName,’A’)]’, [‘ObjectID’]) Remark: this function returns Observable

FilterToXPath

Description: gets resources with the given query Parameters:

  • query: string - xpath query to search resources
  • attributes: string[] = [] - attributes to fetch, if not specified, only DisplayName will be fetched
  • pageSize = 0 - page size of the returned resources
  • index = 0 - starting index in the whole result queue
  • resolveRef = false - if set to true, reference attributes will be represented as object instead of guid
  • orderBy: string[] = [] - sorting attributes definition
  • adminMode = false

Example: getResourceByQuery(‘/Person[starts-with(DisplayName,’A’)]’, [‘ObjectID’]) Remark: this function returns Observable

GetEditorExpressions

Description: gets resources with the given query Parameters:

  • query: string - xpath query to search resources
  • attributes: string[] = [] - attributes to fetch, if not specified, only DisplayName will be fetched
  • pageSize = 0 - page size of the returned resources
  • index = 0 - starting index in the whole result queue
  • resolveRef = false - if set to true, reference attributes will be represented as object instead of guid
  • orderBy: string[] = [] - sorting attributes definition
  • adminMode = false

Example: getResourceByQuery(‘/Person[starts-with(DisplayName,’A’)]’, [‘ObjectID’]) Remark: this function returns Observable

ExamValue

Description: gets resources with the given query Parameters:

  • query: string - xpath query to search resources
  • attributes: string[] = [] - attributes to fetch, if not specified, only DisplayName will be fetched
  • pageSize = 0 - page size of the returned resources
  • index = 0 - starting index in the whole result queue
  • resolveRef = false - if set to true, reference attributes will be represented as object instead of guid
  • orderBy: string[] = [] - sorting attributes definition
  • adminMode = false

Example: getResourceByQuery(‘/Person[starts-with(DisplayName,’A’)]’, [‘ObjectID’]) Remark: this function returns Observable

ExtraValue

Description: gets resources with the given query Parameters:

  • query: string - xpath query to search resources
  • attributes: string[] = [] - attributes to fetch, if not specified, only DisplayName will be fetched
  • pageSize = 0 - page size of the returned resources
  • index = 0 - starting index in the whole result queue
  • resolveRef = false - if set to true, reference attributes will be represented as object instead of guid
  • orderBy: string[] = [] - sorting attributes definition
  • adminMode = false

Example: getResourceByQuery(‘/Person[starts-with(DisplayName,’A’)]’, [‘ObjectID’]) Remark: this function returns Observable

ToSaveValue

Description: gets resources with the given query Parameters:

  • query: string - xpath query to search resources
  • attributes: string[] = [] - attributes to fetch, if not specified, only DisplayName will be fetched
  • pageSize = 0 - page size of the returned resources
  • index = 0 - starting index in the whole result queue
  • resolveRef = false - if set to true, reference attributes will be represented as object instead of guid
  • orderBy: string[] = [] - sorting attributes definition
  • adminMode = false

Example: getResourceByQuery(‘/Person[starts-with(DisplayName,’A’)]’, [‘ObjectID’]) Remark: this function returns Observable

ToSaveResource

Description: gets resources with the given query Parameters:

  • query: string - xpath query to search resources
  • attributes: string[] = [] - attributes to fetch, if not specified, only DisplayName will be fetched
  • pageSize = 0 - page size of the returned resources
  • index = 0 - starting index in the whole result queue
  • resolveRef = false - if set to true, reference attributes will be represented as object instead of guid
  • orderBy: string[] = [] - sorting attributes definition
  • adminMode = false

Example: getResourceByQuery(‘/Person[starts-with(DisplayName,’A’)]’, [‘ObjectID’]) Remark: this function returns Observable

Description: gets resources with the given query Parameters:

  • query: string - xpath query to search resources
  • attributes: string[] = [] - attributes to fetch, if not specified, only DisplayName will be fetched
  • pageSize = 0 - page size of the returned resources
  • index = 0 - starting index in the whole result queue
  • resolveRef = false - if set to true, reference attributes will be represented as object instead of guid
  • orderBy: string[] = [] - sorting attributes definition
  • adminMode = false

Example: getResourceByQuery(‘/Person[starts-with(DisplayName,’A’)]’, [‘ObjectID’]) Remark: this function returns Observable

GetSearchDef

Description: gets resources with the given query Parameters:

  • query: string - xpath query to search resources
  • attributes: string[] = [] - attributes to fetch, if not specified, only DisplayName will be fetched
  • pageSize = 0 - page size of the returned resources
  • index = 0 - starting index in the whole result queue
  • resolveRef = false - if set to true, reference attributes will be represented as object instead of guid
  • orderBy: string[] = [] - sorting attributes definition
  • adminMode = false

Example: getResourceByQuery(‘/Person[starts-with(DisplayName,’A’)]’, [‘ObjectID’]) Remark: this function returns Observable

ToMomentFormat

Description: gets resources with the given query Parameters:

  • query: string - xpath query to search resources
  • attributes: string[] = [] - attributes to fetch, if not specified, only DisplayName will be fetched
  • pageSize = 0 - page size of the returned resources
  • index = 0 - starting index in the whole result queue
  • resolveRef = false - if set to true, reference attributes will be represented as object instead of guid
  • orderBy: string[] = [] - sorting attributes definition
  • adminMode = false

Example: getResourceByQuery(‘/Person[starts-with(DisplayName,’A’)]’, [‘ObjectID’]) Remark: this function returns Observable

IsGuid

Description: gets resources with the given query Parameters:

  • query: string - xpath query to search resources
  • attributes: string[] = [] - attributes to fetch, if not specified, only DisplayName will be fetched
  • pageSize = 0 - page size of the returned resources
  • index = 0 - starting index in the whole result queue
  • resolveRef = false - if set to true, reference attributes will be represented as object instead of guid
  • orderBy: string[] = [] - sorting attributes definition
  • adminMode = false

Example: getResourceByQuery(‘/Person[starts-with(DisplayName,’A’)]’, [‘ObjectID’]) Remark: this function returns Observable

IsDateString

Description: gets resources with the given query Parameters:

  • query: string - xpath query to search resources
  • attributes: string[] = [] - attributes to fetch, if not specified, only DisplayName will be fetched
  • pageSize = 0 - page size of the returned resources
  • index = 0 - starting index in the whole result queue
  • resolveRef = false - if set to true, reference attributes will be represented as object instead of guid
  • orderBy: string[] = [] - sorting attributes definition
  • adminMode = false

Example: getResourceByQuery(‘/Person[starts-with(DisplayName,’A’)]’, [‘ObjectID’]) Remark: this function returns Observable

sortDictionaryByKey

Description: gets resources with the given query Parameters:

  • query: string - xpath query to search resources
  • attributes: string[] = [] - attributes to fetch, if not specified, only DisplayName will be fetched
  • pageSize = 0 - page size of the returned resources
  • index = 0 - starting index in the whole result queue
  • resolveRef = false - if set to true, reference attributes will be represented as object instead of guid
  • orderBy: string[] = [] - sorting attributes definition
  • adminMode = false

Example: getResourceByQuery(‘/Person[starts-with(DisplayName,’A’)]’, [‘ObjectID’]) Remark: this function returns Observable

sortDictionaryByValue

Description: gets resources with the given query Parameters:

  • query: string - xpath query to search resources
  • attributes: string[] = [] - attributes to fetch, if not specified, only DisplayName will be fetched
  • pageSize = 0 - page size of the returned resources
  • index = 0 - starting index in the whole result queue
  • resolveRef = false - if set to true, reference attributes will be represented as object instead of guid
  • orderBy: string[] = [] - sorting attributes definition
  • adminMode = false

Example: getResourceByQuery(‘/Person[starts-with(DisplayName,’A’)]’, [‘ObjectID’]) Remark: this function returns Observable

toXPathQuery

Description: gets resources with the given query Parameters:

  • query: string - xpath query to search resources
  • attributes: string[] = [] - attributes to fetch, if not specified, only DisplayName will be fetched
  • pageSize = 0 - page size of the returned resources
  • index = 0 - starting index in the whole result queue
  • resolveRef = false - if set to true, reference attributes will be represented as object instead of guid
  • orderBy: string[] = [] - sorting attributes definition
  • adminMode = false

Example: getResourceByQuery(‘/Person[starts-with(DisplayName,’A’)]’, [‘ObjectID’]) Remark: this function returns Observable

parseComponentConfig

Description: gets resources with the given query Parameters:

  • query: string - xpath query to search resources
  • attributes: string[] = [] - attributes to fetch, if not specified, only DisplayName will be fetched
  • pageSize = 0 - page size of the returned resources
  • index = 0 - starting index in the whole result queue
  • resolveRef = false - if set to true, reference attributes will be represented as object instead of guid
  • orderBy: string[] = [] - sorting attributes definition
  • adminMode = false

Example: getResourceByQuery(‘/Person[starts-with(DisplayName,’A’)]’, [‘ObjectID’]) Remark: this function returns Observable

stringifyComponentConfig

Description: converts Parameters:

  • config: any - xpath query to search resources

Example: getResourceByQuery(‘/Person[starts-with(DisplayName,’A’)]’, [‘ObjectID’]) Remark: this function returns Observable