.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Sympa::Archive 3Sympa" .TH Sympa::Archive 3Sympa "2022-11-25" "6.2.70" "sympa 6.2.70" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Sympa::Archive \- Archives of Sympa .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& use Sympa::Archive; \& $archive = Sympa::Archive\->new(context => $list); \& \& @arcs = $archive\->get_archives; \& \& $archive\->store($message); \& $archive\->html_store($message); \& \& $archive\->select_archive(\*(Aq2015\-04\*(Aq); \& ($message, $handle) = $archive\->next; \& \& $archive\->select_archive(\*(Aq2015\-04\*(Aq); \& ($message, $handle) = $archive\->fetch(message_id => $message_id); \& $archive\->html_remove($message_id); \& $archive\->remove($handle); \& \& $archive\->html_rebuild(\*(Aq2015\-04\*(Aq); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Sympa::Archive implements the interface to handle archives. .SS "Methods and functions" .IX Subsection "Methods and functions" .ie n .IP "new ( context => $list, [ create => 1 ] )" 4 .el .IP "new ( context => \f(CW$list\fR, [ create => 1 ] )" 4 .IX Item "new ( context => $list, [ create => 1 ] )" \&\fIConstructor\fR. Creates new instance of Sympa::Archive. .Sp Parameter: .RS 4 .ie n .IP "context => $list" 4 .el .IP "context => \f(CW$list\fR" 4 .IX Item "context => $list" Context of object, a Sympa::List instance. .IP "create => 1" 4 .IX Item "create => 1" If necessary, creates directory structure of archive. Dies if creation fails. This parameter was introduced on Sympa 6.2.47b. .RE .RS 4 .RE .ie n .IP "add_archive ( $arc )" 4 .el .IP "add_archive ( \f(CW$arc\fR )" 4 .IX Item "add_archive ( $arc )" \&\fIInstance method\fR. Adds archive directory named \f(CW$arc\fR. Currently, archive directory must have the form \f(CW\*(C`YYYY\-MM\*(C'\fR. .ie n .IP "purge_archive ( $arc )" 4 .el .IP "purge_archive ( \f(CW$arc\fR )" 4 .IX Item "purge_archive ( $arc )" \&\fIInstance method\fR. Removes archive directory and its content entirely. removed content can not be recovered. .ie n .IP "select_archive ( $arc, [ info => 1 ] )" 4 .el .IP "select_archive ( \f(CW$arc\fR, [ info => 1 ] )" 4 .IX Item "select_archive ( $arc, [ info => 1 ] )" \&\fIInstance method\fR. Selects an archive directory. It will be referred by consequent operations. .ie n .IP "fetch ( message_id => $message_id )" 4 .el .IP "fetch ( message_id => \f(CW$message_id\fR )" 4 .IX Item "fetch ( message_id => $message_id )" \&\fIInstance method\fR. Gets a message from archive. \&\fBselect_archive()\fR must be called in advance. .Sp Message will be locked to prevent multiple processing of a single message. .Sp Parameter: .RS 4 .ie n .IP "message_id => $message_id" 4 .el .IP "message_id => \f(CW$message_id\fR" 4 .IX Item "message_id => $message_id" Message \s-1ID\s0 of the message to be fetched. .RE .RS 4 .Sp Returns: .Sp Two-elements list of Sympa::Message instance and filehandle locking a message. .RE .ie n .IP "html_fetch ( file => $filename )" 4 .el .IP "html_fetch ( file => \f(CW$filename\fR )" 4 .IX Item "html_fetch ( file => $filename )" \&\fIInstance method\fR. Gets a metadata of formatted message from \s-1HTML\s0 archive. \&\fBselect_archive()\fR must be called in advance. .Sp Parameter: .RS 4 .ie n .IP "file => $filename" 4 .el .IP "file => \f(CW$filename\fR" 4 .IX Item "file => $filename" File name of the message to be fetched. .RE .RS 4 .Sp Returns: .Sp Hashref. Note that message won't be locked. .RE .IP "get_size ( )" 4 .IX Item "get_size ( )" \&\fIInstance method\fR. Gets total size of messages in archives. This method was introduced on Sympa 6.2.17. .IP "next ( [ reverse => 1 ] )" 4 .IX Item "next ( [ reverse => 1 ] )" \&\fIInstance method\fR. Gets next message in archive. \&\fBselect_archive()\fR must be called in advance. .Sp Message will be locked to prevent multiple processing of a single message. .Sp Parameters: .Sp None. .Sp Returns: .Sp Two-elements list of Sympa::Message instance and filehandle locking a message. .IP "html_next ( [ reverse => 1 ] )" 4 .IX Item "html_next ( [ reverse => 1 ] )" \&\fIInstance method\fR. Gets next metadata of formatted message in archive. \&\fBselect_archive()\fR must be called in advance. .Sp Parameters: .Sp None. .Sp Returns: .Sp Hashref. Note that message will not be locked. .ie n .IP "remove ( $handle )" 4 .el .IP "remove ( \f(CW$handle\fR )" 4 .IX Item "remove ( $handle )" \&\fIInstance method\fR. Removes a message from archive. .Sp Parameter: .RS 4 .ie n .IP "$handle" 4 .el .IP "\f(CW$handle\fR" 4 .IX Item "$handle" Filehandle, Sympa::LockedFile instance, locking message. It is returned by \*(L"fetch\*(R"() or \*(L"next\*(R"(). .RE .RS 4 .Sp Returns: .Sp True value if message could be removed. Otherwise false value. .RE .ie n .IP "html_remove ( $message_id )" 4 .el .IP "html_remove ( \f(CW$message_id\fR )" 4 .IX Item "html_remove ( $message_id )" \&\fIInstance method\fR. \&\s-1TBD.\s0 .ie n .IP "store ( $message )" 4 .el .IP "store ( \f(CW$message\fR )" 4 .IX Item "store ( $message )" \&\fIInstance method\fR. Stores the message into archive. .Sp Parameters: .RS 4 .ie n .IP "$message" 4 .el .IP "\f(CW$message\fR" 4 .IX Item "$message" A Sympa::Message instance to be stored. Following attributes and metadata are referred: .RS 4 .IP "{date}" 4 .IX Item "{date}" Unix time when the message would be delivered. .RE .RS 4 .RE .RE .RS 4 .Sp Returns: .Sp If storing succeeded, marshalled metadata (file name) of the message. Otherwise \f(CW\*(C`undef\*(C'\fR. .RE .ie n .IP "html_store ( $message )" 4 .el .IP "html_store ( \f(CW$message\fR )" 4 .IX Item "html_store ( $message )" \&\fIInstance method\fR. \&\s-1TBD.\s0 .IP "get_archives ( )" 4 .IX Item "get_archives ( )" \&\fIInstance method\fR. Gets a list of archive directories this archive contains. Items of returned value may be fed to \fBselect_archive()\fR and so on. .ie n .IP "html_rebuild ( $arc )" 4 .el .IP "html_rebuild ( \f(CW$arc\fR )" 4 .IX Item "html_rebuild ( $arc )" \&\fIInstance method\fR. Rebuilds archives for the list the name of which is given in the argument \&\f(CW$arc\fR. .Sp Parameters: .RS 4 .ie n .IP "$arc" 4 .el .IP "\f(CW$arc\fR" 4 .IX Item "$arc" A character string containing the name of archive directory in the list which we want to rebuild. .RE .RS 4 .Sp Returns: .Sp \&\fIundef\fR if something goes wrong. .RE .ie n .IP "html_format ( $message, destination_dir => $destination_dir, attachment_url => $attachment_url )" 4 .el .IP "html_format ( \f(CW$message\fR, destination_dir => \f(CW$destination_dir\fR, attachment_url => \f(CW$attachment_url\fR )" 4 .IX Item "html_format ( $message, destination_dir => $destination_dir, attachment_url => $attachment_url )" \&\fIFunction\fR. Converts a message to \s-1HTML.\s0 .Sp Parameters: .RS 4 .ie n .IP "$message" 4 .el .IP "\f(CW$message\fR" 4 .IX Item "$message" Message to be formatted. Sympa::Message instance. .ie n .IP "$destination_dir" 4 .el .IP "\f(CW$destination_dir\fR" 4 .IX Item "$destination_dir" The directory result is stored in. .ie n .IP "$attachment_url" 4 .el .IP "\f(CW$attachment_url\fR" 4 .IX Item "$attachment_url" Base \s-1URL\s0 used to link attachments. .Sp Note: On 6.2.13 and earlier, this option was named "\f(CW\*(C`attach\f(CBe\f(CWment_url\*(C'\fR". .Sp 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. .RE .RS 4 .RE .IP "get_id ( )" 4 .IX Item "get_id ( )" \&\fIInstance method\fR. Gets unique identifier of instance. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fBarchived\fR\|(8), \fBmhonarc\fR\|(1), \fBwwsympa\fR\|(8), Sympa::Message. .SH "HISTORY" .IX Header "HISTORY" Archive was renamed to Sympa::Archive on Sympa 6.2.