Class FileDataType
- java.lang.Object
-
- lumis.doui.datatype.AbstractDouiDataType
-
- lumis.doui.source.field.type.AbstractSourceFieldDataType
-
- lumis.doui.source.field.type.FileDataType
-
- All Implemented Interfaces:
IDouiDataType
,ISourceFieldDataType
- Direct Known Subclasses:
DocumentDataType
,MediaDataType
public class FileDataType extends AbstractSourceFieldDataType
A file data type. Its value is a file stored.- Since:
- 4.0.4
- Version:
- $Revision: 21340 $ $Date: 2018-06-05 13:11:55 -0300 (Tue, 05 Jun 2018) $
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FileDataType.Data
Data object for a field with derived file.protected static class
FileDataType.FileDataConverter
protected static class
FileDataType.FileDataParser
-
Constructor Summary
Constructors Constructor Description FileDataType()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected IConverter
createConverter()
Creates the converter instance that will be used by this data type.protected void
deleteRelatedFile(ISourceField field, SourcePreDeleteDataEvent event)
Deletes related files from persistence.String
getDefaultInputControlType()
Returns the default input control type for this data type.Map<String,? extends Serializable>
getDocumentFieldValues(Object value)
Returns the document field values to be stored in big data for a given value.Map<String,? extends IDocumentTypeFieldBuilder<?>>
getDocumentTypeFieldTemplates()
Returns the document type field templates to be used as a base bysource fields
to create their document type fields.String
getId()
Returns the id for this data type.String
getQueryDataType()
Returns aQueryFieldTypes
constant for a query data type the value of this source field data type is best suited to be kept in.Class<? extends FileDataType.Data>
getValueClass()
Returns the value class for data of this type.void
preDelete(ISourceField field, SourcePreDeleteDataEvent event)
Method called by default for each source field before data is deleted.-
Methods inherited from class lumis.doui.source.field.type.AbstractSourceFieldDataType
init
-
Methods inherited from class lumis.doui.datatype.AbstractDouiDataType
equals, getConverter, getDefaultFilterControlType, getDefaultViewControlType, getDefinitionLocale, getDefinitionPattern, hashCode, isComplexDataType, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface lumis.doui.datatype.IDouiDataType
getConverter, getDefaultFilterControlType, getDefaultViewControlType, getDefinitionLocale, getDefinitionPattern, isComplexDataType
-
Methods inherited from interface lumis.doui.source.field.type.ISourceFieldDataType
postAdd, postDelete, postUpdate, preAdd, preUpdate
-
-
-
-
Method Detail
-
createConverter
protected IConverter createConverter()
Description copied from class:AbstractDouiDataType
Creates the converter instance that will be used by this data type.- Overrides:
createConverter
in classAbstractDouiDataType
- Returns:
- the converter instance.
-
getId
public String getId()
Description copied from interface:IDouiDataType
Returns the id for this data type.- Specified by:
getId
in interfaceIDouiDataType
- Specified by:
getId
in classAbstractDouiDataType
- Returns:
- the id for this data type.
-
getQueryDataType
public String getQueryDataType()
Description copied from interface:ISourceFieldDataType
Returns aQueryFieldTypes
constant for a query data type the value of this source field data type is best suited to be kept in.- Specified by:
getQueryDataType
in interfaceISourceFieldDataType
- Specified by:
getQueryDataType
in classAbstractSourceFieldDataType
- Returns:
- a
QueryFieldTypes
constant.
-
getValueClass
public Class<? extends FileDataType.Data> getValueClass()
Description copied from interface:IDouiDataType
Returns the value class for data of this type.- Specified by:
getValueClass
in interfaceIDouiDataType
- Overrides:
getValueClass
in classAbstractDouiDataType
- Returns:
- the value class for data of this type.
-
getDefaultInputControlType
public String getDefaultInputControlType()
Description copied from interface:IDouiDataType
Returns the default input control type for this data type.- Specified by:
getDefaultInputControlType
in interfaceIDouiDataType
- Overrides:
getDefaultInputControlType
in classAbstractDouiDataType
- Returns:
- the default input control type for this data type, or null if this data type has no default input control type.
-
getDocumentTypeFieldTemplates
public Map<String,? extends IDocumentTypeFieldBuilder<?>> getDocumentTypeFieldTemplates()
Description copied from interface:ISourceFieldDataType
Returns the document type field templates to be used as a base bysource fields
to create their document type fields.The returned value is a map where the key is an identifier suffix to use on the document field identifier. This suffix will be appended to the source field's base identifier in the document. The key may be
null
to indicate that the source field's base identifier is to be used for the document field. The key must not be an empty string.The value of the map is a
IDocumentTypeFieldBuilder
to be used as a base to the respective document type field. The builder's id will be set by the source field and does not need to be specified. TheIDocumentTypeFieldBuilder.setIncludeInGlobalSearch(boolean)
is to be set totrue
if the document field may be included in global search. If it is set totrue
and the source field issearchable
, then the final document type field generated will have this property set totrue
. Otherwise it will befalse
.- Specified by:
getDocumentTypeFieldTemplates
in interfaceISourceFieldDataType
- Overrides:
getDocumentTypeFieldTemplates
in classAbstractSourceFieldDataType
- Returns:
- a map where the key is a relative document field identifier and the value is a document type field builder to be used as a base to the respective document type field.
- See Also:
ISourceFieldDataType.getDocumentFieldValues(Object)
-
getDocumentFieldValues
public Map<String,? extends Serializable> getDocumentFieldValues(Object value)
Description copied from interface:ISourceFieldDataType
Returns the document field values to be stored in big data for a given value.- Specified by:
getDocumentFieldValues
in interfaceISourceFieldDataType
- Overrides:
getDocumentFieldValues
in classAbstractSourceFieldDataType
- Parameters:
value
- a value, of typeIDouiDataType.getValueClass()
or of a type thatIDouiDataType.getConverter()
is able to convert toIDouiDataType.getValueClass()
.- Returns:
- a map where the key is a suffix for the document field identifier, and the value is the value to use as
the value of the respective document field. The key is the same used to define document type fields in
ISourceFieldDataType.getDocumentTypeFieldTemplates()
. - See Also:
ISourceFieldDataType.getDocumentTypeFieldTemplates()
-
preDelete
public void preDelete(ISourceField field, SourcePreDeleteDataEvent event) throws PortalException
Description copied from interface:ISourceFieldDataType
Method called by default for each source field before data is deleted.- Parameters:
field
- the field that is triggering this call.event
- the event that contains information about the delete operation.- Throws:
PortalException
- See Also:
ISourceField#preDelete(ISourcePreDeleteDataEvent)
-
deleteRelatedFile
protected void deleteRelatedFile(ISourceField field, SourcePreDeleteDataEvent event) throws PortalException
Deletes related files from persistence. Called bypreDelete(ISourceField, SourcePreDeleteDataEvent)
.- Parameters:
field
- the field that triggered the call.event
- the event that contains information about the delete operation.- Throws:
PortalException
- Since:
- 10.4.0
-
-