ANNOUNCE: Dada Mail 2.9 Released

Justin Simoni <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.html-template
Message-ID <[email protected]>
The Dada Mail Developing Team meaning... me - is please to announce the  
release of Dada Mail, version 2.9.

The Download is at:

	http://mojo.skazat.com/download/
	
As always, Dada Mail is a free download (GPL licensed)

This release of Dada Mail has focused on one idea: Write Once,  
Distribute Everywhere. Messages sent using Dada Mail are also available  
on the web, searchable, resendable, and syndicated. This allows content  
creators to focus on writing their content, while Dada Mail focuses on  
distributing it and  allows your users to choose on how they would like  
to receive it. This is the largest overhaul of Dada Mail to date.  
Here's a fancy walkthru:

	http://mojo.skazat.com/features/2_9/

Improvements are found in the following areas:

     * Syndication
     * Send an archived message to a friend feature - rewritten
     * mail.cgi - rewritten (basically)
     * Browser-based HTML Message Editor
     * List Screens
     * Archive Screens
     * Email Formatting
     * Path Infos
     * VERP support
     * Fast List Switching
     * Batch Notification Enhancements
     * Internal Templates
     * Subscriber Help Screen
     * HTML Screens - XHTML Compatible
     * Log In Security
     * Developer Stuff

An exhaustive look at all the new features can be found at:

	http://mojo.skazat.com/support/documentation/ 
new_features.pod.html#version_2_9

:: Notes:

	http://mojo.skazat.com/support/documentation/NOTES.pod.html#2_9

:: Changes:

	http://mojo.skazat.com/support/documentation/changes.pod.html#2_9_0

:: Known Issues:

	http://mojo.skazat.com/support/documentation/known_issues.pod.html

I announce this release on the HTML::Template list, since Dada Mail now  
incorporates HTML::Template to interpolate almost all of it's HTML  
Screens.

This has had some great affects:

.: The main, albeit monolithic, script has been reduced in size from  
284k to 186k -  almost all of which has been embedded HTML (in every  
possible way imaginable) which has thus been moved out of the program  
and into separate template files.

.: There are about 70 different template files in Dada Mail that are  
now editable to anyone who can pick up the HTML::Template system.

This has allowed the next affect:

.: We were able to update almost all the HTML to be xHTML Transitional!  
The HTML code in Dada Mail dates to 1999, when the program was first  
written, so this is a nice change.

.: I'm hoping that interested 3rd parties will think of translating the  
program to something other than English, now that a great majority of  
the text/layout of the program is in easy to edit template files.

:: About Dada Mail:

Dada Mail is an intuitive, web-based e-mail list management system,  
which runs on any hosting account that can execute custom CGI scripts.  
Dada Mail is also a conceptual art project.

.: More Information  -

	http://mojo.skazat.com/project/

-----------------------------------------------------------------------

Working so much with HTML::Template I've come to appreciate a few  
things about the package and of the philosophy:

.: Templates should have minimal any logic

I didn't understand why this was such a big deal - I actually saw that  
putting a little logic here and there inside the templates was actually  
a good way to shortcut some harder coding in Perl itself.

Wrong I was.

First off, having all the HTML outside of the Perl program itself,  
really gives a lot of room to actually code - everything becomes  
tighter and easier to manage. What once was spaghetti of HTML, CGI.pm  
method calls and logic? now is in easy-to-understand chunks. Many of  
the admin screens of Dada Mail look like this (actual subroutine):



1: sub view_list_options {
2:
3: 	my ($admin_list, $root_login) = check_list_security(-cgi_obj  => $q,
4: 	                                                    -Function =>  
'view_list_options');
5: 	$list = $admin_list;
6:
7: 	my @list_amount = (10,25,50,100,150,200,
8: 	                   250,300,350, 400,450,
9: 	                   500,550,600,650,700,
10: 	                   750,800,850,900,950,1000
11: 	                  );
12: 	
13: 	require DADA::MailingList::Settings;
14: 	
15: 	my $ls = DADA::MailingList::Settings->new(-List => $list);
16: 	my $li = $ls->get;
17: 	
18: 	if(!$process){
19: 	
20: 		
21: 		my $vlsn_menu = $q->popup_menu(-name     =>  
'view_list_subscriber_number',
22: 									   -values   => [ @list_amount],
23: 									   -default  => $li->{view_list_subscriber_number});
24: 											  									
25: 		print(admin_html_header(-Title      => "View List Options",
26: 		                        -List       => $list,
27: 		                        -Root_Login => $root_login,
28: 		                       ));
29: 		
30: 		require DADA::Template::Widgets;
31: 		print   DADA::Template::Widgets::screen(-screen =>  
'view_list_options_screen.tmpl',
32: 												-vars  => {
33: 															done      => $done,
34: 															vlsn_menu => $vlsn_menu
35: 														  },
36: 											   );
37: 											
38: 		print(admin_html_footer(-List => $list));
39: 	
40: 	}else{
41: 	
42: 		$ls->save({view_list_subscriber_number =>  
$q->param('view_list_subscriber_number')});
43: 		print $q->redirect(-uri => $S_PROGRAM_URL .  
'?f=view_list_options&done=1');
44: 		return;
45: 	}
46:
47: }


Before I get started - if this code looks similar to what you'd see in  
a CGI::Application program - you're right, it's what I want to move to  
- anyways:

Line 3 -

check_list_security() is Dada Mail's way to keep state and check that  
the right people are doing the right things. It uses CGI::Session at  
the core. 2 lines and we're done with that.

Line 21 -

I still used the CGI.pm methods for creating popup menus, and I just  
passed it as a variable to HTML::Template - as the docs state, it's a  
good way to do this;

Line 31 -

DADA::Template::Widgets::screen is basically a wrapper around  
HTML::Template - it checks a few things and does some janitorial work.  
One of the things you pass it is the -vars hashref - which is given  
right to HTML::Template. There's many many places that you have to  
explicitly list the vars to be filled in - but I really like having  
this list available to me, in the code. Code as Data, Data as Code and  
all that.

I'll stop there, but the subroutine itself is really simple - if  
something needs to be saved, save it, if not, give me a screen to make  
changes. It's lovely. Other people can understand what's going on and  
it's in Perl :)

Couldn't have done it without you, HTML::Template!

I was thinking of extending the above and write something on Perl  
Monks, like I did for CGI::Application:

	http://perlmonks.org/index.pl?node_id=199411

Starting with the original version of the above subroutine and stating  
how I made it a bit nicer. If I have time :)


Cheers,

Justin Simoni
-- 
// is an artist, living and working in Denver, Colorado
// URL: http://justinsimoni.com
// PHO: 720.436.7701



-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.