C# Class SenseNet.ContentRepository.Field

Field represent an atomic data of a Content
A Field represents an atomic data type from the perspective of the system. It usually handles Fields usually handles a single ContentHandler property. It is also capable of handling of multiple ContentHandler properties (see the WhoAndWhen Field for an example). It may also consist of values computed from the handled ContentHandler propery(s) or even represent data independent of these properties. In the communication bus this atomic data type is resembled as a transfer object: ContentHandler<--properties--> Field <--transfer object--> FieldControl (Content, ContenView) The Field constructs a transfer object from ContentHandler properties and passes it up to the FieldControl. At the same time this tranfer object is disassembled to ContentHandler properties when passing its data down to the ContentHandler. The Field class is responsible for invoking data validation (data validation itself is done by the FieldSetting property). The class Field can be resembled as bridge between ContentHandlerproperties and ContentView (or any other ways of data output/input). The Field class is also one of the most important system extension points (among with ContentHandler). By defining a new Field class a system-wide usable atomic data type is defined. This kind of extension is usually done when having a need of a more complex or different type than ones already defined in the system.
Inheritance: IIndexableField
ファイルを表示 Open project: maxpavlov/FlexNet Class Usage Examples

Private Properties

Property Type Description
Create Field
DoValidate bool
Export void
Export2 void
GetExportName string
GetInnerXml string
Import void
Import void
ParseImportName string
Save void
SetDefaultValue void
Validate bool

Public Methods

Method Description
GetData ( ) : object

Returns object data which is a transfer object.

GetIndexFieldInfos ( string &textExtract ) : IEnumerable
GetValidationMessage ( ) : string
HasValue ( ) : bool
Parse ( string value ) : bool
SetData ( object value ) : void

Sets object data which is a transfer object.

WriteXml ( XmlWriter writer ) : void

Protected Methods

Method Description
ConvertFrom ( object value ) : object[]

Creates ContentHandler properties from the transfer object.

ConvertTo ( object handlerValues ) : object

Creates a transfer object from ContentHandler properties

ExportData ( XmlWriter writer, ExportContext context ) : void
ExportData2 ( XmlWriter writer, ExportContext context ) : void
ExportNotImplementedException ( ) : Exception
ExportNotImplementedException ( object notImplementedValue ) : Exception
Field ( ) : System
GetHandlerSlot ( int slotIndex ) : Type

Gets the type of the slot.

A slot type may represent numeros CLR types in compile time. In runtime, however a single type from the previously defined enumeration is assigned to this slot. This function returns this type in runtime.

GetXmlData ( ) : string
ImportData ( XmlNode fieldNode ) : void

For Powershell provider

ImportData ( XmlNode fieldNode, ImportContext context ) : void

For old-way-import

InvalidImportDataException ( string message ) : Exception
InvalidImportDataException ( string message, Exception innerException ) : Exception
OnSaveCompleted ( ) : void
ParseValue ( string value ) : bool
ReadProperties ( ) : object
ReadProperty ( string propertyName ) : object
WriteProperties ( object value ) : void
WriteProperty ( string propertyName, object value ) : void
WriteXmlData ( XmlWriter writer ) : void

Private Methods

Method Description
Create ( Content content, FieldSetting fieldSetting ) : Field
DoValidate ( ) : bool
Export ( XmlWriter writer, ExportContext context ) : void
Export2 ( XmlWriter writer, ExportContext context ) : void
GetExportName ( string fieldName, FieldSubType &subType ) : string
GetInnerXml ( ) : string
Import ( XmlNode fieldNode ) : void

For Powershell provider

Import ( XmlNode fieldNode, ImportContext context ) : void

For old-way-import

ParseImportName ( string importName, FieldSubType subType ) : string
Save ( bool validOnly ) : void
SetDefaultValue ( ) : void
Validate ( ) : bool

Method Details

ConvertFrom() protected method

Creates ContentHandler properties from the transfer object.
protected ConvertFrom ( object value ) : object[]
value object
return object[]

ConvertTo() protected method

Creates a transfer object from ContentHandler properties
protected ConvertTo ( object handlerValues ) : object
handlerValues object
return object

ExportData() protected method

protected ExportData ( XmlWriter writer, ExportContext context ) : void
writer System.Xml.XmlWriter
context ExportContext
return void

ExportData2() protected method

protected ExportData2 ( XmlWriter writer, ExportContext context ) : void
writer System.Xml.XmlWriter
context ExportContext
return void

ExportNotImplementedException() protected method

protected ExportNotImplementedException ( ) : Exception
return System.Exception

ExportNotImplementedException() protected method

protected ExportNotImplementedException ( object notImplementedValue ) : Exception
notImplementedValue object
return System.Exception

Field() protected method

protected Field ( ) : System
return System

GetData() public method

Returns object data which is a transfer object.
public GetData ( ) : object
return object

GetHandlerSlot() protected method

Gets the type of the slot.
A slot type may represent numeros CLR types in compile time. In runtime, however a single type from the previously defined enumeration is assigned to this slot. This function returns this type in runtime.
protected GetHandlerSlot ( int slotIndex ) : Type
slotIndex int Index of the slot of which the type is needed
return System.Type

GetIndexFieldInfos() public method

public GetIndexFieldInfos ( string &textExtract ) : IEnumerable
textExtract string
return IEnumerable

GetValidationMessage() public method

public GetValidationMessage ( ) : string
return string

GetXmlData() protected method

protected GetXmlData ( ) : string
return string

HasValue() public method

public HasValue ( ) : bool
return bool

ImportData() protected method

For Powershell provider
protected ImportData ( XmlNode fieldNode ) : void
fieldNode System.Xml.XmlNode
return void

ImportData() protected abstract method

For old-way-import
protected abstract ImportData ( XmlNode fieldNode, ImportContext context ) : void
fieldNode System.Xml.XmlNode
context ImportContext
return void

InvalidImportDataException() protected method

protected InvalidImportDataException ( string message ) : Exception
message string
return System.Exception

InvalidImportDataException() protected method

protected InvalidImportDataException ( string message, Exception innerException ) : Exception
message string
innerException System.Exception
return System.Exception

OnSaveCompleted() protected method

protected OnSaveCompleted ( ) : void
return void

Parse() public method

public Parse ( string value ) : bool
value string
return bool

ParseValue() protected method

protected ParseValue ( string value ) : bool
value string
return bool

ReadProperties() protected method

protected ReadProperties ( ) : object
return object

ReadProperty() protected method

protected ReadProperty ( string propertyName ) : object
propertyName string
return object

SetData() public method

Sets object data which is a transfer object.
public SetData ( object value ) : void
value object
return void

WriteProperties() protected method

protected WriteProperties ( object value ) : void
value object
return void

WriteProperty() protected method

protected WriteProperty ( string propertyName, object value ) : void
propertyName string
value object
return void

WriteXml() public method

public WriteXml ( XmlWriter writer ) : void
writer System.Xml.XmlWriter
return void

WriteXmlData() protected method

protected WriteXmlData ( XmlWriter writer ) : void
writer System.Xml.XmlWriter
return void