DADA::MailingList::Archives

- NAME
- DESCRIPTION
- METHODS

- get_neighbors
- check_if_entry_exists;
- set_archive_subject();
- set_archive_message();
- set_archive_format
- get_archive_subject
- get_archive_format
- get_archive_message
- create_index
- newest_entry
- oldest_entry
- create_index_nav
- make_nav_table,
- make_search_form
- _zap_sig_plaintext
- _zap_sig_html
- massage
- make_search_summary
- _faked_oldstyle_message
- message_blurb
- massage_msg_for_resending
- _take_off_sigs
- massaged_msg_for_display
- _chomp_off_body
- _add_a_body_if_needed
- _get_body_entity
- _bs_raw_msg
- W3CDTF
- atom_index
- rss_index
- send_pings
- _massaged_key

- COPYRIGHT

# NAME

DADA::MailingList::Archives

# DESCRIPTION

This module holds the shared methods between the different archive backends

Many of these methods have to do with massaging the message for viewing;

# METHODS

## get_neighbors

            my ($prev, $next) = $archive->get_neighbors();

this will tell you in the frame of reference of what message you're on, what the previous and next entry keys are.

## check_if_entry_exists;

see if an entry exists, returns 1 when its there, 0 if it aint

## set_archive_subject();

$archive->set_archive_subject($subject);

changes the archive's subject

## set_archive_message();

            $archive->set_archive_message($message);

changes the archive's message (yo)

## set_archive_format

            $archive -> set_archive_format($format);

changes the archive's format (yo)

## get_archive_subject

            my $format = get_archive_subject($key);

gets the subject of the given $key

## get_archive_format

            my $format = get_archive_format($key);

gets the format of the given $key

## get_archive_message

            my $format = get_archive_message($key);

gets the message of the given $key

## create_index

            my ($begin, $stop) = $archive->create_index($start);

This 'll tell you what to print on each archive index. something like, 'start on the 40th message and end on the 50th'

## newest_entry

returns the the key/id of the most recent archive message

## oldest_entry

returns the key/of the first archive message

## create_index_nav

            print $archive->create_index_nav($stopped_at);

creates a HTML table that looks like this:

                <<Prev                      Next >>

at the bottom of each archive index

## make_nav_table,

            print $archive -> make_nav_table(-Id => $id, -List => $list_info{list});

this will make a HTML table that has the previous message, the index and the next message like this:

<< My Previous Message |Archive Index| My Next Message

## make_search_form

            print $archive -> make_search_form();

this prints out the correct HTML form to make for your archives.

## _zap_sig_plaintext

(Private Method)

     my $msg = $self->_zap_sig_plaintext($msg);

Given a string, $msg, returns the message without the opening or signature.

In a PlainText message, the opening is terminated using the (Dada Mail specific):

__

Which is:

     [newline][underscore][underscore][space][newline]

The signature is begun with:

--

Which is:

     [newline][dash][dash][space][newline]

## _zap_sig_html

(Private Method)

     $msg = $self->_zap_sig_html($msg);

Given a string $msg, returns a string that does not have the information located between the opening and signature comments.

The opening comments look like this:

     <!--opening-->
     <!--/opening-->

The signature comments look like this:

     <!--signature-->
     <!--/signature-->

These are both very Dada Mail-specific.

## massage

## make_search_summary

     my $summaries = $archive->make_search_summary($keyword, $search_results);

Given a $keyword (string) and $search_results (array ref of archive keys/ids) will return a hashref of each line the keyword appears in.

## _faked_oldstyle_message

Private Method

     ($new_message, $new_format) = $self->_faked_oldstyle_message($raw_msg);

background:

Before version 2.9, Dada Mail did not save the complete email message, including the headers, in its archive. Beginning with 2.9, if you're using one of the SQL backends, it will - but for backwards compatability, the old style, message-only sort of method is still used.

## message_blurb

     print $archives->message_blurb(-key  => $key,
                                    -size => 256,
                                   ),

Given a key/id of an archived message, returns a plaintext snippet of the archived message. -size will change who large the archive blurb is. NOTE: that this is the maximum size. If the message is smaller, the blurb will reflect that.

## massage_msg_for_resending

     print $archive->massage_msg_for_resending(-key => $entry),

given a -key - a key/id of an archived message, will return a copy of that archived message formatted to be resent. Basically, this means that the email message template has been stripped from the saved message.

## _take_off_sigs

     $entity = $self->_take_off_sigs($entity);

($entity is a MIME::Entity object)

Returns a copy of the entity without the email message template apply (attempts to, anyways)

## massaged_msg_for_display

     $message = $self->massaged_msg_for_display(-key => $key);

returns a string, given a -key - an id/key of an archived message.

Can have many paramaters passed to it:

- -plain_text

  will give back a plaintext formatted message.

- -body_only

  Will return a message formatted in HTML, but will not be a complete HTML document.

## _chomp_off_body

Private Method

     $body = $self->_chomp_off_body($body);

Give a string, will return the contents of the string that were found between HTML <body> tags. If no content was found, will return the entire string back, unchanged.

## _add_a_body_if_needed

Private Method

     $body = $self->_add_a_body_if_needed($body)

Given a string, looks if the string is a complete HTML document, and, if it's not, wraps one around it.

Used for showing archived messages.

## _get_body_entity

Private Methid

     $entity = $self->_get_body_entity($entity);

Given an entity, attempts to find the main message - will default to HTML for multipart/alternative messages.

## _bs_raw_msg

     $raw_msg = $self->_bs_raw_msg($subject, $message, $format);

Tries to munge a complete MIME-compliant message, given a Subject, the body of a message and a format (text/plain, text/html)

## W3CDTF

     print $self->W3CDTF($key);

Given a key/id of an archived message, which is created from the date the message was sent, returns a string in the W3CDTF format.

More information:

http://www.w3.org/TR/NOTE-datetime

This is used for the Atom Feed.

## atom_index

     print $archive->atom_index();

returns a string representing the Atom Feed. More on Atom:

http://www.atomenabled.org/

See Also:

http://search.cpan.org/~minter/XML-Atom-SimpleFeed-0.5/lib/XML/Atom/SimpleFeed.pm

## rss_index

     print $archive->rss_index();

returns a string representing the Rss Feed. More on Atom:

## send_pings

     $self->send_pings();

Sends a notice to updating services, telling them that they should check out the new Syndication Feeds. More information:

http://www.xmlrpc.com/weblogsCom

## _massaged_key

Private Method

Attempts to cleanse a key given to this object that contains weird things. Usually used to massage the id created from the Message-ID header of a email message.

# COPYRIGHT

Copyright (c) 1999-2008 Justin Simoni All rights reserved.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.