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->_ArticleContentPathGet(
    ArticleID => 123,
);