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