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.hayabusa.taglib;
017    
018    import org.opengion.hayabusa.common.HybsSystem;
019    import org.opengion.hayabusa.resource.GUIInfo;
020    import org.opengion.hayabusa.resource.RoleMode ;
021    import org.opengion.hayabusa.db.DBLastSql;
022    import org.opengion.fukurou.util.Attributes;
023    import org.opengion.fukurou.util.XHTMLTag;
024    import org.opengion.fukurou.util.StringUtil ;
025    
026    import static org.opengion.fukurou.util.StringUtil.nval ;
027    
028    /**
029     * ファイルア??ロー??ンロードリンクを作?するタグで?通常は result_info.jsp に?み)?
030     *
031     * 画面検索した結果を??ンロードしたり、ア??ロードする機?は、画面リソースの
032     * ロール制御で管?て?す?
033     * ただし??ォルトで、以下?制限が掛かって?す?
034     *
035     * ファイル?ンロー?
036     *   ・command="NEW|RENEW|FIRST|LAST|PREV|NEXT|VIEW|RESET" のみ
037     * ファイルア??ロー?
038     *   ・command="COPY|INSERT" のみ
039     *
040     * 5.7.8.1 (2014/07/18)
041     *  addDownCmnd と、addUpldCmnd を指定すれ?、ダウンロード?ア??ロードできる
042     *  command を増やすことが可能です?
043     *
044     * また?typeDownload="true" にするとDownload 処?行う為の前??実施します?
045     * Download 処?行うには、指定?画面(呼び出し?)と、抜き?した時?
046     * DBTableModel が??して?か判定します?
047     * また?DBTableModel が存在しな??また?、不備な場?オーバ?フロー)は?
048     * ?SQLを実行する?があり、そもそも?抜?処?出来な?態では?
049     * エラーを返す?があります?
050     * それら???のDownload 処?行うかど?を指定します?
051     * true の場合?session の HybsSystem.DB_LAST_SQL_KEY に格納された
052     * DBLastSql オブジェクトを取得し、scope ?request また?、overflow ?
053     * true の場合に、BODY部を実行します?(通常、queryタグを記述します?)
054     * query の出力?は、scope ?request にします?
055     * それ以外?、tableId から取り出した DBTableModel を?scope = "request"
056     * に(アドレスのみ)コピ?します?
057     * writeTable タグでは、scope = "request" から、DBTableModel を取り?します?
058    
059     * @og.formSample
060     * ●形式:?ユーザーが直接?込?とはありません?
061     * ●body?あ?EVAL_BODY_BUFFERED:BODYを評価し?{@XXXX} を解析しま?
062     *
063     * ●Tag定義??
064     *   <og:fileUD
065     *       command            【TAG】command を指定しま?
066     *       downloadImg        【TAG】ダウンロード時のアイコンを指定しま?初期値:"{@SYS.JSP}/image/fileDownload.gif")
067     *       downloadJsp        【TAG】ダウンロード時の呼び出しJSPを指定しま?初期値:"{@SYS.JSP}/common/fileDownload.jsp")
068     *       uploadImg          【TAG】ア??ロード時のアイコンを指定しま?初期値:"{@SYS.JSP}/image/fileUpload.gif")
069     *       uploadJsp          【TAG】ア??ロード時の呼び出しJSPを指定しま?初期値:"{@SYS.JSP}/common/fileUpload.jsp")
070     *       imgWidth           【TAG】アイコン?イズ(px)を指定しま?初期値:20px)
071     *       imgHeight          【TAG】アイコン高さサイズ(px)を指定しま?初期値:20px)
072     *       filename           【TAG】ダウンロード時ファイル名を?しま?初期値:"{@GUI.LABEL}.xls")
073     *       addDownCmnd        【TAG】ダウンロード時のコマンドを追?定できま?初期値:null)
074     *       addUpldCmnd        【TAG】ア??ロード時のコマンドを追?定できま?初期値:null)
075     *       roles              【TAG】ロールズをセ?しま?
076     *       target             【TAG】ダウンロード文書を表示させるフレー??また?ウィンドウの名前を指定しま?
077     *       errorMsg           【TAG】ダウンロード?来な??合?エラーメ?ージIDを指定しま?初期値:ERR0028)
078     *       typeDownload       【TAG】Download 処?行うかど?を指定しま?初期値:false)
079     *       useEditLink        【TAG】編?ンク自体を出すかど?ど?(初期値:true)
080     *       editImg            【TAG】編?イコンを指定しま?初期値:"{@SYS.JSP}/image/edit.png")
081     *       clmEdit            【TAG】編?にカラ??ブを表示するかど?(初期値:true)
082     *       debug              【TAG】デバッグ??を?力するかど?[true/false]を指定しま?初期値:false)
083     *   >   ... Body ...
084     *   </og:fileUD>
085     *
086     * ●使用?
087     *     <og:fileUD command="{@command}" />
088     *
089     *     <og:fileUD
090     *         command        = command設?(?ンロー?"NEW|RENEW|FIRST|LAST|PREV|NEXT|VIEW" ?  ア??ロー?"COPY|INSERT")
091     *       [ downloadImg ]  = "{@SYS.JSP}/image/fileDownload.gif"   ?ンロード時のアイコン
092     *       [ downloadJsp ]  = "{@SYS.JSP}/common/fileDownload.jsp"  ?ンロード時の呼び出しJSP
093     *       [ uploadImg   ]  = "{@SYS.JSP}/image/fileUpload.gif"     ア??ロード時のアイコン
094     *       [ uploadJsp   ]  = "{@SYS.JSP}/common/filePopup.jsp"     ア??ロード時の呼び出しJSP
095     *       [ imgWidth    ]  = "20px"                                アイコン?イズ(px)
096     *       [ imgHeight   ]  = "20px"                                アイコン高さサイズ(px)
097     *       [ filename    ]  = "{@GUI.LABEL}.xls"               ?ンロード時ファイル?
098     *       [ roles       ]  = "GE|DOC"                              アクセスロールズ
099     *       [ target      ]  = "_blank"                              ?ンロードファイルを開くターゲ?
100     *       [ errorMsg    ]  = "ERR0042"                             エラーメ?ージID
101     *       [ typeDownload]  = "false/true"                          Download 処?行うかど?(初期値:false)
102     *     />
103     *
104     * @og.group ファイルア??ロー??ンロー?
105     *
106     * @og.rev 4.3.0.0 (2008/07/04) 新規追?
107     * @og.rev 5.7.4.1 (2014/03/15) エラーメ?ージ変更
108     *
109     * @version  4.0
110     * @author       Kazuhiko Hasegawa
111     * @since    JDK5.0,
112     */
113    public class FileUDTag extends CommonTagSupport {
114            //* こ?プログラ??VERSION??を設定します?       {@value} */
115            private static final String VERSION = "5.7.8.1 (2014/07/18)" ;
116    
117            private static final long serialVersionUID = 578120140718L ;
118    
119            private String  sysJsp                  = HybsSystem.sys( "JSP" );
120    
121            private String  command                 = null;         // ?ンロー?"NEW|RENEW" 、ア??ロー?"COPY|INSERT"
122            private String  downloadImg             = sysJsp + "/image/fileDownload.gif";   // ?ンロード時のアイコン
123            private String  downloadJsp             = sysJsp + "/common/fileDownload.jsp";  // ?ンロード時の呼び出しJSP
124            private String  uploadImg               = sysJsp + "/image/fileUpload.gif";             // ア??ロード時のアイコン
125            private String  uploadJsp               = sysJsp + "/common/filePopup.jsp";             // ア??ロード時の呼び出しJSP
126            private String  imgWidth                = "20px";                                               // アイコン?イズ(px)
127            private String  imgHeight               = "20px";                                               // アイコン高さサイズ(px)
128            private String  filename                = null;                                                 // ?ンロード時ファイル?"{@GUI.LABEL}.xls")
129            private String  roles                   = null;                                                 // アクセスロールズ
130            private String  target                  = null;                                                 // ?ンロードファイルを開くターゲ?
131            private String  errorMsg                = "ERR0042";                                    // 出力対象??タが見つかりませんでした。?度検索して下さ?? 5.7.4.1 (2014/03/15)
132            private boolean isError                 = false;
133            private boolean typeDownload    = false;                                                // Download 処?行うかど?(初期値:false)
134            private boolean isEdit                  = true;                                                 // 5.6.0.2 (2013/01/19) ロールのisEditとほぼ同等?clmEdit用?
135            private boolean useEditLink             = true;                                                 // 5.7.5.0 (2014/04/04) 編?ンク自体を出すかど?ど?(初期値:true)
136    
137            private String  addDownCmnd             = null;                                                 // 5.7.8.1 (2014/07/18) ?ンロード時のコマンドを追?
138            private String  addUpldCmnd             = null;                                                 // 5.7.8.1 (2014/07/18) ア??ロード時のコマンドを追?
139    
140            private static final String     EDIT_GAMENID= "14_EDIT";                                        // 編?面の画面ID
141            private String                          editImg         = sysJsp + "/image/edit.png";   // 編?のアイコン
142    
143            /**
144             * Taglibの開始タグが見つかったときに処??doStartTag() ?オーバ?ライドします?
145             *
146             * @og.rev 5.1.6.0 (2010/05/01) 画面?並べ替え対?
147             *
148             * @return      後続????(SKIP_BODY)
149             */
150            @Override
151            public int doStartTag() {
152    
153                    if( typeDownload ) {
154                            DBLastSql lastSql = (DBLastSql)getSessionAttribute( HybsSystem.DB_LAST_SQL_KEY );
155                            if( lastSql != null ) {
156                                    String guikey = getRequest().getParameter( "gamenId" );
157                                    if( lastSql.isGuiMatch( guikey ) ) {
158                                            // view タグで仕込んだ clmNames を?Request 変数に設定します?
159                                            setRequestAttribute( "DB.CLM_NAMES" , lastSql.getClmNames() );
160                                            // 5.1.6.0 (2010/05/01) 画面?並べ替え対?
161                                            setRequestAttribute( "DB.VIEW_CLM_NAMES" , lastSql.getViewClmNames() );
162                                            setRequestAttribute( "DB.VIEW_EDITABLE" , Boolean.toString( lastSql.isViewEditable() ) );
163    
164            //                              if( lastSql.isRequest() || lastSql.isOverflow() ) {
165                                            if( lastSql.isRequest() ) {
166                                                    // 5.1.6.0 (2010/05/01)
167                                                    String sql = getUserInfo( "LASTSQL" );
168                                                    if( sql != null ) {
169                                                            return EVAL_BODY_BUFFERED ;     // Body を評価する? extends BodyTagSupport ?
170                                                    }
171                                            }
172                                            String tableId = lastSql.getTableId();
173                                            setRequestAttribute( HybsSystem.TBL_MDL_KEY, getSessionAttribute( tableId ) );
174                                            return SKIP_BODY ;                              // Body を評価しな?
175                                    }
176                            }
177    
178                            // 処?実行できな??合?エラーを?力します?
179                            jspPrint( getResource().getLabel( errorMsg ) );
180                            isError = true;
181                    }
182    
183                    return SKIP_BODY ;                              // Body を評価しな?
184            }
185    
186            /**
187             * Taglibの終?グが見つかったときに処??doEndTag() ?オーバ?ライドします?
188             *
189             * @og.rev 4.3.0.1 (2008/08/11) callBack パラメータの設定漏れ修正、引数から見直?
190             * @og.rev 5.1.6.0 (2010/05/01) 帳票画面定義機?対?
191             * @og.rev 5.1.7.0 (2010/06/01) 進??戻る?タンで?xcel出力?タンを??
192             * @og.rev 5.3.6.0 (2011/06/01) Edit機?見直?
193             * @og.rev 5.3.7.0 (2011/07/01) Excel取込で画面IDとアドレスが異なる?合にエラーとなるバグを修正
194             * @og.rev 5.3.7.0 (2011/07/01) 編?面をリサイズできるように対応します?
195             * @og.rev 5.3.7.0 (2011/07/01) PL/SQLを利用した検索でファイル?ンロードが出来るよ?対応します?
196             * @og.rev 5.4.2.0 (2011/12/01) 画面リソースで画面編??のON/OFFを設定できるようにする?
197             * @og.rev 5.5.2.4 (2012/05/16) nullに対する冗長な比?
198             * @og.rev 5.5.5.2 (2012/08/20) 画面リソースのoモード対?
199             * @og.rev 5.5.6.2 (2012/09/24) makeTagのtarget対?
200             * @og.rev 5.6.0.2 (2013/01/19) editモード?isEditコントロール対?
201             * @og.rev 5.7.5.0 (2014/04/04) 編?ンク自体を出すかど?ど?(初期値:true)
202             * @og.rev 5.7.8.1 (2014/07/18) command="RESET" 時に、ダウンロードリンクを表示
203             * @og.rev 5.7.8.1 (2014/07/18) addDownCmnd , addUpldCmndを追?
204             * @og.rev 5.8.9.0 (2015/08/07) 6.3.4.0の移?EditのURLをindex.jspまで?する?
205             *
206             * @return      後続????
207             */
208            @Override
209            public int doEndTag() {
210                    debugPrint();
211    
212                    if( isError      ) { return SKIP_PAGE ; }               // ペ?ジの残りの処?行わな??
213                    if( typeDownload ) { return EVAL_PAGE ; }               // ペ?ジの残りを評価する?
214    
215                    boolean isDownload ;
216                    // 5.7.8.1 (2014/07/18) command="RESET" 時に、ダウンロードリンクを表示
217                    if(    "NEW".equals(   command ) || "RENEW".equals( command )
218                            || "FIRST".equals( command ) || "LAST".equals(  command )
219                            || "PREV".equals(  command ) || "NEXT".equals(  command )
220                            || "VIEW".equals(  command ) || "RESET".equals( command ) ) {
221                            isDownload = true;
222                    }
223                    else if( "COPY".equals( command ) || "INSERT".equals( command ) ) {
224                            isDownload = false;
225                    }
226                    // 5.7.8.1 (2014/07/18) addDownCmnd , addUpldCmndを追?
227                    else if( addDownCmnd != null && addDownCmnd.equals( command ) ) {
228                            isDownload = true;
229                    }
230                    else if( addUpldCmnd != null && addUpldCmnd.equals( command ) ) {
231                            isDownload = false;
232                    }
233                    else {
234                            return EVAL_PAGE ;
235                    }
236    
237                    byte bitMode ;
238                    if( roles != null ) {
239                            RoleMode roleMode = RoleMode.newInstance( roles );
240                            RoleMode userRoleMode = getUser().getRoleMode();
241                            bitMode = userRoleMode.getAccessBitMode( roleMode );
242                    }
243                    else {
244                            GUIInfo guiInfo = (GUIInfo)getSessionAttribute( HybsSystem.GUIINFO_KEY );
245                            bitMode = guiInfo.getBitMode();
246                    }
247    
248                    if( filename == null ) {
249                            filename = getGUIInfoAttri( "LABEL" ) + ".xls" ;
250                    }
251                    String guikey = getGUIInfoAttri( "KEY" );       // 4.3.0.1 (2008/08/11)
252                    if( isDownload ) {
253                            if( RoleMode.isDownload( bitMode ) ) {
254                                    // 4.3.0.1 (2008/08/11) callBack パラメータの設定漏れ修正、引数から見直?
255                                    // <og:link href="{@SYS.JSP}/common/fileDownload.jsp" target="_blank" useGamenId="false"
256                                    //              keys="filename,h_clms" vals="{@GUI.LABEL}.xls,{@h_clms}" >
257    
258                                    // 5.3.7.0 (2011/07/01) PL/SQLを利用した検索でファイル?ンロードが出来るよ?対応します?
259                                    String href = downloadJsp + "?command=RENEW&gamenId=" + guikey + "&GAMENID=" + guikey + "&filename=" + StringUtil.urlEncode( filename ) ;
260    
261                                    jspPrint( makeTag( downloadImg,href,"Download File", target ) ); // 5.5.6.2 (2012/09/24)
262    
263                                    // 5.1.6.0 (2010/05/01) 帳票画面定義機?対?
264                                    // 5.3.6.0 (2011/06/01) Edit機?見直?
265                                    GUIInfo editGui = getUser().getGUIInfo( EDIT_GAMENID );
266                                    // 5.7.5.0 (2014/04/04) 編?ンク自体を出すかど?ど?(初期値:true)
267                                    if( editGui != null && useEditLink ) {
268    //                                      String hrefEdit = sysJsp + "/" + editGui.getAddress() + "/"
269                                            String hrefEdit = sysJsp + "/" + editGui.getAddress() + "/index.jsp" // 5.8.9.0 (2015/08/07)
270                                                                                    + "?command=NEW&gamenId=" + guikey + "&GAMENID=" + guikey;
271    
272                                            String editName = getRequestValue( "editName" );
273                                            // 5.5.2.4 (2012/05/16) nullに対する冗長な比?
274                                            if( editName != null ) {
275                                                    hrefEdit += "&editName=" + editName;
276                                            }
277    
278                                            // 5.4.2.0 (2011/12/01) 画面リソースで画面編??のON/OFFを設定できるようにする?
279                                            if( RoleMode.isEdit( bitMode ) && isEdit ) { // 5.6.0.2(2013/01/09)
280                                                    hrefEdit += "&edit=true";
281                                            }
282                                            
283                                            // 5.5.5.2 (2012/08/10) 画面リソースで、画面編??の制限を行えるよ?する
284                                            if( RoleMode.isFullEdit( bitMode ) ) {
285                                                    hrefEdit += "&fullEdit=true";
286                                            }
287                                            else{
288                                                    hrefEdit += "&fullEdit=false";
289                                            }
290    
291                                            // 5.3.7.0 (2011/07/01) 編?面をリサイズできるように対応します?
292                                            hrefEdit = "javascript:ogOpen('" + hrefEdit + "',null,null,'width=800px,height=330px,top=350,left=100,resizable=yes',false);";
293                                            jspPrint( makeTag (editImg,hrefEdit,"Edit",null) ); // 5.5.6.2 (2012/09/24)
294                                    }
295                            }
296                    }
297                    else {
298                            if( RoleMode.isUpload( bitMode ) ) {
299                                    // 4.3.0.1 (2008/08/11) callBack パラメータの設定漏れ修正、引数から見直?
300                                    // <og:link href="{@SYS.JSP}/common/filePopup.jsp" keys="callBack" vals="{@GUI.KEY}/{@SESSION.JSPID}" >
301    
302                                    String jspId  = (String)getSessionAttribute( "JSPID" );
303                                    // 5.3.7.0 (2011/07/01) Excel取込で画面IDとアドレスが異なる?合にエラーとなるバグを修正
304                                    String callBack = getGUIInfoAttri( "ADDRESS" ) + "/" + jspId + "?GAMENID=" + guikey;
305                                    callBack = StringUtil.urlEncode( callBack );
306                                    String href = uploadJsp + "?callBack=" +  callBack;
307    
308                                    jspPrint( makeTag( uploadImg,href,"Upload File",target ) ); // 5.5.6.2 (2012/09/24)
309                            }
310                    }
311    
312                    return EVAL_PAGE ;
313            }
314    
315            /**
316             * タグリブオブジェクトをリリースします?
317             * キャ?ュされて再利用される?で、フィールド?初期設定を行います?
318             *
319             * @og.rev 5.7.4.1 (2014/03/15) エラーメ?ージ変更
320             * @og.rev 5.7.5.0 (2014/04/04) useEditLink 追?
321             * @og.rev 5.7.8.1 (2014/07/18) addDownCmnd,addUpldCmnd 追?
322             */
323            @Override
324            protected void release2() {
325                    super.release2();
326                    sysJsp                  = HybsSystem.sys( "JSP" );
327                    command                 = null;         // ?ンロー?"NEW|RENEW|FIRST|LAST|PREV|NEXT|VIEW|RESET" 、ア??ロー?"COPY|INSERT"
328                    downloadImg             = sysJsp + "/image/fileDownload.gif";   // ?ンロード時のアイコン
329                    downloadJsp             = sysJsp + "/common/fileDownload.jsp";  // ?ンロード時の呼び出しJSP
330                    uploadImg               = sysJsp + "/image/fileUpload.gif";             // ア??ロード時のアイコン
331                    uploadJsp               = sysJsp + "/common/filePopup.jsp";             // ア??ロード時の呼び出しJSP
332                    imgWidth                = "20px";                                               // アイコン?イズ(px)
333                    imgHeight               = "20px";                                               // アイコン高さサイズ(px)
334                    filename                = null;                                                 // ?ンロード時ファイル?"{@GUI.LABEL}.xls")
335                    roles                   = null;                                                 // アクセスロールズ
336                    target                  = null;                                                 // ?ンロードファイルを開くターゲ?
337                    errorMsg                = "ERR0042";                                    // 出力対象??タが見つかりませんでした。?度検索して下さ?? 5.7.4.0 (2014/03/15)
338                    typeDownload    = false;                                                // Download 処?行うかど?(初期値:false)
339                    isError                 = false;
340                    editImg                 = sysJsp + "/image/edit.png";   // 編?のアイコン
341                    isEdit                  = true;                                                 // 5.6.0.2 (2013/01/19)
342                    useEditLink             = true;                                                 // 5.7.5.0 (2014/04/04) 追?
343                    addDownCmnd             = null;                                                 // 5.7.8.1 (2014/07/18) ?ンロード時のコマンドを追?
344                    addUpldCmnd             = null;                                                 // 5.7.8.1 (2014/07/18) ア??ロード時のコマンドを追?
345            }
346    
347            /**
348             * リンクを作?します?
349             *
350             * @og.rev 4.3.0.1 (2008/08/11) callBack パラメータの設定漏れ修正、引数から見直?
351             * @og.rev 5.5.6.2 (2012/09/24) tgt引数追?
352             *
353             * @param       imgsrc  イメージソース
354             * @param       href    リンクのURL
355             * @param       alt             イメージの説明文書
356             * @param       tgt             HTMLのtarget
357             *
358             * @return      リンク??
359             */
360            private String makeTag( final String imgsrc, final String href,  final String alt, final String tgt ) { // 5.5.6.2 (2012/09/24)
361                    // linkのBODY部にセ?するイメージタグの作?
362                    Attributes imgAttri = new Attributes();
363                    imgAttri.set( "width"   , imgWidth );
364                    imgAttri.set( "height"  , imgHeight );
365                    imgAttri.set( "src"             , imgsrc );
366                    imgAttri.set( "alt"             , alt );
367    
368                    String img = XHTMLTag.img( imgAttri );
369    
370                    // 4.3.0.1 (2008/08/11) callBack パラメータの設定漏れ修正、引数から見直?
371                    // linkタグの作?
372                    Attributes linkAttri = new Attributes();
373                    linkAttri.set( "href"   , href );
374                    linkAttri.set( "body"   , img );
375                    linkAttri.set( "target" , tgt ); // 5.5.6.2 (2012/09/24)
376    
377                    return XHTMLTag.link( linkAttri );
378            }
379    
380            /**
381             * 【TAG】command を指定します?
382             *
383             * @og.tag
384             * command を指定します?
385             * ?ンロード??NEW|RENEW|FIRST|LAST|PREV|NEXT|VIEW|RESET" のみ有効です?
386             * ア??ロード??COPY|INSERT" のみ有効です?
387             * それ以外?コマンドでは、アイコンは表示されません?
388             * 例えば、NEXT/PREV など?
389             *
390             * @param       cmd コマンド[NEW/RENEW/FIRST/LAST/PREV/NEXT/VIEW/RESET/COPY/INSERT]
391             * @see         #setAddDownCmnd( String )
392             * @see         #setAddUpldCmnd( String )
393             * @see         #setCommand( String )
394             */
395            public void setCommand( final String cmd ) {
396                    command = nval( getRequestParameter( cmd ),command );
397            }
398    
399            /**
400             * 【TAG】ダウンロード時のアイコンを指定しま?初期値:"{&#064;SYS.JSP}/image/fileDownload.gif")?
401             *
402             * @og.tag
403             * ?ンロード時に表示されるアイコンを指定します?
404             * 初期値:"{&#064;SYS.JSP}/image/fileDownload.gif" です?
405             *
406             * @param       img ?ンロード時のアイコン
407             */
408            public void setDownloadImg( final String img ) {
409                    downloadImg = nval( getRequestParameter( img ),downloadImg );
410            }
411    
412            /**
413             * 【TAG】ダウンロード時の呼び出しJSPを指定しま?初期値:"{&#064;SYS.JSP}/common/fileDownload.jsp")?
414             *
415             * @og.tag
416             * ?ンロード時に呼び出されるJSPファイル名を?します?
417             * 初期値:"{&#064;SYS.JSP}/common/fileDownload.jsp" です?
418             *
419             * @param       file ?ンロード時の呼び出しJSP
420             */
421            public void setDownloadJsp( final String file ) {
422                    downloadJsp = nval( getRequestParameter( file ),downloadJsp );
423            }
424    
425            /**
426             * 【TAG】ア??ロード時のアイコンを指定しま?初期値:"{&#064;SYS.JSP}/image/fileUpload.gif")?
427             *
428             * @og.tag
429             * ア??ロード時に表示されるアイコンを指定します?
430             * 初期値:"{&#064;SYS.JSP}/image/fileUpload.gif" です?
431             *
432             * @param       img ア??ロード時のアイコン
433             */
434            public void setUploadImg( final String img ) {
435                    uploadImg = nval( getRequestParameter( img ),uploadImg );
436            }
437    
438            /**
439             * 【TAG】ア??ロード時の呼び出しJSPを指定しま?初期値:"{&#064;SYS.JSP}/common/fileUpload.jsp")?
440             *
441             * @og.tag
442             * ア??ロード時に呼び出されるJSPファイル名を?します?
443             * 初期値:"{&#064;SYS.JSP}/common/fileUpload.jsp" です?
444             *
445             * @param       file ア??ロード時の呼び出しJSP
446             */
447            public void setUploadJsp( final String file ) {
448                    uploadJsp = nval( getRequestParameter( file ),uploadJsp );
449            }
450    
451            /**
452             * 【TAG】アイコン?イズ(px)を指定しま?初期値:20px)?
453             *
454             * @og.tag
455             * ア??ロー??ンロード?アイコンを表示する際??イズ(px)を指定します?
456             * ファイルサイズは、ア??ロー??ンロード?通です?
457             * 初期値は?0px です?
458             *
459             * @param       width   アイコン?イズ(px)
460             */
461            public void setImgWidth( final String width ) {
462                    imgWidth = nval( getRequestParameter( width ),imgWidth );
463            }
464    
465            /**
466             * 【TAG】アイコン高さサイズ(px)を指定しま?初期値:20px)?
467             *
468             * @og.tag
469             * ア??ロー??ンロード?アイコンを表示する際?高さサイズ(px)を指定します?
470             * ファイルサイズは、ア??ロー??ンロード?通です?
471             * 初期値は?0px です?
472             *
473             * @param       height  アイコン高さサイズ(px)
474             */
475            public void setImgHeight( final String height ) {
476                    imgHeight = nval( getRequestParameter( height ),imgHeight );
477            }
478    
479            /**
480             * 【TAG】ダウンロード時ファイル名を?しま?初期値:"{&#064;GUI.LABEL}.xls")?
481             *
482             * @og.tag
483             * ?ンロード時のファイル名を?しま?
484             * 通常は、画面のラベル(?対??XLS拡張子です?
485             * 初期値は?{&#064;GUI.LABEL}.xls" です?
486             *
487             * @param       file    ?ンロード時ファイル?"{&#064;GUI.LABEL}.xls")
488             */
489            public void setFilename( final String file ) {
490                    filename = nval( getRequestParameter( file ),filename );
491            }
492    
493            /**
494             * 【TAG】ロールズをセ?します?
495             *
496             * @og.tag
497             * ここで?したロールを?に、ユーザー毎?アクセス許可がチェ?されます?
498             * アクセス許可されな?、表示されません?
499             * こ?ロールを指定しな??合?、画面のロールが使用されます?
500             *
501             * @param       rls パラメータ
502             */
503            public void setRoles( final String rls ) {
504                    roles = nval( getRequestParameter( rls ),roles );
505            }
506    
507            /**
508             * 【TAG】ダウンロード文書を表示させるフレー??また?ウィンドウの名前を指定します?
509             *
510             * @og.tag フレー?(ターゲ?属?)を設定します?
511             *
512             * @param       flag ?ンロード文書のフレー?(ターゲ?属?)
513             */
514            public void setTarget( final String flag ) {
515                    target = nval( getRequestParameter( flag ),target );
516            }
517    
518            /**
519             * 【TAG】Download 処?行うかど?を指定しま?初期値:false)?
520             *
521             * @og.tag
522             * Download 処?行うには、指定?画面(呼び出し?)と、抜き?した時?
523             * DBTableModel が??して?か判定します?
524             * また?DBTableModel が存在しな??また?、不備な場?オーバ?フロー)は?
525             * ?SQLを実行する?があり、そもそも?抜?処?出来な?態では?
526             * エラーを返す?があります?
527             * それら???のDownload 処?行うかど?を指定します?
528             * true の場合?session の HybsSystem.DB_LAST_SQL_KEY に格納された
529             * DBLastSql オブジェクトを取得し、scope ?request また?、overflow ?
530             * true の場合に、BODY部を実行します?(通常、queryタグを記述します?)
531             * query の出力?は、scope ?request にします?
532             * それ以外?、tableId から取り出した DBTableModel を?scope = "request"
533             * に(アドレスのみ)コピ?します?
534             * writeTable タグでは、scope = "request" から、DBTableModel を取り?します?
535             *
536             * 初期値は、false(抜き出しでは無くリンク作?) です?
537             *
538             * @param       type    Download 処?行うかど?(初期値:false)
539             */
540            public void setTypeDownload( final String type ) {
541                    typeDownload = nval( getRequestParameter( type ),typeDownload );
542            }
543    
544            /**
545             * 【TAG】ダウンロード?来な??合?エラーメ?ージIDを指定しま?初期値:ERR0042)?
546             *
547             * @og.tag
548             * DBTableModel が??に作?された画面と、メモリ中の DBLastSql オブジェクトが
549             * 管?て???が異なる?合?、ダウンロード?来ません?
550             * 同様に、DBLastSql オブジェク?自身が作?されて???合も出来ません?
551             * そ?ようなケースに表示するエラーメ?ージのメ?ージIDを指定します?
552             * 引数は、指定できません?
553             * 初期値は、?ERR0042??力対象??タが見つかりませんでした。?度検索して下さ???です?
554             *
555             * @param       msg ?ンロード文書のフレー?(ターゲ?属?)
556             */
557            public void setErrorMsg( final String msg ) {
558                    errorMsg = nval( getRequestParameter( msg ),errorMsg );
559            }
560    
561            /**
562             * 【TAG】編?イコンを指定しま?初期値:"{&#064;SYS.JSP}/image/edit.png")?
563             *
564             * @og.tag
565             * 編?イコンを指定します?
566             * 初期値:"{&#064;SYS.JSP}/image/edit.png" です?
567             *
568             * @og.rev 5.1.6.0 (2010/05/01) 新規追?
569             *
570             * @param       img ア??ロード時のアイコン
571             */
572            public void setEditImg( final String img ) {
573                    editImg = nval( getRequestParameter( img ),editImg );
574            }
575            
576            /**
577             * 【TAG】Edit画面でカラ??ブを出すかど?(初期値?true)
578             *
579             * @og.tag
580             * falseを指定するとカラ??ブを出さな??
581             *
582             * @param       type    カラ??ブを出すかど?(初期値:true)
583             */
584            public void setClmEdit( final String type ) {
585                    isEdit = nval( getRequestParameter( type ),isEdit );
586            }
587    
588            /**
589             * 【TAG】Edit画面でカラ??ンクを?力するかど?(初期値?true)
590             *
591             * @og.tag
592             * falseを指定するとカラ??ンクを?さな??
593             * 従来は、カラ??面の??【表示?設定?タブを表示しな?けでした?
594             * こ?設定?、RWMODE を? ##d , ##u , ##f の場合にも同様?設定が可能です?
595             * カラ??ンク自体を出さな??は、現時点ではリソース設定できな?め?
596             * タグのパラメータとして?できるようにします?
597             * 基本?は、このパラメータはほとんど使われて??ズなので?
598             * 機?を置き換えます?
599             * 初期値は、カラ??ンクを?力す?=true)です?
600             *
601             * @og.rev 5.7.5.0 (2014/04/04) 新規追?
602             *
603             * @param       flag    カラ??ンクを?力するかど?(初期値:true)
604             * @see         org.opengion.hayabusa.taglib.QueryButtonTag#setUseEditMenu(String)
605             */
606            public void setUseEditLink( final String flag ) {
607                    useEditLink = nval( getRequestParameter( flag ),useEditLink );
608            }
609    
610            /**
611             * 【TAG】ダウンロード時のコマンドを追?定できま?初期値:null)
612             *
613             * @og.tag
614             * ?ンロードリンクが表示され?command は?
615             * "NEW|RENEW|FIRST|LAST|PREV|NEXT|VIEW|RESET" のみです?
616             * これ以外? command で、ダウンロードリンクを表示させたい場合??
617             * こ?、addDownCmnd に、記述します?
618             * 初期値は、null(追?マンド?な?です?
619             *
620             * @og.rev 5.7.8.1 (2014/07/18) 新規追?
621             *
622             * @param       cmd     ?ンロード時のコマンドを追??
623             * @see         #setCommand( String )
624             */
625            public void setAddDownCmnd( final String cmd ) {
626                    addDownCmnd = nval( getRequestParameter( cmd ),addDownCmnd );
627            }
628    
629            /**
630             * 【TAG】ア??ロード時のコマンドを追?定できま?初期値:null)
631             *
632             * @og.tag
633             * ア??ロードリンクが表示され?command は?COPY|INSERT" のみです?
634             * これ以外? command で、ア??ロードリンクを表示させたい場合??
635             * こ?、addUpldCmnd に、記述します?
636             * 初期値は、null(追?マンド?な?です?
637             *
638             * @og.rev 5.7.8.1 (2014/07/18) 新規追?
639             *
640             * @param       cmd     ア??ロード時のコマンドを追??
641             * @see         #setCommand( String )
642             */
643            public void setAddUpldCmnd( final String cmd ) {
644                    addUpldCmnd = nval( getRequestParameter( cmd ),addUpldCmnd );
645            }
646    
647            /**
648             * こ?オブジェクト???表現を返します?
649             * 基本???目?使用します?
650             *
651             * @return こ?クラスの??表現
652             */
653            @Override
654            public String toString() {
655                    return org.opengion.fukurou.util.ToString.title( this.getClass().getName() )
656                                    .println( "VERSION"             ,VERSION                )
657                                    .println( "command"             ,command                )
658                                    .println( "downloadImg" ,downloadImg    )
659                                    .println( "downloadJsp" ,downloadJsp    )
660                                    .println( "uploadImg"   ,uploadImg              )
661                                    .println( "uploadJsp"   ,uploadJsp              )
662                                    .println( "imgWidth"    ,imgWidth               )
663                                    .println( "imgHeight"   ,imgHeight              )
664                                    .println( "filename"    ,filename               )
665                                    .println( "roles"               ,roles                  )
666                                    .println( "target"              ,target                 )
667                                    .println( "Other..."    ,getAttributes().getAttribute() )
668                                    .fixForm().toString() ;
669            }
670    }