<configure
    xmlns="http://namespaces.zope.org/zope"
    xmlns:five="http://namespaces.zope.org/five"
    xmlns:browser="http://namespaces.zope.org/browser"
    xmlns:i18n="http://namespaces.zope.org/i18n"
    xmlns:genericsetup="http://namespaces.zope.org/genericsetup"
    xmlns:plone="http://namespaces.plone.org/plone"
    i18n_domain="ploneintranet">

  <five:registerPackage package="." initialize=".initialize" />

  <include package="dexterity.membrane" />

  <adapter name="Title"
           factory=".indexers.Title" />

  <include package=".browser" />
  <include package=".content" />
  <include package=".upgrades" />

  <!-- Allow users to edit their own profiles -->
  <adapter
     factory=".permissions.UserProfileLocalRoleAdapter"
     />

  <!-- Enable sync of user properties via PAS -->
  <adapter factory=".sync.UserPropertyManager" />

  <adapter
      for="*"
      provides="ploneintranet.userprofile.interfaces.IMemberGroup"
      factory=".adapters.search_membergroup"
      />

  <utility
      name="ploneintranet.userprofile.locations_vocabulary"
      provides="zope.schema.interfaces.IVocabularyFactory"
      component=".vocabularies.primaryLocationVocabulary"
      />

  <genericsetup:registerProfile
      name="default"
      title="Plone Intranet: -- [User Profiles]"
      directory="profiles/default"
      description="Installs the ploneintranet.userprofile package"
      provides="Products.GenericSetup.interfaces.EXTENSION"
      i18n:attributes="title; description"
      post_handler=".setuphandlers.on_install"
      />

  <genericsetup:registerProfile
      name="uninstall"
      title="Plone Intranet: -- [User Profiles uninstall]"
      directory="profiles/uninstall"
      description="Installs the ploneintranet.userprofile package"
      provides="Products.GenericSetup.interfaces.EXTENSION"
      i18n:attributes="title; description"
      post_handler="ploneintranet.userprofile.uninstall.uninstall"
      />

  <genericsetup:registerProfile
      name="testing"
      title="Plone Intranet: -- [User Profiles Testing]"
      directory="profiles/testing"
      description="Testing of the ploneintranet.userprofile package"
      provides="Products.GenericSetup.interfaces.EXTENSION"
      i18n:attributes="title; description"
      />

  <subscriber
      for="Products.PluggableAuthService.interfaces.events.IUserLoggedInEvent"
      handler=".subscribers.on_user_login"
      />

  <subscriber
      for="ploneintranet.userprofile.content.userprofile.IUserProfile
           Products.DCWorkflow.interfaces.IAfterTransitionEvent"
      handler=".subscribers.on_user_transition"
      />

</configure>
