Kernel::System::SysConfig::ValueType::YAML - System configuration YAML value type backend.
Create an object. Do not use it directly, instead use:
use Kernel::System::ObjectManager; local $Kernel::OM = Kernel::System::ObjectManager->new(); my $ValueTypeObject = $Kernel::OM->Get('Kernel::System::SysConfig::ValueType::YAML');
Check if provided EffectiveValue matches structure defined in XMLContentParsed.
my %Result = $ValueTypeObject->SettingEffectiveValueCheck( XMLContentParsed => { Value => [ { 'Item' => [ { 'Content' => 'YAML content', 'ValueType' => 'YAML', }, ], }, ], }, EffectiveValue => 'YAML content', );
Result: %Result = ( EffectiveValue => 'YAML content', Success => 1, Error => undef, );
Extracts the effective value from a XML parsed setting.
my $SettingHTML = $ValueTypeObject->SettingRender( Name => 'SettingName', EffectiveValue => 'YAML content', # (optional) DefaultValue => 'YAML content', # (optional) Class => 'My class' # (optional) Item => [ # (optional) XML parsed item { 'ValueType' => 'YAML', 'Content' => 'YAML content', }, ], RW => 1, # (optional) Allow editing. Default 0. IsArray => 1, # (optional) Item is part of the array IsHash => 1, # (optional) Item is part of the hash IDSuffix => 1, # (optional) Suffix will be added to the element ID SkipEffectiveValueCheck => 1, # (optional) If enabled, system will not perform effective value check. # Default: 1. );
Returns:
$SettingHTML = '<div class "Field"...</div>';
Generate HTML for new array/hash item.
my $HTML = $ValueTypeObject->AddItem( Name => 'SettingName', (required) Name DefaultItem => { (required) DefaultItem hash 'ValueType' => 'Select', 'Content' => 'optiont-1', }, IDSuffix => '_Array1', (optional) IDSuffix is needed for arrays and hashes. );
Returns:
$HTML = '<textarea rows=\'15\' cols=\'50\' class="" type="text" name="SettingName"> ... </textarea>';