Class KmlEndpoint

java.lang.Object
org.codice.ddf.spatial.kml.endpoint.KmlEndpoint

@Path("/") public class KmlEndpoint extends Object
Endpoint used to create KML NetworkLinks. The KML Network Link will link Google Earth to the Catalog through the OpenSearch Endpoint.
Author:
Keith C Wire
  • Constructor Summary

    Constructors
    Constructor
    Description
    KmlEndpoint(org.codice.ddf.branding.BrandingRegistry brandingPlugin, ddf.catalog.CatalogFramework catalogFramework)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    de.micromata.opengis.kml.v_2_2_0.Kml
    getAvailableSources(javax.ws.rs.core.UriInfo uriInfo)
    Creates a list of NetworkLinks, one for each Source including the local catalog.
     
     
     
    byte[]
    getIcon(javax.ws.rs.core.UriInfo uriInfo, String id)
    Retrieves an icon from the hosted directory based on the id provided.
    de.micromata.opengis.kml.v_2_2_0.Kml
    getKmlNetworkLink(javax.ws.rs.core.UriInfo uriInfo)
    Creates a NetworkLink to provide a layer to KML Clients.
    de.micromata.opengis.kml.v_2_2_0.Kml
    getKmlStyles(javax.ws.rs.core.UriInfo uriInfo)
    Kml REST Get.
     
     
     
    void
    setDescription(String description)
    Sets the Description that will be used as the description of the Root NetworkLink.
    void
    setIconLoc(String iconLoc)
    Sets the root directory of icons to be provided via this endpoint.
    void
    Sets the URL of the Logo that will be used in the description of the Root NetworkLink .
    void
    setMaxResults(Integer maxResults)
    Sets the Maximum Number of results each NetworkLink will return.
    void
    Attempts to load a KML Style from a file provided via a file system path.
    void
    setVisibleByDefault(Boolean visibleByDefault)
    Sets if the ddf.catalog.source.Source NetworkLinks should be Visible by Default.
    void
    setWebSite(String webSite)
    Sets the Web Site URL that will be used in the description of the Root NetworkLink.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • KmlEndpoint

      public KmlEndpoint(org.codice.ddf.branding.BrandingRegistry brandingPlugin, ddf.catalog.CatalogFramework catalogFramework)
  • Method Details

    • setStyleUrl

      public void setStyleUrl(String url)
      Attempts to load a KML Style from a file provided via a file system path.
      Parameters:
      url - - the path to the file.
    • setIconLoc

      public void setIconLoc(String iconLoc)
      Sets the root directory of icons to be provided via this endpoint.
      Parameters:
      iconLoc - - the path to the directory of icons
    • getDescription

      public String getDescription()
    • setDescription

      public void setDescription(String description)
      Sets the Description that will be used as the description of the Root NetworkLink.
      Parameters:
      description - - the Description of the Root NetworkLink
    • setVisibleByDefault

      public void setVisibleByDefault(Boolean visibleByDefault)
      Sets if the ddf.catalog.source.Source NetworkLinks should be Visible by Default.
      Parameters:
      visibleByDefault - - true to enable
    • setMaxResults

      public void setMaxResults(Integer maxResults)
      Sets the Maximum Number of results each NetworkLink will return.
      Parameters:
      maxResults - - maximum number of results to return
    • getWebSite

      public String getWebSite()
    • setWebSite

      public void setWebSite(String webSite)
      Sets the Web Site URL that will be used in the description of the Root NetworkLink.
      Parameters:
      webSite - - the URL of the web site
    • getLogo

      public String getLogo()
    • setLogo

      public void setLogo(String logo)
      Sets the URL of the Logo that will be used in the description of the Root NetworkLink .
      Parameters:
      logo - - the URL to the logo
    • getProductName

      public String getProductName()
    • getContact

      public String getContact()
    • getBaseUrl

      public String getBaseUrl()
    • getKmlNetworkLink

      @GET @Path("/") @Produces("application/vnd.google-earth.kml+xml") public de.micromata.opengis.kml.v_2_2_0.Kml getKmlNetworkLink(@Context javax.ws.rs.core.UriInfo uriInfo)
      Creates a NetworkLink to provide a layer to KML Clients.
      Parameters:
      uriInfo - - injected resource providing the URI.
      Returns:
      - KML NetworkLink
    • getAvailableSources

      @GET @Path("/sources") @Produces("application/vnd.google-earth.kml+xml") public de.micromata.opengis.kml.v_2_2_0.Kml getAvailableSources(@Context javax.ws.rs.core.UriInfo uriInfo)
      Creates a list of NetworkLinks, one for each Source including the local catalog.
      Parameters:
      uriInfo - - injected resource provding the URI.
      Returns:
      - Kml containing a folder of NetworkLinks.
    • getKmlStyles

      @GET @Path("/styles") @Produces("application/vnd.google-earth.kml+xml") public de.micromata.opengis.kml.v_2_2_0.Kml getKmlStyles(@Context javax.ws.rs.core.UriInfo uriInfo)
      Kml REST Get. Returns the style Document.
      Parameters:
      uriInfo -
      Returns:
      stylesDoc
      Throws:
      javax.ws.rs.WebApplicationException
    • getIcon

      @GET @Path("/icons/{id:.+}") @Produces({"image/png","image/jpeg","image/tiff","image/gif"}) public byte[] getIcon(@Context javax.ws.rs.core.UriInfo uriInfo, @PathParam("id") String id)
      Retrieves an icon from the hosted directory based on the id provided.
      Parameters:
      uriInfo - - injected resource providing the URI
      id - - the id (filename) of the icon
      Returns:
      iconBytes - the icon as a byte[]