• R/O
  • SSH
  • HTTPS

p2pbbs: Commit


Commit MetaInfo

Revision36 (tree)
Time2010-02-05 17:53:31
Authorspark_xp

Log Message

トピック一覧に作者名が表示されない未実装の部分を実装した.

Change Summary

  • delete: P2PBBS/trunk/log/4a7a13dada54be941753f1c02ac2be1f03d749e8/e3d7f3323baf6d388604985ff6279065dea5f310.dat
  • delete: P2PBBS/trunk/log/4a7a13dada54be941753f1c02ac2be1f03d749e8/d9ba2f6e7e594b7f8ca4db6b38cc5c328c6af492.dat
  • delete: P2PBBS/trunk/log/4a7a13dada54be941753f1c02ac2be1f03d749e8/244a69f25f89d92811575a832dc22e99f8a91cda.dat
  • delete: P2PBBS/trunk/log/4a7a13dada54be941753f1c02ac2be1f03d749e8/f209a98e80695a24578fac37727f58feb2aaa8c7.dat
  • delete: P2PBBS/trunk/log/4a7a13dada54be941753f1c02ac2be1f03d749e8/a4f5706a369c77f3461604f20ac12e3a454af38e.dat
  • delete: P2PBBS/trunk/log/4a7a13dada54be941753f1c02ac2be1f03d749e8/c8b6d8e9c8e2bf9381683387448dfcb3e9f51ef5.dat
  • delete: P2PBBS/trunk/log/4a7a13dada54be941753f1c02ac2be1f03d749e8/cab45a98e58a796edd1b0676916d9b3161c2913e.dat
  • delete: P2PBBS/trunk/log/4a7a13dada54be941753f1c02ac2be1f03d749e8/4241a914b2d2c8687661b454fa360ed62b724d64.dat
  • delete: P2PBBS/trunk/log/4a7a13dada54be941753f1c02ac2be1f03d749e8/1a318db52b20c524740d331f8751ad4ea33af416.dat
  • delete: P2PBBS/trunk/log/4a7a13dada54be941753f1c02ac2be1f03d749e8/a6ffc911b25b59e36ff1c2597d8e2ee95ddb089d.dat
  • delete: P2PBBS/trunk/log/4a7a13dada54be941753f1c02ac2be1f03d749e8/7841e9ae564630dfb6991a85d231a4a6d1587e3a.dat
  • delete: P2PBBS/trunk/log/4a7a13dada54be941753f1c02ac2be1f03d749e8/d6eb69ba6347c28c88b07138c02d5202e14f2291.dat
  • delete: P2PBBS/trunk/log/4a7a13dada54be941753f1c02ac2be1f03d749e8/7fbcb33d9144615e0499aad649e707d053d9a7ed.dat
  • delete: P2PBBS/trunk/log/4a7a13dada54be941753f1c02ac2be1f03d749e8/fb96e7c83380e04a5773099a0f627449be0ea09c.dat
  • delete: P2PBBS/trunk/log/4a7a13dada54be941753f1c02ac2be1f03d749e8/3622bc3cc3b6822457a9e4e450179748966d4e2c.dat
  • delete: P2PBBS/trunk/log/4a7a13dada54be941753f1c02ac2be1f03d749e8/40883ff96f10dde7daf23f7689aaaf18e21d93b2.dat
  • delete: P2PBBS/trunk/log/4a7a13dada54be941753f1c02ac2be1f03d749e8/a8dab15b30614d5fa71b6df04c04d3165110d463.dat
  • delete: P2PBBS/trunk/log/4a7a13dada54be941753f1c02ac2be1f03d749e8
  • delete: P2PBBS/trunk/log/ae2371fb6feb5d5643b42d809fcba82fc2f43d64/a91c820b87cec0b208e921d7661e6cd6b464e418.dat
  • delete: P2PBBS/trunk/log/ae2371fb6feb5d5643b42d809fcba82fc2f43d64/20b89e460c0ab56a7a9adc347753bcbcfcb9ae2a.dat
  • delete: P2PBBS/trunk/log/ae2371fb6feb5d5643b42d809fcba82fc2f43d64/1d77ab9bf3979df15d3a719358c498496e311d9f.dat
  • delete: P2PBBS/trunk/log/ae2371fb6feb5d5643b42d809fcba82fc2f43d64/3ed1a9ffc1d694daf3a96f84fba365fbbb21c3d9.dat
  • delete: P2PBBS/trunk/log/ae2371fb6feb5d5643b42d809fcba82fc2f43d64/a03a934966c007c361f550baa613803c43db080f.dat
  • delete: P2PBBS/trunk/log/ae2371fb6feb5d5643b42d809fcba82fc2f43d64/412604bda8e8da6d5ddb4b93155147ebf9cbb5bb.dat
  • delete: P2PBBS/trunk/log/ae2371fb6feb5d5643b42d809fcba82fc2f43d64
  • modified: P2PBBS/trunk/src/bbs/xml/BBSXMLParser.java (diff)
  • modified: P2PBBS/trunk/src/bbs/gui/GUIMain.java (diff)
  • modified: P2PBBS/trunk/src/bbs/manager/BBSManager.java (diff)
  • modified: P2PBBS/trunk/src/bbs/manager/TopicManageNodeUpdater.java (diff)
  • modified: P2PBBS/trunk/src/bbs/manager/TopicInformationElement.java (diff)
  • modified: P2PBBS/trunk/src/bbs/BBSConfiguration.java (diff)
  • modified: P2PBBS/trunk/src/bbs/client/handler/ClientReadHandler.java (diff)

Incremental Difference

--- P2PBBS/trunk/src/bbs/xml/BBSXMLParser.java (revision 35)
+++ P2PBBS/trunk/src/bbs/xml/BBSXMLParser.java (revision 36)
@@ -269,8 +269,9 @@
269269 String title = getChildren(element, "title");
270270 int num = Integer.parseInt( getChildren(element, "num") );
271271 int activity = Integer.parseInt( getChildren(element, "activity"));
272+ String author = getChildren(element, "author");
272273 TopicInformationElement elem = new TopicInformationElement(
273- categoryID, tid, title, num, activity);
274+ categoryID, tid, title, num, activity, author);
274275 // id
275276 retArray.add(elem);
276277 }catch(Exception e) {
--- P2PBBS/trunk/src/bbs/gui/GUIMain.java (revision 35)
+++ P2PBBS/trunk/src/bbs/gui/GUIMain.java (revision 36)
@@ -404,7 +404,7 @@
404404 private JTextField getJTextField() {
405405 if (jTextField == null) {
406406 jTextField = new JTextField();
407- jTextField.setText("bbs.csci.yamanashi.ac.jp:40002");
407+ jTextField.setText("");
408408 }
409409 return jTextField;
410410 }
--- P2PBBS/trunk/src/bbs/manager/BBSManager.java (revision 35)
+++ P2PBBS/trunk/src/bbs/manager/BBSManager.java (revision 36)
@@ -449,6 +449,7 @@
449449 buf.append("<topic><tid>" + topic.getTid() + "</tid>"
450450 + "<title>" + topic.getTitle() + "</title>"
451451 + "<num>" + topic.getNumOfComment() + "</num>"
452+ + "<author>" + topic.getAuthor() + "</author>"
452453 + "<activity>" + topic.getActivity()
453454 + "</activity></topic>\n");
454455 }
--- P2PBBS/trunk/src/bbs/manager/TopicManageNodeUpdater.java (revision 35)
+++ P2PBBS/trunk/src/bbs/manager/TopicManageNodeUpdater.java (revision 36)
@@ -289,6 +289,13 @@
289289 // 保持しているコメント数
290290 int manageCommentNum = this.topicManager.size(topicID, categoryID);
291291 buf.append("<num>" + manageCommentNum + "</num>\n");
292+ // 作成者
293+ SortedSet<CommentElement> topics = this.topicManager.get(topicID, categoryID, 1, 2);
294+ String author = null;
295+ for( CommentElement topic : topics) {
296+ author = topic.getAuthor();
297+ }
298+ buf.append("<author>" + author + "</author>");
292299 //活性度
293300 int activity = this.topicActivityManager.getActivity(categoryID, topicID);
294301 buf.append("<activity>" + activity + "</activity>");
--- P2PBBS/trunk/src/bbs/manager/TopicInformationElement.java (revision 35)
+++ P2PBBS/trunk/src/bbs/manager/TopicInformationElement.java (revision 36)
@@ -17,6 +17,8 @@
1717 private int numOfComment = 0;
1818 //活性度
1919 private int activity = 0;
20+ //作者
21+ private String author = null;
2022
2123 public TopicInformationElement() {
2224
@@ -29,14 +31,16 @@
2931 * @param title
3032 * @param numOfComment
3133 * @param activity
34+ * @param author
3235 */
3336 public TopicInformationElement(String categoryID, String tid, String title,
34- int numOfComment, int activity) {
37+ int numOfComment, int activity, String author) {
3538 this.categoryID = categoryID;
3639 this.tid = tid;
3740 this.title = title;
3841 this.numOfComment = numOfComment;
3942 this.activity = activity;
43+ this.author = author;
4044 }
4145
4246
@@ -154,4 +158,20 @@
154158 + ", categoryID=" + categoryID + ", numOfComment="
155159 + numOfComment + ", tid=" + tid + ", title=" + title + "]";
156160 }
161+
162+ /**
163+ * authorを取得します。
164+ * @return author
165+ */
166+ public String getAuthor() {
167+ return author;
168+ }
169+
170+ /**
171+ * authorを設定します。
172+ * @param author author
173+ */
174+ public void setAuthor(String author) {
175+ this.author = author;
176+ }
157177 }
--- P2PBBS/trunk/src/bbs/BBSConfiguration.java (revision 35)
+++ P2PBBS/trunk/src/bbs/BBSConfiguration.java (revision 36)
@@ -4,7 +4,7 @@
44 //デフォルト文字コード
55 public static final String DEFAULT_ENCODING = "UTF-8";
66 //読み込んだトピックをローカルに保存するか
7- public static final boolean SAVE_TOPIC_TO_LOCAL = true;
7+ public static final boolean SAVE_TOPIC_TO_LOCAL = false;
88 //トピックログ保存ディレクトリ名
99 public static final String LOG_DIRECTORY = "log";
1010 //ゲートウェイアドレス
@@ -14,7 +14,7 @@
1414 //通信ログ最大数
1515 public static final int NUM_OF_MAX_TRAFFIC_LOG = 100000;
1616 //通信ログをファイルへ出力するか
17- public static final boolean SAVE_TRAFFIC_TO_LOCAL = true;
17+ public static final boolean SAVE_TRAFFIC_TO_LOCAL = false;
1818
1919 /**
2020 * GATEWAY_ADDRESSを取得します。
--- P2PBBS/trunk/src/bbs/client/handler/ClientReadHandler.java (revision 35)
+++ P2PBBS/trunk/src/bbs/client/handler/ClientReadHandler.java (revision 36)
@@ -385,7 +385,7 @@
385385 + categoryID + "/" + topic.getTid() + "/0-0\">");
386386 buf.append(HTMLEncode.encode(topic.getTitle()));
387387 buf.append("</a></td>\n");
388- buf.append("<td>未実装</td>");
388+ buf.append("<td>" + topic.getAuthor() + "</td>");
389389 buf.append("<td>" + topic.getNumOfComment() + "</td>\n");
390390 buf.append("<td>" + df.format((double)topic.getActivity() / 120.0) + "回/時</td>");
391391 buf.append("</tr>");
Show on old repository browser