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 static org.opengion.fukurou.util.StringUtil.nval; 019 020 import org.opengion.fukurou.util.Attributes; 021 import org.opengion.fukurou.util.XHTMLTag; 022 import org.opengion.hayabusa.common.HybsSystem; 023 import org.opengion.hayabusa.db.DBColumn; 024 import org.opengion.hayabusa.db.DBEditConfig; 025 026 /** 027 * query.jsp での検索ボタンを表示します? 028 * 検索ボタン以外に、pageSize、maxRowCount、prevNext、timeView などの 029 * ?も表示可能です? 030 * また?BODY部に登録した値は、table 要?して、td 部に追記されます? 031 * 032 * @og.formSample 033 * ●形式?lt;og:queryButton /> 034 * ●body?あ?EVAL_BODY_BUFFERED:BODYを評価し?{@XXXX} を解析しま? 035 * 036 * ●Tag定義?? 037 * <og:queryButton 038 * command 【TAG】リクエストとして送信するコマンドを?しま?初期値:NEW) 039 * pageSize 【TAG】pageSize プル?ンメニューの初期値を指定しま?(初期値:HTML_PAGESIZE[=100]) 040 * maxRowCount 【TAG】maxRowCount プル?ンメニューの初期値を指定しま?(初期値:DB_MAX_ROW_COUNT[=1000]) 041 * useCrear 【TAG】JavaScriptによる初期化?タンを使用するかど?[true/false]を指定しま?初期値:true) 042 * type 【TAG】?型的なボタンの形状に設定しま?初期値:null) 043 * scope 【TAG】リクエストとして送信するスコープを?しま?初期値:null) 044 * lbl 【TAG】ラベルリソースのラベルIDを指定しま? 045 * accesskey 【TAG】検索ボタンに使用するショートカ?キー?を?しま?初期値:F) 046 * usePrevNext 【TAG】??戻る?prev_next リンクを表示するかど?を指定しま?初期値:true) 047 * usePageSize 【TAG】pageSize 引数を使用するかど?を指定しま?初期値:true) 048 * useRowCount 【TAG】maxRowCount 引数を使用するかど?を指定しま?初期値:true) 049 * useTimeView 【TAG】??間を表示する TimeView を表示するかど?を指定しま?初期値:true) 050 * clearAccesskey 【TAG】クリアボタンに使用するショートカ?キー?を?しま?初期値:C) 051 * useDummy 【TAG】IE用?ーinputを?力するかど? 052 * useEditMenu 【TAG】編??ル?ンを?すかど?(初期値:true) 053 * title 【HTML】要?対する補足?報(title)を設定しま? 054 * style 【HTML】この要?対して適用させるスタイルシー?style)を設定しま? 055 * disabled 【HTML】その部品に対して?択や変更が?来な??(disabled)?しま?サーバ?に送信されな? 056 * tabindex 【HTML】タブ?移動?(tabindex)を指定しま?0 ??32767) 057 * clazz 【HTML】要?対して class 属?を設定しま? 058 * onClick 【HTML】JavaScriptのイベン?onClick を設定しま??onClick="renew('query.jsp','QUERY');") 059 * onBlur 【HTML】JavaScriptのイベン?onBlur を設定しま??onBlur="this.value=value.toUpperCase();") 060 * onFocus 【HTML】JavaScriptのイベン?onFocus を設定しま? 061 * ondblClick 【HTML】JavaScriptのイベン?ondblClick を設定しま? 062 * onMouseDown 【HTML】JavaScriptのイベン?onMouseDown を設定しま? 063 * onMouseUp 【HTML】JavaScriptのイベン?onMouseUp を設定しま? 064 * onMouseMove 【HTML】JavaScriptのイベン?onMouseMove を設定しま? 065 * onMouseOut 【HTML】JavaScriptのイベン?onMouseOut を設定しま? 066 * onMouseOver 【HTML】JavaScriptのイベン?onMouseOver を設定しま? 067 * autofocus 【HTML5】指定した?力?カーソルが当たって自動的にフォーカスされます? 068 * debug 【TAG】デバッグ??を?力するかど?[true/false]を指定しま?初期値:false) 069 * > ... Body ... 070 * </og:queryButton> 071 * 072 * ●使用? 073 * <og:queryButton 074 * command = "NEW" NEW:通常の検索(初期値)?ENTRY:エントリ登録? 075 * type = "ENTRY" null:標?, SELECT:検索ボタンのみ , ENTRY:登録ボタンのみ 076 * pageSize = "100" pageSize の初期値設?初期値:HTML_PAGESIZE) 077 * maxRowCount = "100" maxRowCount の初期値設?初期値:DB_MAX_ROW_COUNT) 078 * useCrear = "true" true:JavaScriptによる初期化/false:通常のresetボタン 079 * scope = "request" null(初期値)?session:セ?ョン登録?request:リクエスト登録 080 * lbl = "MSG0010" 検索ボタンに表示するメ?ージID(初期値:MSG0010) 081 * accesskey = "F" ショートカ?キー??初期値:F) 082 * usePrevNext = "true" Prev-Nextリンクを使用するかど?(初期値:true) 083 * usePageSize = "true" pageSize 引数を使用するかど?(初期値:true) 084 * useRowCount = "true" maxRowCount 引数を使用するかど?(初期値:true) 085 * useTimeView = "true" timeView表示(実行時間表示)を使用するかど?(初期値:true) 086 * useEditMenu = "true" 編??ル?ンを?すかど?(初期値:true) 087 * /> 088 * 089 * 標準的な検索ボタン 090 * <og:queryButton /> 091 * 092 * 標準的な登録ボタン(command="NEW" で、query.jsp で使用するボタン) 093 * <og:queryButton type="ENTRY" /> 094 * 095 * BODY 部に追??表示 096 * <og:queryButton > 097 * <td><jsp:directive.include file="/jsp/common/timeViewImage.jsp" /></td> 098 * </og:queryButton > 099 * 100 * @og.rev 4.0.0.0 (2005/01/31) 新規作? 101 * @og.rev 5.7.1.0 (2013/12/06) HTMLTagSupport を継承し?ボタンに付ける属?を増やします? 102 * @og.group 画面制御 103 * 104 * @version 4.0 105 * @author Kazuhiko Hasegawa 106 * @since JDK5.0, 107 */ 108 // public class QueryButtonTag extends CommonTagSupport { 109 public class QueryButtonTag extends HTMLTagSupport { 110 //* こ?プログラ??VERSION??を設定します? {@value} */ 111 private static final String VERSION = "5.7.5.0 (2014/04/04)" ; 112 113 private static final long serialVersionUID = 575020140404L ; // 5.7.5.0 (2014/04/04) 114 115 private static final String CR = HybsSystem.CR; 116 117 private static final String COMMAND = 118 "<input type=\"hidden\" name=\"command\" value=\"NEW\" id=\"h_cmd\" />"; 119 120 private static final String JSP = HybsSystem.sys( "JSP" ); 121 122 // 4.2.1.0 (2008/04/07) TDにIDを追? 123 // 4.3.1.0 (2008/09/03) 戻る?進??タンをsubmitにより実行する? 124 private static final String PREV_NEXT = 125 "<td id=\"prev-next\"><a href=\"forward.jsp?command=FIRST\" target=\"RESULT\" >" + CR + 126 " <img src=\"" + JSP + "/image/FIRST.gif\" alt=\"FIRST\" border=\"0px\" " + CR + 127 " onclick=\"return submitPrevNextForm('FIRST');\"/>" + CR + 128 "</a>" + CR + 129 "<a href=\"forward.jsp?command=PREV\" target=\"RESULT\" >" + CR + 130 " <img src=\"" + JSP + "/image/PREV.gif\" alt=\"PREV\" border=\"0px\" " + CR + 131 " onclick=\"return submitPrevNextForm('PREV');\"/>" + CR + 132 "</a>" + CR + 133 "<a href=\"forward.jsp?command=NEXT\" target=\"RESULT\" >" + CR + 134 " <img src=\"" + JSP + "/image/NEXT.gif\" alt=\"NEXT\" border=\"0px\" " + CR + 135 " onclick=\"return submitPrevNextForm('NEXT');\"/>" + CR + 136 "</a>" + CR + 137 "<a href=\"forward.jsp?command=LAST\" target=\"RESULT\" >" + CR + 138 " <img src=\"" + JSP + "/image/LAST.gif\" alt=\"LAST\" border=\"0px\" " + CR + 139 " onclick=\"return submitPrevNextForm('LAST');\"/>" + CR + 140 "</a></td>" + CR ; 141 142 private static final String TIME_VIEW = // 4.2.1.0 (2008/04/07) 直接色?を?る? 143 "<td><table cellspacing=\"0\" cellpadding=\"0\">" + CR + 144 "<tr>" + CR + 145 "<td width=\"20px\"> </td>" + CR + 146 "<td width=\"0px\" id=\"queryTbl\" title=\"\" ></td>" + CR + // #ff0000 147 "<td width=\"0px\" id=\"viewTbl\" title=\"\" ></td>" + CR + // #0000ff 148 "<td width=\"0px\" id=\"pageTbl\" title=\"\" ></td>" + CR + // #00ff00 149 "<td width=\"10px\"></td>" + CR + 150 "<td style=\"background-color:transparent;\" id=\"totalTbl\"></td>" + CR + 151 "</tr>" + CR + 152 "</table></td>" + CR ; 153 154 // 4.3.6.0 (2009/04/01) 件数を?タンで開閉させ? 155 private static final String COUNT_SWITCH= 156 "<td>" + 157 // " <img id=\"queryHide\" src=\"" + JSP + "/image/expand_r.png\" alt=\"Expand\" border=\"0px\" "+ 158 " <img id=\"queryHide\" src=\"" + JSP + "/image/expand_r.png\" alt=\"pageSize\" border=\"0px\" "+ // 5.5.3.2 (2012/06/08) 159 " onClick=\"hideClass( event, this, 'hide', 'expand_r', 'shrink_r' )\"> " + CR + 160 "</td>"; 161 162 // 5.6.1.0 (2013/02/01) display:noneの?ー出? 163 private static final String DUMMY_INPUT = "HYBS_DUMMY_NPUT"; 164 165 private String command = "NEW"; 166 private String pageSize = null; 167 private String maxRowCount = null; 168 private String accesskey = "F"; 169 private boolean useCrear = true; 170 private String type = null; // null:標?, SELECT:検索ボタンのみ , ENTRY:登録ボタンのみ 171 private String scope = null; 172 private boolean usePrevNext = true; 173 private boolean usePageSize = true; 174 private boolean useRowCount = true; 175 private boolean useTimeView = true; 176 private String body = null; 177 private String clearAcskey = "C"; 178 private boolean useDummy = HybsSystem.sysBool( "USE_DUMMY_INPUT" ); // 5.6.1.0 (2013/02/01) 179 private boolean useEditMenu = true; // 5.7.5.0 (2014/04/04) 編??ル?ンを?すかど?(初期値:true)? 180 181 /** 182 * Taglibの開始タグが見つかったときに処??doStartTag() ?オーバ?ライドします? 183 * 184 * @return 後続????( EVAL_BODY_BUFFERED ) 185 */ 186 @Override 187 public int doStartTag() { 188 return( EVAL_BODY_BUFFERED ); // Body を評価する? extends BodyTagSupport ? 189 } 190 191 /** 192 * Taglibのタグ本体を処??doAfterBody() ?オーバ?ライドします? 193 * 194 * @og.rev 2.2.0.0 (2002/12/17) 中国?国際化)対?エンコード?取得方法変更 195 * @og.rev 3.0.0.0 (2002/12/25) StringUtil#changeString ? 196 * @og.rev 3.1.1.0 (2003/03/28) ボディの?を取得する??、CommonTagSupport で行う? 197 * 198 * @return 後続????(SKIP_BODY) 199 */ 200 @Override 201 public int doAfterBody() { 202 body = nval( getBodyString(),body ); 203 204 return(SKIP_BODY); 205 } 206 207 /** 208 * Taglibの終?グが見つかったときに処??doEndTag() ?オーバ?ライドします? 209 * 210 * @og.rev 5.3.6.0 (2011/06/01) ??合計などのEdit機?に対応します? 211 * @og.rev 5.6.5.1 (2013/06/14) debugプル?ンの追??つ?に、PageSize と MaxRowCount の 表示条件を?整備します? 212 * @og.rev 5.6.9.4 (2013/10/31) editNameの初期値を外部から与えられるよ?する 213 * @og.rev 5.7.1.0 (2013/12/06) HTMLTagSupportを継承する為、メソ?を?getSubmit() ?makeTag() に変更 214 * @og.rev 5.7.1.2 (2013/12/20) USE_DEFAULT_EDITNAMEでeditNameの初期値変更 215 * @og.rev 5.7.5.0 (2014/04/04) useEditMenu 追? 216 * 217 * @return 後続???? 218 */ 219 @Override 220 public int doEndTag() { 221 debugPrint(); // 4.0.0 (2005/02/28) 222 StringBuilder buf = new StringBuilder( HybsSystem.BUFFER_MIDDLE ); 223 224 buf.append( getHiddenScope() ).append( CR ); 225 226 buf.append( "<table border=\"0\" frame=\"border\" summary=\"submit\" ><tr>" ); 227 buf.append( CR ); 228 // buf.append( "<td>" ).append( getSubmit() ).append( "</td>" ).append( CR ); 229 buf.append( "<td>" ).append( makeTag() ).append( "</td>" ).append( CR ); // 5.7.1.0 (2013/12/06) 230 buf.append( "<td>" ).append( getReset() ).append( "</td>" ).append( CR ); 231 buf.append( "<td>" ).append( getCommand() ).append( "</td>" ).append( CR ); 232 buf.append( "<td>" ).append( getGamenId() ).append( "</td>" ).append( CR ); 233 if( usePrevNext ) { buf.append( PREV_NEXT ).append( CR ); } 234 buf.append( "<td>" ).append( "<span id=\"query-button-append\"></span>").append( "</td>" ).append( CR ); //4 3.6.0 (2009/04/01) 235 // if( usePageSize ) { buf.append( getPageSize() ).append( CR ); } 236 // if( useRowCount ) { buf.append( getMaxRowCount()).append( CR ); } 237 if( body != null ) { 238 buf.append( "<td>" ).append( body ).append( "</td>" ).append( CR ); 239 } 240 241 // 5.7.5.0 (2014/04/04) useEditMenu 追??trueで、編??ル?ンを?力します? 242 if( useEditMenu ) { 243 // 5.3.6.0 (2011/06/01) ??合計などのEdit機?に対応します? 244 String guikey = getGUIInfoAttri( "KEY" ); 245 DBEditConfig[] configs = getUser().getEditConfigs( guikey ); 246 if( configs != null && configs.length > 0 ) { 247 // String selEditName = getUser().getSelectedEdit( getGUIInfoAttri( "KEY" ) ); 248 // String selEditName = nval( getRequestValue( "editName" ) , getUser().getSelectedEdit( getGUIInfoAttri( "KEY" ) )); // 5.6.9.4 (2013/10/31) 249 String selEditName ; // 5.7.1.2 (2013/12/20) 250 if( "FALSE".equalsIgnoreCase( sys( "USE_DEFAULT_EDITNAME" ) ) ){ 251 selEditName = getRequestValue( "editName" ); 252 } 253 else{ 254 selEditName = nval( getRequestValue( "editName" ) , getUser().getSelectedEdit( getGUIInfoAttri( "KEY" ) )); // 5.6.9.4 (2013/10/31) 255 256 } 257 buf.append( getEditSelect( configs, selEditName ) ).append( CR ); 258 } 259 } 260 261 // 5.6.5.1 (2013/06/14) debugプル?ンの追??つ?に、PageSize と MaxRowCount の 表示条件を?整備します? 262 // if( usePageSize || useRowCount){ buf.append( COUNT_SWITCH ).append( CR ); } // 4.3.6.0 (2009/04/01) 263 // if( usePageSize ) { buf.append( getPageSize() ).append( CR ); } 264 // if( useRowCount ) { buf.append( getMaxRowCount()).append( CR ); } 265 266 if( usePageSize || useRowCount) { 267 buf.append( COUNT_SWITCH ).append( CR ); 268 if( usePageSize ) { buf.append( getPageSize() ).append( CR ); } 269 if( useRowCount ) { buf.append( getMaxRowCount()).append( CR ); } 270 // ??は、ユーザーのロールが?root の場合?み表示するようにします? 271 if( "root".equalsIgnoreCase( getUser().getRoles() ) ) { 272 buf.append( getDebugClm() ).append( CR ); // 5.6.5.1 (2013/06/14) debugプル?ンの追? 273 } 274 } 275 276 if( useTimeView ) { buf.append( TIME_VIEW ).append( CR ); } 277 278 buf.append( "</tr></table>" ).append( CR ); 279 280 jspPrint( buf.toString() ); 281 if( useDummy ){ jspPrint( getDummyInput() ); }// 5.6.1.0 (2013/02/01) 282 return(EVAL_PAGE); // ペ?ジの残りを評価する? 283 } 284 285 /** 286 * タグリブオブジェクトをリリースします? 287 * キャ?ュされて再利用される?で、フィールド?初期設定を行います? 288 * 289 * @og.rev 5.6.1.0 (2013/02/01) useDummy 追? 290 * @og.rev 5.7.5.0 (2014/04/04) useEditMenu 追? 291 */ 292 @Override 293 protected void release2() { 294 super.release2(); 295 command = "NEW"; 296 pageSize = null; 297 maxRowCount = null; 298 accesskey = "F"; 299 useCrear = true; 300 type = null; 301 scope = null; 302 usePrevNext = true; 303 usePageSize = true; 304 useRowCount = true; 305 useTimeView = true; 306 clearAcskey = "C"; // 5.3.5.0 (2011/05/01) クリアボタンアクセスキー対? 307 useDummy = HybsSystem.sysBool( "USE_DUMMY_INPUT" ); // 5.6.1.0 (2013/02/01) 308 useEditMenu = true; // 5.7.5.0 (2014/04/04) 編??ル?ンを?すかど?(初期値:true)? 309 } 310 311 /** 312 * サブミ?ボタンを作?します? 313 * 314 * @og.rev 5.3.6.0 (2011/06/01) accessKeyを削除できるように対? 315 * @og.rev 5.5.7.1 (2012/10/05) 不要な括弧出力を削除 316 * @og.rev 5.6.9.3 (2013/10/25) IDを?力す? 317 * @og.rev 5.7.1.0 (2013/12/06) HTMLTagSupportを継承する為、メソ?を?getSubmit() ?makeTag() に変更 318 * 319 * @return サブミ?ボタン 320 */ 321 // private String getSubmit() { 322 @Override 323 protected String makeTag() { 324 String msglbl = getLongLabel(); // 4.0.0 (2005/01/31) 325 if( msglbl == null ) { 326 if( "ENTRY".equalsIgnoreCase( type ) ) { 327 msglbl = getLabel( "ENTRY" ); 328 } 329 else { 330 msglbl = getLabel( "QUERY" ); 331 } 332 } 333 334 // 5.7.1.0 (2013/12/06) XHTMLTag を使用することで、各種属?を追?きるようにします? 335 // String rtn = "<button type=\"submit\" id=\"queryButtonSubmit\" " // 5.6.9.3 (2013/10/25) 336 // + ( accesskey == null ? "" : "accesskey=\"" + accesskey + "\"" ) // 5.5.7.1 (2012/10/05) 337 // + ">" + msglbl 338 // + ( accesskey == null ? "" : "(" + accesskey + ")" ) 339 // +"</button>" ; 340 341 // 5.7.1.0 (2013/12/06) XHTMLTag を使用することで、各種属?を追?きるようにします? 342 if( accesskey != null ) { 343 set( "accesskey" , accesskey ); 344 msglbl = msglbl + "(" + accesskey + ")" ; 345 } 346 347 set( "type" , "submit" ); 348 set( "id" , "queryButtonSubmit" ); 349 set( "body" , msglbl ); 350 351 return XHTMLTag.button( getAttributes() ); 352 } 353 354 /** 355 * リセ?ボタンを作?します? 356 * 357 * @og.rev 4.0.0.0 (2007/10/18) メ?ージリソース統? getResource().getMessage ?getResource().getLabel ) 358 * @og.rev 5.0.2.0 (2009/11/01) 戻る?タンが?力されて?状態で、クリアボタンを押すと、戻る?タンが消える不?合を修正 359 * @og.rev 5.3.5.0 (2011/05/01) クリアボタンにもアクセスキーが付加できるように対? 360 * @og.rev 5.3.6.0 (2011/06/01) accessKeyを削除できるように対? 361 * 362 * @return リセ?ボタン 363 */ 364 private String getReset() { 365 final String rtn ; 366 367 if( useCrear ) { 368 rtn = "<button onClick=\"window.open('" + JSP + "/" + getGUIInfoAttri("ADDRESS") + 369 // "/query.jsp?GAMENID=" + getGUIInfoAttri("KEY") + "','QUERY')\" >" + 370 "/query.jsp?GAMENID=" + getGUIInfoAttri("KEY") + "&command=NEW','QUERY')\" " + 371 // "accesskey=\"" + clearAcskey + "\">" + 372 ( clearAcskey == null ? "" : "accesskey=\"" + clearAcskey + "\"" ) + 373 ">" + 374 // getResource().getMessage( "MSG0011" ) + "</button>" ; 375 // getResource().getLabel( "MSG0011" ) + "</button>" ; 376 getResource().getLabel( "MSG0011" ) + 377 ( clearAcskey == null ? "" : "(" + clearAcskey + ")" ) + 378 "</button>" ; 379 } 380 else { 381 rtn = "<button type=\"reset\" " + 382 ( clearAcskey == null ? "" : "accesskey=\"" + clearAcskey + "\"" ) + 383 ">" + 384 // getResource().getMessage( "MSG0011" ) + "</button>" ; 385 getResource().getLabel( "MSG0011" ) + 386 ( clearAcskey == null ? "" : "(" + clearAcskey + ")" ) + 387 "</button>" ; 388 } 389 390 return rtn; 391 } 392 393 /** 394 * コマンドを出力す?hidden を作?します? 395 * 396 * @return コマンドを出力す?hidden 397 */ 398 private String getCommand() { 399 final String rtn ; 400 401 if( "NEW".equals( command ) ) { 402 rtn = COMMAND; 403 } 404 else { 405 rtn = "<input type=\"hidden\" name=\"command\" value=\"" + 406 command + "\" id=\"h_cmd\" />" ; 407 } 408 409 return rtn; 410 } 411 412 /** 413 * スコープを出力す?hidden を作?します? 414 * 415 * @return スコープを出力す?hidden 416 */ 417 private String getHiddenScope() { 418 String rtn = ""; 419 420 if( scope != null ) { 421 rtn = "<input type=\"hidden\" name=\"scope\" value=\"" + 422 scope + "\" />" ; 423 } 424 425 return rtn; 426 } 427 428 /** 429 * 画面IDを?力す?hidden を作?します? 430 * 431 * @return 画面IDを?力す?hidden 432 */ 433 private String getGamenId() { 434 String rtn = "<input type=\"hidden\" name=\"GAMENID\" value=\"" + 435 getGUIInfoAttri("KEY") + "\" />"; 436 437 return rtn; 438 } 439 440 /** 441 * ペ?ジサイズプル?ンメニューを作?します? 442 * 443 * @og.rev 4.3.6.0 (2008/04/01) idとclassの変更 444 * 445 * @return ペ?ジサイズプル?ンメニュー 446 */ 447 private String getPageSize() { 448 // String rtn = ""; 449 450 // if( usePageSize ) { 451 if( pageSize == null ) { 452 String PAGESIZE = sys( "HTML_PAGESIZE" ); 453 pageSize = nval( getRequestValue( "pageSize" ),PAGESIZE ) ; 454 } 455 456 DBColumn column = getDBColumn( "pageSize" ); 457 String tag = column.getEditorValue( pageSize ); 458 459 // return ( "<td id=\"label\">" + 460 return ( "<td class=\"label pageSize hide\">" + // 4.3.6.0 (2008/04/01) class出? 461 column.getLongLabel() + 462 ":</td><td class=\"pageSize hide\">" + tag + "</td>" ) ; 463 // } 464 465 // return rtn; 466 } 467 468 /** 469 * 検索時??検索数のプル?ンメニューを作?します? 470 * 471 * @og.rev 4.3.6.0 (2008/04/01) idとclassの変更 472 * 473 * @return ?検索数のプル?ンメニュー 474 */ 475 private String getMaxRowCount() { 476 // String rtn = ""; 477 478 // if( useRowCount ) { 479 if( maxRowCount == null ) { 480 String ROW_COUNT = sys( "DB_MAX_ROW_COUNT" ); 481 maxRowCount = nval( getRequestValue( "maxRowCount" ), ROW_COUNT ) ; 482 } 483 484 DBColumn column = getDBColumn( "maxRowCount" ); 485 String tag = column.getEditorValue( maxRowCount ); 486 487 // return ( "<td id=\"label\">" + 488 return ( "<td class=\"label maxRowCount hide\">" + // 4.3.6.0 (2008/04/01) class出? 489 column.getLongLabel() + 490 ":</td><td class=\"maxRowCount hide\">" + tag + "</td>" ) ; 491 // } 492 // return rtn; 493 } 494 495 /** 496 * debugプル?ンメニューを作?します? 497 * 498 * @og.rev 5.6.5.1 (2013/06/14) 新規追? 499 * 500 * @return debugプル?ンメニュー 501 */ 502 private String getDebugClm() { 503 DBColumn column = getDBColumn( "debug" ); 504 String tag = column.getEditorValue( "false" ); 505 506 return ( "<td class=\"label debug hide\">" + 507 column.getLongLabel() + 508 ":</td><td class=\"debug hide\">" + tag + "</td>" ) ; 509 } 510 511 /** 512 * エ??設定?のプル?ンメニューを作?します? 513 * 514 * @og.rev 5.3.6.0 (2011/06/01) 新規追? 515 * 516 * @param configs エ???(配?) 517 * @param selEditName 選択中のエ??? 518 * 519 * @return エ???のプル?ン 520 */ 521 private String getEditSelect( final DBEditConfig[] configs, final String selEditName ) { 522 DBColumn column = getDBColumn( "editName" ); 523 524 StringBuilder buf = new StringBuilder(); 525 buf.append( "<td class=\"label editName\">" ) 526 .append( column.getLongLabel() ) 527 .append( ":</td><td class=\"editName\">" ) 528 .append( "<select name=\"editName\">" ) 529 .append( "<option />" ); 530 for( DBEditConfig config : configs ) { 531 String name = config.getEditName(); 532 if( name != null && name.length() > 0 ) { 533 buf.append( "<option value=\"" ).append( name ).append( "\"" ); 534 if( config.isCommon() ) { 535 buf.append( " class=\"commonEdit\"" ); 536 } 537 if( name.equals( selEditName ) ) { 538 buf.append( " selected" ); 539 } 540 buf.append( ">" ).append( name ).append( "</option>" ); 541 } 542 } 543 buf.append( "</select></td>" ); 544 return buf.toString(); 545 } 546 547 /** 548 * IEのEnterボタンのための?しinput出力? 549 * 550 * ※?コール用 551 * 552 * @og.rev 5.6.1.0 (2013/02/01) 新規作? 553 * 554 * @return ?属?タグ 555 */ 556 private final String getDummyInput() { 557 558 StringBuilder strRet = new StringBuilder( HybsSystem.BUFFER_MIDDLE ); 559 Attributes attributes = new Attributes(); 560 attributes.set("name",DUMMY_INPUT); 561 attributes.set("value",null); 562 attributes.set("optionAttributes","style='display:none;'"); 563 strRet.append( XHTMLTag.input( attributes ) ); 564 565 return strRet.toString(); 566 } 567 568 /** 569 * 【TAG】リクエストとして送信するコマンドを?しま?初期値:NEW)? 570 * 571 * @og.tag 572 * NEW:通常の検索(初期値)?ENTRY:エントリ登録? 573 * 574 * @param cmd 送信するコマン? 575 */ 576 public void setCommand( final String cmd ) { 577 command = nval( getRequestParameter( cmd ),command ); 578 } 579 580 /** 581 * 【TAG】JavaScriptによる初期化?タンを使用するかど?[true/false]を指定しま?初期値:true)? 582 * 583 * @og.tag 584 * 通常の初期化?タンでは、HTMLが作?された状態に戻すだけです?例えば? 585 * 引数付きで設定された場合?そ?引数が設定されて?状態へ戻します? 586 * こ?JavaScriptによる初期化?タンの場?trueの場?は、JavaScriptにより 587 * INIT状態でもう?QUERYフレー?呼び出します?で、指定された引数? 588 * クリアされます? 589 * 初期値は、true:JavaScriptによる初期化です? 590 * 591 * @param flag [true:JavaScriptによる初期?false:通常のresetボタン] 592 */ 593 public void setUseCrear( final String flag ) { 594 useCrear = nval( getRequestParameter( flag ),useCrear ); 595 } 596 597 /** 598 * 【TAG】?型的なボタンの形状に設定しま?初期値:null)? 599 * 600 * @og.tag 601 * クエリーボタンでは、検索ボタン以外に、pageSize、maxRowCount? 602 * prevNext、timeView などの?も表示可能です? 603 * これらを、?別に設定可能ですが??常使用するタイプとして?タイプを 604 * 用意します?これは、設定状態?初期値と?ます? 605 * null :通常の検索ボタンで、フル?の?です? 606 * SELECT:?件のみ検索するようなケースで使用します? 607 * 検索ボタンとクリアボタンのみを表示します? 608 * ENTRY :?なり登録するようなケースで使用します? 609 * 登録ボタンとクリアボタンのみを表示します?(command="NEW" です?) 610 * 611 * @param tp タイプ指?null,SELECT,ENTRY) 612 */ 613 public void setType( final String tp ) { 614 type = nval( getRequestParameter( tp ),type ); 615 616 if( "SELECT".equalsIgnoreCase( type ) ) { 617 accesskey = "F"; 618 usePrevNext = false; 619 usePageSize = false; 620 useRowCount = false; 621 useTimeView = false; 622 } 623 else if( "ENTRY".equalsIgnoreCase( type ) ) { 624 accesskey = "W"; 625 usePrevNext = false; 626 usePageSize = false; 627 useRowCount = false; 628 useTimeView = false; 629 } 630 } 631 632 /** 633 * 【TAG】リクエストとして送信するスコープを?しま?初期値:null)? 634 * 635 * @og.tag 636 * リクエスト時に、付与する引数??の?の、スコープを?します? 637 * これは、検索専用画面の場合?、scope="request" にする事で、メモリの 638 * 無?確保を行わずに、検索結果を表示できます? 639 * ただし?そ?結果に対して、NEXT-PREV ??ヘッ??ソートリンクなどの 640 * 機?が使えなくなります? 641 * 通常は、何も?しな??null)で、RESULT画面の設定に任せるのが良?しょ?? 642 * 初期値は、null = session(セ?ョン登録) です? 643 * 644 * @param scp [session:セ?ョン登録/request:リクエスト登録] 645 */ 646 @Override 647 public void setScope( final String scp ) { 648 scope = nval( getRequestParameter( scp ),scope ); 649 } 650 651 /** 652 * 【TAG】検索ボタンに使用するショートカ?キー?を?しま?初期値:F)? 653 * 654 * @og.tag 655 * ボタンを?Alt-XX で実行できるようにするショートカ?キーを設定します? 656 * 標準では、検索ボタンは?F" に設定して?す?で、Alt-F となります? 657 * ゼロ??を指定すると、ショートカ?キーなしに設定できます? 658 * 初期値は、Find の "F" です? 659 * 660 * @og.rev 5.3.6.0 (2011/06/01) accessKeyを削除できるように対? 661 * @og.rev 5.6.0.3 (2012/01/24) getRequestParameter を何度も呼んで?ので修正? 662 * 663 * @param accsKey ショートカ?キー??初期値:F) 664 */ 665 @Override 666 public void setAccesskey( final String accsKey ) { 667 // accesskey = nval( getRequestParameter( accsKey ),accesskey ); 668 String val = getRequestParameter( accsKey ); 669 if( val == null || val.length() == 0 ) { 670 accesskey = null; 671 } 672 else { 673 // accesskey = getRequestParameter( accsKey ); 674 accesskey = val; // 5.6.0.3 (2012/01/24) 675 } 676 } 677 678 /** 679 * 【TAG】クリアボタンに使用するショートカ?キー?を?しま?初期値:C)? 680 * 681 * @og.tag 682 * ボタンを?Alt-XX で実行できるようにするショートカ?キーを設定します? 683 * 標準では、検索ボタンは?C" に設定して?す?で、Alt-C となります? 684 * ゼロ??を指定すると、ショートカ?キーなしに設定できます? 685 * 初期値は、Clear の "C" です? 686 * 687 * @og.rev 5.3.6.0 (2011/06/01) accessKeyを削除できるように対? 688 * @og.rev 5.6.0.3 (2012/01/24) getRequestParameter を何度も呼んで?ので修正? 689 * 690 * @param accsKey クリアボタンのショートカ?キー??初期値:C) 691 */ 692 public void setClearAccesskey( final String accsKey ) { 693 // clearAcskey = nval( getRequestParameter( accsKey ),clearAcskey ); 694 String val = getRequestParameter( accsKey ); 695 if( val == null || val.length() == 0 ) { 696 clearAcskey = null; 697 } 698 else { 699 // clearAcskey = getRequestParameter( accsKey ); 700 clearAcskey = val; // 5.6.0.3 (2012/01/24) 701 } 702 } 703 704 /** 705 * 【TAG】??戻る?prev_next リンクを表示するかど?を指定しま?初期値:true)? 706 * 707 * @og.tag 708 * 進?戻るリンクは、RESULT画面にコマン?FIRST,PREV,NEXT,LAST) と? 709 * コマンドを送る事で実現して?画像リンクです? 710 * PREV_NEXT が存在しな?面では、消去しておく?があります? 711 * 初期値は、true(表示する)です? 712 * 713 * @param flag prev_next リンクを表示するかど? 714 */ 715 public void setUsePrevNext( final String flag ) { 716 usePrevNext = nval( getRequestParameter( flag ),usePrevNext ); 717 } 718 719 /** 720 * 【TAG】pageSize 引数を使用するかど?を指定しま?初期値:true)? 721 * 722 * @og.tag 723 * pageSize 引数は、RESULT画面のviewタグで使用する ?の表示に 724 * 何件の??タを表示させるかを指定する引数です? 725 * こ?件数が多いと、多くの??タを見ることが?来ますが、その?示? 726 * ?なります??、少な?、PREV_NEXT を多用することになり? 727 * 目??行を探し?しにくくなります? 728 * pageSize の値は、pageSizeパラメータで画面単位に?するか、シス? 729 * パラメータの HTML_PAGESIZE でシス?単位に?できます? 730 * 初期値は、true(使用する)です? 731 * 732 * @param flag pageSize引数を使用するかど? 733 * @see #setPageSize( String ) 734 */ 735 public void setUsePageSize( final String flag ) { 736 usePageSize = nval( getRequestParameter( flag ),usePageSize ); 737 } 738 739 /** 740 * 【TAG】maxRowCount 引数を使用するかど?を指定しま?初期値:true)? 741 * 742 * @og.tag 743 * maxRowCount 引数は、RESULT画面のqueryタグで使用する ?の検索時に 744 * 何件の??タを取得させるかを?する引数です? 745 * こ?件数が多いと、多くの??タを検索することが?来ますが、その?示? 746 * ?なります??、少な?、目??行まで探し?せな?もしれません? 747 * maxRowCount の値は、rowCountパラメータで画面単位に?するか、シス? 748 * パラメータの DB_MAX_ROW_COUNT でシス?単位に?できます? 749 * 750 * 初期値は、true(使用する)です? 751 * 752 * @param flag maxRowCount引数を使用するかど? 753 * @see #setMaxRowCount( String ) 754 */ 755 public void setUseRowCount( final String flag ) { 756 useRowCount = nval( getRequestParameter( flag ),useRowCount ); 757 } 758 759 /** 760 * 【TAG】??間を表示する TimeView を表示するかど?を指定しま?初期値:true)? 761 * 762 * @og.tag 763 * true に設定すると、??間を表示するバ?イメージが表示されます? 764 * これは、DB検索、APサーバ?処??画面表示の???間をバ?イメージで 765 * 表示させる機?です?処?間?目安になります? 766 * 初期値は、true です? 767 * 768 * @param flag TimeView表示をするかど?(初期値:true) 769 */ 770 public void setUseTimeView( final String flag ) { 771 useTimeView = nval( getRequestParameter( flag ),useTimeView ); 772 } 773 774 /** 775 * 【TAG】pageSize プル?ンメニューの初期値を指定しま? 776 * (初期値:HTML_PAGESIZE[={@og.value org.opengion.hayabusa.common.SystemData#HTML_PAGESIZE}])? 777 * 778 * @og.tag 779 * プル?ンメニューを表示する場合?初期値を指定します? 780 * (初期値:ユーザー定数のHTML_PAGESIZE[={@og.value org.opengion.hayabusa.common.SystemData#HTML_PAGESIZE}])? 781 * 782 * @param pSize プル?ンメニューの初期値 783 * @see #setUsePageSize( String ) 784 * @see org.opengion.hayabusa.common.SystemData#HTML_PAGESIZE 785 */ 786 public void setPageSize( final String pSize ) { 787 pageSize = nval( getRequestParameter( pSize ),pageSize ); 788 } 789 790 /** 791 * 【TAG】maxRowCount プル?ンメニューの初期値を指定しま? 792 * (初期値:DB_MAX_ROW_COUNT[={@og.value org.opengion.hayabusa.common.SystemData#DB_MAX_ROW_COUNT}])? 793 * 794 * @og.tag 795 * プル?ンメニューを表示する場合?初期値を指定します? 796 * (初期値:ユーザー定数のDB_MAX_ROW_COUNT[={@og.value org.opengion.hayabusa.common.SystemData#DB_MAX_ROW_COUNT}])? 797 * 798 * @param maxSize maxRowCountプル?ンメニューの初期値 799 * @see #setUseRowCount( String ) 800 * @see org.opengion.hayabusa.common.SystemData#DB_MAX_ROW_COUNT 801 */ 802 public void setMaxRowCount( final String maxSize ) { 803 maxRowCount = nval( getRequestParameter( maxSize ),maxRowCount ); 804 } 805 806 /** 807 * 【TAG】ダミ?のinputタグ(display:none)を?力するか設定します? 808 * (初期値:USE_DUMMY_INPUT[={@og.value org.opengion.hayabusa.common.SystemData#USE_DUMMY_INPUT}])? 809 * 810 * @og.tag 811 * ?ーのinputタグ(display:none)を?力するか設定します? 812 * IEではinputが1つ?の場合にエンターでのsubmitが上手くいかな?め??ーを?置する?があります? 813 * trueに設定するとWriteCheckタグがダミ?を(常に??力します? 814 * (初期値:USE_DUMMY_INPUT[={@og.value org.opengion.hayabusa.common.SystemData#USE_DUMMY_INPUT}])? 815 * 816 * @og.rev 5.6.1.0 (2013/02/01) 新規追? 817 * 818 * @param flag 出力[する(true)/しな?false)] 819 * @see org.opengion.hayabusa.common.SystemData#USE_DUMMY_INPUT 820 */ 821 public void setUseDummy( final String flag ) { 822 useDummy = nval( getRequestParameter( flag ), useDummy ); 823 } 824 825 /** 826 * 【TAG】query画面等で編??ル?ンを?力するかど?(初期値?true) 827 * 828 * @og.tag 829 * falseを指定すると編??ル?ンを?さな?? 830 * popup画面等?画面ID単位では編??は使???に使?くな??合に 831 * タグのパラメータとして個別に?できるようにします? 832 * 初期値は、互換性の関係から?編??ル?ンを?力す?=true)です? 833 * 834 * @og.rev 5.7.5.0 (2014/04/04) 新規追? 835 * 836 * @param flag 編??ル?ンを?力するかど?(初期値:true) 837 * @see org.opengion.hayabusa.taglib.FileUDTag#setUseEditLink(String) 838 */ 839 public void setUseEditMenu( final String flag ) { 840 useEditMenu = nval( getRequestParameter( flag ),useEditMenu ); 841 } 842 843 /** 844 * こ?オブジェクト???表現を返します? 845 * 基本???目?使用します? 846 * 847 * @return こ?クラスの??表現 848 */ 849 @Override 850 public String toString() { 851 return org.opengion.fukurou.util.ToString.title( this.getClass().getName() ) 852 .println( "VERSION" ,VERSION ) 853 .println( "command" ,command ) 854 .println( "pageSize" ,pageSize ) 855 .println( "maxRowCount" ,maxRowCount ) 856 .println( "accesskey" ,accesskey ) 857 .println( "scope" ,scope ) 858 .println( "useCrear" ,useCrear ) 859 .println( "usePrevNext" ,usePrevNext ) 860 .println( "usePageSize" ,usePageSize ) 861 .println( "useRowCount" ,useRowCount ) 862 .println( "useTimeView" ,useTimeView ) 863 .println( "body" ,body ) 864 .println( "Other..." ,getAttributes().getAttribute() ) 865 .fixForm().toString() ; 866 } 867 }