Kernel::System::FAQ::RelatedArticle

NAME

Kernel::System::FAQ::RelatedArticle – sub module of Kernel::System::FAQ

DESCRIPTION

All related faq article functions.

PUBLIC INTERFACE

RelatedAgentArticleList()

Get the related faq article list for the given subject and body.

    my @RelatedAgentArticleList = $FAQObject->RelatedAgentArticleList(
        Subject   => 'Title Example',
        Body      => 'Text Example',  # possible with html tags (will be removed for the search)
        Languages =>[ 'en' ],         # optional
        Limit     => 10,              # optional
        UserID    => 1,
    );

Returns

    my @RelatedAgentArticleList = (
        {
            ItemID       => 123,
            Title        => 'FAQ Title',
            CategoryName => 'Misc',
            Created      => '2014-10-10 10:10:00',
        },
        {
            ItemID       => 123,
            Title        => 'FAQ Title',
            CategoryName => 'Misc',
            Created      => '2014-10-10 10:10:00',
        },
    );

RelatedCustomerArticleList()

Get the related faq article list for the given subject and body.

    my @RelatedCustomerArticleList = $FAQObject->RelatedCustomerArticleList(
        Subject   => 'Title Example',
        Body      => 'Text Example',  # possible with html tags (will be removed for the search)
        Languages => [ 'en' ],        # optional
        Limit     => 10,              # optional
        UserID    => 1,
    );

Returns

    my @RelatedCustomerArticleList = (
        {
            ItemID       => 123,
            Title        => 'FAQ Title',
            CategoryName => 'Misc',
            Created      => '2014-10-10 10:10:00',
        },
        {
            ItemID       => 123,
            Title        => 'FAQ Title',
            CategoryName => 'Misc',
            Created      => '2014-10-10 10:10:00',
        },
    );

PRIVATE FUNCTIONS

_RelatedArticleList()

Get the related faq article list for the given subject and body.

    my @RelatedArticleList = $FAQObject->_RelatedArticleList(
        Subject      => 'Title Example',
        Body         => 'Text Example',  # possible with html tags (will be removed for the search)
        Languages    =>[ 'en' ],         # optional
        Limit        => 10,              # optional
        CustomerUser => 'joe'            # optional
        UserID       => 1,
    );

Returns

    my @RelatedArticleList = (
        {
            ItemID       => 123,
            Title        => 'FAQ Title',
            CategoryName => 'Misc',
            Created      => '2014-10-10 10:10:00',
        },
        {
            ItemID       => 123,
            Title        => 'FAQ Title',
            CategoryName => 'Misc',
            Created      => '2014-10-10 10:10:00',
        },
    );

_BuildRelatedFAQArticleList()

Build the related faq article list from the given content keywords and article keyword relation.

    my @RelatedArticleList = $FAQObject->_BuildRelatedFAQArticleList(
        ContentKeywords => {
            example => 1,
            test    => 3,
            faq     => 6,
        },
        KeywordArticleList => {
            'ExampleKeyword' => [
                12,
                13,
            ],
            'TestKeyword' => [
                876,
            ],
        },
        Limit  => 10, # optional
        UserID => 1,
    );

Returns

    my @RelatedArticleList = (
        {
            ItemID       => 123,
            Title        => 'FAQ Title',
            CategoryName => 'Misc',
            Created      => '2014-10-10 10:10:00',
        },
        {
            ItemID       => 123,
            Title        => 'FAQ Title',
            CategoryName => 'Misc',
            Created      => '2014-10-10 10:10:00',
        },
    );

_BuildKeywordCounterFromContent()

Build the keywords for the given content.

    my $Content = $FAQObject->_BuildKeywordCounterFromContent(
        Content => 'Some Text with a link. More text. [1] https://otrs.com/',
    );

Returns

    %ContentKeywords = (
        example => 1,
        test    => 3,
        faq     => 6,
        ...
    );

_RemoveLinksFromContent()

Remove links from the given content.

    my $Content = $FAQObject->_RemoveLinksFromContent(
        Content => 'Some Text with a link. More text. [1] https://otrs.com/',
    );

Returns

    $Content = 'Some Text with a link. More text.';
Scroll to Top