Package lumis.doui.source.field
Class BaseSourceField
- java.lang.Object
-
- lumis.doui.source.field.BaseSourceField
-
- All Implemented Interfaces:
ISourceField
- Direct Known Subclasses:
BaseTabularSourceField
@StableMinor(version="15.0", sinceVersion="4.0") public abstract class BaseSourceField extends java.lang.Object implements ISourceField
The base implementation for a source field.- Since:
- 4.0.4
- Version:
- $Revision: 25304 $ $Date: 2022-10-22 22:51:05 -0300 (Sat, 22 Oct 2022) $
-
-
Field Summary
Fields Modifier and Type Field Description protected IConverter
converter
protected ISourceFieldDataType
dataType
protected java.lang.Object
defaultValue
protected org.w3c.dom.Node
definitionNode
protected boolean
display
protected boolean
doOptionLookup
protected boolean
externalData
protected boolean
getData
protected java.lang.String
id
protected boolean
introduction
protected boolean
keywords
protected boolean
localize
protected java.lang.Object
maximumValue
protected java.lang.Object
minimumValue
protected java.lang.String
name
protected boolean
parentId
protected java.lang.String
pattern
protected boolean
primaryName
protected boolean
readOnly
protected boolean
required
protected boolean
requiredWhenVisible
protected boolean
searchable
Indicates whether this field included to be found in a simple search (search without specifying a field).protected Source<?>
source
-
Constructor Summary
Constructors Constructor Description BaseSourceField()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDocumentFields(Document document, ISourceData data)
Adds document fields values relative to this field to a document.void
addDocumentTypeFields(IDocumentTypeBuilder<?> documentTypeBuilder)
Adds document type fields relative to this field to a document type.protected java.lang.Object
convertToFieldValueClass(java.lang.Object value, java.util.Locale locale, java.lang.String pattern)
Converts the given object to the this field's value class.protected IConverter
createConverter()
Factory method that creates a converter instance for this field.protected ISourceFieldDataType
createDataType()
Factory method that creates a data type instance for this field.IConverter
getConverter()
Returns the default converter for this field's values.ISourceFieldDataType
getDataType()
org.w3c.dom.Node
getDefaultControlDefinition()
Returns the default control definition to be used for this field.org.w3c.dom.Node
getDefaultInputControlDefinition()
Returns the default input control definition to be used for editing this field's value.java.lang.Object
getDefaultValue()
org.w3c.dom.Node
getDefaultViewControlDefinition()
Returns the default control definition to be used for viewing this field's value.org.w3c.dom.Node
getDefinitionNode()
protected java.lang.String
getDocumentFieldBaseId()
Returns the base identifier to use for values of this field in a big data document.java.lang.String
getId()
java.lang.Object
getMaximumValue()
java.lang.Object
getMinimumValue()
java.lang.String
getName()
java.lang.Class<?>
getValueClass()
Returns the class this field's possible values are assignable to.void
init(Source<?> source, org.w3c.dom.Node fieldNode)
Initializes this source field.protected boolean
isBigDataEnabled()
Returns if big data feature is enabled for this field.boolean
isDisplay()
boolean
isExternalData()
boolean
isGetData()
boolean
isIntroduction()
boolean
isIntroductionImage()
Returns whether this field is the introduction image of the corresponding data.boolean
isKeywords()
boolean
isLocalize()
boolean
isParentId()
boolean
isPrimaryName()
boolean
isPublishStartDate()
Returns whether this field is the publish start date of the corresponding data.boolean
isReadOnly()
Returns true if this field is read-only and should not be rendered editable.boolean
isRequired()
boolean
isRequiredWhenVisible()
boolean
isSearchable()
Returns whether this field included to be found in a simple search (search without specifying a field).-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface lumis.doui.source.field.ISourceField
postAdd, postDelete, postUpdate, preAdd, preDelete, preUpdate
-
-
-
-
Field Detail
-
source
protected Source<?> source
-
definitionNode
protected org.w3c.dom.Node definitionNode
-
id
protected java.lang.String id
-
name
protected java.lang.String name
-
primaryName
protected boolean primaryName
-
introduction
protected boolean introduction
-
keywords
protected boolean keywords
-
display
protected boolean display
-
externalData
protected boolean externalData
-
getData
protected boolean getData
-
required
protected boolean required
-
requiredWhenVisible
protected boolean requiredWhenVisible
-
parentId
protected boolean parentId
-
doOptionLookup
protected boolean doOptionLookup
-
readOnly
protected boolean readOnly
-
dataType
protected ISourceFieldDataType dataType
-
defaultValue
protected java.lang.Object defaultValue
-
pattern
protected java.lang.String pattern
-
converter
protected IConverter converter
-
minimumValue
protected java.lang.Object minimumValue
-
maximumValue
protected java.lang.Object maximumValue
-
localize
protected boolean localize
-
searchable
protected boolean searchable
Indicates whether this field included to be found in a simple search (search without specifying a field).- Since:
- 8.1.0
-
-
Method Detail
-
isIntroduction
public boolean isIntroduction()
- Specified by:
isIntroduction
in interfaceISourceField
-
isIntroductionImage
public boolean isIntroductionImage()
Description copied from interface:ISourceField
Returns whether this field is the introduction image of the corresponding data.- Specified by:
isIntroductionImage
in interfaceISourceField
- Returns:
true
if this field is the introduction image,false
otherwise.
-
isPublishStartDate
public boolean isPublishStartDate()
Description copied from interface:ISourceField
Returns whether this field is the publish start date of the corresponding data.- Specified by:
isPublishStartDate
in interfaceISourceField
- Returns:
true
if this field is the publish start date,false
otherwise.
-
isKeywords
public boolean isKeywords()
- Specified by:
isKeywords
in interfaceISourceField
-
getDataType
public ISourceFieldDataType getDataType()
- Specified by:
getDataType
in interfaceISourceField
-
getId
public java.lang.String getId()
- Specified by:
getId
in interfaceISourceField
-
getName
public java.lang.String getName()
- Specified by:
getName
in interfaceISourceField
-
isDisplay
public boolean isDisplay()
- Specified by:
isDisplay
in interfaceISourceField
-
isLocalize
public boolean isLocalize()
-
isPrimaryName
public boolean isPrimaryName()
- Specified by:
isPrimaryName
in interfaceISourceField
-
isExternalData
public boolean isExternalData()
- Specified by:
isExternalData
in interfaceISourceField
-
isGetData
public boolean isGetData()
- Specified by:
isGetData
in interfaceISourceField
-
isRequired
public boolean isRequired()
- Specified by:
isRequired
in interfaceISourceField
-
isRequiredWhenVisible
public boolean isRequiredWhenVisible()
- Specified by:
isRequiredWhenVisible
in interfaceISourceField
-
isParentId
public boolean isParentId()
- Specified by:
isParentId
in interfaceISourceField
-
isReadOnly
public boolean isReadOnly()
Description copied from interface:ISourceField
Returns true if this field is read-only and should not be rendered editable.- Specified by:
isReadOnly
in interfaceISourceField
- Returns:
- true if this field is read-only, false otherwise.
-
getDefaultValue
public java.lang.Object getDefaultValue()
- Specified by:
getDefaultValue
in interfaceISourceField
-
getDefinitionNode
public org.w3c.dom.Node getDefinitionNode()
- Specified by:
getDefinitionNode
in interfaceISourceField
- Returns:
- the field's definition node.
-
getMinimumValue
public java.lang.Object getMinimumValue()
- Specified by:
getMinimumValue
in interfaceISourceField
-
getMaximumValue
public java.lang.Object getMaximumValue()
- Specified by:
getMaximumValue
in interfaceISourceField
-
isSearchable
public boolean isSearchable()
Description copied from interface:ISourceField
Returns whether this field included to be found in a simple search (search without specifying a field).- Specified by:
isSearchable
in interfaceISourceField
- Returns:
true
if this field is included in simple search,false
otherwise.
-
init
public void init(Source<?> source, org.w3c.dom.Node fieldNode) throws PortalException
Description copied from interface:ISourceField
Initializes this source field. This method is called by the source after the field is created and before it is used. The implementation of this method must initialize all of this instance's attributes.- Specified by:
init
in interfaceISourceField
- Parameters:
source
- the source this field will belong to.fieldNode
- the xml node that contains this field's definition.- Throws:
PortalException
- if this field could not be initialized.
-
createDataType
protected ISourceFieldDataType createDataType() throws PortalException
Factory method that creates a data type instance for this field. This method is called duringinit(Source, Node)
.- Returns:
- the data type instance created.
- Throws:
PortalException
- Since:
- 4.0.4
-
createConverter
protected IConverter createConverter() throws PortalException
Factory method that creates a converter instance for this field. This method is called duringinit(Source, Node)
.- Returns:
- the converter instance created.
- Throws:
PortalException
- Since:
- 4.0.4
-
getConverter
public IConverter getConverter()
Description copied from interface:ISourceField
Returns the default converter for this field's values.- Specified by:
getConverter
in interfaceISourceField
- Returns:
- the default converter for this field's values.
-
convertToFieldValueClass
protected java.lang.Object convertToFieldValueClass(java.lang.Object value, java.util.Locale locale, java.lang.String pattern) throws PortalException
Converts the given object to the this field's value class.- Parameters:
value
- the object to be converted.locale
- the locale to be used in conversion.pattern
- the pattern to be used in conversion.- Returns:
- the converted value.
- Throws:
PortalException
- Since:
- 4.0.10
-
getValueClass
public java.lang.Class<?> getValueClass()
Returns the class this field's possible values are assignable to.This base implemetation defaults to this field's data type value class.
- Specified by:
getValueClass
in interfaceISourceField
- Returns:
- the class this field's possible values are assignable to.
- Since:
- 4.0.4
- See Also:
IDouiDataType.getValueClass()
-
getDefaultControlDefinition
public org.w3c.dom.Node getDefaultControlDefinition() throws PortalException
Description copied from interface:ISourceField
Returns the default control definition to be used for this field.- Specified by:
getDefaultControlDefinition
in interfaceISourceField
- Returns:
- the control definition node.
- Throws:
PortalException
- See Also:
ISourceField.getDefaultInputControlDefinition()
,ISourceField.getDefaultViewControlDefinition()
-
getDefaultInputControlDefinition
public org.w3c.dom.Node getDefaultInputControlDefinition() throws PortalException
Description copied from interface:ISourceField
Returns the default input control definition to be used for editing this field's value.- Specified by:
getDefaultInputControlDefinition
in interfaceISourceField
- Returns:
- the control definition node.
- Throws:
PortalException
- See Also:
ISourceField.getDefaultControlDefinition()
,ISourceField.getDefaultViewControlDefinition()
-
getDefaultViewControlDefinition
public org.w3c.dom.Node getDefaultViewControlDefinition() throws PortalException
Description copied from interface:ISourceField
Returns the default control definition to be used for viewing this field's value.- Specified by:
getDefaultViewControlDefinition
in interfaceISourceField
- Returns:
- the control definition node.
- Throws:
PortalException
- See Also:
ISourceField.getDefaultInputControlDefinition()
,ISourceField.getDefaultControlDefinition()
-
getDocumentFieldBaseId
protected java.lang.String getDocumentFieldBaseId()
Returns the base identifier to use for values of this field in a big data document.- Returns:
- the identifier.
- Since:
- 8.1.0
- See Also:
addDocumentFields(Document, ISourceData)
,addDocumentTypeFields(IDocumentTypeBuilder)
-
isBigDataEnabled
protected boolean isBigDataEnabled()
Returns if big data feature is enabled for this field.- Returns:
- Since:
- 8.1.0
-
addDocumentFields
public void addDocumentFields(Document document, ISourceData data)
Description copied from interface:ISourceField
Adds document fields values relative to this field to a document.- Specified by:
addDocumentFields
in interfaceISourceField
- Parameters:
document
- the document.data
- the source data to be used to obtain the field value.- See Also:
ISourceField.addDocumentTypeFields(IDocumentTypeBuilder)
-
addDocumentTypeFields
public void addDocumentTypeFields(IDocumentTypeBuilder<?> documentTypeBuilder)
Description copied from interface:ISourceField
Adds document type fields relative to this field to a document type.- Specified by:
addDocumentTypeFields
in interfaceISourceField
- See Also:
ISourceField.addDocumentFields(Document, ISourceData)
-
-