Kernel::System::Ticket::Article::Backend::MIMEBase::Base

NAME

Kernel::System::Ticket::Article::Backend::MIMEBase::Base – base class for article storage modules

DESCRIPTION

This is a base class for article storage backends and should not be instantiated directly.

PUBLIC INTERFACE

new()

Don't instantiate this class directly, get instances of the real storage backends instead:

    my $BackendObject = $Kernel::OM->Get('Kernel::System::Article::Backend::MIMEBase::ArticleStorageDB');

BuildArticleContentPath()

Generate a base article content path for article storage in the file system.

    my $ArticleContentPath = $BackendObject->BuildArticleContentPath();

ArticleAttachmentIndex()

Get article attachment index as hash.

    my %Index = $BackendObject->ArticleAttachmentIndex(
        ArticleID        => 123,
        ExcludePlainText => 1,       # (optional) Exclude plain text attachment
        ExcludeHTMLBody  => 1,       # (optional) Exclude HTML body attachment
        ExcludeInline    => 1,       # (optional) Exclude inline attachments
        OnlyHTMLBody     => 1,       # (optional) Return only HTML body attachment, return nothing if not found
    );

Returns:

    my %Index = {
        '1' => {                                                # Attachment ID
            ContentAlternative => '',                           # (optional)
            ContentID          => '',                           # (optional)
            ContentType        => 'application/pdf',
            Filename           => 'StdAttachment-Test1.pdf',
            FilesizeRaw        => 4722,
            Disposition        => 'attachment',
        },
        '2' => {
            ContentAlternative => '',
            ContentID          => '',
            ContentType        => 'text/html; charset="utf-8"',
            Filename           => 'file-2',
            FilesizeRaw        => 183,
            Disposition        => 'attachment',
        },
        ...
    };

PRIVATE FUNCTIONS

_ArticleContentPathGet()

Get the stored content path of an article.

    my $Path = $BackendObject->_ArticleContentPatGeth(
        ArticleID => 123,
    );

ArticleContentPathList()

Get the stored content path of an article.

    my $Paths = $BackendObject->_ArticleContentPatGeth(
        ArticleIDs => [ 123, 456 ],
        Sort       => [ 'content_id', 'article_id' ],
        Group      => [ 'content_id', 'article_id' ],
        Limit      => 1000,                             # optional, limit the amount of result entries
        Offset     => 0,                                # optional, paginate the results
    );

Returns:

    my $Paths = [
        { ArticleID => 123, ContentPath => '2015/07/15' },
        { ArticleID => 456, ContentPath => '2023/03/21' }
    ];
Scroll to Top