lib/Models/AbsIttCatalogItem.js
function loadConceptIdsAndConceptNameMap(item) {
  if (!defined(item._loadConceptIdsAndNameMapPromise)) {
    var parameters = {
      method: "GetDatasetConcepts",
      datasetid: item.datasetId,
      format: "json"
    };
    var datasetConceptsUrl = item._baseUrl + "?" + objectToQuery(parameters);
    var loadDatasetConceptsPromise = loadJson(datasetConceptsUrl)
      .then(function(json) {
        item._conceptIds = json.concepts;
        if (
          json.concepts.indexOf(item.regionConcept) === -1 ||
          json.concepts.indexOf("REGIONTYPE") === -1
        ) {
          throw new DeveloperError(
            "datasetId " +
              item.datasetId +
              " concepts [" +
              json.concepts.join(", ") +
              '] do not include "' +
              item.regionConcept +
              '" and "REGIONTYPE".'
          );
        }
      })
      .otherwise(throwLoadError.bind(null, item, "GetDatasetConcepts"));
    var loadConceptNamesPromise = loadJson(item.conceptNamesUrl).then(function(
      json
    ) {
      item._conceptNamesMap = json;
    });

    item._loadConceptIdsAndNameMapPromise = when.all([
      loadConceptNamesPromise,
      loadDatasetConceptsPromise
    ]);
    // item.concepts and item.conceptNameMap are now defined with the results.
  }
  return item._loadConceptIdsAndNameMapPromise;
}
function loadConceptIdsAndConceptNameMap(item) {
  if (!defined(item._loadConceptIdsAndNameMapPromise)) {
    var parameters = {
      method: "GetDatasetConcepts",
      datasetid: item.datasetId,
      format: "json"
    };
    var datasetConceptsUrl = item._baseUrl + "?" + objectToQuery(parameters);
    var loadDatasetConceptsPromise = loadJson(datasetConceptsUrl)
      .then(function(json) {
        item._conceptIds = json.concepts;
        if (
          json.concepts.indexOf(item.regionConcept) === -1 ||
          json.concepts.indexOf("REGIONTYPE") === -1
        ) {
          throw new DeveloperError(
            "datasetId " +
              item.datasetId +
              " concepts [" +
              json.concepts.join(", ") +
              '] do not include "' +
              item.regionConcept +
              '" and "REGIONTYPE".'
          );
        }
      })
      .otherwise(throwLoadError.bind(null, item, "GetDatasetConcepts"));
    var loadConceptNamesPromise = loadJson(item.conceptNamesUrl).then(function(
      json
    ) {
      item._conceptNamesMap = json;
    });

    item._loadConceptIdsAndNameMapPromise = when.all([
      loadConceptNamesPromise,
      loadDatasetConceptsPromise
    ]);
    // item.concepts and item.conceptNameMap are now defined with the results.
  }
  return item._loadConceptIdsAndNameMapPromise;
}
function loadConceptIdsAndConceptNameMap ( item ) { if ( ! defined ( item . _loadConceptIdsAndNameMapPromise ) ) { var parameters = { method : "GetDatasetConcepts" , datasetid : item . datasetId , format : "json" } ; var datasetConceptsUrl = item . _baseUrl + "?" + objectToQuery ( parameters ) ; var loadDatasetConceptsPromise = loadJson ( datasetConceptsUrl ) . then ( function ( json ) { item . _conceptIds = json . concepts ; if ( json . concepts . indexOf ( item . regionConcept ) === - 1 || json . concepts . indexOf ( "REGIONTYPE" ) === - 1 ) { throw new DeveloperError ( "datasetId " + item . datasetId + " concepts [" + json . concepts . join ( ", " ) + '] do not include "' + item . regionConcept + '" and "REGIONTYPE".' ) ; } } ) . otherwise ( throwLoadError . bind ( null , item , "GetDatasetConcepts" ) ) ; var loadConceptNamesPromise = loadJson ( item . conceptNamesUrl ) . then ( function ( json ) { item . _conceptNamesMap = json ; } ) ; item . _loadConceptIdsAndNameMapPromise = when . all ( [ loadConceptNamesPromise , loadDatasetConceptsPromise ] ) ; // item.concepts and item.conceptNameMap are now defined with the results. } return item . _loadConceptIdsAndNameMapPromise ; }
Returns a promise which, when resolved, indicates that item._conceptIds and item._conceptNamesMap are loaded.
@private
@param  {AbsIttCatalogItem} item This catalog item.
@return {Promise} Promise which, when resolved, indicates that item._conceptIds and item._conceptNamesMap are loaded.
Returns a promise which when resolved indicates that item . _conceptIds and item . _conceptNamesMap are loaded .