Classification Attributes Editor

The main goal of the editor is to enhance search mechanism, especially Simple Search and Filters widget. The editor automatically converts value provided by a user basing on a selected unit.

The editor shouldn't be placed in editor area, it converts classification attributes values while you use search mechanism.

Taking the following details as an example:
  • defined classification units: millimeter, centimeter, and meter
  • base unit: centimeter
When you type value equal to 25 and change unit to meter, the model is informed about value equal to 2500. When you type value equal to 25 and change unit to millimeter, the model is informed about value equal to 2.5.

Editor Definition

Name

Number with classification unit editor.

ID

com.hybris.cockpitng.editor.numberwithclassificationunit

Description

The editor can be used to provide number value together with classification unit. The value that is provided is automatically converted to base unit when user changes classification unit.

Type

java.lang.Number

Author

SAP

Inputs

Not applicable.

Outputs

Not applicable.

Editor Preview

Configuration

You can configure the editor in the following ways:

  • Using classification attribute qualifier:

    The qualifier should have the following format: {catalogId}/{systemVersion}/{classificationClassCode}.{classificationAttributeCode}

    Example of configuration:

    <context type="Product" component="fulltext-search">
       <fts:fulltext-search xmlns:fts="http://www.hybris.com/cockpitng/config/fulltextsearch">
          <fts:field-list>
             <fts:field name="weight" editor="com.hybris.cockpitng.editor.numberwithclassificationunit" >
                <fts:editor-parameter>
                   <fts:name>classificationAttributeQualifier</fts:name>
                   <fts:value>ElectronicsClassification/1.0/40.Weight, 94</fts:value>
                </fts:editor-parameter>
             </fts:field>
          </fts:field-list>
       </fts:fulltext-search>
    </context>
  • Using classification attribute values:

    Provide the following values:

    • catalogID
    • systemVersion
    • classificationClassCode
    • classificationAttributeCode

    Example of configuration:

    <context type="Product" component="fulltext-search">
       <fts:fulltext-search xmlns:fts="http://www.hybris.com/cockpitng/config/fulltextsearch">
          <fts:field-list>
             <fts:field name="weight" editor="com.hybris.cockpitng.editor.numberwithclassificationunit" >
                <fts:editor-parameter>
                   <fts:name>catalogId</fts:name>
                   <fts:value>ElectronicsClassification</fts:value>
                </fts:editor-parameter>
                <fts:editor-parameter>
                   <fts:name>systemVersion</fts:name>
                   <fts:value>1.0</fts:value>
                </fts:editor-parameter>
                <fts:editor-parameter>
                   <fts:name>classificationClassCode</fts:name>
                   <fts:value>40</fts:value>
                </fts:editor-parameter>
                <fts:editor-parameter>
                   <fts:name>classificationAttributeCode</fts:name>
                   <fts:value>Weight, 94</fts:value>
                </fts:editor-parameter>
             </fts:field>
          </fts:field-list>
       </fts:fulltext-search>
    </context>
  • Using classification unit:

    Provide the following values:

    • catalogID
    • systemVersion
    • classificationAttributeUnitCode

    Example of configuration:

    <context type="Product" component="fulltext-search">
       <fts:fulltext-search xmlns:fts="http://www.hybris.com/cockpitng/config/fulltextsearch">
          <fts:field-list>
             <fts:field name="weight" editor="com.hybris.cockpitng.editor.numberwithclassificationunit" >
                <fts:editor-parameter>
                   <fts:name>catalogId</fts:name>
                   <fts:value>ElectronicsClassification</fts:value>
                </fts:editor-parameter>
                <fts:editor-parameter>
                   <fts:name>systemVersion</fts:name>
                   <fts:value>1.0</fts:value>
                </fts:editor-parameter>
                <fts:editor-parameter>
                   <fts:name>classificationAttributeUnitCode</fts:name>
                   <fts:value>146</fts:value>
                </fts:editor-parameter>
             </fts:field>
          </fts:field-list>
       </fts:fulltext-search>
    </context>

Settings

Not applicable.