Class: DataQueryDimension

data. DataQueryDimension


new DataQueryDimension()

Extends

Methods


clone()

Return a copy of this structure

Inherited From:

getAgencyId()

Returns the Id of the Agency who is responsible for maintaining this structure

Inherited From:
Returns:

The Agency Id

Type
string

getAnnotations()

Returns an array of bean.base.AnnotationBean for this structure, or an empty array if there are none

Inherited From:
Returns:

Array of AnnotationBean's for this Object

Type
Array.<bean.base.AnnotationBean>

getAnnotationsWithTitle(title)

Returns an array of bean.base.AnnotationBean with the given title, or an empty array if none exist

Parameters:
Name Type Description
title string

the title to of the Annotation

Inherited From:
Returns:

Array of Annotation beans

Type
Array.<bean.base.AnnotationBean>

getAnnotationsWithType(type)

Returns an array of bean.base.AnnotationBean with the given type, or an empty array if none exist

Parameters:
Name Type Description
type string

the type to of the Annotation

Inherited From:
Returns:

Array of Annotation beans

Type
Array.<bean.base.AnnotationBean>

getAvailableCodes()

Returns an array of @see DataQueryCodes which remain valid selections for a data query. The returned array
excludes any codes which are display only or where hasData=false.

Returns:
Type
Array.<data.DataQueryCode>

getClassType( [bean])

Get the name of the class of this object

Parameters:
Name Type Argument Default Description
bean boolean <optional>
false

If true, the word "bean" will be omitted

Inherited From:
Throws:

If the first argument is supplied but not a boolean

Type
TypeError
Returns:

Name of the class type (constructor)

Type
string
Example
let myCodelist = new CodelistBean(jsonFromServer);
myCodelist.getClassType(); // returns 'CodelistBean' 
myCodelist.getClassType(true); // returns 'Codelist' 

getCodeById(codeId)

Returns the @see data.DataQueryCode with the given id

Returns null if no such code exists

Parameters:
Name Type Description
codeId string

The code id

See:
Returns:
Type
data.DataQueryCode

getCodeCount()

Returns the number of @see DataQueryCodes for this DataQueryDimension.

Returns:
Type
number

getCodeHierarchy()

Returns an array of hierarchical data.DataQueryHCode for this DataQueryDimension

Returns:
Type
Array.<data.DataQueryHCode>

getDataQueryMetadata()

Returns @see DataQueryMetadata that this DataQueryDimension belongs to

Returns:
Type
data.DataQueryMetadata

getFlatCodes()

Returns an flat array of @see data.DataQueryCode for this Dimension, this collapses the Code hierarchy and does not include display only codes

Returns:
Type
Array.<data.DataQueryCode>

getGuid()

Returns a non-editable unique Identifier for this bean, for client side only.

This GUID is generated automatically on the client on construction, the GUID is completely random and will not be the same for a structure with the same URN if the physical object differes.

Inherited From:
Returns:

An immutable string containing the a unique identifier for this structure

Type
string
Example
var jsonCL = 'get JSON from server
var codelist1 = new Codelist(jsonCL);
var codelist2 = new Codelist(jsonCL);

console.log(codelist1.getUrn() === codelist2.getUrn()); //outputs true
console.log(codelist1._guid() === codelist2._guid()); //outputs false

getId()

Returns the Id of this DataQueryDimension

Returns:
Type
string

getMaintainableParent()

Returns the bean.base.MaintainableBean to which which this structure belongs. All structures must either be a MaintainableBean or be contained within a MaintainableBean.

If this class is a MaintainableBean, then it will return itself as MaintainableBean is the outermost container for all structures

Inherited From:
Returns:

This objects maintainable parent

Type
bean.base.MaintainableBean
Example
var annualCode = myCodeList.getItem("A");
annualCode.getMaintainableParent() // returns 'myCodeList'

getMetadata(callBack)

Retrieves all of the associated metadata.ReferenceMetadata for this structure

Parameters:
Name Type Description
callBack IdentifiableBean~MetadataCallBack

a callback for complete

Inherited From:

getMetadataDefs()

Returns an array of @see metadata.ReferenceMetadataLink, or an empty array if there are none

Inherited From:

getName()

Returns the name of this DataQueryDimension

Returns:
Type
string

getParent( [clazz])

Get the parent structure for which this structure is contained

Parameters:
Name Type Argument Description
clazz object <optional>

If supplied will walk up the parent hierarchy until the parent is of this type

Inherited From:
Returns:

The parent for this object

Type
bean.base.Bean
Example
var dsd = dimension.getParent(DataStructureBean); // note that 'DataStructureBean' is not a string but a Class

getSelectedCodes(includeConstrained)

Returns an array of selected @see data.DataQueryCode for this DataQueryDimension.

Parameters:
Name Type Description
includeConstrained

if true this will also include data.DataQueryCode which have become inValid @see data.DataQueryCode#hasData due to the DataQuery selections

Returns:
Type
Array.<data.DataQueryCode>

hasAnnotations()

Returns true if there are at least one annotation on this bean

Inherited From:
Returns:
Type
boolean

hasAnnotationsWithType(title)

Returns true if this has annotations with the given title

Parameters:
Name Type Description
title string

the title to of the Annotation

Inherited From:
Returns:

true if annotations exist with the given title

Type
boolean

hasCodeHierarchy()

Returns true if this DataQueryDimension has a hierarchy of DataQueryCodes, if this returns true the method getHierarchy
can be used to obtain the hierarchical tree of Hierarchical DataQueryCodes

Returns:
Type
Array.<data.DataQueryCode>

hasMetadata()

Returns true if this structure has any metadata.ReferenceMetadata associated with it, if so the #getMetadataDefs can be used to return the Definitions for each linked report, and #getMetadata
can be used to retrieve all the metadata.ReferenceMetadata

Inherited From:
Returns:

true if has Reference Metadata

Type
boolean

setHierarchy()

Builds a hierarchy from the Hierarchy

Parameters:
Type Description
bean.hierarchicalcodelist.HierarchyBean

sortCodesById()

Sorts the codes by id


sortCodesByName()

Sorts the codes by name


toString()

Returns a string that represents this Bean.

If this Bean is an bean.base.IdentifiableBean then this will output the URN, otherwise the GUID will be returned

Inherited From:
Returns:

The URN or GUID

Type
string
Example
let myCodelist = new CodelistBean(jsonFromServer);
myCodelist.toString() // returns: 'urn:sdmx:org.sdmx.infomodel.codelist.Codelist=SDMX:CL_FREQ(1.0)'