cspace-config Fields
What is a Field
Fields are used in creation of the UISPEC.
They connect the service layer definitions with the ui definitions of items and they also help in the creation of the uispec
Where are Fields
Fields are part of the record element of the cspace-config
Structure of Fields
<field id="nametitle" mini="summary,list" exists-in-services="false"> <selector>.csc-object-identification-object-nametitle</selector> <merges> <merge id="title" rank="1"/> <merge id="objectName" rank="2"/> </merges> </field> <field id="title" in-title="yes" mini="list"> <title-selector>.csc-titleBar-object-identification-object-title</title-selector> <selector>.csc-object-identification-object-title</selector> </field> <field id="titleLanguage" autocomplete="vocab-languages" ui-type="enum"> <enum-default>English</enum-default> <selector>.csc-object-identification-object-title-language</selector> </field>
field
attributes
id
- string
- no default required
mini
- set of strings from number|summary|list|search|relate|terms
- default {""}
- defines the fields that are used in find and edit and search results
- number - only one field can be set as number
- summary - only one field can be set as summary
- list - multiple fields can be set as list
- will be used in Find & Edit page and lists on tabs to set columns required
- search - multiple fields can be set as search
- will be used in the search results to set columns required
- relate - multiple fields can be set as relate
- will be used in the RH related Object and relatedProcedures to set columns required
- terms - multiple fields can be set as terms
- will be used in the RH side termsUsed section to set columns required
autocomplete
- set of strings
- default {""}
- allows authorities (or multiple authorities) to be link to a specific field so that they can use autocomplete
- instance id of authority is used as the string reference in this context
container
- boolean true|false 1|0 yes|no
- default false
- used as UI refactors as some fields need a separate container label and some do not
xxx_ui_refactored
- boolean true|false 1|0 yes|no
- default true
- a temporary marker to be used until the UI refactors all their containers
userecord
- string
- default ""
- used mostly by groups/repeats allows a field to be defined as a record. value should be the id of a record.
selector-affix
- string
- default ""
- tobe used when you have multiple fields with userecord set to the same record as it allows you to set a affix that will be included into the UI selector for the fields in the schema and spec.
ui-search
- string range|repeatable|single
- default blank
- if a string is specified then it will set this field as an advanced searchable field in the uispec that is sent to the UI
If the UI sends back a request with a string that hasn't been specified with the ui-search attribute the app will still create the correct search string to send to the service layer. This flag is purely to create the appropriate uispec and uischema for the UI- range is used for date ranges
- repeatable is used when you want the field to be repeatable in UI for advanced search
- single is used for a non-repeatable field in the UI search page
ui-type
- string plain|list|date|linktext|dropdown|enum
- default "plain"
- describes how the field will be described in the uispec. Controls the markup.
ui-readonly
- boolean true|false 1|0 yes|no
- defaults to the value of services-readonly
- if true, instructs the ui to disable editing of the field. Only has an effect in combination with certain non-default ui-types.
seperate_ui_container
- boolean true|false 1|0 yes|no
- default false (unless type = date then defaults to true)
- marks those element which require separate containers in the uispec
as-expander
- boolean true|false 1|0 yes|no
- default false
- used by the ui if expander required in uispec
in-title
- boolean true|false 1|0 yes|no
- default false
- used by the ui to define if a field exists in the title
exists-in-services
- boolean true|false 1|0 yes|no
- default true
- allows certain fields to be set as false and therefore ignored by the service layer but exist in the uispecs etc
services-readonly
- boolean true|false 1|0 yes|no
- default false
- if true, the field is omitted from XML payloads sent to the services layer
display-name
- boolean true|false 1|0 yes|no
- default false
- used by authorities to define which item is used in computeDisplayName
section
- string
- default "common"
- service layer tag - used to define the name of the multipart document
datatype
- string
- default "string"
- can set to "boolean" for checkbox input
Simple Elements
selector
- string
- default ".csc-" + parentID + "-" + id
- UI tag used in uispec creation
linktext
- string
- default "${items.0.number}"
- UI used in uispec creation
linktext-target
- string
- default "${items.0.recordtype}.html?csid=${items.0.csid}"
- UI tag used in uispec creation
autocomplete-selector
- string
- default selector + "-autocomplete"
- UI used in uispec creation
container-selector
- string
- default selector + "-container"
- UI used in uispec creation
title-selector
- string
- default selector + "-titlebar"
- UI used in uispec creation
services-tag
- string
- default id
- UI used in uispec creation
services-filter-param
- string
- default null
- services - used to create restrictions sent to service layer for /accounts
default
- string
- default ""
- Only has an effect if the
datatype
attribute is set to "boolean". Sets the default value of a boolean field. Values of "true", "yes", and "1" (case-insensitive comparison) are interpreted as true, all other values are false.
Complex Elements
merges
no documention yet
enum
<enum has-blank="true"> <default>English</default> <blank-value>Please select a value</blank-value> </enum>
has-blank (property)
- boolean true|false 1|0 yes|no
- default true
- used to define whether a blank field should prefix this controlled list
default (element)
- String
- default null
- used to select which value in the controlled list should be shown as the default value
blank-value(element)
- String
- default - record/enum-blank
- if enum has-blank=true then this is the text that will be shown for the blank entry in the list
- if this tag is not included then it will fall back to the value set in record/enum-blank and if that is not set it will fall back to records/enum-blank and if that is not set it will use the value "Default String"