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