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

    <include package="zope.annotation" />
    <include package="Products.CMFCore" file="permissions.zcml" />

    <include package=".subscribers"/>
    <include package=".browser"/>

    <!-- Set up as a Zope product and register an extension profile -->
    <five:registerPackage package="." />

    <genericsetup:registerProfile
      name="plone.app.iterate"
      title="Working Copy Support (Iterate)"
      directory="profiles/default"
      description="Adds working copy support (aka. in-place staging) to Plone."
      provides="Products.GenericSetup.interfaces.EXTENSION"
      />

    <genericsetup:registerProfile
        name="test"
        title="plone.app.iterate: Test fixture"
        directory="profiles/test"
        description="Extension profile to configure a test fixture"
        for="Products.CMFPlone.interfaces.ITestCasePloneSiteRoot"
        provides="Products.GenericSetup.interfaces.EXTENSION"
        />       

    <genericsetup:upgradeStep
        source="*"
        destination="121"
        title="Reinstall plone.app.iterate"
        description=""
        profile="plone.app.iterate:plone.app.iterate"
        handler="plone.app.iterate.util.upgrade_by_reinstall"
        />

    <!-- Policy and behaviour for basic objects -->
    <class class="Products.Archetypes.BaseObject.BaseObject">
        <implements interface=".interfaces.IIterateAware" />
    </class>

    <adapter factory=".policy.CheckinCheckoutPolicyAdapter" />
    <adapter factory=".relation.CheckinCheckoutReferenceAdapter"/>
    <adapter factory=".archiver.ContentArchiver" />
    <adapter factory=".copier.ContentCopier" />

    <!-- Checkout folder locators -->
    <adapter
        factory=".containers.HomeFolderLocator"
        name="plone.app.iterate.home"
        />

    <adapter
        factory=".containers.ParentFolderLocator"
        name="plone.app.iterate.parent"
        />

    <!-- Handle deletions of working copies -->
    <subscriber
       for=".interfaces.IWorkingCopyRelation
            zope.lifecycleevent.interfaces.IObjectRemovedEvent"
       handler=".event.handleDeletion"
       />

</configure>
