Beispiel #1
0
            }, new TimeIntervalCollection());
        }
    }
});

CsvCatalogItem.defaultUpdaters = clone(CatalogItem.defaultUpdaters);

CsvCatalogItem.defaultUpdaters.tableStyle = function(csvItem, json, propertyName, options) {
    return csvItem._tableStyle.updateFromJson(json[propertyName], options);
};

CsvCatalogItem.defaultUpdaters.concepts = function() {
    // Don't update from JSON.
};

freezeObject(CsvCatalogItem.defaultUpdaters);

CsvCatalogItem.defaultSerializers = clone(CatalogItem.defaultSerializers);

CsvCatalogItem.defaultSerializers.tableStyle = function(csvItem, json, propertyName, options) {
    json[propertyName] = csvItem[propertyName].serializeToJson(options);
    // Add the currently active variable to the tableStyle so it starts with the right one.
    if (defined(csvItem._tableStructure)) {
        var activeItems = csvItem._tableStructure.activeItems;
        json[propertyName].dataVariable = activeItems[0] && activeItems[0].name;
    }
};

CsvCatalogItem.defaultSerializers.legendUrl = function() {
    // Don't serialize, because legends are generated, and sticking an image embedded in a URL is a terrible idea.
};
    // but this gives us reasonable results for sharing and is a lot less work than the ideal
    // solution.
    var previousEnabledItemsOnly = options.enabledItemsOnly;
    options.enabledItemsOnly = true;

    var result = CatalogGroup.defaultSerializers.items(wmsGroup, json, propertyName, options);

    options.enabledItemsOnly = previousEnabledItemsOnly;
    options.serializeForSharing = previousSerializeForSharing;

    return result;
};

ArcGisMapServerCatalogGroup.defaultSerializers.isLoading = function(wmsGroup, json, propertyName, options) {};

freezeObject(ArcGisMapServerCatalogGroup.defaultSerializers);

ArcGisMapServerCatalogGroup.prototype._getValuesThatInfluenceLoad = function() {
    return [this.url, this.blacklist];
};

ArcGisMapServerCatalogGroup.prototype._load = function() {
    var serviceUrl = cleanAndProxyUrl(this.terria, this.url) + '?f=json';
    var layersUrl = cleanAndProxyUrl(this.terria, this.url) + '/layers?f=json';

    var that = this;
    return when.all([loadJson(serviceUrl), loadJson(layersUrl)]).then(function(result) {
        var serviceJson = result[0];
        var layersJson = result[1];

        // Is this really a MapServer REST response?
      return AbsIttCatalogGroup.defaultSerializers;
    }
  }
});

/**
 * Gets or sets the set of default serializer functions to use in {@link CatalogMember#serializeToJson}.  Types derived from this type
 * should expose this instance - cloned and modified if necesary - through their {@link CatalogMember#serializers} property.
 * @type {Object}
 */
AbsIttCatalogGroup.defaultSerializers = clone(CatalogGroup.defaultSerializers);

AbsIttCatalogGroup.defaultSerializers.items =
  CatalogGroup.enabledShareableItemsSerializer;

freezeObject(AbsIttCatalogGroup.defaultSerializers);

AbsIttCatalogGroup.prototype._getValuesThatInfluenceLoad = function() {
  return [this.url, this.blacklist, this.whitelist];
};

AbsIttCatalogGroup.prototype._load = function() {
  var baseUrl = cleanAndProxyUrl(this, this.url);
  var parameters = {
    method: "GetDatasetList",
    format: "json"
  };

  var that = this;

  var url = baseUrl + "?" + objectToQuery(parameters);
    if (!json.inputs) {
        return;
    }

    catalogFunction.inputs = json.inputs.map(parameterJson => {
        const parameter = createParameterFromType(parameterJson.type, {
            terria: catalogFunction.terria,
            catalogFunction: catalogFunction,
            id: parameterJson.id
        });
        parameter.updateFromJson(parameterJson);
        return parameter;
    });
};

freezeObject(TerriaJsonCatalogFunction.defaultUpdaters);

TerriaJsonCatalogFunction.defaultSerializers = clone(CatalogFunction.defaultSerializers);

TerriaJsonCatalogFunction.defaultSerializers.inputs = function(catalogFunction, json, propertyName, options) {
    if (!catalogFunction.inputs) {
        return;
    }

    json[propertyName] = catalogFunction.inputs.map(parameter => parameter.serializeToJson());
};

freezeObject(TerriaJsonCatalogFunction.defaultSerializers);

TerriaJsonCatalogFunction.defaultPropertiesForSharing = clone(CatalogFunction.defaultPropertiesForSharing);
    this.format = options.format;
};

// When colorMap is updated, we need to convert it to a colorMap.
// When colorPalette is updated, we need to update colorMap.
TableColumnStyle.prototype.updaters = {
    colorMap: function(tableColumnStyle, json, propertyName) {
        tableColumnStyle.colorMap = new ColorMap(json[propertyName]);
    },
    colorPalette: function(tableColumnStyle, json, propertyName) {
        return ColorMap.loadFromPalette(json[propertyName]).then(function(colorMap) {
            tableColumnStyle.colorMap = colorMap;
        });
    }
};
freezeObject(TableColumnStyle.prototype.updaters);

TableColumnStyle.prototype.serializers = {
    colorMap: function(tableColumnStyle, json, propertyName) {
        // Only serialize colorMap if there is no colorPalette.
        if (!defined(tableColumnStyle.colorPalette)) {
            json[propertyName] = tableColumnStyle[propertyName];
        }
    }
};
freezeObject(TableColumnStyle.prototype.serializers);

TableColumnStyle.prototype.updateFromJson = function(json, options) {
    return updateFromJson(this, json, options);
};
Beispiel #6
0
// Do this in updateFromJson so we can keep track of the promises required by the colorPalette option.
// This also has the advantage of not using the TableColumnStyle constructor to set the properties, which causes problems with colorPalette too.
TableStyle.prototype.updateFromJson = function(json, options) {
    var promises = [updateFromJson(this, json, options)];
    this.columns = objectToTableColumnStyle(json, promises, options);
    return when.all(promises);
};

TableStyle.prototype.updaters = clone(TableStyle.prototype.updaters);

// Disable the 'columns' updaters, so we do not update columns here; do it directly in the updateFromJson function.
// Why? TableColumnStyle's colorPalette actually returns a promise. The updaters can't handle a promise, but updateFromJson can.
TableStyle.prototype.updaters['columns'] = function(tableStyle, json, propertyName) {
};

freezeObject(TableStyle.prototype.updaters);

function objectToTableColumnStyle(json, promises, options) {
    if (defined(json.columns)) {
        var columns = {};
        for (var propertyName in json.columns) {
            if (json.columns.hasOwnProperty(propertyName)) {
                columns[propertyName] = new TableColumnStyle();
                var thisPromise = columns[propertyName].updateFromJson(json.columns[propertyName], options);
                if (defined(thisPromise)) {
                    promises.push(thisPromise);
                }
            }
        }
        return columns;
    }
        }
    },
    /**
     * Gets the data source associated with this catalog item.
     * @memberOf WebFeatureServiceCatalogItem.prototype
     * @type {DataSource}
     */
    dataSource : {
        get : function() {
            return defined(this._geoJsonItem) ? this._geoJsonItem.dataSource : undefined;
        }
    }
});

WebFeatureServiceCatalogItem.defaultUpdaters = clone(CatalogItem.defaultUpdaters);
freezeObject(WebFeatureServiceCatalogItem.defaultUpdaters);

WebFeatureServiceCatalogItem.defaultSerializers = clone(CatalogItem.defaultSerializers);

// Serialize the underlying properties instead of the public views of them.
WebFeatureServiceCatalogItem.defaultSerializers.dataUrl = function(wfsItem, json, propertyName) {
    json.dataUrl = wfsItem._dataUrl;
};
WebFeatureServiceCatalogItem.defaultSerializers.dataUrlType = function(wfsItem, json, propertyName) {
    json.dataUrlType = wfsItem._dataUrlType;
};
WebFeatureServiceCatalogItem.defaultSerializers.metadataUrl = function(wfsItem, json, propertyName) {
    json.metadataUrl = wfsItem._metadataUrl;
};
freezeObject(WebFeatureServiceCatalogItem.defaultSerializers);
    serializers : {
        get : function() {
            return WebProcessingServiceCatalogGroup.defaultSerializers;
        }
    }
});

/**
 * Gets or sets the set of default serializer functions to use in {@link CatalogMember#serializeToJson}.  Types derived from this type
 * should expose this instance - cloned and modified if necesary - through their {@link CatalogMember#serializers} property.
 * @type {Object}
 */
WebProcessingServiceCatalogGroup.defaultSerializers = clone(CatalogGroup.defaultSerializers);
WebProcessingServiceCatalogGroup.defaultSerializers.items = function(wpsGroup, json, propertyName, options) {};
WebProcessingServiceCatalogGroup.defaultSerializers.isLoading = function(wpsGroup, json, propertyName, options) {};
freezeObject(WebProcessingServiceCatalogGroup.defaultSerializers);

WebProcessingServiceCatalogGroup.prototype._getValuesThatInfluenceLoad = function() {
    return [this.url, this.itemProperties];
};

WebProcessingServiceCatalogGroup.prototype._load = function() {
    var uri = new URI(this.url).search({
        service: 'WPS',
        request: 'GetCapabilities',
        version: '1.0.0'
    });

    var url = proxyCatalogItemUrl(this, uri.toString(), '1d');

    var that = this;
Beispiel #9
0
  "csvDistributionFormat"
);
MagdaCatalogItem.defaultUpdaters.esriMapServerDistributionFormat = createRegexDeserializer(
  "esriMapServerDistributionFormat"
);
MagdaCatalogItem.defaultUpdaters.esriFeatureServerDistributionFormat = createRegexDeserializer(
  "esriFeatureServerDistributionFormat"
);
MagdaCatalogItem.defaultUpdaters.geoJsonDistributionFormat = createRegexDeserializer(
  "geoJsonDistributionFormat"
);
MagdaCatalogItem.defaultUpdaters.czmlDistributionFormat = createRegexDeserializer(
  "czmlDistributionFormat"
);

freezeObject(MagdaCatalogItem.defaultUpdaters);

/**
 * Gets or sets the set of default serializer functions to use in {@link CatalogMember#serializeToJson}.  Types derived from this type
 * should expose this instance - cloned and modified if necesary - through their {@link CatalogMember#serializers} property.
 * @type {Object}
 */
MagdaCatalogItem.defaultSerializers = clone(CatalogItem.defaultSerializers);

MagdaCatalogItem.defaultSerializers.wmsDistributionFormat = createRegexSerializer(
  "wmsDistributionFormat"
);
MagdaCatalogItem.defaultSerializers.wfsDistributionFormat = createRegexSerializer(
  "wfsDistributionFormat"
);
MagdaCatalogItem.defaultSerializers.kmlDistributionFormat = createRegexSerializer(
Beispiel #10
0
  "csvResourceFormat"
);
CkanCatalogItem.defaultUpdaters.esriMapServerResourceFormat = createRegexDeserializer(
  "esriMapServerResourceFormat"
);
CkanCatalogItem.defaultUpdaters.esriFeatureServerResourceFormat = createRegexDeserializer(
  "esriFeatureServerResourceFormat"
);
CkanCatalogItem.defaultUpdaters.geoJsonResourceFormat = createRegexDeserializer(
  "geoJsonResourceFormat"
);
CkanCatalogItem.defaultUpdaters.czmlResourceFormat = createRegexDeserializer(
  "czmlResourceFormat"
);

freezeObject(CkanCatalogItem.defaultUpdaters);

/**
 * Gets or sets the set of default serializer functions to use in {@link CatalogMember#serializeToJson}.  Types derived from this type
 * should expose this instance - cloned and modified if necesary - through their {@link CatalogMember#serializers} property.
 * @type {Object}
 */
CkanCatalogItem.defaultSerializers = clone(CatalogItem.defaultSerializers);

CkanCatalogItem.defaultSerializers.wmsResourceFormat = createRegexSerializer(
  "wmsResourceFormat"
);
CkanCatalogItem.defaultSerializers.wfsResourceFormat = createRegexSerializer(
  "wfsResourceFormat"
);
CkanCatalogItem.defaultSerializers.kmlResourceFormat = createRegexSerializer(
/**
 * Gets or sets the set of default updater functions to use in {@link CatalogMember#updateFromJson}.  Types derived from this type
 * should expose this instance - cloned and modified if necesary - through their {@link CatalogMember#updaters} property.
 * @type {Object}
 */
CkanCatalogGroup.defaultUpdaters = clone(CatalogGroup.defaultUpdaters);

CkanCatalogGroup.defaultUpdaters.wmsResourceFormat = createRegexDeserializer('wmsResourceFormat');
CkanCatalogGroup.defaultUpdaters.wfsResourceFormat = createRegexDeserializer('wfsResourceFormat');
CkanCatalogGroup.defaultUpdaters.kmlResourceFormat = createRegexDeserializer('kmlResourceFormat');
CkanCatalogGroup.defaultUpdaters.csvResourceFormat = createRegexDeserializer('csvResourceFormat');
CkanCatalogGroup.defaultUpdaters.esriMapServerResourceFormat = createRegexDeserializer('esriMapServerResourceFormat');
CkanCatalogGroup.defaultUpdaters.geoJsonResourceFormat = createRegexDeserializer('geoJsonResourceFormat');
CkanCatalogGroup.defaultUpdaters.czmlResourceFormat = createRegexDeserializer('czmlResourceFormat');

freezeObject(CkanCatalogGroup.defaultUpdaters);

/**
 * Gets or sets the set of default serializer functions to use in {@link CatalogMember#serializeToJson}.  Types derived from this type
 * should expose this instance - cloned and modified if necesary - through their {@link CatalogMember#serializers} property.
 * @type {Object}
 */
CkanCatalogGroup.defaultSerializers = clone(CatalogGroup.defaultSerializers);

CkanCatalogGroup.defaultSerializers.items = CatalogGroup.enabledShareableItemsSerializer;

CkanCatalogGroup.defaultSerializers.wmsResourceFormat = createRegexSerializer('wmsResourceFormat');
CkanCatalogGroup.defaultSerializers.wfsResourceFormat = createRegexSerializer('wfsResourceFormat');
CkanCatalogGroup.defaultSerializers.kmlResourceFormat = createRegexSerializer('kmlResourceFormat');
CkanCatalogGroup.defaultSerializers.csvResourceFormat = createRegexSerializer('csvResourceFormat');
CkanCatalogGroup.defaultSerializers.esriMapServerResourceFormat = createRegexSerializer('esriMapServerResourceFormat');
    }

    var result = new TimeIntervalCollection();

    for (var i = 0; i < json.intervals.length; ++i) {
        var interval = json.intervals[i];
        result.addInterval(TimeInterval.fromIso8601({
            iso8601: interval.interval,
            data: interval.data
        }));
    }

    catalogItem.intervals = result;
};

freezeObject(ImageryLayerCatalogItem.defaultUpdaters);

ImageryLayerCatalogItem.defaultSerializers = clone(CatalogItem.defaultSerializers);

ImageryLayerCatalogItem.defaultSerializers.intervals = function(catalogItem, json, propertyName) {
    if (defined(catalogItem.intervals)) {
        var result = [];
        for (var i = 0; i < catalogItem.intervals.length; ++i) {
            var interval = catalogItem.intervals[i];
            result.push({
                interval: TimeInterval.toIso8601(interval),
                data: interval.data
            });
        }
    }
};
Beispiel #13
0
            }

            return this._memoizedInfoItemsSourceLookup;
        }
    }
});

/**
 * Gets or sets the set of default updater functions to use in {@link CatalogMember#updateFromJson}.  Types derived from this type
 * should expose this instance - cloned and modified if necesary - through their {@link CatalogMember#updaters} property.
 * @type {Object}
 */
CatalogMember.defaultUpdaters = {
};

freezeObject(CatalogMember.defaultUpdaters);

/**
 * Gets or sets the set of default serializer functions to use in {@link CatalogMember#serializeToJson}.  Types derived from this type
 * should expose this instance - cloned and modified if necesary - through their {@link CatalogMember#serializers} property.
 * @type {Object}
 */
CatalogMember.defaultSerializers = {
};

freezeObject(CatalogMember.defaultSerializers);

/**
 * Gets or sets the default set of properties that are serialized when serializing a {@link CatalogMember}-derived object
 * for a share link.
 * @type {String[]}
     */
    propertiesForSharing : {
        get : function() {
            return TerrainCatalogItem.defaultPropertiesForSharing;
        }
    }
});

/**
 * Gets or sets the default set of properties that are serialized when serializing a {@link CatalogItem}-derived object with the
 * `serializeForSharing` flag set in the options.
 * @type {String[]}
 */
TerrainCatalogItem.defaultPropertiesForSharing = clone(CatalogItem.defaultPropertiesForSharing);
TerrainCatalogItem.defaultPropertiesForSharing.push('_url');
freezeObject(TerrainCatalogItem.defaultPropertiesForSharing);

TerrainCatalogItem.prototype._showInCesium = function() {
    if (!defined(this._terrainProvider)) {
        throw new DeveloperError('This data source is not enabled.');
    }
    this._disableOtherTerrainItems();
    var scene = this.terria.cesium.scene;
    scene.terrainProvider = this._terrainProvider;
};

TerrainCatalogItem.prototype._hideInCesium = function() {
    if (!defined(this._terrainProvider)) {
        throw new DeveloperError('This data source is not enabled.');
    }
        }
    }
});

/**
 * Gets or sets the set of default serializer functions to use in {@link CatalogMember#serializeToJson}.  Types derived from this type
 * should expose this instance - cloned and modified if necesary - through their {@link CatalogMember#serializers} property.
 * @type {Object}
 */
ArcGisFeatureServerCatalogGroup.defaultSerializers = clone(CatalogGroup.defaultSerializers);

ArcGisFeatureServerCatalogGroup.defaultSerializers.items = CatalogGroup.enabledShareableItemsSerializer;

ArcGisFeatureServerCatalogGroup.defaultSerializers.isLoading = function(wmsGroup, json, propertyName, options) {};

freezeObject(ArcGisFeatureServerCatalogGroup.defaultSerializers);

ArcGisFeatureServerCatalogGroup.prototype._getValuesThatInfluenceLoad = function() {
    return [this.url, this.blacklist];
};

ArcGisFeatureServerCatalogGroup.prototype._load = function() {
    return loadFeatureServer(this);
};

// loadFeatureServer is exposed so that ArcGisCatalogGroup can call it,
// to load a MapServer as if it were an ArcGisFeatureServerCatalogGroup.
ArcGisFeatureServerCatalogGroup.loadFeatureServer = function(catalogGroup) {
    return loadFeatureServer(catalogGroup);
};
Beispiel #16
0
            return CatalogItem.defaultPropertiesForSharing;
        }
    }
});

/**
 * Gets or sets the default metadata to use for data items that don't provide anything better from their
 * {@link CatalogItem#metadata} property.  The default simply indicates that no metadata is available.
 * @type {Metadata}
 */
CatalogItem.defaultMetadata = new Metadata();
CatalogItem.defaultMetadata.isLoading = false;
CatalogItem.defaultMetadata.dataSourceErrorMessage = 'This data item does not have any details available.';
CatalogItem.defaultMetadata.serviceErrorMessage = 'This service does not have any details available.';

freezeObject(CatalogItem.defaultMetadata);

/**
 * Gets or sets the set of default updater functions to use in {@link CatalogMember#updateFromJson}.  Types derived from this type
 * should expose this instance - cloned and modified if necesary - through their {@link CatalogMember#updaters} property.
 * @type {Object}
 */
CatalogItem.defaultUpdaters = clone(CatalogMember.defaultUpdaters);
CatalogItem.defaultUpdaters.rectangle = function(catalogItem, json, propertyName) {
    if (defined(json.rectangle)) {
        catalogItem.rectangle = Rectangle.fromDegrees(json.rectangle[0], json.rectangle[1], json.rectangle[2], json.rectangle[3]);
    } else {
        catalogItem.rectangle = Rectangle.MAX_VALUE;
    }
};
 */
WfsFeaturesCatalogGroup.defaultSerializers = clone(
  CatalogGroup.defaultSerializers
);

WfsFeaturesCatalogGroup.defaultSerializers.items =
  CatalogGroup.enabledShareableItemsSerializer;

WfsFeaturesCatalogGroup.defaultSerializers.isLoading = function(
  wfsGroup,
  json,
  propertyName,
  options
) {};

freezeObject(WfsFeaturesCatalogGroup.defaultSerializers);

WfsFeaturesCatalogGroup.prototype._getValuesThatInfluenceLoad = function() {
  return [
    this.url,
    this.typeNames,
    this.nameProperty,
    this.groupByProperty,
    this.blacklist
  ];
};

WfsFeaturesCatalogGroup.prototype._load = function() {
  var url = new URI(cleanAndProxyUrl(this, this.url))
    .addQuery({
      service: "WFS",
Beispiel #18
0
  }
});

/**
 * Gets or sets the default set of properties that are serialized when serializing a {@link CatalogItem}-derived for a
 * share link.
 * @type {String[]}
 */
AbsIttCatalogItem.defaultPropertiesForSharing = clone(
  TableCatalogItem.defaultPropertiesForSharing
);
AbsIttCatalogItem.defaultPropertiesForSharing.push("filter");
AbsIttCatalogItem.defaultPropertiesForSharing.push("regionConcept");
AbsIttCatalogItem.defaultPropertiesForSharing.push("regionTypeConcept");
AbsIttCatalogItem.defaultPropertiesForSharing.push("displayPercent");
freezeObject(AbsIttCatalogItem.defaultPropertiesForSharing);

AbsIttCatalogItem.defaultSerializers = clone(
  TableCatalogItem.defaultSerializers
);

AbsIttCatalogItem.defaultSerializers.filter = function(item, json) {
  // Create the 'filter' that would start us off with the same active items as are currently shown.
  var nestedFilter = item._concepts.map(function(concept) {
    return concept.toFilter();
  });
  json.filter = nestedFilter.reduce(function(a, b) {
    return a.concat(b);
  }, []);
};
        wmtsItem.tilingScheme = json.tilingScheme;
    }
};

WebMapTileServiceCatalogItem.defaultUpdaters.getFeatureInfoFormats = function(wmtsItem, json, propertyName, options) {
    var formats = [];

    for (var i = 0; i < json.getFeatureInfoFormats.length; ++i) {
        var format = json.getFeatureInfoFormats[i];
        formats.push(new GetFeatureInfoFormat(format.type, format.format));
    }

    wmtsItem.getFeatureInfoFormats = formats;
};

freezeObject(WebMapTileServiceCatalogItem.defaultUpdaters);

WebMapTileServiceCatalogItem.defaultSerializers = clone(ImageryLayerCatalogItem.defaultSerializers);

// Serialize the underlying properties instead of the public views of them.
WebMapTileServiceCatalogItem.defaultSerializers.dataUrl = function(wmtsItem, json, propertyName) {
    json.dataUrl = wmtsItem._dataUrl;
};
WebMapTileServiceCatalogItem.defaultSerializers.dataUrlType = function(wmtsItem, json, propertyName) {
    json.dataUrlType = wmtsItem._dataUrlType;
};
WebMapTileServiceCatalogItem.defaultSerializers.metadataUrl = function(wmtsItem, json, propertyName) {
    json.metadataUrl = wmtsItem._metadataUrl;
};
WebMapTileServiceCatalogItem.defaultSerializers.legendUrl = function(wmtsItem, json, propertyName) {
    json.legendUrl = wmtsItem._legendUrl;
 */
WebFeatureServiceCatalogGroup.defaultSerializers = clone(
  CatalogGroup.defaultSerializers
);

WebFeatureServiceCatalogGroup.defaultSerializers.items =
  CatalogGroup.enabledShareableItemsSerializer;

WebFeatureServiceCatalogGroup.defaultSerializers.isLoading = function(
  wfsGroup,
  json,
  propertyName,
  options
) {};

freezeObject(WebFeatureServiceCatalogGroup.defaultSerializers);

WebFeatureServiceCatalogGroup.prototype._getValuesThatInfluenceLoad = function() {
  return [this.url, this.blacklist];
};

WebFeatureServiceCatalogGroup.prototype._load = function() {
  var url =
    cleanAndProxyUrl(this, this.url) +
    "?service=WFS&version=1.1.0&request=GetCapabilities";

  var that = this;
  return loadXML(url)
    .then(function(xml) {
      // Is this really a GetCapabilities response?
      if (
        }
    }
});

/**
 * Gets or sets the set of default serializer functions to use in {@link CatalogMember#serializeToJson}.  Types derived from this type
 * should expose this instance - cloned and modified if necesary - through their {@link CatalogMember#serializers} property.
 * @type {Object}
 */
WebMapServiceCatalogGroup.defaultSerializers = clone(CatalogGroup.defaultSerializers);

WebMapServiceCatalogGroup.defaultSerializers.items = CatalogGroup.enabledShareableItemsSerializer;

WebMapServiceCatalogGroup.defaultSerializers.isLoading = function(wmsGroup, json, propertyName, options) {};

freezeObject(WebMapServiceCatalogGroup.defaultSerializers);

WebMapServiceCatalogGroup.prototype._getValuesThatInfluenceLoad = function() {
    return [this.url, this.blacklist, this.titleField];
};

WebMapServiceCatalogGroup.prototype._load = function() {
    var url = cleanAndProxyUrl(this, this.url) + '?service=WMS&request=GetCapabilities&version=1.3.0&tiled=true';

    var that = this;
    return loadXML(url).then(function(xml) {
        // Is this really a GetCapabilities response?
        if (!xml || !xml.documentElement || (xml.documentElement.localName !== 'WMS_Capabilities' && xml.documentElement.localName !== 'WMT_MS_Capabilities')) {
            throw new TerriaError({
                title: 'Invalid WMS server',
                message: '\