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

    <include package="plone.dexterity" />
    <include package="plone.app.dexterity" /><!-- To initialize DublinCore behaviors -->
    <include package="plone.behavior" file="meta.zcml" />

    <!-- http://groups.google.com/group/zope-core-dev/browse_thread/thread/6c10ebc16027017f -->
    <!-- ZCML of this package fails in Zope 2.13 for strange reason -->
    <exclude package="zope.contentprovider" />

    <include file="ical.zcml" />

    <subscriber for=".interfaces.IDXEvent
                     zope.lifecycleevent.interfaces.IObjectModifiedEvent"
                handler=".behaviors.data_postprocessing" />
    <subscriber for=".interfaces.IDXEvent
                     zope.lifecycleevent.interfaces.IObjectCreatedEvent"
                handler=".behaviors.data_postprocessing" />

    <adapter
        factory=".traverser.OccurrenceTraverser"
        permission="zope.Public"
        />

    <adapter factory=".behaviors.EventAccessor" />

    <adapter name="start" factory=".behaviors.start_indexer" />
    <adapter name="end" factory=".behaviors.end_indexer" />
    <adapter name="SearchableText" factory=".behaviors.searchable_text_indexer" />
    <adapter name="sync_uid" factory=".behaviors.sync_uid_indexer" />

    <plone:behavior
        title="Event Basic"
        description="Basic Event schema."
        provides=".behaviors.IEventBasic"
        factory=".behaviors.EventBasic"
        for="plone.dexterity.interfaces.IDexterityContent"
        marker=".interfaces.IDXEvent"
        />

    <plone:behavior
        title="Event Recurrence"
        description="Recurrence extension for Events."
        provides=".behaviors.IEventRecurrence"
        factory=".behaviors.EventRecurrence"
        for="plone.dexterity.interfaces.IDexterityContent"
        marker=".interfaces.IDXEventRecurrence"
        />

    <plone:behavior
        title="Event Location"
        description="Location extension for Events."
        provides=".behaviors.IEventLocation"
        factory="plone.behavior.AnnotationStorage"
        for="plone.dexterity.interfaces.IDexterityContent"
        marker=".interfaces.IDXEventLocation"
        />

    <plone:behavior
        title="Event Attendees"
        description="Attendees extension for Events."
        provides=".behaviors.IEventAttendees"
        factory="plone.behavior.AnnotationStorage"
        for="plone.dexterity.interfaces.IDexterityContent"
        marker=".interfaces.IDXEventAttendees"
        />

    <plone:behavior
        title="Event Contact"
        description="Contact extension for Events."
        provides=".behaviors.IEventContact"
        factory="plone.behavior.AnnotationStorage"
        for="plone.dexterity.interfaces.IDexterityContent"
        marker=".interfaces.IDXEventContact"
        />

    <plone:behavior
        title="Event Summary"
        description="Summary/body text extension for Events."
        provides=".behaviors.IEventSummary"
        factory="plone.behavior.AnnotationStorage"
        for="plone.dexterity.interfaces.IDexterityContent"
        />

    <genericsetup:registerProfile
        name="default"
        title="plone.app.event.dx"
        directory="profiles/default"
        description="Plone event dexterity extensions."
        for="Products.CMFPlone.interfaces.IPloneSiteRoot"
        provides="Products.GenericSetup.interfaces.EXTENSION"
        />

</configure>
