Start page / Template development / Forms / Input components / INDEX

FS_INDEXAvailable from FirstSpirit Version 5.2

Contents
for example
to the methods: Index<Index$Record>
FS_INDEX

The FS_INDEX input component is used to integrate external components or modules that need to make data available to the input component. This data can be selected, i.e., referenced, with FS_INDEX. Both function and appearance are highly dependent on the individual implementation of the module.

As standard, FirstSpirit includes a solution for selecting datasets from project data sources. The name of the corresponding DataAccess plug-in is DatasetDataAccessPlugin. It can be specified with the name attribute of the <SOURCE /> tag. See also the example below Selecting datasets.

Important Datasets with a GID (“FS_GID” column) are a mandatory requirement when using DatasetDataAccessPlugin. (For information about the GID, see also Database connection (→Documentation for Administrators) .)

The Using different DataAcess plug-ins section illustrates the use of DataAccess plug-ins provided by FirstSpirit modules.

The Access to FS_INDEX data sub-page describes the interfaces that facilitate access to the value set of an FS_INDEX input component.

Depending on the plug-in used, the input component provides the editor with the following functions:

  • Add entry icon_add_green (ADD)
    Use this icon (or shortcut Shift+N) to add an existing dataset or an element to the index (FS_INDEX). Each element can only be selected once.
  • Creating new entry icon_new_green (NEW)
    Use this icon (or shortcut Ctrl+Shift+N) to create a new dataset or a new element and to add it to the index.
    The new data will be created depending on the plug-in, in the case of the DatasetDataAccessPlugin sample within the database table which is indicated by <TEMPLATE/>, for example.
  • Display entry icon_view_green
    Use this icon (or shortcut Ctrl+Gor double click) to open the referenced dataset or the element in a new tab in the editing area.
  • Remove entry (REMOVE)
    Use this icon (or Del) to remove the selected dataset or element from the index (FS_INDEX). (The dataset itself remains in the database, but it will no more be referenced by this FS_INDEX component.) Removing the entry requires confirming a security prompt first.
  • Move entry icon_down_green
    You can change the order of entries by using these icons or clicking one or more entries and dragging it / them to the required position (drag-and-drop).

One or more functions (exception: moving and displaying) can be deactivated by means of rules (see also special sub-pages, for example for property EDIT). Use the keywords given in brackets above. You can prevent editing an entry by using the keyword EDIT.
Example:

<RULES>
<RULE when="ONLOCK">
<WITH>
<FALSE/>
</WITH>
<DO>
<PROPERTY name="NEW" source="fs_index"/>
</DO>
</RULE>
</RULES>

In this example, new entries are prevented from being created. The corresponding icon is inactive.

In the example below, only three entries are permitted:

<RULES>
<RULE>
<WITH>
<LESS_THAN>
<PROPERTY name="SIZE" source="fs_index"/>
<NUMBER>3</NUMBER>
</LESS_THAN>
</WITH>
<DO>
<PROPERTY name="NEW" source="fs_index"/>
</DO>
</RULE>
</RULES>

For information about transfer types which are supported for drag-and-drop please see also page Drag-and-drop.

FS_INDEX takes over most of the functions supported by the deprecated input component FS_LIST, Type DATABASE. For information about switching from FS_LIST to FS_INDEX please see Migration guide FS_LIST.

name
Designator
Mandatory
convertEntities
ConvertEntity
Optional parameters
height
PositiveInteger
Optional parameters
hidden
YesNo
Optional parameters
indexTreatment
Treatment
Optional parameters
preset
Preset
Optional parameters
searchRelevancy
Relevancy
Optional parameters
useLanguages
YesNo
Optional parameters
viewMode
ViewMode
Optional parameters
lang
LanguageAbbreviation
Mandatory
description
String
Optional parameters
label
String
Optional parameters
name
String
Mandatory

Parameter

The parameters of the FS_INDEX input component are given in the following table.

ParameterMandatorySinceTypeDefault value
name*Yes3.1DesignatorNone
convertEntitiesNo2.0ConvertEntityNONE
heightNo5.2PositiveInteger4
hiddenNo4.0.44YesNoNO
indexTreatmentNo5.2.12TreatmentDEFAULT
presetNo4.0PresetDEFAULT
searchRelevancyNo5.2.305RelevancyDEFAULT
useLanguagesNo2.0YesNoYES
viewModeNo5.2ViewModeDETAILS

name

The attribute "name" is the variable name of an input component with which the the result object of the input component can be used in the templates - with the help of $CMS_VALUE()$ - or the content can be output.

ParameterMandatorySinceTypeDefault value
name*Yes3.1DesignatorNone

convertEntities

The "convertEntities" attribute is used to convert special characters entered in the input component for output in HTML characters.

There are three forms:

  • convertEntities="NONE" (standard)
  • convertEntities="STANDARD"
  • convertEntities="QUOTE"

With the NONE form, no conversion rules whatsoever are applied.

If STANDARD is given the conversion rules in the "convert" area of the selected conversion rule of the template set are applied.

The form QUOTE explicitly includes STANDARD too. However, the "quote" area of the conversion rule is also applied.

ParameterMandatorySinceTypeDefault value
convertEntitiesNo2.0ConvertEntityNONE

height

The height parameter is used to define the display height of the input component. As a value, the parameter expects an integer.
The number selected here specifies the number of rows that are completely visible in the component, based on the initial view mode of the input component (see viewMode parameter). In addition, part of a further row is also made visible in order to indicate to users that the input component contains even more entries.

The default value is 4.

ParameterMandatorySinceTypeDefault value
heightNo5.2PositiveInteger4

hidden

With the "hidden" parameter an input component can be hidden from the editor.

If hidden="YES" the input component is not visible for the editor, if hidden="NO" it is visible.

The default value for hidden is NO.

ParameterMandatorySinceTypeDefault value
hiddenNo4.0.44YesNoNO

indexTreatment

Indexing of datasets that are referenced via this input component may be configured such that the path length will be considered. For a dataset which references other datasets, this controls whether the contents of only this "origin" dataset should be indexed or the contents of this dataset and of the datasets it references should be indexed. If contents of referenced datasets should be indexed as well, the parameter allows specification of the path length to which references should be considered. For example, a path length "2" means that, in addition to the contents of the "origin" dataset, the contents of datasets referenced by this "origin" dataset as well as the contents of datasets referenced by these datasets will be indexed.

The path length can be set for the input components mentioned above via the parameter indexing.relationshipPathLengthToFollow in the configuration file fs-server.conf. By default, a path length "1" is assumed such that, for this input component, datasets and the datasets they immediately reference are indexed.
This configuration is applied server-wide for all projects. On a project/component level, the parameter indexTreatment may be used to manually extend the path length specified by indexing.relationshipPathLengthToFollow across certain tables, thereby practically increasing the value of the parameter indexing.relationshipPathLengthToFollow for certain input components. If

indexTreatment="follow"

is set, datasets which are referenced by the input component in question will be indexed along with the origin dataset. If the parameter is not set, indexTreatment="default" is assumed, and referenced datasets will be indexed according to the configuration of indexing.relationshipPathLengthToFollow. The parameter indexTreatment can thus only be used to extend indexing to a longer path length, but not to limit indexing.

If the path length should be extended via indexTreatment="follow" across several tables, indexTreatment="follow" must be set for the relevant input component in each table along the desired path. If indexTreatment="follow" is not set in a table template (this corresponds to indexTreatment="default"), indexing will stop.

For further information please see page Search and indexing.

ParameterMandatorySinceTypeDefault value
indexTreatmentNo5.2.12TreatmentDEFAULT

preset

Using the preset attribute the handling of default values in an input component can defined (see also chapter Default values). If preset="default" is set, the fall-back value defined in the form is used. If this value in the form is changed later on, these changes will be affect all usages of this default value in the input components maintained by the editor, as long as a value will be set manually in the input component. This is the default setting. If preset="copy" is set, the value entered by the editor is copied directly into the input component. Subsequent changes to the default value in the form do not have any effect on the usages of this default value in the input components maintained by the editor.

ParameterMandatorySinceTypeDefault value
presetNo4.0PresetDEFAULT

searchRelevancy

This parameter can be used for determining the weighting of content of this input component in search results (SiteArchitect: Global Search (Global search (→Documentation FirstSpirit SiteArchitect)), search in data sources (Search (→Documentation FirstSpirit SiteArchitect)) | ContentCreator: search in report area). For example, using this parameter, template developers may specify that elements that contain a search term in a headline input component should be displayed more prominently in search results than elements that only contain the search term in a body text input component. Additionally, contents of individual input components may be configured so that they be ignored during indexing for search, which may increase indexing performance.
Input components may be configured with the following values to specify their contents' weight in search indexing:

  • none: The contents of an input component that is configured with this search relevancy value will not be indexed. Pages, sections, and datasets which contain contents in input components configured with this search relevancy value will not appear in search results if the search term only appears in these input components. Searching for contents of such input components using drag-and-drop will yield no results ("The field is not eligible for search, as it is marked non-relevant for searching."). Such fields are also marked accordingly in "Simple Search" in data sources ("Not eligible for searching.").
  • default: The input component's content receives default weight in the search index (default setting).
  • high: The contents of an input component that is configured with this search relevancy value will be displayed more prominently in search results (exception: search for datasets). This means that if a search term appears in both an element with an input component configured with high search relevancy and an element with an input component configured with default search relevancy, the element which contains the search term in a high-relevancy input component will be shown in a higher position in search results.

If the parameter is not specified for an input component, the component's contents will be indexed with a default weight (searchRelevancy="default").

Hierarchy of evaluation:

  • If searchRelevancy="none" is set for for this input component ("outer input component"),
    • input components of inner entries will not be indexed regardless of the searchRelevancy setting of input components in the templates used for inner entries.
  • If searchRelevancy="default" is set for for this input component ("outer input component"),
    • input components in inner entries, with searchRelevancy="none" will not be indexed,
    • input components in inner entries, with searchRelevancy="default" will be indexed with normal weight,
    • input components in inner entries, with searchRelevancy="high" will be indexed with higher weight.
  • If searchRelevancy="high" is set for for this input component ("outer input component"),
    • input components in inner entries, with searchRelevancy="none" will not be indexed,
    • input components in inner entries, with searchRelevancy="default" or searchRelevancy="high" will be indexed with higher weight.

FS_CATALOG, searchRelevancy, hierarchy

Note: Header fields of snippets (tab Snippet in templates, "Label" field) are also indexed. If an input component is configured with a weighting none (searchRelevancy="none") but its value is included in the template's snippet header field, searching for the input component's value will cause the associated element to appear in search results

For further information, see

  • page Search and indexing
  • interface GomSearchRelevancy (package de.espirit.firstspirit.access.store.templatestore.gom, FirstSpirit Developer API)
  • interface SearchService (package de.espirit.firstspirit.access.search, FirstSpirit Access API)
  • interface QueryAgent (package de.espirit.firstspirit.agency, FirstSpirit Developer API)

ParameterMandatorySinceTypeDefault value
searchRelevancyNo5.2.305RelevancyDEFAULT

useLanguages

The useLanguages parameter can be used to specify whether or not an input component is to store different or deviating values for different languages (multi-lingual maintenance).

If the parameter is not given, deviating values are stored for the different languages as a default.

If NO (...useLanguages="NO") is specified, one value is stored for all languages.

Available from FirstSpirit Version 5.2R5 useLanguages="YES" will potentially no longer be evaluated in FirstSpirit version 5.2R5 and higher. See also parameter forbidPolyglotDataHierarchy (FS_CATALOG).

ParameterMandatorySinceTypeDefault value
useLanguagesNo2.0YesNoYES

viewMode

Use this parameter for controlling how the entries of this input component are to be displayed initially.

  • DETAILS: detailed view of the entries. This is the default value.

    FS_INDEX
  • HEADERS: list view of the entries.

    FS_INDEX, Ansicht HEADERS
  • SYMBOLS: Only symbols will be shown.

    FS_INDEX, Ansicht SYMBOLS

Example:

viewMode="HEADERS"

The editor can choose in every input component himself how the entries are to be displayed.

ParameterMandatorySinceTypeDefault value
viewModeNo5.2ViewModeDETAILS

LANGINFOSAvailable from FirstSpirit Version 4.0

Using the tag LANGINFOS language-dependent information can be defined for each input component, e.g. which title is to be used for the input component in the different project languages (parameter label), which tooltip is to be displayed (parameter description) etc. For reasons of clarity, definitions which are identical in multiple languages will be merged. For example,

<LANGINFOS> 
<LANGINFO lang="*" label="Datum"/>
<LANGINFO lang="DE" label="Datum"/>
<LANGINFO lang="EN" label="Datum"/>
</LANGINFOS>

will be merged to

 <LANGINFOS> 
<LANGINFO lang="*" label="Datum"/>
</LANGINFOS>

after saving.

Available from FirstSpirit Version 4.2R2 Up to and including FirstSpirit version 4.2R2 language definitions will be deleted only in the case if the values are identical in all languages (as in example above). Furthermore, only the parameters lang, description and label are taken into account when merging.

Available from FirstSpirit Version 4.2R4 Since FirstSpirit version 4.2R4 all parameters are taken into account (e.g. format and length). Furthermore, language definitions are also merged within LANGINFOS tags, if they are identical in at least two languages. For example,

<LANGINFOS> 
<LANGINFO lang="*" label="Date" format="dd.MM.yy"/>
<LANGINFO lang="DE" label="Date" format="dd.MM.yy"/>
<LANGINFO lang="EN" label="Date" format="MM/dd/yy"/>
</LANGINFOS>

will become

 <LANGINFOS> 
<LANGINFO lang="*" label="Date" format="dd.MM.yy"/>
<LANGINFO lang="EN" label="Date" format="MM/dd/yy"/>
</LANGINFOS>

after saving.

The definition for the fallback value (*) will not be deleted in any case. If there are two or more language definitions with identical values the first one will be maintained, the other will be deleted.

Available from FirstSpirit Version 4.2R2 IMPORTANT: Up to and including FirstSpirit version 4.2R2 at least one definition for the fallback labelling ("*") must be given:

<LANGINFOS>
<LANGINFO lang="*" label="TEXT"/>
</LANGINFOS>

Available from FirstSpirit Version 4.2R4 From FirstSpirit version 4.2R4 the fallback definition can be omitted. In this case, the language which is defined first will be used automatically as fallback value. For example,

<LANGINFOS>
<LANGINFO lang="EN" label="Date"/>
<LANGINFO lang="DE" label="Datum"/>
</LANGINFOS>

will become

 <LANGINFOS> 
<LANGINFO lang="*" label="Date"/>
<LANGINFO lang="DE" label="Datum"/>
</LANGINFOS>

after saving.

LANGINFOAvailable from FirstSpirit Version 3.1

The LANGINFO tag is used to give values or attributes for a language as well for use as fallback values.

In order to state values or attributes for a language it is necessary to give the abbreviation of the project language in the lang parameter:

...
<LANGINFO lang="DE".../>
...

Fallback values are given with the special language abbreviation * ("for all languages"):

...
<LANGINFO lang="*".../>
...

The lang parameter is a mandatory parameter.

ParameterMandatorySinceTypeDefault value
lang*Yes3.1LanguageAbbreviationNone
descriptionNo3.1StringNone
labelNo3.1StringNone

lang

The lang parameter is used to give the language abbreviation which is entered in the server properties see Language templates (→Documentation for Administrators)) to specify for which project languages the definitions are to apply, e.g. DE for German, EN for English, FR for French etc. The following characters can be used as often as required: -, _, 0-9 and A-Z. Lower case letters are transformed automatically into upper case letters after having saved the template. In addition * can be used for fallback values.

ParameterMandatorySinceTypeDefault value
lang*Yes3.1LanguageAbbreviationNone

description

The description parameter can be used to specify a description of how the input component is to be used and filled by the editor. The text defined here is displayed as a tooltip on mouse-over at the relevant input component.

The text should serve as a guide for the editor and be as short as possible, understandable and relevant. It should match the label (label parameter) and complement it appropriately.
Make sure to use terminology that the editor knows and expects.

Example:

...description="Please enter the text for the headline here (H1)."...

Tip: If you would like to know how to better support and guide editors when filling input components, take a look at the chapter on Rules and other parameters and functions of forms.

ParameterMandatorySinceTypeDefault value
descriptionNo3.1StringNone

label

Use the label parameter to define the label of the input component.

Choose a label that is as short and meaningful as possible.
In combination with a relevant description (description parameter), you can help the editor to use the input component correctly and successfully.

Example:

... label="Headline (H1)" ...

ParameterMandatorySinceTypeDefault value
labelNo3.1StringNone

SOURCEAvailable from FirstSpirit Version 5.2

Source definition for index entries.

ParameterMandatorySinceTypeDefault value
name*Yes5.2StringNone

name

The required DataAccess plug-in is specified with this mandatory parameter.

To reference the DataAccess plug-in included in the standard scope of FirstSpirit, the reference name of the DataAccess plug-in is specified here:

<SOURCE name="DatasetDataAccessPlugin">

See also the example 1) Selection of datasets with "DatasetDataAccessPlugin".

To reference user-defined plug-ins, the name of the module must be specified before and in addition to the reference name of the plug-in, separated by a slash, e.g.,

<SOURCE name="example_webedit/TextBlocksDataAccessPlugin"/>

where "example_webedit" is the name of the module and "TextBlocksDataAccessPlugin" is the name of the plug-in.

See also the example 2) Implementing your own plug-ins.

ParameterMandatorySinceTypeDefault value
name*Yes5.2StringNone
Key

PositiveInteger

Positive integer

Designator

Unique identifier of variable length; must start with a letter or underscore and may only contain the characters "A-Z", "a-z", "0-9" and "_", e.g. "fr_st_varName"

Treatment

Indexing behavior for referenced datasets

DEFAULTAvailable from FirstSpirit Version 5.2.12

Including referenced datasets in indexing according to configuration of "indexing.relationshipPathLengthToFollow"

FOLLOWAvailable from FirstSpirit Version 5.2.12

Extending the path of indexing referenced datasets

Relevancy

Definition of relevancy for search

NONEAvailable from FirstSpirit Version 5.2.305

Irrelevant

DEFAULTAvailable from FirstSpirit Version 5.2.305

Normal relevance

HIGHAvailable from FirstSpirit Version 5.2.305

High relevance

Preset

How to deal with default values

CopyAvailable from FirstSpirit Version 4.0

The value entered by the editor is copied directly into the input component, subsequent changes do not have any effect

DefaultAvailable from FirstSpirit Version 4.0

The fall-back value defined in the form is used, as long as a value will be set manually

ViewMode

Various modes defining how to present entries

DETAILSAvailable from FirstSpirit Version 5.2

Show all details.

HEADERSAvailable from FirstSpirit Version 5.2

Show necessary information only.

SYMBOLSAvailable from FirstSpirit Version 5.2

Show symbols only.

String

A random character string

ConvertEntity

Switch with which to define the conversion rule

NONEAvailable from FirstSpirit Version 2.0

Do not use any conversion rules

STANDARDAvailable from FirstSpirit Version 2.0

Use the conversion rules of the "convert" area

QUOTEAvailable from FirstSpirit Version 2.1

Use the conversion rules of the "convert" and "quote" area

YesNo

Switch to apply an attribute or not

NOAvailable from FirstSpirit Version 2.0

Do not apply attribute

YESAvailable from FirstSpirit Version 2.0

Apply attribute

LanguageAbbreviation

Language abbreviation, e.g. DE, EN, FR or * for return values

Example

Example of an “FS_INDEX” input component:

 <FS_INDEX name="IDENTIFIER">
<LANGINFOS>
<LANGINFO lang="*" label="TEXT_FALLBACK"/>
<LANGINFO lang="DE" label="TEXT_DE"/>
<LANGINFO lang="EN" label="TEXT_EN"/>
</LANGINFOS>
<SOURCE name="DatasetDataAccessPlugin">
<TEMPLATE uid="IDENTIFIER"/>
</SOURCE>
</FS_INDEX>

Examples of use in the template syntax

1) Selecting datasets with "DatasetDataAccessPlugin"

As standard, FirstSpirit includes a solution for selecting datasets from project data sources. The name of the corresponding DataAccess plug-in is DatasetDataAccessPlugin.

Important Datasets with a GID (“FS_GID” column) are a mandatory requirement when using DatasetDataAccessPlugin. (For information about the GID, see also Database connection (→Documentation for Administrators).)

Example:

<FS_INDEX name="st_index">
<LANGINFOS>
<LANGINFO lang="*" label="Dataset selection"/>
<LANGINFO lang="DE" label="Datensatzauswahl"/>
</LANGINFOS>
<SOURCE name="DatasetDataAccessPlugin">
<TEMPLATE uid="Products.products"/>
</SOURCE>
</FS_INDEX>

TEMPLATE: The reference to the required table template is specified with the mandatory tag TEMPLATE.
The reference must be specified in order to define the table from which the selection can be made and which input components are to be displayed.
The unique identifier of the table template must be specified as the value for the uid parameter.

The following tags and parameters are also available when using this plug-in:

<FS_INDEX name="st_index">
<LANGINFOS>
<LANGINFO lang="*" label="Dataset selection"/>
<LANGINFO lang="DE" label="Datensatzauswahl"/>
</LANGINFOS>
<SOURCE name="DatasetDataAccessPlugin">
<TEMPLATE uid="Products.products"/>
<QUERY name="Products.products_1>
<PARAM name="category">1088</PARAM>
</QUERY>
</SOURCE>
</FS_INDEX>

QUERY: The QUERY tag can be used to specify a query based on which the volume of datasets from which a selection can be made with the input component can be restricted.

name: The name parameter is used to specify the reference name of the query, e.g.,

<QUERY name="Products.products_1"/> 

PARAM: If parameters exist for the query defined with QUERY (Parameters tab of the query), a value can be assigned to these parameters with the PARAM tag.

name: The name parameter is used to specify the name of the query parameter.
The value of the query parameter is specified enclosed by an opening and a closing PARAM tag, e.g.,

<QUERY name="Products.products_1">
<PARAM name="category">1088</PARAM>
</QUERY>

“category” is a parameter defined for the query, “1088” is the value.

The way in which datasets (texts, images) are displayed in the form is influenced by the snippet definition of the underlying table template.

See also the example project.

2) Using different DataAccess plug-ins

DataAccess plug-ins can be implemented to link external sources (e.g., web services) to the FS_INDEX input component. This enables data objects from external sources of this nature to be referenced in the index component and used for content-related purposes.

In such cases, an FS_INDEX input component in a template would be configured as in the following example:

<FS_INDEX name="st_dataaccess">
<LANGINFOS>
<LANGINFO lang="*" label="Data Access Plugin"/>
</LANGINFOS>
<SOURCE name="example_webedit/TextBlocksDataAccessPlugin"/>
</FS_INDEX>

The name in the <SOURCE /> tag references the technical name of the FirstSpirit module and the technical name of the DataAccess plug-in component (see module definition in Plug-in development > Development and allocation). In the tag, these names are separated by a slash. In the example above, the module component called TextBlocksDataAccessPlugin in the module is being referenced with the technical name example_webedit.

DataAccess plug-ins can make dedicated XML elements for configuring data access available for use with FS_INDEX input components (see GomConfigurable DataAccess session builder aspect). These dedicated XML elements are available in the <SOURCE /> block and must be structured as specified in the plug-in code.

3) FS_INDEX containing only one entry

If you would like that the editor can select only one entry within your FS_INDEX component, you can manage this using a rule with the ADD property and a “less than” check (via <LESS_THAN/>), for example

<RULE>
<WITH>
<LESS_THAN>
<PROPERTY name="SIZE" source="fs_index"/>
<NUMBER>1</NUMBER>
</LESS_THAN>
</WITH>
<DO>
<PROPERTY name="ADD" source="fs_index"/>
</DO>
</RULE>

For technical reasons, the ADD rule is disregarded when replacing entries in ContentCreator in the preview. To ensure that the desired number of entries will not be exceeded, please use a rule with the restriction level SAVE, which will be applied when saving the form, for example

<RULE>  
<WITH>
<LESS_THAN>
<PROPERTY name="SIZE" source="fs_index"/>
<NUMBER>2</NUMBER>
</LESS_THAN>
</WITH>
<DO>
<VALIDATION scope="SAVE">
<PROPERTY name="VALID" source="fs_index"/>
<MESSAGE lang="*" text="The maximum number of entries is exceeded! Max. 1"/>
<MESSAGE lang="DE" text="Anzahl der Einträge überschritten! Max. 1"/>
</VALIDATION>
</DO>
</RULE>

If an entry is added to FS_INDEX via the preview in ContentCreator even though there is already an entry, the form will open showing the rule violation (“The maximum number of entries is exceeded! Max. 1”) and it can only be saved if surplus entries have been removed.

© 2005 - 2022 Crownpeak Technology GmbH | All rights reserved. | FirstSpirit 2022.12 | Data privacy