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    }