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