NAME
Kernel::WebApp::Controller::API::Role::ProvidesBusinessObjectList – Role that provides methods to manage business object list content.
PUBLIC INTERFACE
Provides methods to manage business object list content. The role consumer has to provide the method ValidationJSONBodyFields of role Kernel::WebApp::Controller::API::Role::ValidatesInputData, that will be extended with needed parameters to be validated.
has ItemIDs
This attribute contains the list of item ids, that are provided via the ItemSearch
method by the related endpoint.
has ItemList
This attribute contains the list of items, that are provided via the _BuildItemList
method.
has TotalItems
This attribute contains the total count of items, that are provided via the DiscoverTotalItems
method by the related endpoint.
has ItemIDsWithUserActivity
This attribute contains the list of items, that are provided via the _BuildItemIDsWithUserActivity
method.
requires ItemSearch
Every endpoint that consumes this role, must implement a method ItemSearch
, provides the list of items to be displayed in the related business object list.
requires DiscoverTotalItems
Every endpoint that consumes this role, must implement a method DiscoverTotalItems
, that discover the total items count.
has ItemLimit
This attribute contains the item limit.
has AdditionalItemDataParams
This attribute contains the additional params for the item data build (e.g. TicketID for ticket articles). Normally this attribute is empty, the data must be provided from the endpoint.
has ItemDetailDataDynamicFields
This attribute contains the list of dynamic fields which should be included in the item detail data.
around ValidationJSONBodyFields
Injects validators
to the validation schema for needed business object list related fields. For more information, please refer to Kernel::WebApp::Controller::API::Role::ValidatesInputData.
BusinessObjectListGet()
This method executes the method ItemSearch
to retrieve the needed business object list items and the related meta information. Based on the given Page
and ItemsPerPage
parameters, it will reply a paginated set of items together with the related meta information.
If no parameter is given, the parameter Page
will be implicitly treated as 1:
my $BusinessObjectList = $Self->BusinessObjectListGet();
If the parameter Page
is explicitly set to 0, the whole list of business object list items will be returned. If the parameter Page
is set to a positive integer greater than 0, the relate page of items will be returned.
If the parameters PageFrom
and PageUntil
are given, the related window of items will be returned. The parameter PageFrom
might even be undef
and will be implicitly treated as 1 in that case.
If parameter Page
is given, possible parameters PageFrom
and PageUntil
will be ignored.
Returns:
{
ItemsTotal => 4,
PagesTotal => 2,
ItemList => [
{ 2 => 'Data' },
{ 3 => 'Data' },
],
AllItemIDs => [ 2, 3 ],
}
PRIVATE INTERFACE
_BuildItemList()
Initializes the attribute ItemList
.
_BuildItemIDsWithUserActivity()
Initializes the attribute ItemIDsWithUserActivity
.
_BuildItemLimit()
Initializes the attribute ItemLimit
.
_BuildItemDetailDataDynamicFields()
Initializes the attribute ItemDetailDataDynamicFields
.