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    }