Class BaseDataClassFieldsManager
- Namespace
- CMS.FormEngine
- Assembly
- CMS.FormEngine.dll
The class represents the default implementation of IDataClassFieldsManager.
public class BaseDataClassFieldsManager : AbstractFieldManager, IDataClassFieldsManager
- Inheritance
-
objectAbstractFieldManagerBaseDataClassFieldsManager
- Implements
- Extension Methods
Constructors
BaseDataClassFieldsManager()
public BaseDataClassFieldsManager()
Methods
ConfigureDataClass(string, DataClassInfo, FormFieldInfo)
Allows to configure given dataClass based on field.
protected virtual void ConfigureDataClass(string fieldName, DataClassInfo dataClass, FormFieldInfo field)
Parameters
fieldNamestringdataClassDataClassInfofieldFormFieldInfo
CreateField(string, FormFieldInfo)
Tries to create a new field with data from formField.
public FieldValidationResult CreateField(string className, FormFieldInfo formField)
Parameters
classNamestringClass name or alternative form name of the form the field belongs to.
formFieldFormFieldInfoField containing the data of the new field.
Returns
- FieldValidationResult
Instance of FieldValidationResult, if the validation result is valid, new field was created. Otherwise it was not and validation result indicates why.
Exceptions
- ArgumentNullException
No field definition was provided.
- InvalidOperationException
The corresponding data class was not found.
CreateFormDefinition(DataClassInfo, FormInfo, FormFieldInfo)
Creates a new field specified by newField in the form provided to it by form and updates the database accordingly.
protected virtual void CreateFormDefinition(DataClassInfo dataClass, FormInfo form, FormFieldInfo newField)
Parameters
dataClassDataClassInfoData class info of the edited data class.
formFormInfoForm info that has a new field inserted.
newFieldFormFieldInfoModel containing field data.
DeleteField(string, string)
Tries to delete a field specified by fieldName
public FieldValidationResult DeleteField(string className, string fieldName)
Parameters
classNamestringClass name or alternative form name of the form the field belongs to.
fieldNamestringName of the field to be deleted.
Returns
- FieldValidationResult
Instance of FieldValidationResult if the validation result is valid and the field was deleted. Otherwise, it is not deleted and the validation result indicates why.
Exceptions
- InvalidOperationException
The corresponding data class was not found.
DeleteFieldFromDefinition(DataClassInfo, FormInfo, string)
Deletes the field specified by fieldName from the form given by form and from the database.
protected virtual void DeleteFieldFromDefinition(DataClassInfo dataClass, FormInfo form, string fieldName)
Parameters
dataClassDataClassInfoData class info of the edited data class.
formFormInfoForm info containing deleted field.
fieldNamestringDeleted field name.
MoveField(string, int, int)
public void MoveField(string className, int sourceIndex, int destinationIndex)
Parameters
classNamestringsourceIndexintdestinationIndexint
UpdateAlternativeForms(DataClassInfo)
Update all alternative forms connected to given dataClass.
protected virtual void UpdateAlternativeForms(DataClassInfo dataClass)
Parameters
dataClassDataClassInfoData class info object with updated form definition.
Remarks
Coupled class for each alternative form is handled as well.
UpdateField(string, string, FormFieldInfo)
Tries to update a field given by fieldName with data from formField.
public FieldValidationResult UpdateField(string className, string fieldName, FormFieldInfo formField)
Parameters
classNamestringClass name or alternative form name of the form the field belongs to.
fieldNamestringName of a field that is being updated.
formFieldFormFieldInfoField which contains updated data.
Returns
- FieldValidationResult
Instance of FieldValidationResult, if the validation result is valid, update was performed. Otherwise it was not and validation result indicates why.
Exceptions
- ArgumentNullException
No field definition provided.
- InvalidOperationException
Unknown
classNameorfieldNameprovided.
UpdateFormDefinition(DataClassInfo, FormInfo)
Updates a form definition of the dataClass using the data from formInfo and alters database table structure appropriately.
protected virtual void UpdateFormDefinition(DataClassInfo dataClass, FormInfo formInfo)
Parameters
dataClassDataClassInfoEdited data class info.
formInfoFormInfoForm info that updates the form definition.
UpdateFormDefinition(DataClassInfo, FormInfo, string, FormFieldInfo)
Updates a form definition of given editedFieldName using the data from newFormFieldInfo and alters database table structure appropriately.
protected virtual void UpdateFormDefinition(DataClassInfo dataClass, FormInfo form, string editedFieldName, FormFieldInfo newFormFieldInfo)
Parameters
dataClassDataClassInfoEdited data class info.
formFormInfoForm info to be updated.
editedFieldNamestringEdited field name.
newFormFieldInfoFormFieldInfoNew form field info.