[pal-cvs 3964] [1699] added smtp config.

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2009年 1月 24日 (土) 07:36:23 JST


Revision: 1699
          http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1699
Author:   shinsuke
Date:     2009-01-24 07:36:23 +0900 (Sat, 24 Jan 2009)

Log Message:
-----------
added smtp config.

Modified Paths:
--------------
    timecard/trunk/src/main/java/jp/sf/pal/timecard/action/ConfigAction.java
    timecard/trunk/src/main/java/jp/sf/pal/timecard/form/config/ConfigForm.java
    timecard/trunk/src/main/resources/application.properties
    timecard/trunk/src/main/resources/application_ja.properties
    timecard/trunk/src/main/webapp/WEB-INF/view/config/index.jsp


-------------- next part --------------
Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/action/ConfigAction.java
===================================================================
--- timecard/trunk/src/main/java/jp/sf/pal/timecard/action/ConfigAction.java	2009-01-23 22:22:27 UTC (rev 1698)
+++ timecard/trunk/src/main/java/jp/sf/pal/timecard/action/ConfigAction.java	2009-01-23 22:36:23 UTC (rev 1699)
@@ -6,6 +6,7 @@
 
 import jp.sf.pal.timecard.TimecardConstants;
 import jp.sf.pal.timecard.common.util.ConfigUtil;
+import jp.sf.pal.timecard.common.util.NotificationUtil;
 import jp.sf.pal.timecard.common.util.SAStrutsUtil;
 import jp.sf.pal.timecard.form.config.ConfigForm;
 
@@ -44,6 +45,15 @@
                 TimecardConstants.DEFAULT_MANAGER, "admin");
         configForm.csvEncoding = ConfigUtil.getString(
                 TimecardConstants.CSV_ENCODING, "UTF-8");
+        configForm.notificationTemplateEncoding = ConfigUtil.getString(
+                NotificationUtil.TEMPLATE_ENCODING, "UTF-8");
+        configForm.notificationSmtpHost = ConfigUtil.getString(
+                NotificationUtil.SMTP_HOST, "localhost");
+        // TODO user, password for smtp
+        configForm.notificationSubjectEncoding = ConfigUtil.getString(
+                NotificationUtil.SUBJECT_ENCODING, "UTF-8");
+        configForm.notificationBodyEncoding = ConfigUtil.getString(
+                NotificationUtil.BODY_ENCODING, "UTF-8");
         return "index.jsp";
     }
 
@@ -72,6 +82,16 @@
                 configForm.defaultManager);
         ConfigUtil.setProperty(TimecardConstants.CSV_ENCODING,
                 configForm.csvEncoding);
+        ConfigUtil.setProperty(NotificationUtil.TEMPLATE_ENCODING,
+                configForm.notificationTemplateEncoding);
+        ConfigUtil.setProperty(NotificationUtil.SMTP_HOST,
+                configForm.notificationSmtpHost);
+        // TODO user, password for smtp
+        ConfigUtil.setProperty(NotificationUtil.SUBJECT_ENCODING,
+                configForm.notificationSubjectEncoding);
+        ConfigUtil.setProperty(NotificationUtil.BODY_ENCODING,
+                configForm.notificationBodyEncoding);
+
         try {
             ConfigUtil.save();
             SAStrutsUtil.addMessage(request, "success.update_config");

Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/form/config/ConfigForm.java
===================================================================
--- timecard/trunk/src/main/java/jp/sf/pal/timecard/form/config/ConfigForm.java	2009-01-23 22:22:27 UTC (rev 1698)
+++ timecard/trunk/src/main/java/jp/sf/pal/timecard/form/config/ConfigForm.java	2009-01-23 22:36:23 UTC (rev 1699)
@@ -36,4 +36,16 @@
 
     @Required(target = "update")
     public String csvEncoding;
+
+    @Required(target = "update")
+    public String notificationTemplateEncoding;
+
+    @Required(target = "update")
+    public String notificationSmtpHost;
+
+    @Required(target = "update")
+    public String notificationSubjectEncoding;
+
+    @Required(target = "update")
+    public String notificationBodyEncoding;
 }

Modified: timecard/trunk/src/main/resources/application.properties
===================================================================
--- timecard/trunk/src/main/resources/application.properties	2009-01-23 22:22:27 UTC (rev 1698)
+++ timecard/trunk/src/main/resources/application.properties	2009-01-23 22:36:23 UTC (rev 1699)
@@ -203,4 +203,7 @@
 
 labels.download_csv=Download CSV
 labels.csv_encoding=Encoding for CSV
-
+labels.template_encoding=Encoding for Email Template
+labels.smtp_host=SMTP Host
+labels.subject_encoding=Encoding for Email Subject
+labels.body_encoding=Encoding for Email Body

Modified: timecard/trunk/src/main/resources/application_ja.properties
===================================================================
--- timecard/trunk/src/main/resources/application_ja.properties	2009-01-23 22:22:27 UTC (rev 1698)
+++ timecard/trunk/src/main/resources/application_ja.properties	2009-01-23 22:36:23 UTC (rev 1699)
@@ -196,3 +196,7 @@
 
 labels.download_csv=CSV \u3067\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9
 labels.csv_encoding=CSV \u306e\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0
+labels.template_encoding=\u30e1\u30fc\u30eb\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306e\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0
+labels.smtp_host=SMTP \u30db\u30b9\u30c8
+labels.subject_encoding=\u30e1\u30fc\u30eb\u4ef6\u540d\u306e\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0
+labels.body_encoding=\u30e1\u30fc\u30eb\u672c\u6587\u306e\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0
\ No newline at end of file

Modified: timecard/trunk/src/main/webapp/WEB-INF/view/config/index.jsp
===================================================================
--- timecard/trunk/src/main/webapp/WEB-INF/view/config/index.jsp	2009-01-23 22:22:27 UTC (rev 1698)
+++ timecard/trunk/src/main/webapp/WEB-INF/view/config/index.jsp	2009-01-23 22:36:23 UTC (rev 1699)
@@ -61,6 +61,22 @@
 			<th><bean:message key="labels.csv_encoding"/></th>
 			<td><html:text property="csvEncoding" size="5" style="width:100%;"/></td>
 		</tr>
+		<tr>
+			<th><bean:message key="labels.template_encoding"/></th>
+			<td><html:text property="notificationTemplateEncoding" /></td>
+		</tr>
+		<tr>
+			<th><bean:message key="labels.smtp_host"/></th>
+			<td><html:text property="notificationSmtpHost" /></td>
+		</tr>
+		<tr>
+			<th><bean:message key="labels.subject_encoding"/></th>
+			<td><html:text property="notificationSubjectEncoding" /></td>
+		</tr>
+		<tr>
+			<th><bean:message key="labels.body_encoding"/></th>
+			<td><html:text property="notificationBodyEncoding" /></td>
+		</tr>
 	</tbody>
 	<tfoot>
 		<tr>



pal-cvs メーリングリストの案内
Back to archive index