チェンジセット 8
- 更新日時:
- 2007/02/17 15:28:26 (5 年 前)
- パス:
- tPod/trunk
- ファイル:
-
- 1 追加
- 8 変更
-
README.sj (変更) (5 diff)
-
application.properties (変更) (2 diff)
-
makefile (変更) (3 diff)
-
serv.bat (変更) (1 diff)
-
servlet/icon/url.gif (追加)
-
src/jp/tyzoh/rinza/folksonomy/tpod/Engine.java (変更) (2 diff)
-
src/jp/tyzoh/rinza/folksonomy/tpod/Repository.java (変更) (1 diff)
-
src/jp/tyzoh/rinza/folksonomy/tpod/Rinza.java (変更) (2 diff)
-
src/jp/tyzoh/rinza/folksonomy/tpod/tPod.java (変更) (21 diff)
凡例:
- 変更なし
- 追加
- 削除
-
tPod/trunk/README.sj
r6 r8 27 27 �@���p�҂��D���Ȃ悤�ɃL�[���[�h����A��������������s�����Ƃ��ł��܂��B 28 28 �@�L�[���[�h�̓����N���b�N�őI��邱�Ƃ��\�ł��B 29 �E �����L�[���[�h���o�i5.2 �̒lj�@�\�j 30 �@�e�L�X�g�t�@�C���̃L�[���[�h����I�ɒ��o���܂��B 31 �E �R�����g�Â��i0.5.2 �̒lj�@�\�j 32 �@���p�҂����R�ɃR�����g������܂��B 33 �E URL �o�^�i0.5.2 �̒lj�@�\�j 34 �@�t�@�C�������ł͂Ȃ� URL ��^�ł������ɂȂ������i�������S������ΏۊO�ł��j�B 29 35 �E �S������g 30 36 �@�S��������W���ƘA�g���A�L�[���[�h������ł͂Ȃ��S������s�������ɂȂ����B 31 37 �E �A�N�Z�X�R���g���[�� 32 38 �@����ʂɃA�N�Z�X�������邱�Ƃ��ł��܂��B 33 34 �����W�����ł̊J���A�C�e�� 35 �E�R�����g�L�q 36 �E�����L�[���[�h���o 37 38 �� �����[�X��2006�N10�� 39 �E�T�}���\���i0.5.2 �̒lj�@�\�j 40 �@ �摜�k���\���A�R�����g�T�}���A�L�[���[�h�T�}������ł������ɂȂ������B 41 42 �� �����W�����ł̊J���A�C�e���i�\�� 43 �E����DB�iSSDB �Ή��j 44 45 �� �����[�X��2007�N2�� 39 46 �o�[�W������ 40 0.5. 147 0.5.2 41 48 42 49 �� �z�z�� 43 50 44 tPod-0.5. 1.zip51 tPod-0.5.2.zip 45 52 46 53 ���̃t�@�C����ӂ̃f�B���N�g���œW�J�������̂悤�ȍ\���ƂȂ����B … … 74 81 75 82 �� ������ 76 OS�i���L�����ꂩ�j83 �EOS�i���L�����ꂩ�j 77 84 Windows 2000, XP 78 85 Linux(FedoraCore4 �ȍ~�œ����F�ς݁j 79 86 80 MW87 �EMW 81 88 Apache �i�����Ă��j 82 89 Tomcat �i5�ȍ~�œ����F�ς݁j 83 90 Rinza RDF Repository�i���łɉғ����Ă����̂������������p���邱�Ƃ��ł��܂��j 84 91 85 AP92 �EAP 86 93 namazu�i�����Ă��j 87 88 DB 94 mecab�i�����Ă��j 95 96 �EDB 89 97 PostgreSQL ������MySQL 90 98 DB ��Rinza RDF Repository �o�R�Ŏg�p���܂��̂ŁARinza RDF Repository �����łɉғ����Ă������͕s�v�ł��B … … 111 119 ���̋L�q�ɂ��������application.properties ��W���Ă��������B 112 120 121 ----- application.properties�i�ꕔ�����j �J�n ----- 113 122 #tPod �̃t�@�C����ǂ����B���N�g�� 114 123 #podDirectory=/var/lib/tPod/files/ … … 134 143 #inline=false 135 144 145 #�C���[�W�̏k���\���T�C�Y�B�ǂ��炩�� 0 �̂Ƃ��͏k���\���Ȃ� 146 #thumbWidth=40 147 #thumbHeight=40 148 149 #�L�[���[�h�̃T�}���[�̕\�����i�������j�B0 �̂Ƃ��̓T�}���\���Ȃ��B 150 #keywordSummarySize=60 151 152 #�R�����g�̃T�}���[�̕\�����i�������j�B0 �̂Ƃ��̓T�}���\���Ȃ��B 153 #commentSummarySize=60 154 136 155 # Connector 137 156 # Rinza RDF Repository �̃T�[�o IP �A�h���X 138 connector.agent.address=192.168.23.105 139 140 #connector.agent.address=localhost 157 connector.agent.address=localhost 141 158 # Rinza RDF Repository �̃G���R�[�h�^�C�v 142 159 connector.encoding=Shift_JIS 160 ----- application.properties �I�� ----- 143 161 144 162 *�jtomcat �̎�s���̕����R�[�h�ƈقȂ�������s���邱�Ƃ��������B … … 154 172 mknmz /var/lib/tPod/files -O /var/lib/tPod/index 155 173 --namazu.sh end-- 174 175 �S�D�����L�[���[�h���o���C�u�����̓�������o��Ȃ����ꍇ�ł����p�C���̂��߂ɁA���C�u�������K�v�ƂȂ����B 176 http://dev.tyzoh.jp/trac/folksonomy ����keyword-0.1.1.zip �ȍ~��E�����[�h�A������svn �ɂ��`�F�b�N�A�E�g���A 177 (autoKeywod)/trunk/src/jp/tyzoh/rinza/folksonomy/keyword 178 ���� 179 (autoKeywod)/trunk/src/jp/tyzoh/rinza/folksonomy/analyze 180 ��od �� 181 (tPod)/trunk/src/jp/tyzoh/rinza/folksonomy 182 �ȉ��ɃR�s�[���Ă��������B 183 �܂��A�������o��Ȃ��ꍇ�́A�`�ԑf��G���W���Ƃ���MeCab ��E�����[�h���Ă��������B 184 http://mecab.sourceforge.jp/ 185 0.93 �œ����F��Ă������B 186 187 ----- application.properties�i�ꕔ�����j �J�n ----- 188 #�L�[���[�h�������o��̐��B0 �̂Ƃ��̓L�[���[�h���o�Ȃ��B 189 autoKeywordSize=10 190 #analyzer = jp.tyzoh.rinza.folksonomy.keyword.Mecab 191 #mecab �̃p�X 192 analyzer.command =/var/lib/tPod/mecab.sh 193 #analyzer.command = c:\\mecab\\bin\\mecab.exe 194 #searcher = jp.tyzoh.rinza.folksonomy.searcher.Namazu 195 ----- application.properties �I�� ----- 156 196 157 197 �� �C���X�g�[����zip ��J���� lib �f�B���N�g�����������B -
tPod/trunk/application.properties
r1 r8 9 9 10 10 #tPod �̃t�@�C����ǂ����B���N�g�� 11 podDirectory=/var/lib/tPod/files/ 11 #podDirectory=/var/lib/tPod/files/ 12 podDirectory=d:\\tPodPool 12 13 #�S��������W���̃p�X 13 command=/var/lib/tPod/namazu.sh 14 #command=/var/lib/tPod/namazu.sh 15 command=c:\\namazu\\bin\\namazu.exe -l 14 16 #�S��������W���̃C���f�b�N�X�����v���O�����̃p�X 15 index=sh /var/lib/tPod/mknmz.sh 17 #index=sh /var/lib/tPod/mknmz.sh 18 index=c:\\namazu\\bin\\mknmz.bat d:\\tPodPool -O 16 19 #�S��������W���́u�C���f�b�N�X�v�f�B���N�g�� 17 indexDirectory=/var/lib/tPod/index/ 20 #indexDirectory=/var/lib/tPod/index/ 21 indexDirectory=c:\\tPodIndex 18 22 #Windows �͎w�����ALinux �n��euc-jp 19 23 #encodeType=euc-jp … … 21 25 #����ʂ�����C���\�����邩�ۂ� 22 26 #inline=false 27 #�C���[�W�̏k���\���T�C�Y�B�ǂ��炩�� 0 �̂Ƃ��͏k���\���Ȃ� 28 #thumbWidth=40 29 #thumbHeight=40 30 #�L�[���[�h�̃T�}���[�̕\�����i�������j�B0 �̂Ƃ��̓T�}���\���Ȃ��B 31 #keywordSummarySize=60 32 #�R�����g�̃T�}���[�̕\�����i�������j�B0 �̂Ƃ��̓T�}���\���Ȃ��B 33 #commentSummarySize=60 34 #�L�[���[�h�������o��̐��B0 �̂Ƃ��̓L�[���[�h���o�Ȃ��B 35 autoKeywordSize=10 36 #analyzer = jp.tyzoh.rinza.folksonomy.keyword.Mecab 37 analyzer.command = d:\\mecab\\bin\\mecab.exe 38 #searcher = jp.tyzoh.rinza.folksonomy.searcher.Namazu 23 39 24 40 # Connector -
tPod/trunk/makefile
r1 r8 1 1 RM = c:/cygnus/cygwin-b20/H-i586-cygwin32/bin/rm.exe 2 JAVAC = c:\jdk\bin\javac.exe2 JAVAC = d:\jdk\bin\javac.exe 3 3 SRCPATH = src 4 4 PATH = $(SRCPATH)/jp/tyzoh/rinza/folksonomy/tpod 5 5 PATH2 = $(SRCPATH)/jp/tyzoh/rinza/folksonomy/search 6 6 PATH3 = $(SRCPATH)/jp/tyzoh/rinza/folksonomy/common 7 PATH4 = $(SRCPATH)/jp/tyzoh/rinza/folksonomy/tpodclient 8 PATH5 = $(SRCPATH)/jp/tyzoh/rinza/folksonomy/analyze 9 PATH6 = $(SRCPATH)/jp/tyzoh/rinza/folksonomy/keyword 7 10 SRCS = $(PATH)/tPod.java $(PATH)/Engine.java $(PATH)/Comment.java \ 8 11 $(PATH)/Keyword.java $(PATH)/PermissionNum.java \ … … 11 14 $(PATH)/User.java $(PATH)/Util.java \ 12 15 $(PATH2)/Searcher.java $(PATH2)/Namazu.java \ 13 $(PATH3)/Util.java 16 $(PATH3)/Util.java \ 17 # $(PATH4)/Mail.java $(PATH4)/MailClient.java $(PATH4)/RegistAll.java \ 18 $(PATH5)/Analyzer.java $(PATH5)/Keyword.java $(PATH5)/KeywordComplex.java $(PATH5)/Mecab.java \ 19 $(PATH6)/Auto.java $(PATH6)/Engine.java $(PATH6)/Result.java 14 20 OBJS = $(SRCS:.java=.class) 15 21 LIBPATH = lib 16 LIBS = $(LIBPATH)/servlet-api.jar;$(LIBPATH)/commons-fileupload-1.0.jar;$(LIBPATH)/rinza-rdf.jar 22 LIBS = $(LIBPATH)/servlet-api.jar;$(LIBPATH)/commons-fileupload-1.0.jar;$(LIBPATH)/rinza-rdf.jar;$(LIBPATH)/commons-httpclient-3.0.1.jar 17 23 18 24 .SUFFIXES: .java .class … … 21 27 22 28 .java.class: 23 $(JAVAC) -classpath $(LIBS);$(SRCPATH) $<29 $(JAVAC) -classpath $(LIBS);$(SRCPATH); $< 24 30 25 31 clean: -
tPod/trunk/serv.bat
r1 r8 2 2 del servlet\WEB-INF\classes\jp\tyzoh\rinza\folksonomy\search\*.class 3 3 del servlet\WEB-INF\classes\jp\tyzoh\rinza\folksonomy\common\*.class 4 del servlet\WEB-INF\classes\jp\tyzoh\rinza\folksonomy\analyze\*.class 5 del servlet\WEB-INF\classes\jp\tyzoh\rinza\folksonomy\keyword\*.class 4 6 copy src\jp\tyzoh\rinza\folksonomy\tpod\*.class servlet\WEB-INF\classes\jp\tyzoh\rinza\folksonomy\tpod 5 7 copy src\jp\tyzoh\rinza\folksonomy\search\*.class servlet\WEB-INF\classes\jp\tyzoh\rinza\folksonomy\search 6 8 copy src\jp\tyzoh\rinza\folksonomy\common\*.class servlet\WEB-INF\classes\jp\tyzoh\rinza\folksonomy\common 9 copy src\jp\tyzoh\rinza\folksonomy\analyze\*.class servlet\WEB-INF\classes\jp\tyzoh\rinza\folksonomy\analyze 10 copy src\jp\tyzoh\rinza\folksonomy\keyword\*.class servlet\WEB-INF\classes\jp\tyzoh\rinza\folksonomy\keyword 7 11 copy application.properties servlet\WEB-INF\classes\ 8 12 copy lib\rinza-rdf.jar servlet\WEB-INF\lib -
tPod/trunk/src/jp/tyzoh/rinza/folksonomy/tpod/Engine.java
r7 r8 461 461 } 462 462 463 public synchronized String registerURL(String title, String url, String uid, String time, String keyword, PrintWriter out) 464 { 465 long no = System.currentTimeMillis(); 466 if (title.equals("")) { 467 int index = url.lastIndexOf("/"); 468 if (index > -1) { 469 title = url.substring(index); 470 } 471 } 472 String registeredURL = "URL:"+no+":"+title; 473 time = time.equals("")?Long.toString(new Date().getTime()):time; 474 String category = "URL"; 475 User user = searchUser(uid); 476 String group = (String)user.getGroupList().get(0); 477 478 repository.registerFile(registeredURL, url, time, url, category, uid, user.getName(), group, "true", "true", "false", "false", cutSearchword(keyword)); 479 480 return registeredURL; 481 } 482 463 483 public synchronized String registerFile(String uploadFileName, String uploadAbsolutePath, File uploadedFile, String uid, String time, String keyword, PrintWriter out) 464 484 { … … 547 567 { 548 568 return repository.deleteKeyword(filename, cutSearchword(keyword)); 569 } 570 571 boolean changeTitle(String filename, String value) 572 { 573 return repository.changeTag(filename, "_name", value, null); 574 } 575 576 static boolean isURL(String filename) 577 { 578 return filename.startsWith("URL:"); 579 } 580 581 static String getURL(String filename) 582 { 583 if (isURL(filename)) { 584 String name = filename.substring("URL:".length()); 585 int index = name.indexOf(":"); 586 if (index > -1) { 587 name = name.substring(index + 1); 588 } else { 589 name = ""; // internal error 590 } 591 return name; 592 } else { 593 return ""; 594 } 549 595 } 550 596 -
tPod/trunk/src/jp/tyzoh/rinza/folksonomy/tpod/Repository.java
r7 r8 104 104 105 105 /** 106 * �^�O�ύX 107 */ 108 public boolean changeTag(String filename, String tag, String value, PrintWriter out); 109 110 /** 106 111 * �^�O���� */ 107 112 public Map searchTag(Map table, List keywordList, User user, PrintWriter out); -
tPod/trunk/src/jp/tyzoh/rinza/folksonomy/tpod/Rinza.java
r7 r8 497 497 498 498 fileResource.removeAll(Resource.ANY, Resource.ANY); 499 File file = new File(podDirectory, getFilename(fileResource.getURI())); 500 return file.delete(); 499 if (Engine.isURL(filename)) { 500 return true; 501 } else { 502 File file = new File(podDirectory, getFilename(fileResource.getURI())); 503 return file.delete(); 504 } 501 505 } 502 506 … … 594 598 fileResource.removeAll(keywordResource, Util.encode(keywordOne)); 595 599 } 600 601 return true; 602 } 603 604 /** 605 * �^�O�ύX 606 */ 607 public boolean changeTag(String filename, String tag, String value, PrintWriter out) 608 { 609 Resource fileResource = ResourceFactory.get(getFileURI(filename)); 610 Resource keywordResource = ResourceFactory.get("ns:"+tag); 611 fileResource.removeAll(keywordResource, Resource.ANY); 612 setString(fileResource, tag, value); 596 613 597 614 return true; -
tPod/trunk/src/jp/tyzoh/rinza/folksonomy/tpod/tPod.java
r7 r8 11 11 import org.apache.commons.*; 12 12 import java.security.cert.X509Certificate; 13 //import jp.tyzoh.rinza.folksonomy.keyword.*;13 import jp.tyzoh.rinza.folksonomy.keyword.*; 14 14 15 15 /** … … 29 29 /** �C�����C���\���ɂ��邩�ۂ� */ 30 30 boolean isInline = true; 31 /** �C���[�W�̃T���l�[���̕\���T�C�Y�B�ǂ��炩�� 0 �̂Ƃ��͕\���Ȃ� */ 32 int thumbWidth = 0; 33 int thumbHeight = 0; 34 /** �R�����g�̃T�}���̕\�����i�����j���B0 �̂Ƃ��̓T�}���\���Ȃ� */ 35 int commentSummarySize = 0; 36 /** �L�[���[�h�̃T�}���̕\�����i�����j���B0 �̂Ƃ��̓T�}���\���Ȃ� */ 37 int keywordSummarySize = 0; 38 /** �����L�[���[�h���o��̐��B0 �̂Ƃ��͎������o���Ȃ� */ 39 int autoKeywordSize = 0; 31 40 32 41 /** �T�[�u���b�g��URL�iIE �o�O��/ … … 38 47 39 48 Engine engine = new Engine(); 40 //jp.tyzoh.rinza.folksonomy.keyword.Engine autoKeyword = new jp.tyzoh.rinza.folksonomy.keyword.Engine();49 jp.tyzoh.rinza.folksonomy.keyword.Engine autoKeyword = new jp.tyzoh.rinza.folksonomy.keyword.Engine(); 41 50 42 51 public void init() … … 53 62 servletURL = properties.getProperty("servletURL", servletURL); 54 63 isInline = properties.getProperty("inline", "true").equals("true"); 64 thumbWidth = parseInt(properties.getProperty("thumbWidth", "0")); 65 thumbHeight = parseInt(properties.getProperty("thumbHeight", "0")); 66 keywordSummarySize = parseInt(properties.getProperty("keywordSummarySize", "0")); 67 commentSummarySize = parseInt(properties.getProperty("commentSummarySize", "0")); 68 autoKeywordSize = parseInt(properties.getProperty("autoKeywordSize", "0")); 55 69 56 70 if (!engine.init(properties, out)) { … … 58 72 } 59 73 60 /*61 74 if (!autoKeyword.init(properties, out)) { 62 75 out.println("autoKeyword engine is not initialized"); 63 76 } 64 */65 77 66 78 contentTypeMap.put("", "text/plain"); … … 77 89 iconMap.put("xls", "xls.gif"); 78 90 iconMap.put("pdf", "pdf.gif"); 91 } 92 93 int parseInt(String value) 94 { 95 try { 96 return Integer.parseInt(value); 97 } catch(Exception ex) { 98 return 0; 99 } 79 100 } 80 101 … … 115 136 } else if (command.equals("regist")) { 116 137 regist(req, res, requestMap); 138 } else if (command.equals("registURL")) { 139 registURL(req, res, requestMap); 117 140 } else if (command.equals("download")) { 118 141 download(req, res, requestMap); … … 163 186 } else if (command.equals("regist")) { 164 187 regist(req, res); 188 } else if (command.equals("registURL")) { 189 registURL(req, res); 165 190 } else if (command.equals("registUser")) { 166 191 req.setCharacterEncoding(encodeType); … … 365 390 out.println(" <a href=\"../../tPod/servlet/tPod?command=regist&"+ 366 391 "uid="+uid+ 367 "\">�t�@�C���o�^</a><br>"); 392 "\">�t�@�C���o�^</a>"); 393 out.println(" <a href=\"../../tPod/servlet/tPod?command=registURL&"+ 394 "uid="+uid+ 395 "\">URL�o�^</a>"); 396 368 397 369 398 if (!isEasy) { … … 458 487 } 459 488 460 private int showAllKeywords(PrintWriter out, boolean isSelect) 461 { 462 return showAllKeywords(out, null, isSelect); 463 } 464 465 private int showAllKeywords(PrintWriter out, String filename, boolean isSelect) 466 { 489 String getCommentSummary(String filename, int length) 490 { 491 Comment[] commentArray = engine.getAllComments(filename); 492 engine.sortCommentTime(commentArray); 493 494 String summary = ""; 495 for(int i = 0; i < commentArray.length; i++) { 496 summary += "[" + commentArray[i].getComment() + "]"; 497 } 498 499 if (summary.length() >= length) { 500 summary = summary.substring(0, length-3); 501 summary += "..."; 502 } 503 504 return summary; 505 } 506 507 private int showAllKeywords(PrintWriter out, boolean isSelect) 508 { 509 return showAllKeywords(out, null, isSelect); 510 } 511 512 private int showAllKeywords(PrintWriter out, String filename, boolean isSelect) 513 { 467 514 return showAllKeywords(out, null, isSelect, false); 468 515 } 469 516 470 private int showAllKeywords(PrintWriter out, String filename, boolean isSelect, boolean isAuto)517 private int showAllKeywords(PrintWriter out, String filename, boolean isSelect, boolean useAuto) 471 518 { 472 519 boolean isAll = filename == null; … … 492 539 out.println("<br>"); 493 540 494 /* 495 if (isAuto) { 541 if (useAuto && autoKeywordSize > 0) { 496 542 out.println("<br>�������o���ꂽ�L�[���[�h��F<br>"); 497 543 Collection collection = autoKeyword.getKeywords(engine.getRealFile(filename).getAbsolutePath()); 498 int limit = 10;544 int limit = autoKeywordSize; 499 545 Iterator iterator = collection.iterator(); 500 546 while(iterator.hasNext()) { … … 507 553 out.println("<br>"); 508 554 } 509 */510 555 511 556 return spanNum; 557 } 558 559 String getKeywordSummary(String filename, int length) 560 { 561 Keyword[] keywordArray = engine.getAllKeywords(filename); 562 engine.sortKeywordTime(keywordArray); 563 564 String summary = ""; 565 for(int i = 0; i < keywordArray.length; i++) { 566 summary += "<" + keywordArray[i].value + ">"; 567 } 568 569 if (summary.length() >= length) { 570 summary = summary.substring(0, length-3); 571 summary += "..."; 572 } 573 574 return summary; 512 575 } 513 576 … … 671 734 } 672 735 String iconName = getIcon(filename); 673 out.print("<td><img src=\"/tPod/icon/"+iconName+"\" border=0></td>"); 674 out.println("<td><a href=\"tPod?command=download&file="+filename+"&orig="+origname+"\">"+origname+"</a></td>"); 736 out.println("<td><img src=\"/tPod/icon/"+iconName+"\" border=0></td>"); 737 if (engine.isURL(filename)) { 738 String name = engine.getURL(filename); 739 out.println("<td><a href=\""+name+"\">"+origname+"</a></td>"); 740 } else { 741 out.println("<td><a href=\"tPod?command=download&file="+filename+"&orig="+origname+"\">"+origname+"</a></td>"); 742 } 743 out.print("<td>"); 744 if (thumbWidth > 0 && thumbHeight > 0 && isFigure(filename)) { 745 out.print("<a href=\"tPod?command=download&file="+filename+"&orig="+origname+"\"><img src=\"tPod?command=download&file="+filename+"&orig="+origname+"\" width=\"" + thumbWidth + "\" height=\"" + thumbHeight + "\"></a>"); 746 } else { 747 out.print(" "); 748 } 749 out.print("</td>"); 750 675 751 out.println("<td>"+timeString+"</td>"); 676 752 677 753 out.println("</tr>"); 754 755 if (commentSummarySize > 0) { 756 String commentSummary = getCommentSummary(filename, commentSummarySize); 757 if (commentSummary.length() > 0) { 758 out.println("<tr><td> </td><td> </td><td> </td><td> </td><td> </td><td>" + getCommentSummary(filename, commentSummarySize) + "</td></tr>"); 759 } 760 } 761 762 if (keywordSummarySize > 0) { 763 out.println("<tr><td> </td><td> </td><td> </td><td> </td><td> </td><td>" + getKeywordSummary(filename, keywordSummarySize) + "</td></tr>"); 764 } 765 678 766 } 679 767 … … 686 774 } 687 775 776 private boolean isFigure(String filename) 777 { 778 String name = filename.toLowerCase(); 779 return 780 name.endsWith(".jpg") || name.endsWith(".jpeg") || 781 name.endsWith(".gif") || name.endsWith(".png"); 782 } 783 688 784 private String getIcon(String filename) 689 785 { 690 String iconName = (String)iconMap.get(getExt(filename.toLowerCase())); 691 return iconName == null ? "file.gif" : iconName; 786 if (engine.isURL(filename)) { 787 return "url.gif"; 788 } else { 789 String iconName = (String)iconMap.get(getExt(filename.toLowerCase())); 790 return iconName == null ? "file.gif" : iconName; 791 } 692 792 } 693 793 … … 945 1045 } 946 1046 947 private void addKeywordBody(String uid, String[] origname, String []filename, boolean isAuto, PrintWriter out)1047 private void addKeywordBody(String uid, String[] origname, String []filename, boolean useAuto, PrintWriter out) 948 1048 { 949 1049 int num = origname.length; … … 968 1068 for(int i = 0; i < num; i++) { 969 1069 out.println("<br><br>"+origname[i]+"�̃L�[���[�h�F<br>"); 970 showAllKeywords(out, filename[i], true, isAuto);1070 showAllKeywords(out, filename[i], true, useAuto); 971 1071 out.println("<br>"); 972 1072 } … … 1004 1104 out.println("</table>"); 1005 1105 out.println("<input type=submit name=ac value=\"�A�N�Z�X���ύX\"><br>"); 1006 1106 1107 if (num == 1) { 1108 String title = "�t�@�C����"; 1109 if (engine.isURL(filename[0])) { 1110 title = "�^�C�g��"; 1111 } 1112 out.println("<br>" + title + "�ύX<br>"); 1113 out.println("<input type=text name=title value=\"" + origname[0] + "\">"); 1114 out.println("<input type=submit name=ct value=\"" + title + "�ύX\"><br>"); 1115 } 1116 1007 1117 out.println("<br><input type=submit name=remove value=\"�t�@�C���폜\"> "); 1008 1118 … … 1028 1138 boolean isRemove = req.getParameter("remove") != null; 1029 1139 boolean isAC = req.getParameter("ac") != null; 1140 boolean isCT = req.getParameter("ct") != null; 1030 1141 1031 1142 res.setContentType("text/html; charset="+encodeType); … … 1068 1179 out.println("<tr><td>���̑��@������/td><td>"+(temp.getOtherWrite()?"����:"�s����)+"<td></tr>"); 1069 1180 out.println("<table>"); 1181 } else if (isCT) { 1182 String title = new String(req.getParameter("title").getBytes("iso-8859-1"), encodeType); 1183 engine.changeTitle(filename[i], title); 1184 origname[i] = title; 1070 1185 } 1071 1186 … … 1287 1402 1288 1403 /** 1404 * URL�o�^�� 1405 */ 1406 void /* Get */ registURL(HttpServletRequest req, HttpServletResponse res, Map requestMap) throws ServletException, IOException 1407 { 1408 String uid = (String)requestMap.get("uid"); 1409 1410 res.setContentType("text/html; charset="+encodeType); 1411 PrintWriter out = res.getWriter(); 1412 out.println("<html>"); 1413 out.println("<body>"); 1414 1415 out.println("<form method=\"POST\" action=\""+servletURL+"tPod/servlet/tPod\" target=\"lower\">"); 1416 out.println("�o�^ URL<br>"); 1417 out.println("<input type=text name=\"url\" value=\"\" size=\"60\"><br>"); 1418 out.println("�o�^ URL �̃^�C�g��<br>"); 1419 out.println("<input type=text name=\"title\" value=\"\" size=\"60\"><br>"); 1420 out.println("<input type=hidden name=\"command\" value=\"registURL\">"); 1421 out.println("<input type=hidden name=\"uid\" value=\""+uid+"\">"); 1422 out.print("�L�[���[�h<br>"); 1423 out.print("<input type=text name=\"keyword\" size=\"60\"><br>"); 1424 out.println("<input type=submit value=\"�o�^\"> "); 1425 out.println("</form>"); 1426 out.println("<a href=\"../../tPod/servlet/tPod?"+ 1427 "command=inspect&"+ 1428 "uid="+uid+ 1429 "\">tPod����> "); 1430 out.println("</body>"); 1431 out.println("</html>"); 1432 1433 } 1434 1435 /** 1436 * URL�o�^ 1437 */ 1438 void /* Post */ registURL(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException 1439 { 1440 String uid = req.getParameter("uid"); 1441 String url = req.getParameter("url"); 1442 String title = new String(req.getParameter("title").getBytes("iso-8859-1"), encodeType); 1443 String keyword = new String(req.getParameter("keyword").getBytes("iso-8859-1"), encodeType); 1444 1445 String time = ""; 1446 1447 res.setContentType("text/html; charset="+encodeType); 1448 PrintWriter out = res.getWriter(); 1449 out.println("<html>"); 1450 out.println("<body>"); 1451 1452 String registeredURL = engine.registerURL(url, title, uid, time, keyword, out); 1453 if (registeredURL != null) { 1454 out.println("�u" + url + "�v��^���܂����B<br>"); 1455 addKeywordBody(uid, new String[]{url}, new String[]{registeredURL}, out); 1456 } else { 1457 out.println("�u" + url + "�v�̓o�^�͎��s���܂����B<br>"); 1458 } 1459 out.println("</body>"); 1460 out.println("</html>"); 1461 } 1462 1463 /** 1289 1464 * �t�@�C���o�^�� 1290 1465 */ … … 1323 1498 String uid = ""; 1324 1499 String userName = ""; 1325 String group = "";1326 1500 String time = ""; 1327 1501 String keyword = "";
