afs_acp_build - AFS - Reference Guides

AFS Filters Description

Product
AFS
Platform
7.12
Category
Reference Guides
Language
English

The acp_build is a filter available in the AFSv7 antidot-paf package. It creates ACP feeds from a set of XML layer inputs. The XML files are split according to the <feed> tags. One file is created per feed tag.

This input document must be generated by a predecessor filter of afs_acp_build, e.g., afs_xml_xslt, since the input is driven by the customer needs from the PaF input data. The input must conform to acp.xsd from an official AFSv7 ACP schema (http://ref.antidot.net/v7.9/acp.xsd).

The afs_acp_build filter cannot be instantiated more than once. It will not read the "instances" parameter in the configuration.

Features: - Can be run in both full and incremental (update existing feeds) modes. - Automatically removes duplicates to optimize ACP feeds file size. - One suggestion may be serialized into several feeds. - Several suggestions may be defined in a single layer.

The filter is declared with the afs_acp_build type. It is in the antidot-paf package. It is a visitor filter.

This filter can be instantiated only once at any given moment. It will not read the "instances" parameter in the configuration.

The Acp build db filter specifications are described in the following table:

Parameter name

Mandatory

Type

Default

Description

input_layer

No

layer

CONTENTS

Layer to read.

output_dir

Yes

string

N/A

The output directory where acp files will be flushed (relative to PaF install directory).

Example of an input layer file:

<feeds>
  <feed names=" __maSourceDeDonnee__ ">
    <AFS>
      <Suggestions lang="fr">
        <Suggestion keyword="luc celestopode" score="123" label="Luc Celestopode">
          <Option key="côté" value="Clair"/>
          <Option key="maître" value="Yoda"/>
          <Option key="couleurDuSabre" value="Bleu"/>
        </Suggestion>
        <Suggestion keyword="père sombre" score="42" label="Père Sombre">
          <Option key="côté" value="Obscur"/>
          <Option key="maître" value="Dark Sidious"/>
          <Option key="couleurDuSabre" value="Rouge"/>
        </Suggestion>
      </Suggestions>
    </AFS>
  </feed>

  <feed names=" __myDataSource__ ; __myDataSource2__ ">
    <AFS>
      <Suggestions lang="en">
       <Suggestion keyword="Luke Skywalker" score="123" label="Luke Skywalker">
          <Option key="side" value="Light"/>
          <Option key="master" value="Yoda"/>
          <Option key="lightSaberColor" value="Blue"/>
        </Suggestion>
        <Suggestion keyword="Darth Vader" score="42" label="Darth Vader">
          <Option key="side" value="Dark"/>
          <Option key="master" value="Dark Sidious"/>
          <Option key="lightSaberColor" value="Red"/>
        </Suggestion>
      </Suggestions>
    </AFS>
  </feed>
</feeds>
You can see three different feeds, one in French and two in English. Once AFS applies the afs_acp_build filter on this file, three output files are generated:
  • One file for the French content named maSourceDeDonnee_fr:acp.xml

<AFS>
  <Suggestions lang="fr">
    <Suggestion keyword="luc celestopode" label="Luc Celestopode" score="123">
      <Option key="côté" value="Clair"/>
      <Option key="maître" value="Yoda"/>
      <Option key="couleurDuSabreLaser" value="Bleu"/>
    </Suggestion>
    <Suggestion keyword="père sombre" label="Père Sombre" score="42">
      <Option key="côté" value="Obscur"/>
      <Option key="maître" value="Dark Sidious"/>
      <Option key="couleurDuSabreLaser" value="Rouge"/>
    </Suggestion>
  </Suggestions>
  </AFS>
  • One file for the English content named myDataSource_en:acp.xml

<AFS>
  <Suggestions lang="en">
    <Suggestion keyword="luke skywalker" label="Luke Skywalker" score="123">
      <Option key="side" value="Light"/>
      <Option key="master" value="Yoda"/>
      <Option key="lightSaberColor" value="Blue"/>
    </Suggestion>
    <Suggestion keyword="darth vader" label="Darth Vader" score="42">
      <Option key="side" value="Dark"/>
      <Option key="master" value="Dark Sidious"/>
      <Option key="lightSaberColor" value="Red"/>
    </Suggestion>
  </Suggestions>
</AFS>
  • And one file for the English content named myDataSource2_en:acp.xml

<AFS>
  <Suggestions lang="en">
    <Suggestion keyword="luke skywalker" label="Luke Skywalker" score="123">
      <Option key="side" value="Light"/>
      <Option key="master" value="Yoda"/>
      <Option key="lightSaberColor" value="Blue"/>
    </Suggestion>
    <Suggestion keyword="darth vader" label="Darth Vader" score="42">
      <Option key="side" value="Dark"/>
      <Option key="master" value="Dark Sidious"/>
      <Option key="lightSaberColor" value="Red"/>
    </Suggestion>
  </Suggestions>
</AFS>

Note: The language is retrieved from the settings done with the afs_lang_set filter. If no language is set, the filter considers the language as UNKNOWN.