001 /* 002 * Copyright (c) 2009 The openGion Project. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 013 * either express or implied. See the License for the specific language 014 * governing permissions and limitations under the License. 015 */ 016 package org.opengion.plugin.column; 017 018 import org.opengion.hayabusa.db.AbstractEditor; 019 import org.opengion.hayabusa.db.CellEditor; 020 import org.opengion.hayabusa.db.DBColumn; 021 import org.opengion.fukurou.util.XHTMLTag; 022 023 /** 024 * UPLOAD エãƒ?‚£ã‚¿ãƒ¼ã¯ã€ãƒ•ァイルアãƒ??ãƒãƒ¼ãƒ‰ã‚’行ã†å ´åˆã«ä½¿ç”¨ã™ã‚‹ç·¨é›?”¨ã‚¯ãƒ©ã‚¹ã§ã™ã? 025 * 026 * ファイルアãƒ??ãƒãƒ¼ãƒ‰ã§ã€è¡Œã”ã¨ã«æŒ?®šã§ãる機è?を追åŠ?—ã¾ã™ã? 027 * æ–°ã—ã„ファイルをã?カラãƒ?_NEW ã§æŒ?®šã™ã‚‹ã“ã¨ã§ã€äº‹å‰ã«æŒ?®šã•れãŸãƒ•ァイルåã« 028 * 強制変更後ã«ã‚¢ãƒ??ãƒãƒ¼ãƒ‰å¯èƒ½ã§ã™ã? 029 * ã¤ã¾ã‚Šã?inputã‚¿ã‚°ã®type="file" ã§æŒ?®šã™ã‚‹ã‚«ãƒ©ãƒ?(ä¾?file)ã¨ã€å¯¾å¿œã™ã‚? 030 * 新ファイルå?ä¾?file_NEW) を作æ?ã—ã?新ファイルå?ã‚?hidden ç‰ã§æ¸¡ã—ã¾ã™ã? 031 * ã•らã«ã€form ã®é€ä¿¡å…ˆã?ã€forward.jsp ã§ã¯ãªãã?実際ã«å‡¦ç?—ãŸã„ç”»é¢ã«ç›´æŽ¥ 032 * é€ä¿¡ã—ã¾ã™ã?ã“れã¯ã€ãƒ•ァイルアãƒ??ãƒãƒ¼ãƒ‰ãŒã€enctype="multipart/form-data" 033 * ã®ãŸã‚ã€forward.jsp ã§å‡¦ç?§ããªã?‚ºã§ã™ã? 034 * ã¡ãªã¿ã«ã€ORACLEã®å ´åˆã?カラãƒ?ã«FILE ã¯ä½¿ãˆã¾ã›ã‚“。ã“れã?予ç´?ªžã«ãªã£ã¦ã?¾ã™ã? 035 * 下記サンプルJSP(34CheckIn2)ã§ã‚‚ã?UFILE ã«ã—ã¦ã?¾ã™ã? 036 * 037 * カラãƒ??表示ã«å¿?¦ãªå±žæ?ã¯, DBColumn オブジェクãƒ?よりå–り出ã—ã¾ã™ã? 038 * ã“ã?クラスã¯ã€DBColumn オブジェクト毎ã«?‘ã¤ä½œæ?ã•れã¾ã™ã? 039 * 040 * @og.rev 3.8.6.0 (2006/09/29) æ–°è¦è¿½åŠ? 041 * 042 * @og.group ãƒ??ã‚¿ç·¨é›? 043 * 044 * @version 4.0 045 * @author Kazuhiko Hasegawa 046 * @since JDK5.0, 047 */ 048 public class Editor_UPLOAD extends AbstractEditor { 049 //* ã“ã?プãƒã‚°ãƒ©ãƒ??VERSIONæ–?—å?ã‚’è¨å®šã—ã¾ã™ã? {@value} */ 050 private static final String VERSION = "4.0.0.0 (2005/08/31)" ; 051 052 /** 053 * ãƒ?ƒ•ォルトコンストラクターã€? 054 * ã“ã?コンストラクターã§ã€åŸºæœ¬ã‚ªãƒ–ジェクトを作æ?ã—ã¾ã™ã? 055 * 056 * @og.rev 3.1.1.1 (2003/04/03) å?‚ªãƒ–ジェクトã‹ã‚‰è?åˆ??インスタンスを返ã™ãƒ•ァクトリメソãƒ?ƒ‰ã‚’追åŠ?? 057 * 058 */ 059 public Editor_UPLOAD() { 060 // 4.3.4.4 (2009/01/01) 061 // super(); 062 } 063 064 /** 065 * コンストラクターã€? 066 * 067 * @param clm DBColumnオブジェクãƒ? 068 */ 069 private Editor_UPLOAD( final DBColumn clm ) { 070 super( clm ); 071 attributes.set( "type" ,"file" ); 072 tagBuffer.add( XHTMLTag.inputAttri( attributes ) ); 073 } 074 075 /** 076 * å?‚ªãƒ–ジェクトã‹ã‚‰è?åˆ??インスタンスを返ã—ã¾ã™ã? 077 * 自åˆ??身をã‚ャãƒ?‚·ãƒ¥ã™ã‚‹ã®ã‹ã?æ–°ãŸã«ä½œæ?ã™ã‚‹ã®ã‹ã?ã€å„サブクラスã®å®Ÿè£?« 078 * ã¾ã‹ã•れã¾ã™ã? 079 * 080 * @param clm DBColumnオブジェクãƒ? 081 * 082 * @return CellEditorオブジェクãƒ? 083 */ 084 public CellEditor newInstance( final DBColumn clm ) { 085 return new Editor_UPLOAD( clm ); 086 } 087 }