<configure xmlns="http://namespaces.zope.org/zope"
           xmlns:browser="http://namespaces.zope.org/browser"
           xmlns:five="http://namespaces.zope.org/five"
           xmlns:genericsetup="http://namespaces.zope.org/genericsetup"
           xmlns:grok="http://namespaces.zope.org/grok"
           xmlns:z3c="http://namespaces.zope.org/z3c"
           i18n_domain="euphorie">

    <include package="plone.app.folder" />
    <include package="plone.app.z3cform" />
    <include package="plone.namedfile" />
    <include package="plone.formwidget.namedfile" />
    <include package="plone.directives.dexterity" />
    <include package="plone.app.dexterity" />
    <include package="plone.app.vocabularies" />
    <include package="plone.uuid" />
    <include package="htmllaundry" />
    <include package=".api" />
    <include package=".behaviors" />
    <include package=".browser" />

    <browser:resourceDirectory
        name="euphorie.static"
        directory="static"
        />

    <permission
        id="euphorie.content.ManageCountry"
        title="Euphorie: Manage country"
        />

    <permission
        id="euphorie.content.AddNewRIEContent"
        title="Euphorie: Add new RIE Content"
        />

    <permission
        id="euphorie.content.DeletePublishedContent"
        title="Euphorie: Delete published content"
        />

    <grok:grok package="." />

    <five:registerClass
        class=".fti.ConditionalDexterityFTI"
        meta_type="Conditional Dexterity FTI"
        addview="plone.dexterity.fti"
        permission="cmf.ManagePortal"
        icon="plone.dexterity.fti.gif"
        global="False"
        />

    <subscriber handler=".login.SectorLoginHandler" />
    <subscriber
        for="euphorie.content.risk.IRisk
             zope.lifecycleevent.ObjectCopiedEvent
             "
        handler=".risk.handle_risk_pasted"
        />
    <subscriber
        for="euphorie.content.risk.IRisk
             zope.lifecycleevent.ObjectMovedEvent
             "
        handler=".risk.handle_risk_pasted"
        />

    <adapter
      for=".survey.ISurvey zope.schema.interfaces.IField"
      factory=".survey.SurveyAttributeField"

      />

    <adapter
      factory=".user.UserProvider"
      provides="Products.membrane.interfaces.user.IMembraneUserObject"
      />

    <adapter
      for=".countrymanager.ICountryManager"
      factory=".user.UserProvider"
      provides="Products.membrane.interfaces.user.IMembraneUserObject"
      />

    <adapter
      factory=".countrymanager.SearchableTextIndexer"
      name="SearchableText" />

    <adapter
      factory=".help.SearchableTextIndexer"
      name="SearchableText" />

    <adapter
      factory=".module.SearchableTextIndexer"
      name="SearchableText" />

    <adapter
      factory=".page.SearchableTextIndexer"
      name="SearchableText" />

    <adapter
      factory=".profilequestion.SearchableTextIndexer"
      name="SearchableText" />

    <adapter
      factory=".risk.SearchableTextIndexer"
      name="SearchableText" />

    <adapter
      factory=".sector.SearchableTextIndexer"
      name="SearchableText" />

    <adapter
      factory=".survey.SearchableTextIndexer"
      name="SearchableText" />

    <adapter
      factory=".solution.SearchableTextIndexer"
      name="SearchableText" />

    <adapter
        factory=".module.ImageSizeValidator"
        />

    <adapter
        factory=".risk.ImageSizeValidator"
        />

    <include package=".behaviour" />

    <genericsetup:registerProfile
        name="default"
        title="Euphorie content types"
        directory="profiles/default"
        description="Content types for defining sectors and surveys"
        provides="Products.GenericSetup.interfaces.EXTENSION"
        for="Products.CMFPlone.interfaces.IPloneSiteRoot"
        />

    <browser:page
        name="clean-content"
        for="Products.CMFPlone.interfaces.IPloneSiteRoot"
        permission="cmf.ManagePortal"
        class=".upgrade.CleanupContent"
        />

  <utility provides=".utils.IToolTypesInfo"
           factory=".utils.ToolTypesInfo" />

  <utility
      name="euphorie.tool_types_vocabulary"
      provides="zope.schema.interfaces.IVocabularyFactory"
      component=".utils.ToolTypesVocabularyFactory"
      />

  <utility
      name="euphorie.measures_text_handling_vocabulary"
      provides="zope.schema.interfaces.IVocabularyFactory"
      component=".utils.MeasuresTextHandlingVocabularyFactory"
      />


  <browser:page
      name="export_users"
      for="euphorie.content.sectorcontainer.ISectorContainer"
      permission="cmf.ManagePortal"
      class=".utils.UserExport"
      layer="plonetheme.nuplone.skin.interfaces.NuPloneSkin"
      />


  <browser:page
      name="export_users_csv"
      for="euphorie.content.sectorcontainer.ISectorContainer"
      permission="cmf.ManagePortal"
      class=".utils.UserExportCSV"
      layer="plonetheme.nuplone.skin.interfaces.NuPloneSkin"
      />

</configure>
