Base metadata object

@constructor
@abstract
@memberof carto.layer.metadata
@api
967321
function Base (type, rule) {
  this._type = type || '';
  this._column = rule.getColumn();
  this._mapping = rule.getMapping();
  this._property = rule.getProperty();
}
638569
function getMetadata ($) {
  const image = ($('figure[representativeofpage=true] img').attr('src') ||
                 $('meta[property="og:image"]').attr('content') ||
                 '')

  const dateStr = ($('meta[property="article:modified_time"]').attr('content') ||
                   $('meta[property="article:published_time"]').attr('content') ||
                   $('meta[name="DC.date.issued"]').attr('content') ||
                   $('meta[property=date]').attr('content') ||
                   $('.news-body-date time').attr('datetime') ||
                   '').replace(' ', '')

  const publishedDate = new Date(dateStr)

  const author = ($('meta[name=author]').attr('content') ||
                  $('[itemprop=articleBody] .data [itemprop=author] [itemprop=name]').text().trim() ||
                  $('article .news-author [itemprop=author] [itemprop=name]').text().trim() ||
                  $('article [itemprop=name]').text().trim() ||
                  $('.main [itemprop=author]').text().trim() ||
                  $('.cuerpo-articulo [href^="/autor"]').text().trim() ||
                  $('.news-info-box-author [itemprop=author]').text().trim() ||
                  // For ara - Currently not working
                  // $('#content p.pg-bkn-dateline small').text().trim() ||
                  // For eldiario.es
                  $('#content address.dateline small').text().trim() ||
                  // The following 2 lines are for huffingtonpost
                  $('article .info .thirdparty-logo').text().trim() ||
                  $('article .info .name.fn').text().trim() ||
                  $('.detalleFullTexto .author a').text().trim() ||
                  '')

  const title = ($('meta[property="og:title"]').attr('content') ||
                 '')

  return {
    image,
    publishedDate,
    source: {
      author
    },
    title
  }
}
1226328
function buildLayers(layersObject) {
	// Array of layers
	var layers = [];

	if (layersObject) {
		// Iterate over all layers
		for (var int = 0; int < layersObject.length; int++) {
			// One layer
			var singleLayer = layersObject[int];

			// Build a new layer object
			var layer = {};

			// Determine name from GetCapabilities document
			if (singleLayer.Name) {
				if (singleLayer.Name[0]) {
					layer.Name = singleLayer.Name[0];
				}
			}

			// Determine title from GetCapabilities document
			if (singleLayer.Title) {
				if (singleLayer.Title[0]) {
					layer.Title = singleLayer.Title[0];
				}
			}

			// Determine abstract from GetCapabilities document
			if (singleLayer.Abstract) {
				if (singleLayer.Abstract[0]) {
					layer.Abstract = singleLayer.Abstract[0];
				}
			}

			layer.Layer = buildLayers(singleLayer.Layer);

			// Determine layer name if not available
			layer.Name = determineLayerName(layer);

			// Determine layer title if not available
			if (!(layer.Title)) {
				layer.Title = layer.Name;
			}

			// Add layer to the array
			layers.push(layer);
		}
	}

	return layers;
}
116456
function(model, col, options) {
    if (this.size() > 0) {

      // Assign an order of 0 to the first layer
      this.at(0).set({ order: 0 });

      if (this.size() > 1) {
        var layersByType = {};
        for (var i = 1; i < this.size(); ++i) {
          var layer = this.at(i);
          var layerType = layer.get('type');
          layersByType[layerType] = layersByType[layerType] || [];
          layersByType[layerType].push(layer);
        }

        var lastOrder = 0;
        var sortedTypes = [CARTODB_LAYER_TYPE, TORQUE_LAYER_TYPE, TILED_LAYER_TYPE];
        for (var i = 0; i < sortedTypes.length; ++i) {
          var type = sortedTypes[i];
          var layers = layersByType[type] || [];
          for (var j = 0; j < layers.length; ++j) {
            var layer = layers[j];
            layer.set({
              order: ++lastOrder
            });
          }
        }
      }
    }
  }
961998
function setBasemap(basemap) {
      app.debug('MapActions >>> setBasemap');
      app.map.setBasemap(basemap);
      _jsDispatcher.Dispatcher.dispatch({
        actionType: _jsConstantsAppConstants.MAP.basemap,
        data: basemap
      });
    }
1161873
function(terria) {
  ImageryLayerCatalogItem.call(this, terria);

  /**
   * Gets or sets the file extension used to retrieve Open Street Map data
   * This property is observable.
   * @type {String}
   */
  this.fileExtension = "png";

  /**
   * Gets or sets the maximum tile level to retrieve from Open Street Map data
   * This property is observable.
   * @type {String}
   */
  this.maximumLevel = 25;

  /**
   * Gets or sets the attribution to display with the data
   * This property is observable.
   * @type {String}
   */
  this.attribution = undefined;

  /**
   * Gets or sets the array of subdomains, one of which will be prepended to each tile URL.
   * This property is observable.
   * @type {Array}
   */
  this.subdomains = undefined;

  knockout.track(this, ["fileExtension", "maximumLevel", "attribution"]);
}
740131
def _init_metadata(self):
        """"""
        ItemTextsFormRecord._init_metadata(self)
        ItemFilesFormRecord._init_metadata(self)
        edXBaseFormRecord._init_metadata(self)
        IRTItemFormRecord._init_metadata(self)
        TimeValueFormRecord._init_metadata(self)
        ProvenanceFormRecord._init_metadata(self)
        super(edXItemFormRecord, self)._init_metadata()
100047
function serialize (layersCollection, dataviewsCollection) {
  // Named map templates include both http, cartodb and torque layers
  // so we need to iterate through all the layers in the collection to
  // get the indexes rights. Templates are not aware of Google Maps
  // base layers, so we have to ignore them to get indexes right.
  var layers = layersCollection.filter(function (layer) {
    return !LayerTypes.isGoogleMapsBaseLayer(layer);
  });

  return {
    buffersize: {
      mvt: 0
    },
    styles: _getStylesFromLayers(layers)
  };
}
365973
function getBaseClassObject( base, $arr ) {
			function addAllBaseInfo( ) {
				var v, arr = $arr;
				var proto = baseClassObject.prototype;
				var constList = proto.$get("Const"), isConst;
				for ( var k in baseClassObject) {
					if (baseClassObject.hasOwnProperty(k)) {
						isConst = constList.hasOwnProperty(k);
						v = baseClassObject[k];
						if (typeof v == 'function') {
							if (k == '$add') {
								continue;
							}
							for ( var l = arr.length - 1; l >= 0; l--) {
								if (arr[l][k] != undefined)
									break;
								arr[l][k] = v;
							}
						}
						else {
							isConst && baseClassObject.$add(baseClassObject, k, v, isConst);
							for ( var m = arr.length - 1; m >= 0; m--) {
								if (arr[m][k] != undefined)
									break;
								baseClassObject.$add(arr[m], k, undefined, isConst);
							}
						}
					}
				}
				// deleteing $add as all operations on $add are completed for this
				// instance.
				delete baseClassObject.$add;
				var currentClass = arr.pop();
	            !currentClass.isAbstract && currentClass.base.prototype.isAbstract && currentClass.base.prototype.setAbstractMethods(currentClass);
				currentClass.base = baseClassObject;
				//Object.seal(currentClass);
			}

			base.prototype.get$arr = function( ) {
				return $arr;
			};
			base.prototype.__base___ = true;
			var baseClassObject = new base();
			delete base.prototype.__base___;
			delete base.prototype.get$arr;
			var baseObj = changeContext(baseClassObject.constructor, baseClassObject, addAllBaseInfo);
			baseObj.prototype = baseClassObject;
			baseObj.$ADD = function( o ) {
				$arr.unshift(o);
				delete baseObj.$ADD;
			};
			return baseObj;
		}
38984
function (layer) {
            return function (attributes, record) {
                // Add the label for a name record in the database to a separate layer.
                if (!!layer) {
                    addLabelForName(attributes, record, layer);
                }

                if (record.isPointType()) {
                    // Modify placemark attributes in a data dependent manner as appropriate.

                    var currentPlacemarkAttributes = new WorldWind.PlacemarkAttributes(placemarkAttributes);

                    if (attributes.values.hasOwnProperty('pop_max')) {
                        var population = attributes.values.pop_max;
                        currentPlacemarkAttributes.imageScale = 0.01 * Math.log(population);
                    }

                    return {attributes: currentPlacemarkAttributes};
                }
                else {
                    // This should never be reached.
                    alert("Invalid record type was encountered!");
                    return null;
                }
            }
        }
840069
function baseFormat(data, strict) {
  const isArray = Array.isArray(data);

  if (!isArray && (data === null || typeof data !== 'object')) {
    throw new TypeError('data must be an Object or Array');
  }

  const records = [];

  if (isArray) {
    for (let i = 0, len = data.length; i < len; ++i) {
      records[i] = objectToRecord(data[i], strict);
    }
  } else {
    records.push(objectToRecord(data, strict));
  }

  return records.join('\n');
}
1031062
function Base(client, endpoint) {
	var base = this;

	/**
	 * Get a list of all records for the current API
	 *
	 * @method list
	 * @param {Object} query - OPTIONAL querystring params
	 * @param {Function} callback
	 */
	base.list = function() {
		return function(query, callback) {
			var q = '';

			if (query && 'function' === typeof callback)
				q = '?' + querystring.stringify(query);

			client.exec({
				path: '/' + endpoint + q
			}, arguments[arguments.length - 1]);
		};
	};

	/**
	 * Get a single record by its key
	 *
	 * @method fetch
	 * @param {Integer|String} key
	 * @param {Function} callback
	 */
	base.fetch = function() {
		return function(key, callback) {
			client.exec({
				path: '/' + endpoint + '/' + key
			}, callback);
		};
	};

	/**
	 * Create a new record
	 *
	 * @method create
	 * @param {Object|String} data
	 * @param {Function} callback
	 */
	base.create = function() {
		return function(data, callback) {
			client.exec({
				method: 'POST',
				path: '/' + endpoint,
				body: data
			}, callback);
		};
	};

	/**
	 * Update a record
	 *
	 * @method update
	 * @param {Integer|String} key
	 * @param {Object|String} data
	 * @param {Function} callback
	 */
	base.update = function() {
		return function(key, data, callback) {
			client.exec({
				method: 'PUT',
				path: '/' + endpoint + '/' + key,
				body: data
			}, callback);
		};
	};

	/**
	 * Remove a record
	 *
	 * @method remove
	 * @param {Integer|String} key
	 * @param {Function} callback
	 */
	base.remove = function() {
		return function(key, callback) {
			client.exec({
				method: 'DELETE',
				path: '/' + endpoint + '/' + key
			}, callback);
		};
	};

	/**
	 * Do requested action
	 *
	 * @method doAction
	 * @param {Integer|String} key
	 * @param {String} action
	 * @param {Object} body
	 * @param {Function} callback
	 */
	base.doAction = function() {
		return function(key, action, body, callback) {
			body = body || {};
			body.type = action;

			client.exec({
				method: 'POST',
				path: '/' + endpoint + '/' + key + '/actions',
				body: body
			}, callback);
		};
	};
}
464238
function (metadata) {
    var result = createResult(metadata)
    var parentResult = current()
    if (parentResult) {
      parentResult.children.push(result)
    }
    currentNesting.push(result)
  }
1209488
function(layerModel, gmapsLayer, gmapsMap) {
  this.gmapsLayer = gmapsLayer;
  this.map = this.gmapsMap = gmapsMap;
  this.model = layerModel;
  this.model.bind('change', this._update, this);

  this.type = layerModel.get('type') || layerModel.get('kind');
  this.type = this.type.toLowerCase();
}
1369941
function onMetadata (metadata) {
  metadata = icy.parse(metadata);
  console.error('METADATA EVENT:');
  console.error(metadata);
}
29629
public function metaData()
    {
        Meta::setTitle($this->label)
        //            ->set("og:type", "article", "property")
        //            ->set("og:title", $this->label, "property")
        //            ->set("og:description", $this->content(), "property")
            ->set("og:url", $this->href, "property")
        //            ->setImageOG(($this->hasFeaturedImage() ? $this->featuredImage : null))
        //            ->setArticleOG($this)
        //            ->setHrefLangData($this)
            ->setCanonical($this->href)
            ->setWildcards(
                [
                '{{title}}' => $this->label,
                '{{sitename}}' => settings('siteTitle')
                ]
            );

        return;
    }
813112
function(clazz, metaData) {
        this.applyMethods(clazz, metaData.clazz_methods || {});
        this.applyMethods(clazz.prototype, metaData.methods || {});
    }