• R/O
  • SSH
  • HTTPS

clearfybusiness: Commit


Commit MetaInfo

Révision224 (tree)
l'heure2019-07-23 15:56:33
Auteurdaianji

Message de Log

(empty log message)

Change Summary

Modification

--- org.clearfy/org.clearfy.datawrapper/src/main/java/org/clearfy/datawrapper/data/KeyValueStrage.java (nonexistent)
+++ org.clearfy/org.clearfy.datawrapper/src/main/java/org/clearfy/datawrapper/data/KeyValueStrage.java (revision 224)
@@ -0,0 +1,94 @@
1+/*
2+ * The MIT License
3+ *
4+ * Copyright 2017 tmworks.
5+ *
6+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7+ * of this software and associated documentation files (the "Software"), to deal
8+ * in the Software without restriction, including without limitation the rights
9+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+ * copies of the Software, and to permit persons to whom the Software is
11+ * furnished to do so, subject to the following conditions:
12+ *
13+ * The above copyright notice and this permission notice shall be included in
14+ * all copies or substantial portions of the Software.
15+ *
16+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+ * THE SOFTWARE.
23+ */
24+package org.clearfy.datawrapper.data;
25+
26+import java.sql.ResultSet;
27+import java.sql.SQLException;
28+import java.sql.Timestamp;
29+import java.util.logging.Level;
30+import java.util.logging.Logger;
31+import org.clearfy.datawrapper.Column;
32+import org.clearfy.datawrapper.Table;
33+
34+/**
35+ *
36+ * @author Takahiro MURAKAMI <daianji@gmail.com>
37+ */
38+public class KeyValueStrage extends Table {
39+
40+ public Column<String> Key;
41+
42+ public Column<Timestamp> Stamp;
43+
44+ public Column<Timestamp> Mdate;
45+
46+ public Column<Short> Disable;
47+
48+ public Column<String> Value;
49+
50+ @Override
51+ public void defineColumns() {
52+ Key.setPrimaryKey(true)
53+ .setAllowNull(false);
54+
55+ Stamp.setDefault("CURRENT_TIMESTAMP")
56+ .setAllowNull(false);
57+
58+ Mdate.setDefault("CURRENT_TIMESTAMP")
59+ .setAllowNull(false);
60+
61+ Disable.setDefault("0")
62+ .setAllowNull(false);
63+
64+ Value.setLength(64)
65+ .setAllowNull(false);
66+
67+ }
68+
69+ public String getParameter(String key) {
70+
71+ String rvalue = "";
72+ try {
73+ this.selectAllColumn();
74+ ResultSet rs = this.select(this.Key.sameValueOf(key),
75+ this.Value.setSelectable(true)
76+ );
77+ if (rs.next()) {
78+ rvalue = rs.getString(this.Value.getName());
79+ }
80+ } catch (SQLException ex) {
81+ Logger.getLogger(KeyValueStrage.class.getName()).log(Level.SEVERE, null, ex);
82+ }
83+ return rvalue;
84+ }
85+
86+
87+ public void setParameter(String key, String value){
88+ this.merge(
89+ this.Key.setValue(key),
90+ this.Value.setValue(value)
91+ );
92+ }
93+
94+}
--- org.clearfy/org.clearfy.web/src/main/java/org/clearfy/plugin/mail/MailSetting.java (revision 223)
+++ org.clearfy/org.clearfy.web/src/main/java/org/clearfy/plugin/mail/MailSetting.java (nonexistent)
@@ -1,86 +0,0 @@
1-/*
2- * The MIT License
3- *
4- * Copyright 2017 tmworks.
5- *
6- * Permission is hereby granted, free of charge, to any person obtaining a copy
7- * of this software and associated documentation files (the "Software"), to deal
8- * in the Software without restriction, including without limitation the rights
9- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10- * copies of the Software, and to permit persons to whom the Software is
11- * furnished to do so, subject to the following conditions:
12- *
13- * The above copyright notice and this permission notice shall be included in
14- * all copies or substantial portions of the Software.
15- *
16- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22- * THE SOFTWARE.
23- */
24-package org.clearfy.plugin.mail;
25-
26-import java.sql.ResultSet;
27-import java.sql.SQLException;
28-import java.sql.Timestamp;
29-import java.util.logging.Level;
30-import java.util.logging.Logger;
31-import org.clearfy.datawrapper.Column;
32-import org.clearfy.datawrapper.Table;
33-
34-/**
35- *
36- * @author Takahiro MURAKAMI <daianji@gmail.com>
37- */
38-public class MailSetting extends Table {
39-
40- public Column<String> Key;
41-
42- public Column<Timestamp> Stamp;
43-
44- public Column<Timestamp> Mdate;
45-
46- public Column<Short> Disable;
47-
48- public Column<String> Value;
49-
50- @Override
51- public void defineColumns() {
52- Key.setPrimaryKey(true)
53- .setAllowNull(false);
54-
55- Stamp.setDefault("CURRENT_TIMESTAMP")
56- .setAllowNull(false);
57-
58- Mdate.setDefault("CURRENT_TIMESTAMP")
59- .setAllowNull(false);
60-
61- Disable.setDefault("0")
62- .setAllowNull(false);
63-
64- Value.setLength(64)
65- .setAllowNull(false);
66-
67- }
68-
69- public String getParameter(String key) {
70-
71- String rvalue = "";
72- try {
73- this.selectAllColumn();
74- ResultSet rs = this.select(this.Key.sameValueOf(key),
75- this.Value.setSelectable(true)
76- );
77- if (rs.next()) {
78- rvalue = rs.getString(this.Value.getName());
79- }
80- } catch (SQLException ex) {
81- Logger.getLogger(MailSetting.class.getName()).log(Level.SEVERE, null, ex);
82- }
83- return rvalue;
84- }
85-
86-}
Afficher sur ancien navigateur de dépôt.