Caution: This documentation is for eZ Publish legacy, from version 3.x to 6.x.
For 5.x documentation covering Platform see eZ Documentation Center, for difference between legacy and Platform see 5.x Architecture overview.

Commands

Summary

Sets character transformation rules.

Usage

Commands[]=<transformation_command1_groupname>

Description

The Commands setting allows you to define the rules of character transformation and define them to the corresponding groups. These commands will be used by the system in addition to the rules defined in the transformation files if any are specified to a certain group.
It is also possible to specify parameters for the commands, these will allowed the system to look for the defined rule in all transformation files (not only the loaded ones). If not specified all corresponding transformation rules will be used.
The following list contains the possible transformation commands:

  • normalize: this command normalizes multiple characters with similar meaning to one type. For each parameter, it looks for rules named:
    <parameter>_normalize
    
    If no parameters are used it will use all normalize rules.
  • search_normalize: this command runs normalization rules required for search engine. For each parameter, it looks for rules named:
    <parameter>_search_normalize
    
    If no parameters are used it will use all search rules.
  • transform: this command transforms one type of character into another. For each parameter, it looks for rules named:
    <parameter1>_to_<parameter2>
    
    If no parameters are used it will find all transformation rules.
  • decompose: this command turns special characters into strings representing the character. For each parameter, it looks for rules named:
    <parameter>_decompose
    
    If no parameters are used it will find all decompose rules.
  • lowercase: this command turns characters into their lowercase variant if possible. For each parameter, it looks for rules named:
    <parameter>_lowercase
    
    If no parameters are used it will find all lowercase rules.
  • uppercase: this command turns characters into their uppercase variant if possible. For each parameter, it looks for rules named:
    <parameter>_uppercase
    
    If no parameters are used it will find all uppercase rules.
  • transliterate: this command converts from one type of charset to another by finding similar characters or strings. For each parameter, it looks for rules named:
    <parameter1>_transliterate_<parameter2>
    
    If no parameters are used it will find all transliteration rules
  • diacritical: this command removes diacriticals from characters. For each parameter, it looks for rules named:
    <parameter>_diacritical
    
    If no parameters are used it will find all diacritical rules.
  • rule: this command runs custom transformation rule. For each parameter, it looks for rules named:
    <parameter>
    
    If no parameters are used it will do nothing.
  • url_cleanup: this command performs cleanups to make the text presentable in a URL. No parameters can be passed for this command.
  • identifier_cleanup: this command performs cleanups to make the text usable as an identifier. No parameters can be passed for this command.
  • search_cleanup: this command performs cleanup to make the text parsable by the search engine. For each parameter, it looks for rules named:
    <parameter>_search_cleanup
    
    If no parameters are used it will find all search_cleanup rules.

It is also possible to create custom rules in order to transform characters according to your own specific needs.

Examples

example 1
[urlalias_iri]
 
Commands[]
Commands[]=url_cleanup_iri

This is the default setting for commands in [urlalias_in]. This command will perform an IRI cleanup only, which means that almost all unicode characters are allowed in URLs with the exceptions being space, ampersand and semi-colon.

example 2
[search]
 
Commands[]
Commands[]=decompose
Commands[]=normalize
Commands[]=diacritical
Commands[]=search_normalize
Commands[]=lowercase
Commands[]=transform(inverted,normal)
Commands[]=transform(math,ascii)
Commands[]=search_cleanup

These are the default commands to use for search.

example 3
[urlalias]
 
Commands[]
Commands[]=url_cleanup
Commands[]=transform

This configuration means that when the setting TransformationGroup in Site.ini is set to "urlalias", the system will use two commands, url_cleanup and transform, in addition to the rules from the transformation files that are loaded by default.

Example 4
[transformation]
 
Groups[]
Groups[]=my_group
 
[my_group]
 
Files[]
 
Extensions[]
 
Commands[]
 
Commands[]=transform(math,ascii)

This configuration sets a new custom group "my_group" that will use the transform command with a parameter "math_to_ascii". The transformation rules for this case are defined in the corresponding section of "latin.tr" transformation file and will turn some special math symbols into ASCII equivalents.

Ester Heylen (22/06/2010 12:10 pm)

Ricardo Correia (26/07/2013 9:58 am)

Ester Heylen, Ricardo Correia


Comments

There are no comments.