2006/unicorn/src/org/w3c/unicorn/output MailOutputModule.java,1.11,1.12

Update of /sources/public/2006/unicorn/src/org/w3c/unicorn/output
In directory hutz:/tmp/cvs-serv29372/src/org/w3c/unicorn/output

Modified Files:
	MailOutputModule.java 
Log Message:
internationalized messages
+ localized Date format

Index: MailOutputModule.java
===================================================================
RCS file: /sources/public/2006/unicorn/src/org/w3c/unicorn/output/MailOutputModule.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- MailOutputModule.java	29 Sep 2009 16:08:25 -0000	1.11
+++ MailOutputModule.java	30 Sep 2009 13:36:15 -0000	1.12
@@ -7,8 +7,10 @@
 import java.io.CharArrayWriter;
 import java.io.UnsupportedEncodingException;
 import java.io.Writer;
+import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.List;
+import java.util.Locale;
 import java.util.Map;
 import java.util.ArrayList;
 import java.util.Properties;
@@ -62,10 +64,10 @@
 		//mapOfStringObject.put("baseUri", "http://qa-dev.w3.org/unicorn/");
 		
 		ArrayList<Message> messages = ((ArrayList<Message>) mapOfStringObject.get("messages"));
-		Message pendingMess = new Message(Message.Level.INFO, "Le rapport est en cours d'envoi à l'adresse: " + recipient);
+		Message pendingMess = new Message(Message.Level.INFO, "$message_mail " + recipient);
 		
 		if (recipient == null) {
-			throw new UnicornException(new Message(Message.Level.ERROR, "Aucune adresse email spécifiée. Rajoutez &opt_email=votre.adresse@mail.com à la requête."));
+			throw new UnicornException(new Message(Message.Level.ERROR, "$message_missing_email"));
 		} else {
 			messages.add(pendingMess);
 		}
@@ -84,15 +86,13 @@
 		if (mailOutputFormaters == null && mailOutputFormaters.get(0) == null)
 			return;
 		
-		// TODO http://java.sun.com/developer/EJTechTips/2004/tt0625.html#1 for multipart messages
-		
-
-		
 		try {
 			ArrayList<Message> messages = ((ArrayList<Message>) mapOfStringObject.get("messages"));
-			messages.add(new Message(Message.Level.INFO, "Observation effectuée le " + new Date()));
+			SimpleDateFormat dateFormat = new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss (Z)", new Locale(outputParameters.get("lang")));
 			
-			mapOfStringObject.put("baseUri", "http://qa-dev.w3.org:8001/unicorn/");
+			messages.add(new Message(Message.Level.INFO, "$message_mail_date " + dateFormat.format(new Date())));
+			
+			mapOfStringObject.put("baseUri", Property.get("UNICORN_URL"));
 			
 			Properties mailProps = Property.getProps("mail.properties");
 			Authenticator auth = new UnicornAuthenticator(mailProps.getProperty("unicorn.mail.username"), mailProps.getProperty("unicorn.mail.password"));

Received on Wednesday, 30 September 2009 13:36:18 UTC