Package com.jalios.jcms
Class TypeFieldEntry
java.lang.Object
com.jalios.jcms.TypeFieldEntry
- Direct Known Subclasses:
TitleTypeFieldEntry
This class holds all informations of a type's field.
- Author:
- Jean-Philippe Encausse, Olivier Jaquemet
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected Stringprotected intprotected Stringprotected Stringprotected booleanprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected intprotected Stringprotected TypeFieldEntry.DescriptionTypeprotected Stringprotected String[]protected booleanprotected String[]protected booleanprotected booleanprotected booleanprotected String[]protected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected intprotected Stringprotected intprotected Numberprotected Numberprotected Stringprotected Stringprotected intprotected intprotected Stringprotected intprotected intprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected final org.jdom.Element -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns true if the HTML contained in this field must be escaped.intAbstract/Summary lengthbooleangetBoolean(Data data) Gets the value of thisbooleanfield for the givenData.getCategory(Data data, Member mbr) Gets the value of the givenCategoryfield name for the givenData.Return the internal "chooser" of this field.intgetCols()TextInput/TextArea columns number.Control Settings of widget editor.SQLQuery/DBRecord/SQLResult: data source of this SQL related field.DateChooser: date formatDBRecord: columns to be listed for this DB record field (comma separated)DBRecord: primary key column of this DB record field.DBRecord: column used as label for this DB record fieldDBRecord: ORDER BY SQL criteria DB record fieldDBRecord: table of this DB record field.intDouble decimals countReturns a copy of the language map of default value for this textual field.Returns a copy of the language map of default value for this textual field.Returns a copy of the language map of default value for this textual field.Returns the default value (in the main language) of this textual field.Default value of field that can be expressed/converted into a string.Deprecated.since jcms-5.7.0.getDescription(String lang) Returns the localized description of this field.Returns the localized map of description of this field.Type of description to be used by widget:DescriptionType.NONEDescriptionType.TEXTDescriptionType.TOOLTIPdoubleGets the value of thisdoublefield for the givenData.Return the internal editor type of this field.String[]Enumerate: Labels of this enumerate field, e.g { "Red", "Green", "Blue"} for the default language of the type/site.Enumerate: Map of 'language to labels' for this enumerate field, e.g {{"en" -> { "Red", "Green", "Blue"}, "fr" -> ...String[]Enumerate: Possible values of this enumerate field, e.g { "00FF00", "00FF00", "0000FF"}.getFieldValueAsString(Data data, String lang) Gets value of the field asStringfor field of the following type:intlongdoublebooleanStringgetFieldValueAsString(Data data, String lang, boolean useDefault) Gets value of the field asStringfor field of the following type:intlongdoublebooleanStringString[]getFieldValueAsStringArray(Data data, String lang) Gets value of the field asString[]for field of the following type:int[]long[]double[]boolean[]String[]ListSetString[]getFieldValueAsStringArray(Data data, String lang, boolean useDefault) Gets value of the field asString[]for field of the following type:int[]long[]double[]boolean[]String[]ListSetString[]getGids()Member chooser: Group IDsintGets the value of thisintfield for the givenData.getLabel()Deprecated.since jcms-5.7.0.Returns the localized label of this field.Returns the Map of localized label of this field.longGets the value of thislongfield for the givenData.intTextInput maximum length.intSQLQuery/DBRecord/SQLResult: maximum row to be retrieved (0 means no limit)Returns the maximum value authorized for this number field (integer or decimal), if available.String[]Returns the mininum value authorized for this number field (integer or decimal), if available.getName()Java name of this field.Recapitalized java name of this field, (first letter capitalized).Gets the value of thisObjectfield for the givenData.Gets the value of thisObjectfield for the givenData.Gets the value of thisObjectfield for the givenData.getOffLabel(String lang) Returns the localized offLabel for to this field.Boolean: false/OFF Label of a boolean field.getOnLabel(String lang) Returns the localized onLabel for to this field.Boolean: true/ON Label of a boolean field.intReturns the resize heightintReturns the resize widthgetRoot()Categories: Root Category ID of this category fieldintgetRows()TextArea/WYSIWYG rows number.intgetSize()Enumerate: html Select size.Type: superTypesgetTab()Tab: tab name in which this field will be displayed.TabGroup: group name for multivalued fields, all field having the same value will be display together.getType()Retrieve type of this field asString.Short type of this field.getUnit()TextInput unit
e.g.TextInput unit, displayed after input.TextInput unit, displayed before input.Returns the WYSIWYG configuration ID.WYSIWYG toolbar options.org.jdom.ElementXML Parsing: jdom Element for this field.booleanCheck if an index is expected to be generated in the database for this field.protected voidInit the default value.protected voidprotected voidInit the enumerate values.voidinitType()protected voidInit the field unitsbooleanAbstract/Summary field?booleanIs field's editor any type of link (i.e.booleanWidget Type.booleanWidget Type.booleanImage field?booleanWidget Type.booleanDateChooser: use date only, or date and time?booleanWidget Type.booleanCategories: Display RootbooleanEnumerate.booleanDeprecated.this value might not reflect the proper translation status of the label list, you should now consider that enumerate label are always I18NedbooleanCategories: Exclusive.booleanbooleanTextArea.booleanWidget Type.booleanWidget Type.booleanisHidden()Hidden field?booleanisInline()Inline boolean ?booleanReturn true if the field display keywordsbooleanisLink()Is field's editor a link (as opposed to a chooser for example).booleanWidget Type.booleanWidget Type.booleanReturns true if this is an URL field which must be open in a new window.booleanRequired field?booleanisResize()Returns true if this is an image field which must be resized.booleanSearchable fieldbooleanbooleanWidget Type.booleanisSuper()booleanTextarea.booleanTextfield.booleanbooleanType: boolean?booleanType: boolean[]?booleanbooleanbooleanbooleanbooleanType: Date?booleanType: Date[]?booleanType: FileDocument? or DBFileDocument?booleanType: FileDocument MV? or DBFileDocument MV?booleanType: double?booleanType: double[]?booleanType: int?booleanType: int[]?booleanbooleanType: long?booleanType: long[]?booleanbooleanbooleanisTypeMV()booleanbooleanbooleanType: Publication?booleanType: Publication[]?booleanType: Publication MVbooleanbooleanbooleanType: String?booleanType: String[]?booleanbooleanbooleanisUrl()URL.booleanisWidget()Is this field manage through a widgetbooleanWysiwyg.booleanInline editing ?voidReload all I18N informations for this type field entry.protected voidFind the right ControlSettingstoString()booleantrim()Returns true if the value in this field must be trimmed when saved
-
Field Details
-
xmlElt
protected final org.jdom.Element xmlElt -
type
-
typeShort
-
isTypeInt
protected boolean isTypeInt -
isTypeIntArray
protected boolean isTypeIntArray -
isTypeLong
protected boolean isTypeLong -
isTypeLongArray
protected boolean isTypeLongArray -
isTypeDouble
protected boolean isTypeDouble -
isTypeDoubleArray
protected boolean isTypeDoubleArray -
isTypeBoolean
protected boolean isTypeBoolean -
isTypeBooleanArray
protected boolean isTypeBooleanArray -
isTypePrimitive
protected boolean isTypePrimitive -
isTypePrimitiveArray
protected boolean isTypePrimitiveArray -
isTypeString
protected boolean isTypeString -
isTypeStringArray
protected boolean isTypeStringArray -
isTypeDate
protected boolean isTypeDate -
isTypeDateArray
protected boolean isTypeDateArray -
isTypeArray
protected boolean isTypeArray -
isTypeList
protected boolean isTypeList -
isTypeSet
protected boolean isTypeSet -
isTypeScalar
protected boolean isTypeScalar -
isTypePublication
protected boolean isTypePublication -
isTypePublicationArray
protected boolean isTypePublicationArray -
isTypePublicationMV
protected boolean isTypePublicationMV -
isTypeDocument
protected boolean isTypeDocument -
isTypeDocumentMV
protected boolean isTypeDocumentMV -
isTypeMember
protected boolean isTypeMember -
isTypeMemberMV
protected boolean isTypeMemberMV -
isTypeData
protected boolean isTypeData -
isTypeDataMV
protected boolean isTypeDataMV -
isTypeWorkspace
protected boolean isTypeWorkspace -
isTypeWorkspaceMV
protected boolean isTypeWorkspaceMV -
isTypeCategory
protected boolean isTypeCategory -
isEnumerate
protected boolean isEnumerate -
isWidget
protected boolean isWidget -
isWysiwyg
protected boolean isWysiwyg -
isTextfield
protected boolean isTextfield -
isTextarea
protected boolean isTextarea -
labelMap
-
editor
-
name
-
nameCap
-
tab
-
descriptionMap
-
descriptionType
-
isSuper
protected boolean isSuper -
isRequired
protected boolean isRequired -
isInline
protected boolean isInline -
isWysiwygInline
protected boolean isWysiwygInline -
isHidden
protected boolean isHidden -
isAbstract
protected boolean isAbstract -
abstractLength
protected int abstractLength -
isDataImage
protected boolean isDataImage -
isSearchable
protected boolean isSearchable -
isKeyword
protected boolean isKeyword -
fieldML
protected boolean fieldML -
fieldWiki
protected boolean fieldWiki -
cols
protected int cols -
maxlength
protected int maxlength -
rows
protected int rows -
size
protected int size -
enumerateLabels
-
enumerateValues
-
enumerateLabelsMap
-
enumerateML
protected boolean enumerateML -
dataSource
-
maxRows
protected int maxRows -
dbrTable
-
dbrKeyCol
-
dbrColumns
-
dbrLabelCol
-
dbrOrderBy
-
superTypes
-
isDateOnly
protected boolean isDateOnly -
dateFormat
-
wysiwygParams
-
tabGroup
-
onLabelMap
-
offLabelMap
-
unit
-
unitAfter
-
unitBefore
-
decimals
protected int decimals -
root
-
isExclusive
protected boolean isExclusive -
isDisplayRoot
protected boolean isDisplayRoot -
chooser
-
gids
-
defaultValue
-
defaultTextMap
-
isOpenWindow
protected boolean isOpenWindow -
isResize
protected boolean isResize -
resizeWidth
protected int resizeWidth -
resizeHeight
protected int resizeHeight -
escapeHtml
protected boolean escapeHtml -
maxResolution
-
dbindex
protected boolean dbindex -
minValue
-
maxValue
-
-
Constructor Details
-
TypeFieldEntry
protected TypeFieldEntry() -
TypeFieldEntry
public TypeFieldEntry(org.jdom.Element xmlElement)
-
-
Method Details
-
initType
public void initType() -
reloadI18N
public void reloadI18N()Reload all I18N informations for this type field entry. This includes : label, description, on & off label, default text, enumerate labels- Since:
- jcms-8.0.2
-
initEnumerate
protected void initEnumerate()Init the enumerate values. -
initUnits
protected void initUnits()Init the field units -
initDefault
protected void initDefault()Init the default value. -
resolveControlSettings
protected void resolveControlSettings()Find the right ControlSettings -
initDescription
protected void initDescription() -
toString
-
getXmlElement
public org.jdom.Element getXmlElement()XML Parsing: jdom Element for this field.
Access, but do not modify.- Returns:
- the
Elementof this field.
-
getInt
Gets the value of thisintfield for the givenData.- Parameters:
data- theDatafrom which to retrieve the field value.- Returns:
- the
intfield value - Throws:
NoSuchFieldException- if the field was not found in the givenData.NullPointerException- if the givenDatais null.- See Also:
-
getLong
Gets the value of thislongfield for the givenData.- Parameters:
data- theDatafrom which to retrieve the field value.- Returns:
- the
longfield value - Throws:
NoSuchFieldException- if the field was not found in the givenData.NullPointerException- if the givenDatais null.- See Also:
-
getDouble
Gets the value of thisdoublefield for the givenData.- Parameters:
data- theDatafrom which to retrieve the field value.- Returns:
- the
doublefield value - Throws:
NoSuchFieldException- if the field was not found in the givenData.NullPointerException- if the givenDatais null.- See Also:
-
getBoolean
Gets the value of thisbooleanfield for the givenData.- Parameters:
data- theDatafrom which to retrieve the field value.- Returns:
- the
booleanfield value - Throws:
NoSuchFieldException- if the field was not found in the givenData.NullPointerException- if the givenDatais null.- See Also:
-
getCategory
Gets the value of the givenCategoryfield name for the givenData.- Parameters:
data- theDatafrom which to retrieve the field value.mbr- the member used to check rigth access to categories.- Returns:
- a
TreeSetofCategory - Throws:
NoSuchFieldException- if the field was not found in the givenData.NullPointerException- if the givenDatais null.- See Also:
-
getObject
Gets the value of thisObjectfield for the givenData.
If the field is multilingual, the default language will be used.
Do not retrieveCategoryfields, see #getCategory(Member).- Parameters:
data- theDatafrom which to retrieve the field value.- Returns:
- the
Objectfield value - Throws:
NoSuchFieldException- if the field was not found in the givenData.NullPointerException- if the givenDatais null.- See Also:
-
getObject
Gets the value of thisObjectfield for the givenData.
If the field is multilingual, the given language will be used unless empty in which case value in default language is used.
Do not retrieveCategoryfields, see #getCategory(Member).- Parameters:
data- theDatafrom which to retrieve the field value.lang- the language (ISO 639: 2-letter codes) in which to retrieve the field value (used only for multilingual fields).- Returns:
- the
Objectfield value - Throws:
NoSuchFieldException- if the field was not found in the givenData.NullPointerException- if the givenDatais null.- See Also:
-
getObject
Gets the value of thisObjectfield for the givenData.
If the field is multilingual, the given language will be used.
Do not retrieveCategoryfields, see #getCategory(Member).- Parameters:
data- theDatafrom which to retrieve the field value.lang- the language (ISO 639: 2-letter codes) in which to retrieve the field value (used only for multilingual fields).useDefault- whether to use the publication main language if the field value is not available in the requested language (used only for multilingual fields).- Returns:
- the
Objectfield value - Throws:
NoSuchFieldException- if the field was not found in the givenData.NullPointerException- if the givenDatais null.- Since:
- jcms-10.0.2 / JCMS-7140
- See Also:
-
getFieldValueAsString
Gets value of the field asStringfor field of the following type:intlongdoublebooleanString
- Parameters:
data- the data from which to retrive the given fieldlang- the lang in which to retrieve the field if multilang- Returns:
- the value of this field as a
String, null if the field value cannot be converted to the typeString. - Throws:
NoSuchFieldException- if the field was not found in the givenData.
-
getFieldValueAsString
public String getFieldValueAsString(Data data, String lang, boolean useDefault) throws NoSuchFieldException Gets value of the field asStringfor field of the following type:intlongdoublebooleanString
- Parameters:
data- the data from which to retrive the given fieldlang- the lang in which to retrieve the field if multilanguseDefault- whether to use the publication main language if the field value is not available in the requested language (used only for multilingual fields).- Returns:
- the value of this field as a
String, null if the field value cannot be converted to the typeString. - Throws:
NoSuchFieldException- if the field was not found in the givenData.- Since:
- jcms-10.0.2 / JCMS-7140
-
getFieldValueAsStringArray
Gets value of the field asString[]for field of the following type:int[]long[]double[]boolean[]String[]ListSet
- Parameters:
data- the data from which to retrive the given fieldlang- the lang in which to retrieve the field, if field is multi-lang- Returns:
- the value of this field as a
String[], null if the field value cannot be converted to the typeString[]. - Throws:
NoSuchFieldException- if the field was not found in the givenData.
-
getFieldValueAsStringArray
public String[] getFieldValueAsStringArray(Data data, String lang, boolean useDefault) throws NoSuchFieldException Gets value of the field asString[]for field of the following type:int[]long[]double[]boolean[]String[]ListSet
- Parameters:
data- the data from which to retrive the given fieldlang- the lang in which to retrieve the field, if field is multi-languseDefault- whether to use the publication main language if the field value is not available in the requested language (used only for multilingual fields).- Returns:
- the value of this field as a
String[], null if the field value cannot be converted to the typeString[]. - Throws:
NoSuchFieldException- if the field was not found in the givenData.- Since:
- jcms-10.0.2 / JCMS-7140
-
getLabel
Deprecated.since jcms-5.7.0.Returns the label of this field (localized in the main language).- Returns:
- the label of this field (localized in the main language).
- See Also:
-
getLabel
Returns the localized label of this field.- Parameters:
lang- the language- Returns:
- the localized label of this field.
- Since:
- jcms-5.7.0
-
getLabelMap
Returns the Map of localized label of this field.- Returns:
- the Map of localized label of this field.
- Since:
- jcms-5.7.0
-
getName
Java name of this field. e.g. "intro".- Returns:
- the java name of this field as a
String
-
getNameCap
Recapitalized java name of this field, (first letter capitalized). e.g. "Intro".- Returns:
- the recapitalized java name of this field as a
String
-
getDescription
Deprecated.since jcms-5.7.0.Returns the description of this field (localized in the main language).- Returns:
- the description of this field (localized in the main language).
- See Also:
-
getDescription
Returns the localized description of this field.- Parameters:
lang- the language- Returns:
- the localized description of this field.
- Since:
- jcms-5.7.0
-
getDescriptionMap
Returns the localized map of description of this field.- Returns:
- the localized map of description of this field.
- Since:
- jcms-5.7.0
-
getType
Retrieve type of this field asString.
Can be one of these values:"int","int[]""long","long[]""double","double[]""boolean","boolean[]""String","String[]""java.util.Date","java.util.Date[]"
And also any types supported by JCMS (list not exhaustive):"com.jalios.jcms.Publication","com.jalios.jcms.Publication[]"and its subclasses"com.jalios.jcms.Content","com.jalios.jcms.Content[]"and its subclasses"com.jalios.jcms.portlet.PortalElement","com.jalios.jcms.portlet.PortalElement[]""com.jalios.jcms.Group","com.jalios.jcms.Group[]""com.jalios.jcms.Member","com.jalios.jcms.Member[]""java.util.TreeSet"(for Categories)
The value"super"marks the place (for the edit form) where the inherited field are located.- Returns:
- the type of this field as a
Stringor "super" if this field mark the place of inherited fields.
-
getTypeShort
Short type of this field. e.g. if type is "String[]" or "List<String>", short type is "String".- Returns:
- the type of this field as a
Stringif any, or "super" if this field mark the place of inherited fields. - See Also:
-
getCollectionTypeMapping
-
isTypeInt
public boolean isTypeInt()Type: int?- Returns:
- true if this field is an
int. - See Also:
-
isTypeIntArray
public boolean isTypeIntArray()Type: int[]?- Returns:
- true if this field is an
int[]. - See Also:
-
isTypeLong
public boolean isTypeLong()Type: long?- Returns:
- true if this field is an
long. - See Also:
-
isTypeLongArray
public boolean isTypeLongArray()Type: long[]?- Returns:
- true if this field is an
long[]. - See Also:
-
isTypeDouble
public boolean isTypeDouble()Type: double?- Returns:
- true if this field is an
double. - See Also:
-
isTypeDoubleArray
public boolean isTypeDoubleArray()Type: double[]?- Returns:
- true if this field is an
double[]. - See Also:
-
isTypeBoolean
public boolean isTypeBoolean()Type: boolean?- Returns:
- true if this field is an
boolean. - See Also:
-
isTypeBooleanArray
public boolean isTypeBooleanArray()Type: boolean[]?- Returns:
- true if this field is an
boolean[]. - See Also:
-
isTypePrimitive
public boolean isTypePrimitive()- Returns:
- true if the field's type is a primitive type
(
int,long,doubleorboolean). - See Also:
-
isTypePrimitiveArray
public boolean isTypePrimitiveArray()- Returns:
- true if the field's type is a primitive type
(
int[],long[],double[]orboolean[]). - See Also:
-
isTypeString
public boolean isTypeString()Type: String?- Returns:
- true if this field is an
String. - See Also:
-
isTypeStringArray
public boolean isTypeStringArray()Type: String[]?- Returns:
- true if this field is an
String[]. - See Also:
-
isTypeDate
public boolean isTypeDate()Type: Date?- Returns:
- true if this field is an
Date. - See Also:
-
isTypeDateArray
public boolean isTypeDateArray()Type: Date[]?- Returns:
- true if this field is an
Date[]. - See Also:
-
isTypeScalar
public boolean isTypeScalar()- Returns:
- true if the field's type is a scalar of any possible type.
- See Also:
-
isTypeMV
public boolean isTypeMV()- Returns:
- true if the field's type is a multivalued (array, List or Set) of any possible type.
- See Also:
-
isTypeArray
public boolean isTypeArray()- Returns:
- true if the field's type is an array of any possible type.
- See Also:
-
isTypeList
public boolean isTypeList()- Returns:
- true if the field's type is a List of any possible type.
- See Also:
-
isTypeSet
public boolean isTypeSet()- Returns:
- true if the field's type is a Set of any possible type.
- See Also:
-
isTypeCollection
public boolean isTypeCollection()- Returns:
- true if the field's type is a Collection (List or Set) of any possible type.
- See Also:
-
isTypeCategory
public boolean isTypeCategory()- Returns:
- true if the field's type is "java.util.TreeSet" and editor is "category".
(field is a
TreeSetofCategory). - See Also:
-
isTypePublication
public boolean isTypePublication()Type: Publication?- Returns:
- true if this field is a
Publication. - See Also:
-
isTypePublicationArray
public boolean isTypePublicationArray()Type: Publication[]?- Returns:
- true if this field is a
Publication[]. - See Also:
-
isTypePublicationMV
public boolean isTypePublicationMV()Type: Publication MV- Returns:
- true if this field is a
Publication[], aList<? extends Publication>orSet<? extends Publication>. - See Also:
-
isTypeDocument
public boolean isTypeDocument()Type: FileDocument? or DBFileDocument?- Returns:
- true if this field is a
Document. - See Also:
-
isTypeDocumentMV
public boolean isTypeDocumentMV()Type: FileDocument MV? or DBFileDocument MV?- Returns:
- true if this field is a
FileDocument[], aList<? extends FileDocument>orSet<? extends FileDocument>. - See Also:
-
isTypeData
public boolean isTypeData() -
isTypeDataMV
public boolean isTypeDataMV() -
isTypeMember
public boolean isTypeMember() -
isTypeMemberMV
public boolean isTypeMemberMV() -
isTypeWorkspace
public boolean isTypeWorkspace() -
isTypeWorkspaceMV
public boolean isTypeWorkspaceMV() -
isRequired
public boolean isRequired()Required field?- Returns:
- true if this field is required, false otherwise
-
isInline
public boolean isInline()Inline boolean ?- Returns:
- true if this field is displaying inline, false instead (vertical)
-
isWysiwygInline
public boolean isWysiwygInline()Inline editing ?- Returns:
- true if this field is to be edited directly in the form, false otherwise (through a popup or such)
-
isHidden
public boolean isHidden()Hidden field?- Returns:
- true if this field is hidden, false otherwise
-
isAbstract
public boolean isAbstract()Abstract/Summary field?- Returns:
- true if this field is the summary for the type, false otherwise
-
getAbstractLength
public int getAbstractLength()Abstract/Summary length- Returns:
- the length of the abstract
-
isDataImage
public boolean isDataImage()Image field?- Returns:
- true if this field is the image for the type, false otherwise
-
isSearchable
public boolean isSearchable()Searchable field- Returns:
- true if this field is searchable, false otherwise
-
isSimpleString
public boolean isSimpleString()- Returns:
- true if this field's type is a
Stringor aString[]AND not an enumerate neither a wysywig. - See Also:
-
isSuper
public boolean isSuper()- Returns:
- true if this field is not really a field, but instead, the place (for the edit form) where the inherited field are located.
- See Also:
-
getEditor
Return the internal editor type of this field.
Can be one of these values (list not exhaustive):"category""color""email""enumerate""image""media""password""query""textarea""textfield""url""wysiwyg""radio""check""list""combo""int","int[]""double","double[]""boolean","boolean[]""member","member[]""group","group[]""link","link[]""duration","duration[]""date","date[]""sqlquery","sqlquery[]""dbrecord","dbrecord[]"
- Returns:
- the field's editor as a
String
-
isLink
public boolean isLink()Is field's editor a link (as opposed to a chooser for example). (UI related).- Returns:
- true if this field is a link
- See Also:
-
isAnyLink
public boolean isAnyLink()Is field's editor any type of link (i.e. link or member or group).- Returns:
- true if this field is any type of link.
- Since:
- jcms-6.1.0
-
getChooser
Return the internal "chooser" of this field.
Can be one of these values (list not exhaustive):"checkbox""combo""listbox""multilistbox""popup""tree"
- Returns:
- the chooser value of this field, if any, otherwise may return empty string or null.
-
isFieldML
public boolean isFieldML()- Returns:
- true if this field a multi-language field.
-
getDefaultValue
Default value of field that can be expressed/converted into a string.- Returns:
- a
Stringwith the default value of this field.
-
getDefaultTextMap
Returns a copy of the language map of default value for this textual field.- Returns:
- the language map of default value for this field. Returns an empty map if there is no default value.
- Since:
- jcms-5.7.3
-
getDefaultTextMapArray
Returns a copy of the language map of default value for this textual field.- Returns:
- the language map of default value for this field. Returns an empty map if there is no default value.
- Since:
- jcms-10.0.0
-
getDefaultTextMapList
Returns a copy of the language map of default value for this textual field.- Returns:
- the language map of default value for this field. Returns an empty map if there is no default value.
- Since:
- jcms-10.0.0
-
getDefaultTextString
Returns the default value (in the main language) of this textual field.- Returns:
- the default value (in the main language) of this textual field. Returns null if there is no default value.
- Since:
- jcms-5.7.3
-
isUrl
public boolean isUrl()URL.- Returns:
- true if field is a url field, false otherwise.
-
isFieldWiki
public boolean isFieldWiki()TextArea.- Returns:
- true if field is a wiki field, false otherwise.
-
isWysiwyg
public boolean isWysiwyg()Wysiwyg.- Returns:
- true if this field is a wysiwyg, false otherwise.
-
isTextfield
public boolean isTextfield()Textfield.- Returns:
- true if this field is a textfield, false otherwise.
-
isTextarea
public boolean isTextarea()Textarea.- Returns:
- true if this field is a textarea, false otherwise.
-
getCols
public int getCols()TextInput/TextArea columns number.
(UI related)- Returns:
- the number of columns to use in the form textinput or textarea.
-
getMaxlength
public int getMaxlength()TextInput maximum length.- Returns:
- the maximum length of a text input.
-
getRows
public int getRows()TextArea/WYSIWYG rows number.
(UI related)- Returns:
- the number of rows to use in the form textarea or in a wysiwyg.
-
getUnit
TextInput unit
e.g. "$"- Returns:
- the unit.
-
getUnitBefore
TextInput unit, displayed before input.
e.g. "$"- Returns:
- the unit displayed before a text input.
-
getUnitAfter
TextInput unit, displayed after input.
e.g. "km"- Returns:
- the unit displayed after a text input.
-
getDecimals
public int getDecimals()Double decimals count- Returns:
- the decimals count for double fields.
-
getWysiwygParams
WYSIWYG toolbar options.
Computed from xml field attribute toolbar[0-4]. e.g. : &toolbar0=open&toolbar1=open&toolbar2=open&toolbar3=open&toolbar4=hidden (UI related)- Returns:
- a string with wysiwyg toolbar options.
-
getWysiwygConfigurationId
Returns the WYSIWYG configuration ID.- Returns:
- WYSIWYG configuration ID
-
getMediaTypes
-
isOpenWindow
public boolean isOpenWindow()Returns true if this is an URL field which must be open in a new window.- Returns:
- true if this is an URL field which must be open in a new window.
- Since:
- jcms-6.1.0
-
isResize
public boolean isResize()Returns true if this is an image field which must be resized.- Returns:
- true if this is an image field which must be resized.
- Since:
- jcms-6.1.0
-
getResizeWidth
public int getResizeWidth()Returns the resize width- Returns:
- the resize width
- Since:
- jcms-6.1.0
-
getResizeHeight
public int getResizeHeight()Returns the resize height- Returns:
- the resize height
- Since:
- jcms-6.1.0
-
escapeHtml
public boolean escapeHtml()Returns true if the HTML contained in this field must be escaped.- Returns:
- true if the HTML contained in this field must be escaped.
- Since:
- jcms-6.1.0
-
trim
public boolean trim()Returns true if the value in this field must be trimmed when saved- Returns:
- true to trim, false to keep as is
- Since:
- jcms-10.0.2
-
getMinValue
Returns the mininum value authorized for this number field (integer or decimal), if available.- Returns:
- the minimum value, or null if it was not defined for this field. Returns an Integer instance for integer field, or a Double instance for decimal fields.
-
getMaxValue
Returns the maximum value authorized for this number field (integer or decimal), if available.- Returns:
- the maximum value, or null if it was not defined for this field. Returns an Integer instance for integer field, or a Double instance for decimal fields.
-
getDataSource
SQLQuery/DBRecord/SQLResult: data source of this SQL related field.- Returns:
- the data source of the SQL field
-
getMaxRows
public int getMaxRows()SQLQuery/DBRecord/SQLResult: maximum row to be retrieved (0 means no limit)- Returns:
- the maximum number of rows to be retrieved.
-
getDbrTable
DBRecord: table of this DB record field.- Returns:
- the name of the SQL table used for this DB record field.
-
getDbrKeyCol
DBRecord: primary key column of this DB record field.- Returns:
- the name of primary key SQL column used for this DB record field.
-
getDbrColumns
DBRecord: columns to be listed for this DB record field (comma separated)- Returns:
- a
Stringwith comma separated SQL columns name SQL listed for this DB record field.
-
getDbrLabelCol
DBRecord: column used as label for this DB record field- Returns:
- a
Stringwith the SQL column name used a label for this DB record field
-
getDbrOrderBy
DBRecord: ORDER BY SQL criteria DB record field- Returns:
- a
Stringwith the ORDER BY SQL criteria for this DB record field
-
getSuperTypes
Type: superTypes- Returns:
- a
Stringwith the list of super types
-
isEnumerate
public boolean isEnumerate()Enumerate.- Returns:
- true if this field a an enumerate.
-
getSize
public int getSize()Enumerate: html Select size.
(UI related)- Returns:
- the size of a
selectin a html form.
-
getEnumerateLabels
Enumerate: Labels of this enumerate field, e.g { "Red", "Green", "Blue"} for the default language of the type/site.- Returns:
- a
String[]containing all labels for this field, or null if this field is not an enumerate
-
getEnumerateLabelsMap
Enumerate: Map of 'language to labels' for this enumerate field, e.g {{"en" -> { "Red", "Green", "Blue"}, "fr" -> ... }} for the default language of the type/site.- Returns:
- a
String[]containing all labels for this field, or null if this field is not an enumerate - Since:
- jcms-8.0.0
-
getEnumerateValues
Enumerate: Possible values of this enumerate field, e.g { "00FF00", "00FF00", "0000FF"}.- Returns:
- a
String[]containing all values for this field, or null if this field is not an enumerate.
-
isEnumerateML
public boolean isEnumerateML()Deprecated.this value might not reflect the proper translation status of the label list, you should now consider that enumerate label are always I18NedEnumerate: multilanguage.- Returns:
trueif this field has multilanguage labels (field contains labelList_en... etc).
-
isDateOnly
public boolean isDateOnly()DateChooser: use date only, or date and time?- Returns:
- true if this field was specified to use date only (no time).
-
getDateFormat
DateChooser: date format- Returns:
- the date format.
-
getRoot
Categories: Root Category ID of this category field- Returns:
- a
Stringwith the ID of the root Category of this field
-
isDisplayRoot
public boolean isDisplayRoot()Categories: Display Root- Returns:
- true if this Category field should display its root
-
isExclusive
public boolean isExclusive()Categories: Exclusive.
(UI related)- Returns:
- true if only one category can be selected in html form, false otherwise.
-
getGids
Member chooser: Group IDs- Returns:
- a
String[]containing the jcms id of theGroupfrom which we chooseMember.
-
getOffLabelMap
Boolean: false/OFF Label of a boolean field. e.g. "No", "Disabled"- Returns:
Map{language, label} with the label to use for the false/off value of this boolean.
-
getOffLabel
Returns the localized offLabel for to this field.- Parameters:
lang- the language- Returns:
- the localized offLabel for to this field.
- Since:
- jcms-5.7.0
-
getOnLabelMap
Boolean: true/ON Label of a boolean field. e.g. "Yes", "Enabled"- Returns:
Map{language, label} with the label to use for the true/on value of this boolean.
-
getOnLabel
Returns the localized onLabel for to this field.- Parameters:
lang- the language- Returns:
- the localized onLabel for to this field.
- Since:
- jcms-5.7.0
-
getTab
Tab: tab name in which this field will be displayed.- Returns:
- a
Stringwith the name of the tab.
-
getTabGroup
TabGroup: group name for multivalued fields, all field having the same value will be display together. (has nothing to do with Tab). e.g. Interview type has two multivalued fields, "questions" and "answers" with the same tabgroup, when switching to second value of "questions", we display the second value of "answers". (UI related)- Returns:
- name of group name
-
isWidget
public boolean isWidget()Is this field manage through a widget- Returns:
- true if this field manage through a widget.
-
getControlSettings
Control Settings of widget editor. seeControlSettings.- Returns:
ControlSettingsobject.
-
getDescriptionType
Type of description to be used by widget:DescriptionType.NONEDescriptionType.TEXTDescriptionType.TOOLTIP
- Returns:
- an int indicating what type of description will be display.
-
isMbrChsr
public boolean isMbrChsr()Widget Type.- Returns:
- true if the widget editor for this field is ControlType.MEMBER / SelectorType.CHOOSER
-
isMbrEnum
public boolean isMbrEnum()Widget Type.- Returns:
- true if the widget editor for this field is ControlType.MEMBER / SelectorType.SELECT
-
isGrpChsr
public boolean isGrpChsr()Widget Type.- Returns:
- true if the widget editor for this field is ControlType.GROUP / SelectorType.CHOOSER
-
isGrpEnum
public boolean isGrpEnum()Widget Type.- Returns:
- true if the widget editor for this field is ControlType.GROUP / SelectorType.SELECT
-
isDateChsr
public boolean isDateChsr()Widget Type.- Returns:
- true if the widget editor for this field is ControlType.DATE
-
isCatEditor
public boolean isCatEditor()Widget Type.- Returns:
- true if the widget editor for this field is ControlType.CATEGORY
-
isSQLQuery
public boolean isSQLQuery()Widget Type.- Returns:
- true if the widget editor for this field is ControlType.SQLQUERY
-
isDBRecordChsr
public boolean isDBRecordChsr()Widget Type.- Returns:
- true if the widget editor for this field is ControlType.DBRECORD
-
isCatTreeEditor
public boolean isCatTreeEditor()Widget Type.- Returns:
- true if this field is not managed through widget editor but using a category tree editor
-
isKeyword
public boolean isKeyword()Return true if the field display keywords- Returns:
- boolean true if
-
getMaxResolution
-
hasDBIndex
public boolean hasDBIndex()Check if an index is expected to be generated in the database for this field.- Returns:
- true if field has an index in the database, false otherwise.
- Since:
- JCMS-11591
-