<configure
    xmlns="http://namespaces.zope.org/zope"
    xmlns:grok="http://namespaces.zope.org/grok"
    xmlns:browser="http://namespaces.zope.org/browser"
    xmlns:genericsetup="http://namespaces.zope.org/genericsetup"
    xmlns:i18n="http://namespaces.zope.org/i18n"
    i18n_domain="seantis.dir.base">

    <i18n:registerTranslations directory="locales" />

    <!-- Include configuration for dependencies listed in setup.py -->
    <includeDependencies package="." />

    <!-- upgrades -->
    <include file="upgrades.zcml" />

    <!-- Grok the package to initialise schema interfaces and content classes -->
    <grok:grok package="." />

    <!-- Register an extension profile to make the product installable -->
    <genericsetup:registerProfile
        name="default"
        title="seantis.dir.base"
        description="Directory package for Plone using Dexterity"
        directory="profiles/default"
        provides="Products.GenericSetup.interfaces.EXTENSION"
        />

    <!-- Resources -->
    <browser:resourceDirectory
        name="seantis.dir.base.javascripts"
        directory="js"/>

    <browser:resourceDirectory
        name="seantis.dir.base.stylesheets"
        directory="css"/>

    <browser:resourceDirectory
        name="seantis.dir.base.images"
        directory="images"/>

    <!-- Override default kml-document -->
    <browser:page
      for="seantis.dir.base.interfaces.IDirectoryItem"
      name="kml-document"
      class="seantis.dir.base.core.KMLDocument"
      layer="collective.geo.kml.interfaces.IGeoKmlLayer"
      permission="zope2.View"
      />

    <browser:resource name="directory-map.js" file="js/directory-map.js"/>

    <!-- Remove default portlets from directories (may be added later) -->
    <subscriber for="seantis.dir.base.interfaces.IDirectoryBase
                     zope.app.container.interfaces.IObjectAddedEvent"                 
                handler=".subscribers.block_portlets_on_creation"
    />
    <subscriber for="seantis.dir.base.interfaces.IDirectoryItemBase
                     zope.app.container.interfaces.IObjectAddedEvent"                 
                handler=".subscribers.block_portlets_on_creation"
    />

</configure>