NAME
Kernel::System::ProcessManagement::Modules::Base::ITSMConfigItem – Base module.
_ReplaceXMLData()
Replace the XMLData to one that uses internal values.
my $NewXMLData = $TicketLinkITSMConfigItemObject->_ReplaceXMLData(
Definition => $DefinitionArrayRef, # Configuration Item Definition or just part of it
XMLData => $XMLDataHashRef,
Parent => 'some parent',
);
returns:
$NewXMLData = $XMLDataHashRef, # with replaced values
_ReplaceValue()
Replace user values with system ready values.
my $NewValue = $TicketLinkITSMConfigItemObject->_ReplaceValue(
Value => $Value # $Value could be a string, a time stamp,
# general catalog class name, or a integer
Input => $InputDefinitionHashRef, # The definition of the element input extracted
# from the Configuration Item definition for
# for each value
# for root key items
);
_ReplaceInputDate()
Replaces the user value with a system valid value.
my $NewValue = $TicketLinkITSMConfigItemObject->_ReplaceInputDate(
Value => '12/12/1977',
);
or
my $NewValue = $TicketLinkITSMConfigItemObject->_ReplaceInputDate(
Value => '1977-12-12',
);
returns:
$NewValue = '1977-12-12',
_ReplaceInputDateTime()
Replaces the user value with a system valid value.
my $NewValue = $TicketLinkITSMConfigItemObject->_ReplaceInputDateTime(
Value => '12/12/1977 12:00:00',
);
or
my $NewValue = $TicketLinkITSMConfigItemObject->_ReplaceInputDateTime(
Value => '1977-12-12 12:00:00',
);
returns:
$NewValue = '1977-12-12 12:00:00';
_ReplaceInputGeneralCatalog()
Replaces the user value with a system valid value.
my $NewValue = $TicketLinkITSMConfigItemObject->_ReplaceInputGeneralCatalog(
Value => 'some value',
Class => 'Some general catalog class'
);
returns:
$NewValue = 123
_FormatSearchXMLData()
Create a XMLData suitable for ConfigItemSeach.
my $NewXMLData = $TicketLinkITSMConfigItemObject->_FormatSearchXMLData(
XMLData => $XMLDataHashRef,
Child => 1, # or 0, optional
);
returns:
$NewXMLData = $XMLDataHashRef, # suitable for version add
_CleanXMLData()
Remove leading and trailing white spaces in the XMLData.
my $XMLDataClean = $TicketLinkITSMConfigItemObject->_CleanXMLData(
Definition => $DefinitionArrayRef, # Configuration Item Definition or just part of it
XMLData => $XMLDataHashRef,
);
returns:
$XMLDataClean = {
Success => 1, # if everything is OK
}
_ValidateValue()
Set the correct XML data format for VersionAdd() recursively.
Converts the plain values e.g.: NewXMLData = { 'NIC::1' => AirPort, 'NIC::1::IPAdress::1' => '127.0.0.1', 'NIC::1::IPoverDHCP::1' => Yes, };
Into: XMLData = { # … NIC => [ undef, { Content => 'AirPort', IPAddress => [ undef, { Content => '127.0.0.1', }, ], IPoverDHCP => [ undef, { Content => 37, # Or the correct General Catalog value. }, ] } ] # … };
my $FormatResult = $TicketLinkITSMConfigItemObject->_XMLDataFormat(
Parent => 'ParentKey', # (optional)
ParentIndex => '123', # (optional)
XMLDefinition => $XMLdefinitionArrayRef,
NewXMLData => $XMLDataHashRefPlainFormat,
LastXMLData => $LastVersionXMLData, # as results from VersionGet() $VersionData->{XMLData}->[1]->{Version}->[1]
);
returns
FormatResult = {
XMLData => $XMLDataHashRef, # ready for VersionAdd()
Error => 1, # in case something went wrong
}
_ValidateValue()
checks if the given value is valid.
my $Sucess = $TicketLinkITSMConfigItemObject->_ValidateValue(
Value => 'some value',
Parent => 'ParentKey::', # (optional)
ParentIndex => '123::', # (optional)
ItemKey => 'someKey',
Input => $ImputHashRef, # From config item XML definition.
);
returns
$Success = 1 # or 0
_ValidateInputText()
checks if the given value is valid.
my $Sucess = $TicketLinkITSMConfigItemObject->_ValidateInputText(
Value => 'some value',
MaxLength => 123,
);
returns
$Success = 1 # or 0
ValidateInputDate()
checks if the given value is valid.
my $Sucess = $TicketLinkITSMConfigItemObject->_ValidateInputDate(
Value => '12/12/1977',
);
or
my $Sucess = $TicketLinkITSMConfigItemObject->_ValidateInputDate(
Value => '1977-12-12',
);
returns
$Success = 1 # or 0
_ValidateInputDateTime()
checks if the given value is valid.
my $Sucess = $TicketLinkITSMConfigItemObject->_ValidateInputDateTime(
Value => '12/12/1977 12:00:00',
);
or
my $Sucess = $TicketLinkITSMConfigItemObject->_ValidateInputDateTime(
Value => '1977-12-12 12:00:00',
);
returns
$Success = 1 # or 0
_ValidateInputCustomer()
checks if the given value is valid.
my $Sucess = $TicketLinkITSMConfigItemObject->_ValidateInputCustomer(
Value => 'some customer login',
);
returns
$Success = 1 # or 0
_ValidateInputCustomerCompany()
checks if the given value is valid.
my $Sucess = $TicketLinkITSMConfigItemObject->_ValidateInputCustomerCompany(
Value => 'some customer company name',
);
returns
$Success = 1 # or 0
_ValidateInputInteger()
checks if the given value is valid.
my $Sucess = $TicketLinkITSMConfigItemObject->_ValidateInputInteger(
Value => 123,
);
returns
$Success = 1 # or 0
_ValidateInputGeneralCatalog()
checks if the given value is valid.
my $Sucess = $TicketLinkITSMConfigItemObject->_ValidateInputGeneralCatalog(
Value => 123,
Class => 'Some general catalog class'
);
returns
$Success = 1 # or 0
