Class: DataProviderSchemeBean

bean.organisation. DataProviderSchemeBean

Represents a DataProviderScheme


new DataProviderSchemeBean( [json])

Parameters:
Name Type Argument Description
json object <optional>

The json to build this object from, if none supplied, default json will be created

Extends

Methods


clone()

Return a copy of this structure

Inherited From:

getAgency(callback)

Resolves and returns the Agency who is responsible for maintaining this structure

Parameters:
Name Type Description
callback function

the callback function which should accept the Agency as a parameter argument

Inherited From:
Returns:

The Agency ID

Type
string
Example
maint.getAgency(onAgencyResponse);

function onAgencyResponse(acy) {
  console.log(acy.getName());
}

getAgencyId()

Returns the Id of the Agency that 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>

getChildIdentifiables()

Returns an array of child identifiable objects. this method is an alias for ItemSchemeBean#getItems

Inherited From:
Returns:

An array of one of the possible Items as defined in the class doc

Type
Array.<bean.base.ItemBean>

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' 

getCrossReferencingStructures()

Returns an array of IdentifiableBean structures that reference this structure

Inherited From:
Returns:

bean.base.IdentifiableBean[] structures which reference this Identifiable


getDescription()

Get the Description of this structure.

The locale is determined by the language set in util.LocaleUtils.CURRENT_LANGUAGE

Inherited From:
Returns:

an Object locale: {"locale":"locale", "value":"value"}

Type
object

getDescriptionByLocale(locale)

Get the Description by locale

Parameters:
Name Type Description
locale string

The locale

Inherited From:
Returns:

an Object locale: {"locale":"locale", "value":"value"}

Type
object

getDescriptions()

Get the descriptions for this Structure for each of the locales which hold a descriptions value

Inherited From:
Returns:

Array of Object locals: {"locale":"locale", "value":"value"}

Type
Array.<object>

getEndDate(format)

Returns the end date of this maintainable artifact, returns null if there is no endDate.

If format is false or not provided, the date is represented as the number of milliseconds since 1970

Parameters:
Name Type Description
format boolean

if true then the date will be formatted as a ISO 8601 string

Inherited From:
Returns:

The end date

Type
number
Example
var endData = new Date(maint.getEndDate())

getFullId()

Returns the full id of this structure, e.g if it is a cateogry it will be the id of the category and all the parent categories

Inherited From:
Returns:

The full id

Type
string

getFullIdPath(includeDifferentTypes)

Returns a period separated id of this identifiable, starting from the non-maintainable top-level ancestor to this identifiable.

For example, if this is "Category A" as a child of "Category AA", then this method will return AA.A (note the category scheme id is not present in this identifier).

Returns null if this is a maintainable bean.

Parameters:
Name Type Description
includeDifferentTypes boolean

if true will recurse all the way back up the tree regardless of ancestor types, up to the maintainable level.
If false, will stop at the first occurrence of an ancestor who's getClassType() is not equal to getClassType().

Inherited From:
Returns:

The full id

Type
string

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()

Get the Id of this Structure

Inherited From:
Returns:

The ID

Type
string

getIdentifiables(type)

Returns an array of Identifiables of a given type

Parameters:
Name Type Description
type Bean

any Structure type

Inherited From:
Returns:

The Structure

Type
*
Example
var allDimensions = dsd.getIdentifiables("DimensionBean")

getItem(id)

Return an item by the given id

Parameters:
Name Type Description
id string

The id of the item

Inherited From:
Returns:

one of the possible Items as defined in the class doc or null if the item does not exist

Type
ItemBean | null
Example
var code = codelist.getItem("A");

getItems()

Returns all the items in this Item Scheme

Inherited From:
Returns:

An array of one of the possible Items as defined in the class doc

Type
Array.<bean.base.ItemBean>

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~MetadatCallBack

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()

Get the name of this structure in a specific locale.

The locale is determined by the language which is set in util.LocaleUtils.CURRENT_LANGUAGE

Inherited From:
Returns:

an Object locale: {"locale":"locale", "value":"value"}

Type
object

getNameByLocale(locale)

Get the name by locale provided

Parameters:
Name Type Description
locale string

The locale

Inherited From:
Returns:

an Object locale: {"locale":"locale", "value":"value"}

Type
object

getNames()

Get the names for this Structure for each of the locales which hold a name value

Inherited From:
Returns:

Array of Object locals: {"locale":"locale", "value":"value"}

Type
Array.<object>

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

getServiceURL()

Get the service URL of this structure

Inherited From:
Returns:

The URL

Type
string

getStartDate(format)

Returns the start date of this maintainable artifact, returns null if there is no startDate

If format is false or not provided, the date is represented as the number of milliseconds since 1970

Parameters:
Name Type Description
format boolean

if true then the date will be formatted as a ISO 8601 string

Inherited From:
Returns:

The start date

Type
number
Example
var startData = new Date(maint.getStartDate())

getUri()

Returns the URI for this component, returns null if there is no URI.

URI describes where additional information can be found for this structure.

This is relevant if bean.base.MaintainableBean#isStub is true as the URI will reference the full structure.

Inherited From:
Returns:

The URI

Type
string

getUrn()

Returns the URN for this component.

The URN is unique to this instance and is a computable generated value based on other attributes set within the component.

Inherited From:
Returns:

The URN

Type
string

getVersion()

Returns the version of this maintainable artifact, default version is 1.0

Version is a integer value with period '.' separators between integers, for example 1.2.3.19

Inherited From:
Returns:

The version

Type
string

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

hasChildren()

Returns true if this IdentifiableBean has any child IdentifiableBean

Inherited From:
Returns:

true if this class has Child IdentifiableBean

Type
boolean

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

isDraft()

If this structure is marked as a draft, this will return true. Drafts are only seen by the agency the structure belongs to.

Inherited From:
Returns:

if this is a draft

Type
boolean

isFinal()

Return true if this is a final structure

Inherited From:
Returns:

true if final

Type
boolean

isPartial()

Returns true if this Item Scheme contains only a subset of Items

Inherited From:
Returns:

true if is Partial

Type
boolean

isStub()

Returns true if this structure is a stub, if it is then it will not contain any composite structures.

A stub is a lightweight representation of the Maintainable structure, without all the content, for example a Codelist without all the Codes.

Inherited From:
Returns:

true if stub

Type
boolean

itemCreationTypeChecker()

Because of the lack of generics, this public static function returns the item that the implemented class uses (example: CodelistBean would return a CodeBean)
Make sure to call it using .call() like this : ItemSchemeBean.itemCreationTypeChecker.call(function or object to check);

Inherited From:
Throws:

If the instance does not have any item associated

Type
TypeError
Returns:

The item used by the instance

Type
bean.base.ItemBean
Example
ItemSchemeBean.itemCreationTypeChecker.call(CodelistBean)// returns CodeBean
ItemSchemeBean.itemCreationTypeChecker.call(DataProviderSchemeBean)// returns DataProviderBean

loadFromStub()

If #isStub returns true, this method can be used to load the full structure from the server, this is a synchronous call

Inherited From:

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)'