File

platform-components-ng/projects/platform-components-lib/src/lib/components/attributes/service/attribute.service.ts

Description

Attribute service

Index

Properties
Methods

Constructor

constructor(http: HttpClient, qppLocalisationService: QppLocalisationService)
Parameters :
Name Type Optional
http HttpClient No
qppLocalisationService QppLocalisationService No

Methods

addDomainValue
addDomainValue(domainId: number, parentDomainValueId: number, name: string, position: number)

Add domain value

Parameters :
Name Type Optional Description
domainId number No

Domain Id

parentDomainValueId number No

Parent domain value Id

name string No

Name

position number No

Position

Returns : any

Promise<DomainValue[]>

createAttribute
createAttribute(_attribute: Attribute)

Create attribute

Parameters :
Name Type Optional Description
_attribute Attribute No

attribute

Returns : Promise<Attribute>

Promise

deleteAttribute
deleteAttribute(attributeId: number)

Delete attribute

Parameters :
Name Type Optional Description
attributeId number No

Attribute Id

Observable

deleteDomain
deleteDomain(domainId: number)

Delete domain

Parameters :
Name Type Optional Description
domainId number No

Domain Id

Observable

deleteDomainValue
deleteDomainValue(domainId: number, valueId: number)

Delete domain value

Parameters :
Name Type Optional Description
domainId number No

Domain Id

valueId number No

Domain value Id

Observable

disableDomainValueCache
disableDomainValueCache()

Disable domain value cache.

Returns : void
enableDomainValueCache
enableDomainValueCache()

Enable domain value cache.

Returns : void
getAdminHomeInfo
getAdminHomeInfo()

Get admin home info

Returns : Observable<AttributeHomeSummary>

Observable

getAllAttributes
getAllAttributes()

Get all attributes

Promise<Observable<Attribute[]>>

getAllDomains
getAllDomains()

Get all domain

Promise<Observable<Domain[]>>

getAttribute
getAttribute(id: number)

Get attribute

Parameters :
Name Type Optional Description
id number No

Id

Observable

getAttributesByName
getAttributesByName(attributeNames: string[])

Get attributes by name

Parameters :
Name Type Optional Description
attributeNames string[] No

Attribute Names

Observable<Attribute[]>

getAttributesState
getAttributesState()

Get attributes state

Returns : Attribute[]

Attribute[]

getChildDomainValues
getChildDomainValues(domainId: number, domainValueId: number, isSortByValue)

Fetch immediate child domain values for a domain value.

Parameters :
Name Type Optional Default value Description
domainId number No

domain Id.

domainValueId number No

domain value Id.

isSortByValue No false

Item sorted by value.

Returns : Observable<DomainValue[]>

Observable<DomainValue[]>.

getContentTypeAttributes
getContentTypeAttributes(contentTypeId: number, useCache, includeSubContentTypes)
Parameters :
Name Type Optional Default value
contentTypeId number No
useCache No false
includeSubContentTypes No false
Returns : Promise<any>
getDomain
getDomain(id: number)

Get domain

Parameters :
Name Type Optional Description
id number No

Id

Returns : Observable<Domain>

Observable

getDomainsState
getDomainsState()

Get domains state

Returns : Domain[]

Domain[]

getDomainValues
getDomainValues(domainId: number)

Fetch domain values for a domain id.

Parameters :
Name Type Optional Description
domainId number No

domain Id to fetch its values.

Returns : Observable<DomainValue[]>

Observable<DomainValue[] | User[] | Group[] | Array<User | Group>>.

getMeasurementUnits
getMeasurementUnits()

Get measurement units

Returns : Observable<literal type[]>

Observable

resetDomainValueCache
resetDomainValueCache()

Clears domain value cache.

Returns : void
saveDomain
saveDomain(domain: UpdateDomainRequest)

Save domain

Parameters :
Name Type Optional Description
domain UpdateDomainRequest No

Domain

Returns : Observable<Domain>

Observable

saveDomainInfo
saveDomainInfo(domain: DomainInfo)

Save domain info

Parameters :
Name Type Optional Description
domain DomainInfo No

Domain

Returns : Observable<DomainInfo>

Observable

setDomainValue
setDomainValue(domainId, domainValue)

Set domain value

Parameters :
Name Optional Description
domainId No

domain id

domainValue No

domainValue to be set/update on said domain

Returns : any

Promise

setDomainValues
setDomainValues(domainId, domainValues: DomainValue[])

Set domain values

Parameters :
Name Type Optional Description
domainId No

Domain id

domainValues DomainValue[] No

DomainValue list

Returns : any

Observable

updateAttribute
updateAttribute(_attribute: Attribute)

Update attribute

Parameters :
Name Type Optional Description
_attribute Attribute No

attribute

Returns : Promise<Attribute>

Promise

Properties

Public recentAdded
Type : Subject<Attribute>
Public recentUpdated
Type : Subject<Attribute>

result-matching ""

    No results matching ""