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    }