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 * lbl = "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 = "5.7.1.2 (2013/12/20)" ;
110
111 private static final long serialVersionUID = 571220131220L ; // 5.7.1.2 (2013/12/20)
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 * @og.rev 5.7.1.2 (2013/12/20) USE_DEFAULT_EDITNAMEでeditNameの初期値変更
212 *
213 * @return 後続å?ç�??æŒ?¤º
214 */
215 @Override
216 public int doEndTag() {
217 debugPrint(); // 4.0.0 (2005/02/28)
218 StringBuilder buf = new StringBuilder( HybsSystem.BUFFER_MIDDLE );
219
220 buf.append( getHiddenScope() ).append( CR );
221
222 buf.append( "<table border=\"0\" frame=\"border\" summary=\"submit\" ><tr>" );
223 buf.append( CR );
224 // buf.append( "<td>" ).append( getSubmit() ).append( "</td>" ).append( CR );
225 buf.append( "<td>" ).append( makeTag() ).append( "</td>" ).append( CR ); // 5.7.1.0 (2013/12/06)
226 buf.append( "<td>" ).append( getReset() ).append( "</td>" ).append( CR );
227 buf.append( "<td>" ).append( getCommand() ).append( "</td>" ).append( CR );
228 buf.append( "<td>" ).append( getGamenId() ).append( "</td>" ).append( CR );
229 if( usePrevNext ) { buf.append( PREV_NEXT ).append( CR ); }
230 buf.append( "<td>" ).append( "<span id=\"query-button-append\"></span>").append( "</td>" ).append( CR ); //4 3.6.0 (2009/04/01)
231 // if( usePageSize ) { buf.append( getPageSize() ).append( CR ); }
232 // if( useRowCount ) { buf.append( getMaxRowCount()).append( CR ); }
233 if( body != null ) {
234 buf.append( "<td>" ).append( body ).append( "</td>" ).append( CR );
235 }
236 // 5.3.6.0 (2011/06/01) é›?¨ˆã?合計などのEdit機è?に対応しますã?
237 String guikey = getGUIInfoAttri( "KEY" );
238 DBEditConfig[] configs = getUser().getEditConfigs( guikey );
239 if( configs != null && configs.length > 0 ) {
240 // String selEditName = getUser().getSelectedEdit( getGUIInfoAttri( "KEY" ) );
241 // String selEditName = nval( getRequestValue( "editName" ) , getUser().getSelectedEdit( getGUIInfoAttri( "KEY" ) )); // 5.6.9.4 (2013/10/31)
242 String selEditName ; // 5.7.1.2 (2013/12/20)
243 if( "FALSE".equalsIgnoreCase( sys( "USE_DEFAULT_EDITNAME" ) ) ){
244 selEditName = getRequestValue( "editName" );
245 }
246 else{
247 selEditName = nval( getRequestValue( "editName" ) , getUser().getSelectedEdit( getGUIInfoAttri( "KEY" ) )); // 5.6.9.4 (2013/10/31)
248
249 }
250 buf.append( getEditSelect( configs, selEditName ) ).append( CR );
251 }
252
253 // 5.6.5.1 (2013/06/14) debugプルãƒ?‚¦ンの追åŠ??つã�?�§に、PageSize と MaxRowCount の 表示条件をã?整備しますã?
254 // if( usePageSize || useRowCount){ buf.append( COUNT_SWITCH ).append( CR ); } // 4.3.6.0 (2009/04/01)
255 // if( usePageSize ) { buf.append( getPageSize() ).append( CR ); }
256 // if( useRowCount ) { buf.append( getMaxRowCount()).append( CR ); }
257
258 if( usePageSize || useRowCount) {
259 buf.append( COUNT_SWITCH ).append( CR );
260 if( usePageSize ) { buf.append( getPageSize() ).append( CR ); }
261 if( useRowCount ) { buf.append( getMaxRowCount()).append( CR ); }
262 // ãƒ?ƒ�ãƒ?‚°は、ユーザーのロールがã?root の場合ã?み表示するようにしますã?
263 if( "root".equalsIgnoreCase( getUser().getRoles() ) ) {
264 buf.append( getDebugClm() ).append( CR ); // 5.6.5.1 (2013/06/14) debugプルãƒ?‚¦ンの追åŠ?
265 }
266 }
267
268 if( useTimeView ) { buf.append( TIME_VIEW ).append( CR ); }
269
270 buf.append( "</tr></table>" ).append( CR );
271
272 jspPrint( buf.toString() );
273 if( useDummy ){ jspPrint( getDummyInput() ); }// 5.6.1.0 (2013/02/01)
274 return(EVAL_PAGE); // ペã?ジの残りを評価するã€?
275 }
276
277 /**
278 * タグリブオブジェクトをリリースしますã?
279 * キャãƒ?‚·ュされて再利用されるã?で、フィールドã?初期設定を行いますã?
280 *
281 * @og.rev 5.6.1.0 (2013/02/01) useDummy
282 */
283 @Override
284 protected void release2() {
285 super.release2();
286 command = "NEW";
287 pageSize = null;
288 maxRowCount = null;
289 accesskey = "F";
290 useCrear = true;
291 type = null;
292 scope = null;
293 usePrevNext = true;
294 usePageSize = true;
295 useRowCount = true;
296 useTimeView = true;
297 clearAcskey = "C"; // 5.3.5.0 (2011/05/01) クリアボタンアクセスキー対å¿?
298 useDummy = HybsSystem.sysBool( "USE_DUMMY_INPUT" ); // 5.6.1.0 (2013/02/01)
299 }
300
301 /**
302 * サブミãƒ?ƒˆボタンを作æ?しますã?
303 *
304 * @og.rev 5.3.6.0 (2011/06/01) accessKeyを削除できるように対å¿?
305 * @og.rev 5.5.7.1 (2012/10/05) 不要な括弧出力を削除
306 * @og.rev 5.6.9.3 (2013/10/25) IDをå?力すã‚?
307 * @og.rev 5.7.1.0 (2013/12/06) HTMLTagSupportを継承する為、メソãƒ?ƒ‰をã?getSubmit() â‡?makeTag() に変更
308 *
309 * @return サブミãƒ?ƒˆボタン
310 */
311 // private String getSubmit() {
312 @Override
313 protected String makeTag() {
314 String msglbl = getLongLabel(); // 4.0.0 (2005/01/31)
315 if( msglbl == null ) {
316 if( "ENTRY".equalsIgnoreCase( type ) ) {
317 msglbl = getLabel( "ENTRY" );
318 }
319 else {
320 msglbl = getLabel( "QUERY" );
321 }
322 }
323
324 // 5.7.1.0 (2013/12/06) XHTMLTag を使用することで、各種属æ?を追åŠ?�§きるようにしますã?
325 // String rtn = "<button type=\"submit\" id=\"queryButtonSubmit\" " // 5.6.9.3 (2013/10/25)
326 // + ( accesskey == null ? "" : "accesskey=\"" + accesskey + "\"" ) // 5.5.7.1 (2012/10/05)
327 // + ">" + msglbl
328 // + ( accesskey == null ? "" : "(" + accesskey + ")" )
329 // +"</button>" ;
330
331 // 5.7.1.0 (2013/12/06) XHTMLTag を使用することで、各種属æ?を追åŠ?�§きるようにしますã?
332 if( accesskey != null ) {
333 set( "accesskey" , accesskey );
334 msglbl = msglbl + "(" + accesskey + ")" ;
335 }
336
337 set( "type" , "submit" );
338 set( "id" , "queryButtonSubmit" );
339 set( "body" , msglbl );
340
341 return XHTMLTag.button( getAttributes() );
342 }
343
344 /**
345 * リセãƒ?ƒˆボタンを作æ?しますã?
346 *
347 * @og.rev 4.0.0.0 (2007/10/18) メãƒ?‚»ージリソース統å�? getResource().getMessage â‡?getResource().getLabel )
348 * @og.rev 5.0.2.0 (2009/11/01) 戻るã?タンがå?力されてã�?‚‹状態で、クリアボタンを押すと、戻るã?タンが消える不å?合を修正
349 * @og.rev 5.3.5.0 (2011/05/01) クリアボタンにもアクセスキーが付加できるように対å¿?
350 * @og.rev 5.3.6.0 (2011/06/01) accessKeyを削除できるように対å¿?
351 *
352 * @return リセãƒ?ƒˆボタン
353 */
354 private String getReset() {
355 final String rtn ;
356
357 if( useCrear ) {
358 rtn = "<button onClick=\"window.open('" + JSP + "/" + getGUIInfoAttri("ADDRESS") +
359 // "/query.jsp?GAMENID=" + getGUIInfoAttri("KEY") + "','QUERY')\" >" +
360 "/query.jsp?GAMENID=" + getGUIInfoAttri("KEY") + "&command=NEW','QUERY')\" " +
361 // "accesskey=\"" + clearAcskey + "\">" +
362 ( clearAcskey == null ? "" : "accesskey=\"" + clearAcskey + "\"" ) +
363 ">" +
364 // getResource().getMessage( "MSG0011" ) + "</button>" ;
365 // getResource().getLabel( "MSG0011" ) + "</button>" ;
366 getResource().getLabel( "MSG0011" ) +
367 ( clearAcskey == null ? "" : "(" + clearAcskey + ")" ) +
368 "</button>" ;
369 }
370 else {
371 rtn = "<button type=\"reset\" " +
372 ( clearAcskey == null ? "" : "accesskey=\"" + clearAcskey + "\"" ) +
373 ">" +
374 // getResource().getMessage( "MSG0011" ) + "</button>" ;
375 getResource().getLabel( "MSG0011" ) +
376 ( clearAcskey == null ? "" : "(" + clearAcskey + ")" ) +
377 "</button>" ;
378 }
379
380 return rtn;
381 }
382
383 /**
384 * コマンドを出力すã‚?hidden を作æ?しますã?
385 *
386 * @return コマンドを出力すã‚?hidden
387 */
388 private String getCommand() {
389 final String rtn ;
390
391 if( "NEW".equals( command ) ) {
392 rtn = COMMAND;
393 }
394 else {
395 rtn = "<input type=\"hidden\" name=\"command\" value=\"" +
396 command + "\" id=\"h_cmd\" />" ;
397 }
398
399 return rtn;
400 }
401
402 /**
403 * スコープを出力すã‚?hidden を作æ?しますã?
404 *
405 * @return スコープを出力すã‚?hidden
406 */
407 private String getHiddenScope() {
408 String rtn = "";
409
410 if( scope != null ) {
411 rtn = "<input type=\"hidden\" name=\"scope\" value=\"" +
412 scope + "\" />" ;
413 }
414
415 return rtn;
416 }
417
418 /**
419 * 画面IDをå?力すã‚?hidden を作æ?しますã?
420 *
421 * @return 画面IDをå?力すã‚?hidden
422 */
423 private String getGamenId() {
424 String rtn = "<input type=\"hidden\" name=\"GAMENID\" value=\"" +
425 getGUIInfoAttri("KEY") + "\" />";
426
427 return rtn;
428 }
429
430 /**
431 * ペã?ジサイズプルãƒ?‚¦ンメニューを作æ?しますã?
432 *
433 * @og.rev 4.3.6.0 (2008/04/01) idとclassの変更
434 *
435 * @return ペã?ジサイズプルãƒ?‚¦ンメニュー
436 */
437 private String getPageSize() {
438 // String rtn = "";
439
440 // if( usePageSize ) {
441 if( pageSize == null ) {
442 String PAGESIZE = sys( "HTML_PAGESIZE" );
443 pageSize = nval( getRequestValue( "pageSize" ),PAGESIZE ) ;
444 }
445
446 DBColumn column = getDBColumn( "pageSize" );
447 String tag = column.getEditorValue( pageSize );
448
449 // return ( "<td id=\"label\">" +
450 return ( "<td class=\"label pageSize hide\">" + // 4.3.6.0 (2008/04/01) class出åŠ?
451 column.getLongLabel() +
452 ":</td><td class=\"pageSize hide\">" + tag + "</td>" ) ;
453 // }
454
455 // return rtn;
456 }
457
458 /**
459 * 検索時ã?æœ?¤§検索数のプルãƒ?‚¦ンメニューを作æ?しますã?
460 *
461 * @og.rev 4.3.6.0 (2008/04/01) idとclassの変更
462 *
463 * @return æœ?¤§検索数のプルãƒ?‚¦ンメニュー
464 */
465 private String getMaxRowCount() {
466 // String rtn = "";
467
468 // if( useRowCount ) {
469 if( maxRowCount == null ) {
470 String ROW_COUNT = sys( "DB_MAX_ROW_COUNT" );
471 maxRowCount = nval( getRequestValue( "maxRowCount" ), ROW_COUNT ) ;
472 }
473
474 DBColumn column = getDBColumn( "maxRowCount" );
475 String tag = column.getEditorValue( maxRowCount );
476
477 // return ( "<td id=\"label\">" +
478 return ( "<td class=\"label maxRowCount hide\">" + // 4.3.6.0 (2008/04/01) class出åŠ?
479 column.getLongLabel() +
480 ":</td><td class=\"maxRowCount hide\">" + tag + "</td>" ) ;
481 // }
482 // return rtn;
483 }
484
485 /**
486 * debugプルãƒ?‚¦ンメニューを作æ?しますã?
487 *
488 * @og.rev 5.6.5.1 (2013/06/14) 新規追åŠ?
489 *
490 * @return debugプルãƒ?‚¦ンメニュー
491 */
492 private String getDebugClm() {
493 DBColumn column = getDBColumn( "debug" );
494 String tag = column.getEditorValue( "false" );
495
496 return ( "<td class=\"label debug hide\">" +
497 column.getLongLabel() +
498 ":</td><td class=\"debug hide\">" + tag + "</td>" ) ;
499 }
500
501 /**
502 * エãƒ?‚£ãƒ?ƒˆ設定ä¸?¦§のプルãƒ?‚¦ンメニューを作æ?しますã?
503 *
504 * @og.rev 5.3.6.0 (2011/06/01) 新規追åŠ?
505 *
506 * @param configs エãƒ?‚£ãƒ?ƒˆä¸?¦§(配å?)
507 * @param selEditName 選択中のエãƒ?‚£ãƒ?ƒˆå�?
508 *
509 * @return エãƒ?‚£ãƒ?ƒˆä¸?¦§のプルãƒ?‚¦ン
510 */
511 private String getEditSelect( final DBEditConfig[] configs, final String selEditName ) {
512 DBColumn column = getDBColumn( "editName" );
513
514 StringBuilder buf = new StringBuilder();
515 buf.append( "<td class=\"label editName\">" )
516 .append( column.getLongLabel() )
517 .append( ":</td><td class=\"editName\">" )
518 .append( "<select name=\"editName\">" )
519 .append( "<option />" );
520 for( DBEditConfig config : configs ) {
521 String name = config.getEditName();
522 if( name != null && name.length() > 0 ) {
523 buf.append( "<option value=\"" ).append( name ).append( "\"" );
524 if( config.isCommon() ) {
525 buf.append( " class=\"commonEdit\"" );
526 }
527 if( name.equals( selEditName ) ) {
528 buf.append( " selected" );
529 }
530 buf.append( ">" ).append( name ).append( "</option>" );
531 }
532 }
533 buf.append( "</select></td>" );
534 return buf.toString();
535 }
536
537 /**
538 * IEのEnterボタンのためのã€?š しinput出力ã?
539 *
540 * ※å†?ƒ¨コール用
541 *
542 * @og.rev 5.6.1.0 (2013/02/01) 新規作æ?
543 *
544 * @return éš?�—属æ?タグ
545 */
546 private final String getDummyInput() {
547
548 StringBuilder strRet = new StringBuilder( HybsSystem.BUFFER_MIDDLE );
549 Attributes attributes = new Attributes();
550 attributes.set("name",DUMMY_INPUT);
551 attributes.set("value",null);
552 attributes.set("optionAttributes","style='display:none;'");
553 strRet.append( XHTMLTag.input( attributes ) );
554
555 return strRet.toString();
556 }
557
558 /**
559 * 【TAG】リクエストとして送信するコマンドをæŒ?®šしまã�?初期値:NEW)ã€?
560 *
561 * @og.tag
562 * NEW:通常の検索(初期値)?�ENTRY:エントリ登録æ™?
563 *
564 * @param cmd 送信するコマンãƒ?
565 */
566 public void setCommand( final String cmd ) {
567 command = nval( getRequestParameter( cmd ),command );
568 }
569
570 /**
571 * 【TAG】JavaScriptによる初期化ã?タンを使用するかどã�?�‹[true/false]を指定しまã�?初期値:true)ã€?
572 *
573 * @og.tag
574 * 通常の初期化ã?タンでは、HTMLが作æ?された状態に戻すだけですã?例えばã€?
575 * 引数付きで設定された場合ã?そã?引数が設定されてã�?‚‹状態へ戻しますã?
576 * こã?JavaScriptによる初期化ã?タンの場å�?trueの場å�?は、JavaScriptにより
577 * INIT状態でもうä¸?º¦QUERYフレーãƒ?‚’呼び出しますã?で、指定された引数ã‚?
578 * クリアされますã?
579 * 初期値は、true:JavaScriptによる初期化ですã?
580 *
581 * @param flag [true:JavaScriptによる初期åŒ?false:通常のresetボタン]
582 */
583 public void setUseCrear( final String flag ) {
584 useCrear = nval( getRequestParameter( flag ),useCrear );
585 }
586
587 /**
588 * 【TAG】å?型的なボタンの形状に設定しまã�?初期値:null)ã€?
589 *
590 * @og.tag
591 * クエリーボタンでは、検索ボタン以外に、pageSize、maxRowCountã€?
592 * prevNext、timeView などのé ?›®も表示可能ですã?
593 * これらを、å?別に設定可能ですがã€??常使用するタイプとしてã€?¼“タイプを
594 * 用意しますã?これは、設定状態ã?初期値とã�?�ˆますã?
595 * null :通常の検索ボタンで、フルè£?‚™のæŒ?®šですã?
596 * SELECT:?‘件のみ検索するようなケースで使用しますã?
597 * 検索ボタンとクリアボタンのみを表示しますã?
598 * ENTRY :ã�?��なり登録するようなケースで使用しますã?
599 * 登録ボタンとクリアボタンのみを表示しますã?(command="NEW" ですã?)
600 *
601 * @param tp タイプ指å®?null,SELECT,ENTRY)
602 */
603 public void setType( final String tp ) {
604 type = nval( getRequestParameter( tp ),type );
605
606 if( "SELECT".equalsIgnoreCase( type ) ) {
607 accesskey = "F";
608 usePrevNext = false;
609 usePageSize = false;
610 useRowCount = false;
611 useTimeView = false;
612 }
613 else if( "ENTRY".equalsIgnoreCase( type ) ) {
614 accesskey = "W";
615 usePrevNext = false;
616 usePageSize = false;
617 useRowCount = false;
618 useTimeView = false;
619 }
620 }
621
622 /**
623 * 【TAG】リクエストとして送信するスコープをæŒ?®šしまã�?初期値:null)ã€?
624 *
625 * @og.tag
626 * リクエスト時に、付与する引数æƒ??のã�?�¡の、スコープをæŒ?®šしますã?
627 * これは、検索専用画面の場合ã?、scope="request" にする事で、メモリの
628 * 無é§?�ª確保を行わずに、検索結果を表示できますã?
629 * ただしã?そã?結果に対して、NEXT-PREV ã‚??ヘッãƒ??ソートリンクなどの
630 * 機è?が使えなくなりますã?
631 * 通常は、何もæŒ?®šしなã�?жæ…?null)で、RESULT画面の設定に任せるのが良ã�?�§しょã�??
632 * 初期値は、null = session(セãƒ?‚·ョン登録) ですã?
633 *
634 * @param scp [session:セãƒ?‚·ョン登録/request:リクエスト登録]
635 */
636 @Override
637 public void setScope( final String scp ) {
638 scope = nval( getRequestParameter( scp ),scope );
639 }
640
641 /**
642 * 【TAG】検索ボタンに使用するショートカãƒ?ƒˆキーæ–?—をæŒ?®šしまã�?初期値:F)ã€?
643 *
644 * @og.tag
645 * ボタンをã?Alt-XX で実行できるようにするショートカãƒ?ƒˆキーを設定しますã?
646 * 標準では、検索ボタンはã€?F" に設定してã�?�¾すã?で、Alt-F となりますã?
647 * ゼロæ–?—å?を指定すると、ショートカãƒ?ƒˆキーなしに設定できますã?
648 * 初期値は、Find の "F" ですã?
649 *
650 * @og.rev 5.3.6.0 (2011/06/01) accessKeyを削除できるように対å¿?
651 * @og.rev 5.6.0.3 (2012/01/24) getRequestParameter を何度も呼んでã�?‚‹ので修正ã€?
652 *
653 * @param accsKey ショートカãƒ?ƒˆキーæ–??初期値:F)
654 */
655 @Override
656 public void setAccesskey( final String accsKey ) {
657 // accesskey = nval( getRequestParameter( accsKey ),accesskey );
658 String val = getRequestParameter( accsKey );
659 if( val == null || val.length() == 0 ) {
660 accesskey = null;
661 }
662 else {
663 // accesskey = getRequestParameter( accsKey );
664 accesskey = val; // 5.6.0.3 (2012/01/24)
665 }
666 }
667
668 /**
669 * 【TAG】クリアボタンに使用するショートカãƒ?ƒˆキーæ–?—をæŒ?®šしまã�?初期値:C)ã€?
670 *
671 * @og.tag
672 * ボタンをã?Alt-XX で実行できるようにするショートカãƒ?ƒˆキーを設定しますã?
673 * 標準では、検索ボタンはã€?C" に設定してã�?�¾すã?で、Alt-C となりますã?
674 * ゼロæ–?—å?を指定すると、ショートカãƒ?ƒˆキーなしに設定できますã?
675 * 初期値は、Clear の "C" ですã?
676 *
677 * @og.rev 5.3.6.0 (2011/06/01) accessKeyを削除できるように対å¿?
678 * @og.rev 5.6.0.3 (2012/01/24) getRequestParameter を何度も呼んでã�?‚‹ので修正ã€?
679 *
680 * @param accsKey クリアボタンのショートカãƒ?ƒˆキーæ–??初期値:C)
681 */
682 public void setClearAccesskey( final String accsKey ) {
683 // clearAcskey = nval( getRequestParameter( accsKey ),clearAcskey );
684 String val = getRequestParameter( accsKey );
685 if( val == null || val.length() == 0 ) {
686 clearAcskey = null;
687 }
688 else {
689 // clearAcskey = getRequestParameter( accsKey );
690 clearAcskey = val; // 5.6.0.3 (2012/01/24)
691 }
692 }
693
694 /**
695 * 【TAG】é?ã‚?¼�戻るã?prev_next リンクを表示するかどã�?�‹を指定しまã�?初期値:true)ã€?
696 *
697 * @og.tag
698 * 進ã‚?¼�戻るリンクは、RESULT画面にコマンãƒ?FIRST,PREV,NEXT,LAST) とã�?�†
699 * コマンドを送る事で実現してã�?‚‹画像リンクですã?
700 * PREV_NEXT が存在しなã�?”»面では、消去しておくå¿?¦�がありますã?
701 * 初期値は、true(表示する)ですã?
702 *
703 * @param flag prev_next リンクを表示するかどã�?�‹
704 */
705 public void setUsePrevNext( final String flag ) {
706 usePrevNext = nval( getRequestParameter( flag ),usePrevNext );
707 }
708
709 /**
710 * 【TAG】pageSize 引数を使用するかどã�?�‹を指定しまã�?初期値:true)ã€?
711 *
712 * @og.tag
713 * pageSize 引数は、RESULT画面のviewタグで使用する ä¸?›žの表示に
714 * 何件のãƒ??タを表示させるかを指定する引数ですã?
715 * こã?件数が多いと、多くのãƒ??タを見ることがå?来ますが、そのåˆ?¡¨示ã�?
716 * é�?��なりますã?é€?�«、少なã�?�¨、PREV_NEXT を多用することになりã?
717 * 目çš??行を探しå?しにくくなりますã?
718 * pageSize の値は、pageSizeパラメータで画面単位にæŒ?®šするか、シスãƒ?ƒ
719 * パラメータの HTML_PAGESIZE でシスãƒ?ƒ 単位にæŒ?®šできますã?
720 * 初期値は、true(使用する)ですã?
721 *
722 * @param flag pageSize引数を使用するかどã�?�‹
723 * @see #setPageSize( String )
724 */
725 public void setUsePageSize( final String flag ) {
726 usePageSize = nval( getRequestParameter( flag ),usePageSize );
727 }
728
729 /**
730 * 【TAG】maxRowCount 引数を使用するかどã�?�‹を指定しまã�?初期値:true)ã€?
731 *
732 * @og.tag
733 * maxRowCount 引数は、RESULT画面のqueryタグで使用する ä¸?›žの検索時に
734 * 何件のãƒ??タを取得させるかをæŒ?®šする引数ですã?
735 * こã?件数が多いと、多くのãƒ??タを検索することがå?来ますが、そのåˆ?¡¨示ã�?
736 * é�?��なりますã?é€?�«、少なã�?�¨、目çš??行まで探しå?せなã�?�‹もしれませんã€?
737 * maxRowCount の値は、rowCountパラメータで画面単位にæŒ?®šするか、シスãƒ?ƒ
738 * パラメータの DB_MAX_ROW_COUNT でシスãƒ?ƒ 単位にæŒ?®šできますã?
739 *
740 * 初期値は、true(使用する)ですã?
741 *
742 * @param flag maxRowCount引数を使用するかどã�?�‹
743 * @see #setMaxRowCount( String )
744 */
745 public void setUseRowCount( final String flag ) {
746 useRowCount = nval( getRequestParameter( flag ),useRowCount );
747 }
748
749 /**
750 * 【TAG】å?ç�?™‚間を表示する TimeView を表示するかどã�?�‹を指定しまã�?初期値:true)ã€?
751 *
752 * @og.tag
753 * true に設定すると、å?ç�?™‚間を表示するバã?イメージが表示されますã?
754 * これは、DB検索、APサーバã?処ç�??画面表示のå�??ç�?™‚間をバã?イメージで
755 * 表示させる機è?ですã?処ç�?™‚間ã?目安になりますã?
756 * 初期値は、true ですã?
757 *
758 * @param flag TimeView表示をするかどã�?�‹(初期値:true)
759 */
760 public void setUseTimeView( final String flag ) {
761 useTimeView = nval( getRequestParameter( flag ),useTimeView );
762 }
763
764 /**
765 * 【TAG】pageSize プルãƒ?‚¦ンメニューの初期値を指定しまã�?
766 * (初期値:HTML_PAGESIZE[={@og.value org.opengion.hayabusa.common.SystemData#HTML_PAGESIZE}])ã€?
767 *
768 * @og.tag
769 * プルãƒ?‚¦ンメニューを表示する場合ã?初期値を指定しますã?
770 * (初期値:ユーザー定数のHTML_PAGESIZE[={@og.value org.opengion.hayabusa.common.SystemData#HTML_PAGESIZE}])ã€?
771 *
772 * @param pSize プルãƒ?‚¦ンメニューの初期値
773 * @see #setUsePageSize( String )
774 * @see org.opengion.hayabusa.common.SystemData#HTML_PAGESIZE
775 */
776 public void setPageSize( final String pSize ) {
777 pageSize = nval( getRequestParameter( pSize ),pageSize );
778 }
779
780 /**
781 * 【TAG】maxRowCount プルãƒ?‚¦ンメニューの初期値を指定しまã�?
782 * (初期値:DB_MAX_ROW_COUNT[={@og.value org.opengion.hayabusa.common.SystemData#DB_MAX_ROW_COUNT}])ã€?
783 *
784 * @og.tag
785 * プルãƒ?‚¦ンメニューを表示する場合ã?初期値を指定しますã?
786 * (初期値:ユーザー定数のDB_MAX_ROW_COUNT[={@og.value org.opengion.hayabusa.common.SystemData#DB_MAX_ROW_COUNT}])ã€?
787 *
788 * @param maxSize maxRowCountプルãƒ?‚¦ンメニューの初期値
789 * @see #setUseRowCount( String )
790 * @see org.opengion.hayabusa.common.SystemData#DB_MAX_ROW_COUNT
791 */
792 public void setMaxRowCount( final String maxSize ) {
793 maxRowCount = nval( getRequestParameter( maxSize ),maxRowCount );
794 }
795
796 /**
797 * 【TAG】ダミã?のinputタグ(display:none)をå?力するか設定しますã?
798 * (初期値:USE_DUMMY_INPUT[={@og.value org.opengion.hayabusa.common.SystemData#USE_DUMMY_INPUT}])ã€?
799 *
800 * @og.tag
801 * ãƒ?ƒŸーのinputタグ(display:none)をå?力するか設定しますã?
802 * IEではinputが1つã�?�‘の場合にエンターでのsubmitが上手くいかなã�?�Ÿめã?ãƒ?ƒŸーをé?置するå¿?¦�がありますã?
803 * trueに設定するとWriteCheckタグがダミã?を(常に?‰å?力しますã?
804 * (初期値:USE_DUMMY_INPUT[={@og.value org.opengion.hayabusa.common.SystemData#USE_DUMMY_INPUT}])ã€?
805 *
806 * @og.rev 5.6.1.0 (2013/02/01) 新規追åŠ?
807 *
808 * @param flag 出力[する(true)/しなã�?false)]
809 * @see org.opengion.hayabusa.common.SystemData#USE_DUMMY_INPUT
810 */
811 public void setUseDummy( final String flag ) {
812 useDummy = nval( getRequestParameter( flag ), useDummy );
813 }
814
815 /**
816 * こã?オブジェクトã?æ–?—å?表現を返しますã?
817 * 基本çš?�«ãƒ?ƒ�ãƒ?‚°目çš?�«使用しますã?
818 *
819 * @return こã?クラスのæ–?—å?表現
820 */
821 @Override
822 public String toString() {
823 return org.opengion.fukurou.util.ToString.title( this.getClass().getName() )
824 .println( "VERSION" ,VERSION )
825 .println( "command" ,command )
826 .println( "pageSize" ,pageSize )
827 .println( "maxRowCount" ,maxRowCount )
828 .println( "accesskey" ,accesskey )
829 .println( "scope" ,scope )
830 .println( "useCrear" ,useCrear )
831 .println( "usePrevNext" ,usePrevNext )
832 .println( "usePageSize" ,usePageSize )
833 .println( "useRowCount" ,useRowCount )
834 .println( "useTimeView" ,useTimeView )
835 .println( "body" ,body )
836 .println( "Other..." ,getAttributes().getAttribute() )
837 .fixForm().toString() ;
838 }
839 }