<?xml version="1.0"?>
<configure
  xmlns="http://namespaces.zope.org/zope"
  xmlns:five="http://namespaces.zope.org/five"
  xmlns:browser="http://namespaces.zope.org/browser"
  xmlns:zcml="http://namespaces.zope.org/zcml"
  i18n_domain="collective.geo.kml">

  <browser:resourceDirectory
      name="geo.kml.javascripts"
      directory="javascripts"
      />

  <browser:page
      for="collective.geo.geographer.interfaces.IGeoreferenceable"
      name="kml-document"
      class=".kmldocument.KMLDocument"
      layer = "..interfaces.IGeoKmlLayer"
      permission="zope2.View"
      />

  <!--  was ATBTreeFolder and ATFolder -->
  <browser:page
      for="Products.CMFCore.interfaces.IFolderish"
      name="kml-document"
      class=".kmldocument.KMLFolderDocument"
      layer = "..interfaces.IGeoKmlLayer"
      permission="zope2.View"
      />

  <browser:page
      for="Products.ATContentTypes.interface.IATTopic"
      name="kml-document"
      layer = "..interfaces.IGeoKmlLayer"
      class=".kmldocument.KMLTopicDocument"
      permission="zope2.View"
      />

  <!-- New style collections -->
  <browser:page
      zcml:condition="installed plone.app.collection"
      name="kml-document"
      for="plone.app.collection.interfaces.ICollection"
      layer = "..interfaces.IGeoKmlLayer"
      class=".kmldocument.KMLTopicDocument"
      permission="zope2.View"/>



  <!--  was ATTopic, ATFolder, ATBTreeFolder,  -->
  <browser:page
      name="kml-openlayers"
      for="Products.CMFCore.interfaces.IFolderish"
      class=".kmlopenlayersview.KmlOpenLayersView"
      layer = "..interfaces.IGeoKmlLayer"
      template = "kmlopenlayersview.pt"
      permission = "zope2.View"
      />

  <!-- New style collections -->
  <browser:page
      zcml:condition="installed plone.app.collection"
      name="kml-openlayers"
      for="plone.app.collection.interfaces.ICollection"
      class=".kmlopenlayersview.KmlOpenLayersView"
      layer = "..interfaces.IGeoKmlLayer"
      template = "kmlopenlayersview.pt"
      permission="zope2.View"/>

  <adapter
      for="..interfaces.IKMLOpenLayersView
           zope.interface.Interface
           zope.interface.Interface
           zope.interface.Interface"
      factory=".kmlopenlayersview.KMLMapLayers"
      />

  <include package="plone.app.contentmenu" />

  <browser:menuItem
      title="Kml Openlayers View"
      for="Products.CMFCore.interfaces.IFolderish"
      menu="plone_displayviews"
      action="kml-openlayers"
      description="Set Openlayers Kml as default view."
      />

  <!-- New style collections -->
  <browser:menuItem
      zcml:condition="installed plone.app.collection"
      title="Kml Openlayers View"
      for="plone.app.collection.interfaces.ICollection"
      menu="plone_displayviews"
      action="kml-openlayers"
      description="Set Openlayers Kml as default view."
      />



  <browser:page
      name="kmldocument-macros"
      for="*"
      class=".kmldocument_macros.KmlDocumentMacros"
      permission="zope2.View"
      />

  <browser:viewlet
      name="collective.geo.kml.kmlcontentviewlet"
      for="collective.geo.geographer.interfaces.IGeoreferenceable"
      class=".viewlets.ContentViewlet"
      manager="plone.app.layout.viewlets.interfaces.IAboveContentBody"
      template="kmlcontentviewlet.pt"
      layer="..interfaces.IGeoKmlLayer"
      permission="zope2.View"
  />

  <browser:viewlet
      name="collective.geo.kml.kmlbelowcontentviewlet"
      for="collective.geo.geographer.interfaces.IGeoreferenceable"
      class=".viewlets.ContentViewlet"
      manager="plone.app.layout.viewlets.interfaces.IBelowContentBody"
      template="kmlcontentviewlet.pt"
      layer="..interfaces.IGeoKmlLayer"
      permission="zope2.View"
  />


  <adapter
      for="..interfaces.IKMLOpenLayersViewlet
           zope.interface.Interface
           zope.interface.Interface
           zope.interface.Interface"
      factory=".viewlets.KMLMapViewletLayers"
      />

  <!-- layers views -->
  <browser:page
      name="kml-layer"
      for="*"
      template="layers_templates/kml_layer.pt"
      permission="zope.Public"
      />

  <browser:page
      name="kmlviewlet-layer"
      for="*"
      template="layers_templates/kml_layer.pt"
      permission="zope.Public"
      />




</configure>
