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