Beispiel #1
0
  /**
   * Grabs the list of allowed MIME-Types for the GetMap operation from the set of {@link
   * GetMapOutputFormat}s registered in the application context.
   *
   * @param applicationContext The application context where to grab the GetMapOutputFormats from.
   * @see GetMapOutputFormat#getContentType()
   */
  public Set<String> getAvailableMapFormatNames() {

    final Collection<GetMapOutputFormat> producers;
    producers = WMSExtensions.findMapProducers(applicationContext);
    final Set<String> formats = new HashSet<String>();

    for (GetMapOutputFormat producer : producers) {
      formats.addAll(producer.getOutputFormatNames());
    }
    return formats;
  }
Beispiel #2
0
  /** @return all allowed GetMap format names */
  public Set<String> getAllowedMapFormatNames() {

    final Collection<GetMapOutputFormat> producers;
    producers = WMSExtensions.findMapProducers(applicationContext);
    final Set<String> formats = new HashSet<String>();

    for (GetMapOutputFormat producer : producers) {
      if (isAllowedGetMapFormat(producer) == false) {
        continue; // skip this producer, its mime type is not allowed
      }
      formats.addAll(producer.getOutputFormatNames());
    }

    return formats;
  }
Beispiel #3
0
  /**
   * Checks is a getMap mime type is allowed
   *
   * @param format
   * @return
   */
  public boolean isAllowedGetMapFormat(GetMapOutputFormat format) {

    if (getServiceInfo().isGetMapMimeTypeCheckingEnabled() == false) return true;
    Set<String> mimeTypes = getServiceInfo().getGetMapMimeTypes();
    return mimeTypes.contains(format.getMimeType());
  }