Scroll to navigation

Sympa::Archive(3Sympa) sympa 6.2.72 Sympa::Archive(3Sympa)

NAME

Sympa::Archive - Archives of Sympa

SYNOPSIS

  use Sympa::Archive;
  $archive = Sympa::Archive->new(context => $list);
  @arcs = $archive->get_archives;
  $archive->store($message);
  $archive->html_store($message);
  $archive->select_archive('2015-04');
  ($message, $handle) = $archive->next;
  $archive->select_archive('2015-04');
  ($message, $handle) = $archive->fetch(message_id => $message_id);
  $archive->html_remove($message_id);
  $archive->remove($handle);
  $archive->html_rebuild('2015-04');

DESCRIPTION

Sympa::Archive implements the interface to handle archives.

Methods and functions

Constructor. Creates new instance of Sympa::Archive.

Parameter:

Context of object, a Sympa::List instance.
If necessary, creates directory structure of archive. Dies if creation fails. This parameter was introduced on Sympa 6.2.47b.
Instance method. Adds archive directory named $arc. Currently, archive directory must have the form "YYYY-MM".
Instance method. Removes archive directory and its content entirely. removed content can not be recovered.
Instance method. Selects an archive directory. It will be referred by consequent operations.
Instance method. Gets a message from archive. select_archive() must be called in advance.

Message will be locked to prevent multiple processing of a single message.

Parameter:

Message ID of the message to be fetched.

Returns:

Two-elements list of Sympa::Message instance and filehandle locking a message.

Instance method. Gets a metadata of formatted message from HTML archive. select_archive() must be called in advance.

Parameter:

File name of the message to be fetched.

Returns:

Hashref. Note that message won't be locked.

Instance method. Gets total size of messages in archives. This method was introduced on Sympa 6.2.17.
Instance method. Gets next message in archive. select_archive() must be called in advance.

Message will be locked to prevent multiple processing of a single message.

Parameters:

None.

Returns:

Two-elements list of Sympa::Message instance and filehandle locking a message.

Instance method. Gets next metadata of formatted message in archive. select_archive() must be called in advance.

Parameters:

None.

Returns:

Hashref. Note that message will not be locked.

Instance method. Removes a message from archive.

Parameter:

$handle
Filehandle, Sympa::LockedFile instance, locking message. It is returned by "fetch"() or "next"().

Returns:

True value if message could be removed. Otherwise false value.

Instance method. TBD.
Instance method. Stores the message into archive.

Parameters:

$message
A Sympa::Message instance to be stored. Following attributes and metadata are referred:
{date}
Unix time when the message would be delivered.

Returns:

If storing succeeded, marshalled metadata (file name) of the message. Otherwise "undef".

Instance method. TBD.
Instance method. Gets a list of archive directories this archive contains. Items of returned value may be fed to select_archive() and so on.
Instance method. Rebuilds archives for the list the name of which is given in the argument $arc.

Parameters:

$arc
A character string containing the name of archive directory in the list which we want to rebuild.

Returns:

undef if something goes wrong.

Function. Converts a message to HTML.

Parameters:

$message
Message to be formatted. Sympa::Message instance.
$destination_dir
The directory result is stored in.
$attachment_url
Base URL used to link attachments.

Note: On 6.2.13 and earlier, this option was named ""attachement_url"".

Note: On 6.2.17 and later, this option may take an arrayref value. In such case items will be percent-encoded and conjuncted. Otherwise if a string is given, it will not be encoded.

Instance method. Gets unique identifier of instance.

SEE ALSO

archived(8), mhonarc(1), wwsympa(8), Sympa::Message.

HISTORY

Archive was renamed to Sympa::Archive on Sympa 6.2.

2024-07-15 6.2.72