<configure
    xmlns="http://namespaces.zope.org/zope"
    xmlns:browser="http://namespaces.zope.org/browser"
    xmlns:i18n="http://namespaces.zope.org/i18n"
    xmlns:monkey="http://namespaces.plone.org/monkey"
    i18n_domain="senaite.core">

    <adapter
      factory=".acquirefielddefaults.AcquireFieldDefaults"
      provides="bika.lims.interfaces.IAcquireFieldDefaults"
      for="bika.lims.interfaces.IAnalysisRequest"
      name="DefaultAquireFieldDefaults"
    />

    <adapter
      factory=".widgetvisibility.ClientFieldWidgetVisibility"
      provides="bika.lims.interfaces.IATWidgetVisibility"
      for="bika.lims.interfaces.IAnalysisRequest"
      name="ClientFieldWV"
    />

    <adapter
      factory=".widgetvisibility.BatchARAdd_BatchFieldWidgetVisibility"
      provides="bika.lims.interfaces.IATWidgetVisibility"
      for="bika.lims.interfaces.IAnalysisRequest"
      name="BatchBatchFieldWV"
    />

    <adapter
      factory=".widgetvisibility.OptionalFieldsWidgetVisibility"
      provides="bika.lims.interfaces.IATWidgetVisibility"
      for="bika.lims.interfaces.IAnalysisRequest"
      name="OptionalFieldsWidgetVisibility"
    />
    <adapter
      factory=".widgetvisibility.OptionalFieldsWidgetVisibility"
      provides="bika.lims.interfaces.IATWidgetVisibility"
      for="bika.lims.interfaces.ISample"
      name="OptionalFieldsWidgetVisibility"
    />
    <adapter
      factory=".widgetvisibility.OptionalFieldsWidgetVisibility"
      provides="bika.lims.interfaces.IATWidgetVisibility"
      for="bika.lims.interfaces.IBatch"
      name="OptionalFieldsWidgetVisibility"
    />

    <adapter
      factory=".widgetvisibility.WorkflowAwareWidgetVisibility"
      provides="bika.lims.interfaces.IATWidgetVisibility"
      for="bika.lims.interfaces.IAnalysisRequest"
      name="WorkflowAwareWV"
    />
    <adapter
      factory=".widgetvisibility.WorkflowAwareWidgetVisibility"
      provides="bika.lims.interfaces.IATWidgetVisibility"
      for="bika.lims.interfaces.ISample"
      name="WorkflowAwareWV"
    />

    <adapter
      factory=".widgetvisibility.SamplingWorkflowWidgetVisibility"
      provides="bika.lims.interfaces.IATWidgetVisibility"
      for="bika.lims.interfaces.ISample"
      name="SamplingWorkflowWV"
    />

    <adapter
      factory=".widgetvisibility.SamplingWorkflowWidgetVisibility"
      provides="bika.lims.interfaces.IATWidgetVisibility"
      for="bika.lims.interfaces.IAnalysisRequest"
      name="SamplingWorkflowWV"
    />

    <adapter
      for="zope.interface.Interface
           zope.publisher.interfaces.browser.IBrowserRequest"
      factory="bika.lims.adapters.referencewidgetvocabulary.DefaultReferenceWidgetVocabulary"
      provides="bika.lims.interfaces.IReferenceWidgetVocabulary"
    />

    <adapter
      factory=".widgetvisibility.HideARPriceFields"
      provides="bika.lims.interfaces.IATWidgetVisibility"
      for="bika.lims.interfaces.IAnalysisRequest"
      name="HideARPriceFields"
    />

    <adapter
      factory=".widgetvisibility.HideClientDiscountFields"
      provides="bika.lims.interfaces.IATWidgetVisibility"
      for="bika.lims.interfaces.IClient"
      name="HideClientDiscountFields"
    />

    <adapter name='bika.lims.IHaveIdentifiersExtender' factory=".identifiers.IHaveIdentifiersSchemaExtender"/>
    <adapter name='bika.lims.IHaveIdentifiersModifier' factory=".identifiers.IHaveIdentifiersSchemaModifier"/>

    <adapter factory=".identifiers.IdentifiersIndexer" name="Identifiers"/>

    <browser:page
      for="*"
      name="getidentifiertypes"
      class="bika.lims.adapters.identifiers.ajaxGetIdentifierTypes"
      permission="zope.Public"
      layer="bika.lims.interfaces.IBikaLIMS"
    />

    <monkey:patch
      description="Allow Identifiers to be included in SearchableText"
      class="Products.Archetypes.BaseObject.BaseObject"
      original="SearchableText"
      replacement=".identifiers.SearchableText"
      preserveOriginal="True"
     />

    <!-- Stickers -->
    <!-- IGetStickerTemplates adapters -->
    <adapter
      factory="bika.lims.adapters.stickers.GetSampleStickers"
      for="bika.lims.interfaces.ISample"
      provides="bika.lims.interfaces.IGetStickerTemplates"
    />
    <adapter
      factory="bika.lims.adapters.stickers.GetSampleStickers"
      for="bika.lims.interfaces.IAnalysisRequest"
      provides="bika.lims.interfaces.IGetStickerTemplates"
    />

</configure>
