Class: SeriesConstraintBean

bean.constraint. SeriesConstraintBean

Represents a Content Constraint that has includedSeriesKeys OR excludedSeriesKeys


new SeriesConstraintBean( [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>

getAttachments()

Get the attachments for this Series Constraint

Returns:

An array of attachments

Type
Array.<string>

getChildIdentifiables()

Returns an Array of child IdentifiableBean belonging to this structure, for example if this structure is a CodelistBean, this call would return all the CodeBean structures
belonging to the CodelistBean

Inherited From:
Returns:

any IdentifiableBean

Type
Array.<bean.base.IdentifiableBean>

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

getExcludeSeries()

Get all the Excluded Series from this Series Constraint

Returns:

An array of all Excluded Series

Type
Array.<string>

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

getIncludeSeries()

Get all the included Series from this Series Constraint

Returns:

An array of all included Series

Type
Array.<string>

getJson()

Get the Json for the current Constraint

Inherited From:
Returns:

The JSON object

Type
object

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

isDefiningDataPresent()

Returns true if this constraint is defining data present, false if defining data that is allowed to be reported.

If this returns true, then this constraint can be used to build a $data.PreDefinedQuery as it is defining a sub-cube of data.

If this returns false then this constraint is used by the Registry server to impose rules on reported data, and is used as part of the data validation process

Inherited From:
Returns:
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

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

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