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 */ 016package org.opengion.hayabusa.taglib; 017 018import static org.opengion.fukurou.util.StringUtil.nval; 019 020import java.io.IOException; 021import java.io.ObjectInputStream; 022import java.io.ObjectOutputStream; 023import java.util.Map; 024 025import org.opengion.fukurou.util.StringUtil; 026import org.opengion.hayabusa.common.HybsSystem; 027import org.opengion.hayabusa.common.HybsSystemException; 028import org.opengion.hayabusa.db.DBColumn; 029import org.opengion.hayabusa.db.DBColumnConfig; 030import org.opengion.hayabusa.db.DBTableModel; 031import org.opengion.hayabusa.resource.CodeData; 032import org.opengion.hayabusa.resource.LabelData; 033 034/** 035 * 検索結果のカラムに対して様々な属性を付加するタグです。 036 * 037 * このタグでは、カラムリソースの属性を再設定できます。検索結果(DBTableModel) 038 * には、カラムオブジェクト(DBColumn)を持っています。このオブジェクトは、 039 * カラムリソースで設定した値を持っています。その個々の値を再設定することで、 040 * カラムオブジェクトの属性をその都度設定しなおすことができます。 041 * 最もよく使用するのは、must 属性の設定と、DBMENU エディターの設定です。 042 * must属性は、予め必須項目として指定することが出来ない為、画面毎に再設定が 043 * 必要です。ただし、ここでのmust属性は、カラムの表示色を変更するだけで、 044 * 実際のnullチェックは、columnCheck タグのnullCheck属性で指定します。 045 * DBMENU エディターは、データベースの属性から選択リストを作成する機能ですが、 046 * これも、マスタ登録時は、テキストフィールドで入力し、使用時は、選択するケース 047 * の様に、画面毎に異なる形式で使用したい場合があるためです。 048 * このタグでは、カラムオブジェクトの属性以外に、HTMLの属性を付加する事も 049 * できます。 050 * 051 * @og.formSample 052 * ●形式:<og:ColumnEditor column="・・・" ・・・ > ・・・ </og:ColumnEditor > 053 * ●body:あり(EVAL_BODY_BUFFERED:BODYを評価し、{@XXXX} を解析します) 054 * 055 * ●Tag定義: 056 * <og:columnEditor 057 * column 【TAG】カラム名をセットします 058 * columns 【TAG】カラム名をカンマ区切りで複数セットします 059 * label 【TAG】ラベルリソースに定義されたラベルIDをセットします 060 * className 【TAG】カラムのクラス名(VARCHAR2,NUMBER など)をセットします 061 * size 【TAG】カラムの表示サイズをセットします(大きさだけで入力文字制限ではありません) 062 * maxlength 【TAG】カラムの入力文字制限数をセットします 063 * writable 【TAG】カラムが書き込み可能かどうか[true/false]をセットします(初期値:null) 064 * renderer 【TAG】カラムの表示用レンデラー({@og.doc03Link renderer Renderer_****})をセットします 065 * editor 【TAG】カラムの編集用エディター({@og.doc03Link editor Editor_****})をセットします 066 * dbType 【TAG】DBタイプ({@og.doc03Link dbType DBType_****})をセットします 067 * codeName 【TAG】コードセレクトのユニークキー(コード名称)をセットします 068 * codeList 【TAG】コードセレクトのサブセットとなるコードをCSV形式で指定します 069 * codeGroup 【TAG】コードセレクトのサブセットとなるグループを指定します 070 * defaultVal 【TAG】初期値をセットします 071 * param 【TAG】パラメータをセットします 072 * roles 【TAG】ロールをセットします 073 * must 【TAG】必須入力を表す色に変えるかどうか[true/false]を指定します(初期値:false) 074 * mustAny 【TAG】選択必須入力(どれかひとつ必須)を表す色[true/mustAny/その他]を指定します(初期値:無指定) 075 * optionAttributes 【TAG】JavaScript などの HTML基本タグ以外の属性を、そのままタグとして使用します 076 * addNoValue 【TAG】コンボボックスの値なしのOptionの有無[true/false]を指定します(初期値:falseと同等) 077 * useLabelMap 【TAG】SQL文を指定してラベル情報を動的に読み込むかどうか[true/false]指定します(初期値:false) 078 * useSLabel 【TAG】MENU,DBMENUでSLABELを利用するかどうか[auto/true/false]を指定します(初期値:null) 079 * noDisplayVal 【TAG】指定の値を非表示にします(レンデラーのみ有効)(初期値:null) 080 * scope 【TAG】キャッシュする場合のスコープ[request/page/session/applicaton]を指定します(初期値:session) 081 * tableId 【TAG】(通常使いません)sessionから所得する DBTableModelオブジェクトの ID 082 * dbid 【TAG】(通常使いません)データベースへ接続する場合のID 083 * caseKey 【TAG】このタグ自体を利用するかどうかの条件キーを指定します(初期値:null) 084 * caseVal 【TAG】このタグ自体を利用するかどうかの条件値を指定します(初期値:null) 085 * caseNN 【TAG】指定の値が、null/ゼロ文字列 でない場合(Not Null=NN)は、このタグは使用されます(初期値:true) 086 * caseNull 【TAG】指定の値が、null/ゼロ文字列 の場合は、このタグは使用されます(初期値:true) 087 * lang 【HTML】要素の内容と他の属性値の言語(lang,xml:lang)を指定します 088 * style 【HTML】この要素に対して適用させるスタイルシート(style)を設定します 089 * clazz 【HTML】要素に対して class 属性を設定します 090 * onClick 【HTML】JavaScriptのイベント onClick を設定します(例:onClick="renew('query.jsp','QUERY');") 091 * onChange 【HTML】JavaScriptのイベント onChange を設定します(例:onChange="renew('query.jsp','QUERY');") 092 * onBlur 【HTML】JavaScriptのイベント onBlur を設定します(例:onBlur="this.value=value.toUpperCase();") 093 * onFocus 【HTML】JavaScriptのイベント onFocus を設定します 094 * ondblClick 【HTML】JavaScriptのイベント ondblClick を設定します 095 * onMouseDown 【HTML】JavaScriptのイベント onMouseDown を設定します 096 * onMouseUp 【HTML】JavaScriptのイベント onMouseUp を設定します 097 * onMouseMove 【HTML】JavaScriptのイベント onMouseMove を設定します 098 * onMouseOut 【HTML】JavaScriptのイベント onMouseOut を設定します 099 * onMouseOver 【HTML】JavaScriptのイベント onMouseOver を設定します 100 * onSelect 【HTML】JavaScriptのイベント onSelect を設定します 101 * onKeydown 【HTML】JavaScriptのイベント onKeydown を設定します 102 * onKeypress 【HTML】JavaScriptのイベント onKeypress を設定します 103 * onKeyup 【HTML】JavaScriptのイベント onKeyup を設定します 104 * autocomplete 【HTML5】入力候補を提示して入力内容を自動補完する[on/off](初期値はon)。 105 * autofocus 【HTML5】指定した入力欄にカーソルが当たって自動的にフォーカスされます。 106 * pattern 【HTML5】正規表現で入力値のパターンを指定します。 107 * placeholder 【HTML5】入力欄に初期表示する内容を指定します。 108 * required 【HTML5】入力必須を指定します 109 * list 【HTML5】ユーザーに入力候補として提案するデータリストの要素のid属性の値を指定します。 110 * min 【HTML5】入力欄で入力できる最小値を指定します。 111 * max 【HTML5】入力欄で入力できる最大値を指定します。 112 * step 【HTML5】入力欄で刻むステップ値を指定する。 113 * type 【HTML5】HTML5追加分[text/search/tel/url/email/datetime/date/month/week/time/datetime-local/number/range/color] 114 * eventColumn 【TAG】イベントカラム(親カラム)のセット 115 * eventURL 【TAG】eventColumn利用時に呼ばれるJSPのURL 116 * eventCallback 【TAG】eventColumn実行後のcallbak関数指定 117 * noResource 【TAG】ResourceManager を使用しないかどうか[true/false]を指定します(初期値:false) 118 * stringOutput 【TAG】レンデラ利用のExcel出力時にセルタイプを文字列にするかどうか(初期値:true) 119 * debug 【TAG】デバッグ情報を出力するかどうか[true/false]を指定します(初期値:false) 120 * > ... Body ... 121 * </og:columnEditor> 122 * 123 * ●使用例: 124 * ・必須表示の場合 125 * <og:columnEditor column="NOSYN" must="true" /> 126 * 127 * ・DBからのコンボボックスの場合 128 * <og:columnEditor column="CDBK" editor="DBMENU"> 129 * select CDBK,CDBK||':'||NMBK from DB02 order by 1 130 * </og:columnEditor> 131 * 132 * ・親子関係のプルダウンを作る場合 133 * ({@xxx.value}で同じ行のxxxカラムで選択した値を取得します) 134 * <og:columnEditor column="CDBK" editor="DBMENU" 135 * eventColumn="OYA"> 136 * select CDBK,CDBK||':'||NMBK from DB02 137 * where CLM = {@OYA.value} order by 1 138 * </og:columnEditor> 139 * 140 * 141 * @og.rev 3.5.1.0 (2003/10/03) 親クラスをCommonTagSupportからHTMLTagSupportに変更。 142 * @og.group 画面表示 143 * 144 * @version 4.0 145 * @author Kazuhiko Hasegawa 146 * @since JDK5.0, 147 */ 148public class ColumnEditorTag extends HTMLTagSupport { 149 //* このプログラムのVERSION文字列を設定します。 {@value} */ 150 private static final String VERSION = "5.7.6.3 (2014/05/23)" ; 151 152 private static final long serialVersionUID = 576320140523L ; 153 154 // 5.7.1.0 (2013/12/06) HTML5 で新たに追加された、type を追加 155 private static final String CHECK_TYPE = "|text|search|tel|url|email|datetime|date|month|week|time|datetime-local|number|range|color|" ; 156 157 private transient LabelData labelData = null; 158 private String tableId = HybsSystem.TBL_MDL_KEY; 159 private String[] columns = null; // 3.7.0.5 (2005/04/11) 160 private boolean allColumns = false; // 3.8.8.5 (2007/03/09) 161 private String className = null; 162 private String size = null; 163 private String maxlength = null; // 3.5.5.5 (2004/04/23) 164 private String writable = null; 165 private String renderer = null; 166 private String editor = null; 167 private String dbType = null; 168 private String codeName = null; // 3.5.5.7 (2004/05/10) 169 private String codeList = null; // 5.1.9.0 (2010/08/01) 新規追加(Codeリソースのサブセット) 170 private String codeGroup = null; // 5.1.9.0 (2010/08/01) 新規追加(Codeリソースのサブセット) 171 private String defaultVal = null; 172 private String parameter = null; 173 private String dbid = null; 174 private String addNoValue = null; // 3.5.5.9 (2004/06/07) 175 private static final String DEFAULT_ADD_NO_VALUE = "true"; // 3.7.0.5 (2005/04/11) 176 177 private String eventColumn = null; // 4.3.6.0 (2009/04/01) イベントカラム 178 private String rawParameter = null; // 4.3.6.0 (2009/04/01) 生パラメータ 179 private String eventURL = null; // 4.3.6.0 (2009/04/01) イベントURL 180 181 // 4.3.4.0 (2008/12/01) ラベルデータの動的取得に対応します。 182 private boolean useLabelMap = false; // 4.3.4.0 (2008/12/01) 183 private String useSLabel = null; // 5.6.2.3 (2013/03/22) MENU,DBMENUでSLABELを利用するかどうか 184 private String noDisplayVal = null; // 5.6.2.3 (2013/03/22) 非表示文字の設定 185 private Map<String,LabelData> labelMap = null; 186 187 // 5.7.3.0 (2014/02/07) ResourceManager を使用しないかどうか[true/false]を指定 188 private boolean noResource = false; 189 190 private boolean stringOutput = HybsSystem.sysBool( "USE_STRING_EXCEL_OUTPUT" ); // 5.7.6.3 (2014/05/23) 191 192 /** 193 * Taglibの開始タグが見つかったときに処理する doStartTag() を オーバーライドします。 194 * 195 * @og.rev 3.1.0.0 (2003/03/20) DBColumnConfig#getColumnConfig() メソッド廃止 196 * @og.rev 3.1.1.0 (2003/03/28) ボディの内容を取得する処理を、CommonTagSupport で行う。 197 * @og.rev 3.1.1.2 (2003/04/04) Tomcat4.1 対応。ボディが存在する場合のみボディが呼ばれる対応。 198 * @og.rev 3.5.1.0 (2003/10/03) 親クラスをCommonTagSupportからHTMLTagSupportに変更。 199 * @og.rev 3.5.5.5 (2004/04/23) 入力欄の大きさを指定する viewSize 属性を追加。 200 * @og.rev 3.5.5.7 (2004/05/10) CodeSelection を、codeName を元に構築できるように設定します。 201 * @og.rev 3.5.5.9 (2004/06/07) addNoValue が、設定された場合のみ、config に設定します 202 * @og.rev 3.7.0.5 (2005/04/11) 複数カラムを同時設定できる columns 属性を追加 203 * @og.rev 5.2.2.0 (2010/11/01) caseKey 、caseVal 属性対応 204 * 205 * @return 後続処理の指示( EVAL_BODY_BUFFERED ) 206 */ 207 @Override 208 public int doStartTag() { 209 // 5.2.2.0 (2010/11/01) caseKey 、caseVal 属性対応 210 if( useTag() ) { 211 if( "DBMENU".equalsIgnoreCase(editor) ) { 212 className = "VARCHAR2"; 213 renderer = "DBMENU"; 214 editor = "DBMENU"; 215 216 if( addNoValue == null ) { 217 addNoValue = DEFAULT_ADD_NO_VALUE ; 218 } 219 } 220 221 return EVAL_BODY_BUFFERED ; 222 } 223 return SKIP_BODY ; // Body を評価しない 224 } 225 226 /** 227 * Taglibのタグ本体を処理する doAfterBody() を オーバーライドします。 228 * 229 * @og.rev 2.3.1.3 (2003/02/08) ラベル、サイズのみでも変更できるように修正 230 * @og.rev 3.0.0.1 (2003/02/14) DBMENU作成時に、ラベルの最後のスペースを除去する。 231 * @og.rev 3.1.0.0 (2003/03/20) DBColumnConfig#getColumnConfig() メソッド廃止 232 * @og.rev 3.1.1.0 (2003/03/28) ボディの内容を取得する処理を、CommonTagSupport で行う。 233 * @og.rev 3.1.1.2 (2003/04/04) Tomcat4.1 対応。ボディが存在する場合のみボディが呼ばれる対応。 234 * @og.rev 3.5.0.0 (2003/09/17) キー、ラベルともに、""(ダブルコーテーション)で囲うように変更。 235 * @og.rev 3.5.5.7 (2004/05/10) このタグでSQLを発行するのではなく、DBMENU の DBColumnを作成する。 236 * @og.rev 3.5.5.9 (2004/06/07) addNoValue が null の場合は、初期値を設定します。 237 * @og.rev 3.7.0.5 (2005/04/11) 複数カラムを同時設定できる columns 属性を追加 238 * @og.rev 3.8.6.3 (2006/11/30) SQL 文の前後のスペースを取り除きます。 239 * @og.rev 4.3.4.0 (2008/12/01) ラベルデータの動的取得に対応します。 240 * @og.rev 4.3.6.0 (2009/04/01) イベントカラム対応 241 * @og.rev 5.1.7.0 (2010/06/01) 動的プルダウン実装見直し 242 * @og.rev 5.5.4.0 (2012/07/02) 予約語対応 243 * 244 * @return 後続処理の指示(SKIP_BODY) 245 */ 246 @Override 247 public int doAfterBody() { 248 String sql = getBodyString(); 249 if( sql != null && sql.length() > 0 ) { 250 if( useLabelMap ) { labelMap = getResource().getLabelMap( sql.trim() ); } // 4.3.4.0 (2008/12/01) 251 else { 252 if( eventColumn != null && eventColumn.length() >0 ){ // 4.3.6.0 (2009/04/01) 253 rawParameter = getReservedParameter(getBodyRawString().trim()); // 5.5.4.0 (2012/07/01) 254 } 255 parameter = sql.trim() ; 256 } 257 } 258 259 return SKIP_BODY ; 260 } 261 262 /** 263 * Taglibの終了タグが見つかったときに処理する doEndTag() を オーバーライドします。 264 * 265 * @og.rev 3.1.1.2 (2003/04/04) Tomcat4.1 対応。release2() を doEndTag()で呼ぶ。 266 * @og.rev 3.1.1.2 (2003/04/04) Tomcat4.1 対応。ボディが存在する場合のみボディが呼ばれる対応。 267 * @og.rev 3.7.0.5 (2005/04/11) 複数カラムを同時設定できる columns 属性を追加 268 * @og.rev 3.8.8.5 (2007/03/09) 全カラム が指定されたことにする allColumns 属性を追加 269 * @og.rev 4.1.2.1 (2008/03/13) must , mustAny 属性を自動化します。 270 * @og.rev 4.3.4.0 (2008/12/01) カラム指定のワイルドカード対応 271 * @og.rev 5.2.1.0 (2010/10/01) must , mustAny 属性の処理を、HTMLTagSupport に移します。 272 * @og.rev 5.2.2.0 (2010/11/01) caseKey 、caseVal 属性対応 273 * 274 * @return 後続処理の指示 275 */ 276 @Override 277 public int doEndTag() { 278 debugPrint(); // 4.0.0 (2005/02/28) 279 // 5.2.2.0 (2010/11/01) caseKey 、caseVal 属性対応 280 if( !useTag() ) { return EVAL_PAGE; } 281 282 DBTableModel table = (DBTableModel)getObject( tableId ); 283 if( table == null ) { return EVAL_PAGE; } 284 285 if( columns != null ) { 286 // 3.8.8.5 (2007/03/09) 全カラム が指定 287 String mustType = getMustType(); // 5.2.1.0 (2010/10/01) 288 if( allColumns ) { 289 int len = table.getColumnCount(); 290 for( int i=0; i<len; i++ ) { 291 292 // 4.3.4.0 (2008/12/01) 293 DBColumn dbColumn = table.getDBColumn( i ); 294 for( int j=0; j<columns.length; j++ ) { 295 String prefix = columns[j].replace( "*", "" ); 296 if( dbColumn.getName().indexOf( prefix ) == 0 ) { // 前方一致のみ対応 297 DBColumnConfig config = getModifyConfig( dbColumn ); 298 table.setDBColumn( i,new DBColumn( config ) ); 299 300 // 4.1.2.1 (2008/03/13) 301 if( mustType != null ) { 302 table.addMustType( i,mustType ); 303 } 304 break; 305 } 306 } 307 } 308 } 309 else { 310 for( int i=0; i<columns.length; i++ ) { 311 int clmNo = table.getColumnNo( columns[i] ); 312 DBColumn dbColumn = table.getDBColumn( clmNo ); 313 DBColumnConfig config = getModifyConfig( dbColumn ); 314 table.setDBColumn( clmNo,new DBColumn( config ) ); 315 316 // 4.1.2.1 (2008/03/13) 317 if( mustType != null ) { 318 table.addMustType( clmNo,mustType ); 319 } 320 } 321 } 322 } 323 324 return EVAL_PAGE ; 325 } 326 327 /** 328 * 検索条件の入力用のテキストフィールドを作成します。 329 * 330 * テーブルタグによりフィールドは分割されます。 331 * 使用時は、テーブルタグを前後に使用して下さい。 332 * このクラスでは、このメソッドは、使われておりません。 333 * 334 * @og.rev 3.5.1.0 (2003/10/03) 新規追加 335 * 336 * @return 入力用のテキストフィールドタグ 337 */ 338 @Override 339 protected String makeTag() { 340 return null; 341 } 342 343 /** 344 * タグリブオブジェクトをリリースします。 345 * 346 * キャッシュされて再利用されるので、フィールドの初期設定を行います。 347 * 348 * @og.rev 2.0.0.4 (2002/09/27) カスタムタグの release() メソッドを、追加 349 * @og.rev 3.1.1.2 (2003/04/04) Tomcat4.1 対応。release2() を doEndTag()で呼ぶ。 350 * @og.rev 3.5.1.0 (2003/10/03) 親クラスをCommonTagSupportからHTMLTagSupportに変更。 351 * @og.rev 3.5.5.5 (2004/04/23) 入力欄の大きさを指定する viewSize 属性を追加。 352 * @og.rev 3.5.5.7 (2004/05/10) codeName 属性を追加。 353 * @og.rev 3.5.5.9 (2004/06/07) addNoValue 属性を修正。 354 * @og.rev 3.7.0.5 (2005/04/11) 複数カラムを同時設定できる columns 属性を追加 355 * @og.rev 3.8.8.5 (2007/03/09) 全カラム が指定されたことにする allColumns 属性を追加 356 * @og.rev 4.1.2.1 (2008/03/13) must , mustAny 属性を自動化します。 357 * @og.rev 4.3.4.0 (2008/12/01) ラベルデータの動的取得に対応します。 358 * @og.rev 5.1.9.0 (2010/08/01) codeList , codeGroup 属性を追加。(Codeリソースのサブセット) 359 * @og.rev 5.2.1.0 (2010/10/01) must , mustAny 属性の処理を、HTMLTagSupport に移します。 360 * @og.rev 5.6.2.3 (2013/03/22) useSLabel 属性を追加。(MENU,DBMENUでSLABELを利用するかどうか) 361 * @og.rev 5.6.2.3 (2013/03/22) 非表示文字の設定。noDisplayVal 属性を追加。 362 * @og.rev 5.7.3.0 (2014/02/07) noResource 属性を追加。ResourceManager を使用しないかどうか 363 * @og.rev 5.7.6.3 (2014/05/23) stringOutput追加 364 */ 365 @Override 366 protected void release2() { 367 super.release2(); 368 tableId = HybsSystem.TBL_MDL_KEY; 369 columns = null; // 3.7.0.5 (2005/04/11) 370 allColumns = false; // 3.8.8.5 (2007/03/09) 371 labelData = null; // 4.0.0 (2005/01/31) 372 className = null; 373 size = null; 374 maxlength = null; // 3.5.5.5 (2004/04/23) 375 writable = null; 376 renderer = null; 377 editor = null; 378 dbType = null; 379 codeName = null; // 3.5.5.7 (2004/05/10) 380 codeList = null; // 5.1.9.0 (2010/08/01) 新規追加(Codeリソースのサブセット) 381 codeGroup = null; // 5.1.9.0 (2010/08/01) 新規追加(Codeリソースのサブセット) 382 defaultVal = null; 383 parameter = null; 384 dbid = null; 385 addNoValue = null; // 3.5.5.9 (2004/06/07) 386 useLabelMap = false; // 4.3.4.0 (2008/12/01) 387 useSLabel = null; // 5.6.2.3 (2013/03/22) MENU,DBMENUでSLABELを利用するかどうか 388 noDisplayVal = null; // 5.6.2.3 (2013/03/22) 非表示文字の設定 389 labelMap = null; // 4.3.4.0 (2008/12/01) 390 eventColumn = null; // 4.3.6.0 (2009/04/01) 391 rawParameter = null; // 4.3.6.0 (2009/04/01) 392 eventURL = null; // 4.3.6.0 (2009/04/01) 393 noResource = false; // 5.7.3.0 (2014/02/07) noResource 属性を追加。 394 stringOutput = HybsSystem.sysBool( "USE_STRING_EXCEL_OUTPUT" ); // 5.7.6.3 (2014/05/23) 395 } 396 397 /** 398 * カスタマイズされた DBColumnConfig を作成します。 399 * 400 * DBColumnConfig は、DBColumn より取得します。この DBColumnConfig に、 401 * 属性で指定された値をセットすることで、カスタマイズを行います。 402 * 403 * @og.rev 3.7.0.5 (2005/04/11) 新規追加 404 * @og.rev 4.1.2.1 (2008/03/13) must , mustAny 属性を自動化します。 405 * @og.rev 4.3.4.0 (2008/12/01) ラベルデータの動的取得に対応します。 406 * @og.rev 4.3.6.0 (2009/04/01) evnetColumn対応 407 * @og.rev 5.1.8.0 (2010/07/01) メソッド名変更(setDefValue ⇒ setDefault) 408 * @og.rev 5.1.9.0 (2010/08/01) codeList ,codeGroup 属性を追加(Codeリソースのサブセット) 409 * @og.rev 5.6.2.3 (2013/03/22) useSLabel 属性を追加。(MENU,DBMENUでSLABELを利用するかどうか) 410 * @og.rev 5.6.2.3 (2013/03/22) 非表示文字の設定。noDisplayVal 属性を追加。 411 * @og.rev 5.7.3.0 (2014/02/07) noResource 属性を追加。ResourceManager を使用しないかどうか 412 * @og.rev 5.7.6.2 (2014/05/16) IEのHTML5機能が無効の場合の処理 413 * @og.rev 5.7.6.3 (2014/05/23) stringOutput追加 414 * 415 * @param dbColumn カラムオブジェクト 416 * 417 * @return カスタマイズされた DBColumnConfig 418 */ 419 private DBColumnConfig getModifyConfig( final DBColumn dbColumn ) { 420 // 5.7.3.0 (2014/02/07) noResource 属性を追加 421 if( noResource ) { 422 labelData = new LabelData( dbColumn.getName() ); 423 renderer = "LABEL"; 424 } 425 426 DBColumnConfig config = dbColumn.getConfig(); 427 428 // 5.7.6.2 (2014/05/16) IEのHTML5機能が無効の場合の処理 429 String ieHTML5 = (String)getSessionAttribute( HybsSystem.IE_HTML5_KEY ); 430 if( "FALSE".equalsIgnoreCase( ieHTML5 ) ) { 431 if( "DATALIST".equalsIgnoreCase( editor ) || 432 "DATALIST".equalsIgnoreCase( config.getEditor() ) ) { 433 editor = "INDBMENU"; 434 } 435 } 436 437 String lang = get( "lang" ); // 4.0.0 (2005/01/31) super クラスで受けます。 438 439 if( lang != null ) { config.setLang( lang ); } 440 if( labelData != null ) { config.setLabelData( labelData ); } // 4.0.0 (2005/01/31) 441 if( className != null ) { config.setClassName( className ); } 442 if( size != null ) { config.setViewLength(size ); } 443 if( maxlength != null ) { config.setMaxlength( maxlength ); } // 3.5.5.5 (2004/04/23) 444 if( writable != null ) { config.setWritable( writable ); } 445 if( renderer != null ) { config.setRenderer( renderer ); } 446 if( editor != null ) { config.setEditor( editor ); } 447 if( dbType != null ) { config.setDbType( dbType ); } 448 if( defaultVal != null ) { config.setDefault( defaultVal ); } // 5.1.8.0 (2010/07/01) 449 if( parameter != null ) { config.setParameter( parameter ); } 450 if( dbid != null ) { config.setDbid( dbid ); } 451 if( eventColumn != null ) { config.setEventColumn(eventColumn); } // 4.3.6.0 (2009/04/01) 452 if( eventURL != null ) { config.setEventURL( eventURL ); } // 4.3.6.0 (2009/04/01) 453 if( rawParameter != null ){ config.setRawParameter( rawParameter ); } // 4.3.6.0 (2009/04/01) 454 if( useSLabel != null ) { config.setUseSLabel( useSLabel ); } // 5.6.2.3 (2013/03/22) 455 if( noDisplayVal != null ) { config.setNoDisplayVal( noDisplayVal ); } // 5.6.2.3 (2013/03/22) 456 457 // 4.0.0 (2005/11/30) ロールを指定 458 String roles = get( "roles" ); 459 if( roles != null ) { config.setRoles( roles ); } 460 461 // 4.0.0 (2005/01/31) 462 if( codeName != null ) { 463 CodeData codeData = getResource().getCodeData( codeName ) ; 464 config.setCodeData( codeData ); 465 } 466 467 // codeName で指定のリソースでも、サブセットが作成できます。 468 // 5.1.9.0 (2010/08/01) codeList 属性を追加(Codeリソースのサブセット) 469 if( codeList != null ) { 470 CodeData codeData = config.getCodeData() ; 471 if( codeData != null ) { 472 config.setCodeData( codeData.subsetList( codeList ) ); 473 } 474 } 475 476 // 5.1.9.0 (2010/08/01) codeGroup 属性を追加(Codeリソースのサブセット) 477 if( codeGroup != null ) { 478 CodeData codeData = config.getCodeData() ; 479 if( codeData != null && codeData.useGroup() ) { 480 config.setCodeData( codeData.subsetGroup( codeGroup ) ); 481 } 482 } 483 484 // 3.5.5.9 (2004/06/07) 485 // 注意:addNoValue は、互換性の関係で、値が指定された場合のみ、 486 // config に設定します。 487 // editor="DBMENU" が、指定された場合は、addNoValue が指定されていない場合のみ、 488 // 従来との互換性の関係より、このクラスのデフォルト(true)を、config に設定します。 489 if( addNoValue != null ) { 490 boolean anv = Boolean.valueOf( addNoValue ).booleanValue() ; 491 config.setAddNoValue( anv ); 492 } 493 494 // 3.5.1.0 (2003/10/03) 親クラスをCommonTagSupportからHTMLTagSupportに変更。 495 config.setEditorAttributes( getAttributes() ); 496 497 // 4.3.4.0 (2008/12/01) ラベルデータの動的取得に対応します。 498 if( useLabelMap && labelMap != null ) { 499 LabelData ldata = labelMap.get( dbColumn.getName() ); 500 if( ldata != null ) { 501 config.setLabelData( ldata ); 502 } 503 } 504 505 // 5.7.6.3 (2014/05/23) 506 config.setStringOutput( stringOutput ); 507 508 return config ; 509 } 510 511 /** 512 * 【TAG】カラム名をセットします。 513 * 514 * @og.tag 515 * カラム名をセットします。 516 * columns と同時にはセットできません。 517 * 値に"*"を指定することで、全カラムを対象とすることができます。 518 * また、"PN*,CDK*"等のように前方一致でのワイルドカード指定も可能です。 519 * 520 * @og.rev 3.7.0.5 (2005/04/11) 複数カラムを同時設定できる columns 属性を追加 521 * @og.rev 3.8.8.5 (2007/03/09) 全カラム が指定されたことにする allColumns 属性を追加 522 * 523 * @param clm ネーム 524 */ 525 public void setColumn( final String clm ) { 526 if( columns != null ) { 527 String errMsg = "columns との同時セットは出来ません。: " + HybsSystem.CR 528 + "column=[" + clm + "] , " 529 + "columns=[" + StringUtil.array2csv( columns ) + "]"; 530 throw new HybsSystemException( errMsg ); 531 } 532 String column = getRequestParameter( clm ); 533 if( column != null && column.length() > 0 ) { 534 columns = new String[] { column }; 535 allColumns = column.indexOf( '*' ) >= 0 ; // 3.8.8.5 (2007/03/09) 536 } 537 } 538 539 /** 540 * 【TAG】カラム名をカンマ区切りで複数セットします。 541 * 542 * @og.tag 543 * カラム名をセットします。 544 * column と同時にはセットできません。 545 * 分解方法は、通常のパラメータ取得後に、CSV分解します。 546 * 値に"*"を指定することで、全カラムを対象とすることができます。 547 * また、"PN*,CDK*"等のように前方一致でのワイルドカード指定も可能です。 548 * 549 * @og.rev 3.7.0.5 (2005/04/11) 複数カラムを同時設定できる columns 属性を追加 550 * @og.rev 3.8.8.5 (2007/03/09) 通常のパラメータ取得後に、CSV分解に戻します。 551 * @og.rev 3.8.8.5 (2007/03/09) 全カラム が指定されたことにする allColumns 属性を追加 552 * 553 * @param clms CSV形式のカラム名 554 */ 555 public void setColumns( final String clms ) { 556 if( columns != null ) { 557 String errMsg = "column との同時セットは出来ません。: " + HybsSystem.CR 558 + "column=[" + StringUtil.array2csv( columns ) + "] , " 559 + "columns=[" + clms + "]" ; 560 throw new HybsSystemException( errMsg ); 561 } 562 String column = nval( getRequestParameter( clms ),null ); 563 if( column != null ) { 564 allColumns = column.indexOf( '*' ) >= 0 ; // 3.8.8.5 (2007/03/09) 565 columns = StringUtil.csv2Array( column ); 566 if( columns.length == 0 ) { columns = null; } 567 } 568 } 569 570 /** 571 * 【TAG】ラベルリソースに定義されたラベルIDをセットします。 572 * 573 * @og.tag 574 * ラベルをセットします。 575 * 576 * @og.rev 2.3.1.2 (2003/01/28) ラベルリソースからラベル名を取得するように修正 577 * @og.rev 4.0.0.0 (2005/01/31) キーより、ラベルデータオブジェクトを取得します。 578 * 579 * @param lbl ラベル 580 */ 581 public void setLabel( final String lbl ) { 582 labelData = getResource().getLabelData( getRequestParameter( lbl ) ) ; // 4.0.0 (2005/01/31) 583 } 584 585 /** 586 * 【TAG】カラムのクラス名(VARCHAR2,NUMBER など)をセットします。 587 * 588 * @og.tag 589 * カラムのクラス名をセットします。 590 * 591 * @param cls カラムのクラス 592 */ 593 public void setClassName ( final String cls ) { 594 className = nval( getRequestParameter( cls ),className ); 595 } 596 597 /** 598 * 【TAG】カラムの入力文字制限数をセットします。 599 * 600 * @og.tag 601 * カラムの入力文字制限数をセットします。 602 * 603 * @param len カラムの入力文字制限数 604 */ 605 public void setMaxlength( final String len ) { 606 maxlength = nval( getRequestParameter( len ),maxlength ); 607 } 608 609 /** 610 * 【TAG】カラムの表示サイズをセットします(大きさだけで入力文字制限ではありません)。 611 * 612 * @og.tag 613 * カラムのサイズをセットします。 614 * 615 * @og.rev 3.5.5.5 (2004/04/23) 入力欄の大きさを指定する viewSize 属性を追加。 616 * 617 * @param siz カラムのサイズ 618 */ 619 public void setSize( final String siz ) { 620 size = nval( getRequestParameter( siz ),size ); 621 } 622 623 /** 624 * 【TAG】カラムが書き込み可能かどうか[true/false]をセットします(初期値:null)。 625 * 626 * @og.tag 627 * カラムの書き込み可能をセットします。 628 * 629 * @param flag カラムの書き込み可能かどうか(true:可能/false:付加) 630 */ 631 public void setWritable ( final String flag ) { 632 writable = nval( getRequestParameter( flag ),writable ); 633 } 634 635 /** 636 * 【TAG】カラムの表示用レンデラー({@og.doc03Link renderer Renderer_****})をセットします。 637 * 638 * @og.tag 639 * これは、plugin.column 以下の Renderer_**** クラスの **** を与えます。 640 * これらは、CellRenderer インターフェースを継承したサブクラスです。 641 * 属性クラス定義の {@link org.opengion.hayabusa.db.CellRenderer Renderer} を参照願います。 642 * {@og.doc03Link renderer Renderer_**** クラス} 643 * 644 * @param rdr カラムの表示用レンデラー(Renderer_**** の ****) 645 * @see org.opengion.hayabusa.db.CellRenderer 646 */ 647 public void setRenderer ( final String rdr ) { 648 renderer = nval( getRequestParameter( rdr ),renderer ); 649 } 650 651 /** 652 * 【TAG】カラムの編集用エディター({@og.doc03Link editor Editor_****})をセットします。 653 * 654 * @og.tag 655 * これは、plugin.column 以下の Editor_**** クラスの **** を 656 * 与えます。これらは、CellEditor インターフェースを継承したサブクラスです。 657 * 属性クラス定義の {@link org.opengion.hayabusa.db.CellEditor Editor} を参照願います。 658 * {@og.doc03Link editor Editor_**** クラス} 659 * 660 * @param ed カラムの編集用エディター(Editor_**** の ****) 661 * @see org.opengion.hayabusa.db.CellEditor 662 */ 663 public void setEditor ( final String ed ) { 664 editor = nval( getRequestParameter( ed ),editor ); 665 } 666 667 /** 668 * 【TAG】DBタイプ({@og.doc03Link dbType DBType_****})をセットします。 669 * 670 * @og.tag 671 * これは、org.opengion.hayabusa.db.column 以下の DBType_**** クラスの **** を 672 * 与えます。これらは、DBType インターフェースを継承したサブクラスです。 673 * 属性クラス定義の {@link org.opengion.hayabusa.db.DBType DBType} を参照願います。 674 * {@og.doc03Link dbType DBType_**** クラス} 675 * 676 * @param dt パラメータ 677 * @see org.opengion.hayabusa.db.DBType DBType_**** の **** 678 */ 679 public void setDbType( final String dt ) { 680 dbType = nval( getRequestParameter( dt ),dbType ); 681 } 682 683 /** 684 * 【TAG】コードセレクトのユニークキー(コード名称)をセットします。 685 * 686 * @og.tag 687 * このキーを元に、CodeSelectionオブジェクトを構築します。 688 * 689 * @og.rev 3.5.5.7 (2004/05/10) 新規作成 690 * 691 * @param name メニューのユニークキー(コード名称) 692 */ 693 public void setCodeName( final String name ) { 694 codeName = nval( getRequestParameter( name ),codeName ); 695 } 696 697 /** 698 * 【TAG】コードセレクトのサブセットとなるコードをCSV形式で指定します。 699 * 700 * @og.tag 701 * この値に限定された、コードリソースを、既存の、CodeSelection の 702 * サブセットとして作成します。 703 * codeName で指定されたリソースでも、サブセットを作成する事ができます。 704 * 705 * @og.rev 5.1.9.0 (2010/08/01) 新規作成 706 * 707 * @param list コードセレクトのサブセットとなるコード 708 */ 709 public void setCodeList( final String list ) { 710 codeList = nval( getRequestParameter( list ),codeList ); 711 } 712 713 /** 714 * 【TAG】コードセレクトのサブセットとなるグループを指定します。 715 * 716 * @og.tag 717 * この値に限定された、コードリソースを、既存の、CodeData の 718 * サブセットとして作成します。 719 * codeName で指定されたリソースでも、サブセットを作成する事ができます。 720 * 721 * @og.rev 5.1.9.0 (2010/08/01) 新規作成 722 * 723 * @param group コードセレクトのサブセットとなるグループ 724 */ 725 public void setCodeGroup( final String group ) { 726 codeGroup = nval( getRequestParameter( group ),codeGroup ); 727 } 728 729 /** 730 * 【廃止】パラメータをセットします(param 属性を使用してください)。 731 * 732 * @og.tag 733 * ここで指定したパラメータは、renderer、editor、dbType すべてのパラメータに 734 * セットされます。 735 * パラメータをセットします。 736 * 737 * @og.rev 5.1.7.0 (2010/06/01) 動的プルダウン実装見直し 738 * @og.rev 5.6.4.3 (2013/05/24) 廃止します。param 属性を使用してください。 739 * @og.rev 5.9.1.3 (2015/10/30) コメントアウトされていたので復活させる 740 * 741 * @param prm パラメータ 742 * @see #setParam( String ) 743 * @deprecated lbl 属性を使用してください。 744 */ 745 @Deprecated public void setParameter( final String prm ) { 746 setParam( prm ); // 5.6.4.3 (2013/05/24) 廃止に伴い、新しいメソッド側へ振ります。 747 } 748 749 /** 750 * 【TAG】パラメータをセットします。 751 * 752 * @og.tag 753 * ここで指定したパラメータは、renderer、editor、dbType すべてのパラメータに 754 * セットされます。 755 * パラメータをセットします。 756 * 757 * @og.rev 5.6.4.3 (2013/05/24) 新規追加 758 * 759 * @param prm パラメータ 760 */ 761 public void setParam( final String prm ) { 762 parameter = nval( getRequestParameter( prm ),parameter ); 763 rawParameter = nval( prm, parameter ); 764 } 765 766 /** 767 * 【TAG】初期値をセットします。 768 * 769 * @og.tag 770 * 初期値をセットします。 771 * 772 * @param dv 初期値 773 */ 774 public void setDefaultVal( final String dv ) { 775 defaultVal = nval( getRequestParameter( dv ),defaultVal ); 776 } 777 778 /** 779 * 【TAG】コンボボックスの値なしのOptionの有無[true/false]を指定します(初期値:falseと同等)。 780 * 781 * @og.tag 782 * コンボボックスの場合、値なしのOptionをSelectに含めるかどうかを指定します。 783 * ここでは、検索結果の登録画面に使用されるケースが多いため、なにも指定されない 784 * 場合は、なにもセットしません。(Coderesourceの指定どおり) 785 * 動作としては、初期値は、含めない("false") と同等です。 786 * 787 * <og:columnEditor column="CDBK" addNoValue="false" /> 788 * 789 * @param flag [true:含める/それ以外:含めない] 790 */ 791 public void setAddNoValue( final String flag ) { 792 addNoValue = nval( getRequestParameter( flag ),addNoValue ); 793 } 794 795 /** 796 * 【TAG】SQL文を指定してラベル情報を動的に読み込むかどうか[true/false]指定します(初期値:false)。 797 * 798 * @og.tag 799 * trueを指定すると、body部分に記述されたSQL文よりラベル情報を生成して、 800 * 動的にラベル表示を切り替えます。 801 * 802 * ワイルドカードを使用した、カラムの複数指定と組み合わせることで、外部から設定 803 * されたラベル情報で一括で変更することができます。 804 * 805 * 発行するクエリでは、第1カラムにラベルキーを、第2カラムにラベル名称を設定します。 806 * 第3カラムが存在する場合は、名称(短)として使用されます。(必須ではありません) 807 * 808 * ここで作成されたラベル情報は、カラムエディターを適用したDBTableModelのみで 809 * 有効であり、内部的にもキャッシュされません。 810 * 811 * 初期値は、false(動的読込しない)です。 812 * 813 * @og.rev 4.3.4.0 (2008/12/01) 新規作成 814 * 815 * @param flag 動的読込 [true:する/false:しない] 816 */ 817 public void setUseLabelMap( final String flag ) { 818 useLabelMap = nval( getRequestParameter( flag ),useLabelMap ); 819 } 820 821 /** 822 * 【TAG】MENU,DBMENUでSLABELを利用するかどうか[auto/true/false]を指定します(初期値:null)。 823 * 824 * @og.tag 825 * 通常はセレクトメニューは一覧とそれ以外で短縮ラベルの利用が自動で切り替わります。 826 * 強制的にSLABELを利用させたい場合にこの属性をtrue/falseにセットして下さい。 827 * auto/true/false以外を指定した場合はfalse扱いとします。 828 * ここでの初期値は、値の変更を行わないということで、null です。 829 * 830 * @og.rev 5.6.2.3 (2013/03/22) columnタグに実装されているので移植 831 * 832 * @param prm [auto:自動/true:利用する/false:利用しない] 833 */ 834 public void setUseSLabel( final String prm ) { 835 useSLabel = nval( getRequestParameter( prm ),useSLabel ); 836 if( useSLabel != null && 837 !"auto".equalsIgnoreCase( useSLabel ) && 838 !"true".equalsIgnoreCase( useSLabel ) && 839 !"false".equalsIgnoreCase( useSLabel ) ) { 840 String errMsg = "useSLabel は、[auto:自動/true:利用する/false:利用しない] から選んでください。" 841 + "useSLabel=[" + prm + "]" + HybsSystem.CR ; 842 throw new HybsSystemException( errMsg ); 843 } 844 } 845 846 /** 847 * 【TAG】非表示文字列を指定します(初期値:null)。 848 * 849 * @og.tag 850 * これは、例えば、数字型の場合は、0 がデフォルトなどの場合、 851 * あえて表示したくないなどのケースに使います。 852 * そのような状況が設定されていない場合は、null が返されます。 853 * 初期値は、null です。 854 * 855 * @og.rev 5.6.2.3 (2013/03/22) 新規追加 856 * 857 * @param prm [auto:自動/true:利用する/false:利用しない] 858 */ 859 public void setNoDisplayVal( final String prm ) { 860 noDisplayVal = nval( getRequestParameter( prm ),noDisplayVal ); 861 } 862 863 /** 864 * 【TAG】(通常は使いません)結果のDBTableModelを、sessionに登録するときのキーを指定します 865 * (初期値:HybsSystem#TBL_MDL_KEY[={@og.value org.opengion.hayabusa.common.HybsSystem#TBL_MDL_KEY}])。 866 * 867 * @og.tag 868 * 検索結果より、DBTableModelオブジェクトを作成します。これを、下流のviewタグ等に 869 * 渡す場合に、通常は、session を利用します。その場合の登録キーです。 870 * query タグを同時に実行して、結果を求める場合、同一メモリに配置される為、 871 * この tableId 属性を利用して、メモリ空間を分けます。 872 * (初期値:HybsSystem#TBL_MDL_KEY[={@og.value org.opengion.hayabusa.common.HybsSystem#TBL_MDL_KEY}])。 873 * 874 * @param id sessionに登録する時の ID 875 */ 876 public void setTableId( final String id ) { 877 tableId = nval( getRequestParameter( id ),tableId ); 878 } 879 880 /** 881 * 【TAG】データベースへ接続する場合のID。 882 * 883 * @og.tag 884 * データベース接続を使用するエディター、レンデラーを使用する場合に使用する接続先IDを指定します。 885 * カラムオブジェクトは、query処理ではなく、view処理時に適用されるため、データベース 886 * 接続先を指定する必要があります。 887 * 初期値は、null(DEFAULT 接続) です。 888 * 889 * @og.rev 4.0.0.0 (2006/04/02) 新規追加 890 * 891 * @param id 接続先ID 892 */ 893 public void setDbid( final String id ) { 894 dbid = nval( getRequestParameter( id ),dbid ); 895 } 896 897 /** 898 * 【TAG】イベントカラム(親カラム)のセット。 899 * 900 * @og.tag 901 * 親子関係を持った項目の動的な入れ替えを行う場合に利用します。 902 * このカラムを変化させるトリガとなるカラムの名前をセットします。 903 * 904 * ※詳細はcolumnTagのeventURL属性の説明をご覧下さい。 905 * 906 * なお、columnEditorで、Viewに対して、SQL文の定義(置き換え定義)をする場合でも、 907 * 他カラムの値の参照は、columnタグの場合と同様に、{@XXXX}または$nの変数により行います。 908 * この場合、これらの変数は、"自身と同一行のカラム"を意味します。 909 * 910 * @og.rev 4.3.6.0 (2009/04/01) 911 * @og.rev 5.1.7.0 (2010/06/01) コメント大幅修正 912 * 913 * @param col 親カラム 914 */ 915 public void setEventColumn( final String col ) { 916 eventColumn = nval( getRequestParameter( col ), eventColumn ); 917 } 918 919 /** 920 * 【TAG】eventColumn利用時に呼ばれるJSPのURL。 921 * 922 * @og.tag 923 * イベントカラム指定時に部品を作成するJSPを指定します。 924 * 初期値はシステムリソースのEVENT_COLUMN_URLです。 925 * (例:eventURL="makeColumn_custom.jsp") 926 * 927 * ※詳細はcolumnTagのeventURL属性の説明をご覧下さい。 928 * 929 * @og.rev 4.3.6.0 (2009/04/01) 930 * 931 * @param url JSPのURL 932 */ 933 public void setEventURL( final String url ) { 934 eventURL = nval( getRequestParameter( url ), eventURL ); 935 } 936 937 /** 938 * 【TAG】eventColumn実行後のcallbak関数指定。 939 * 940 * @og.tag 941 * eventColumnの動作終了後に実行するCallback関数の指定を行います。 942 * 関数名のみを指定して下さい。 943 * ex) sampleCallback()を実行する場合はeventCallback="sampleCallback" 944 * 実行する関数の第一引数には自動的に次の要素が入った配列が渡されます 945 * [0] 変更された子カラムのID属性値 946 * [1] evnetColumn実行後の子カラムの値 947 * [2] eventColumn実行前の子カラムの値 948 * 949 * この属性は、optionAttributesへの設定と同様の動作を行います。 950 * 951 * @og.rev 5.5.4.0 (2012/07/02) 新規追加 952 * 953 * @param callback Callback関数 954 */ 955 public void setEventCallback( final String callback ) { 956 // optionAttributes扱いで登録します。 957 if( callback != null && callback.length() > 0 ){ 958 add( "optionAttributes", "eventCallback='"+getRequestParameter( callback )+"'" ); 959 } 960 } 961 962 /** 963 * 【HTML5】表示形式を指定します(初期値:text)。 964 * 965 * @og.tag 966 * ColumnTagは、カラムリソースで作成される為、タイプは固定です。 967 * しかし、HTML5 で追加された形式には、有用なタイプも存在する為、 968 * それらへの書き換えをできるようにします。 969 * よって、ここでは、従来型のタイプへの書き換えはできません。 970 * (textだけは例外で戻せるようにします)。 971 * 972 * [search/tel/url/email/datetime/date/month/week/time/datetime-local/number/range/color] 973 * が、設定できます。 974 * 975 * HTML5 の機能を有効にするには、ネイティブモードで動作させる必要があります。 976 * @ USE_IE7_HEADER = "false" に設定する。 977 * A USE_HTML5_HEADER = "true" に設定する。 978 * B IEのツール⇒互換表示設定で、互換表示に追加したWebサイトから削除する。 979 * C 同上の設定で、イントラサイトを互換表示で表示するのチェックを外す。 980 * 必要があります。 981 * 982 * <og:input type="text" /> テキストボックスを表示 983 * 984 * HTML5 で追加されたタイプ 985 * <og:input type="search" /> 検索テキストの入力欄を作成する 986 * <og:input type="tel" /> 電話番号の入力欄を作成する 987 * <og:input type="url" /> URLの入力欄を作成する 988 * <og:input type="email" /> メールアドレスの入力欄を作成する 989 * <og:input type="datetime" /> UTC(協定世界時)による日時の入力欄を作成する 990 * <og:input type="date" /> 日付の入力欄を作成する 991 * <og:input type="month" /> 月の入力欄を作成する 992 * <og:input type="week" /> 週の入力欄を作成する 993 * <og:input type="time" /> 時間の入力欄を作成する 994 * <og:input type="datetime-local" /> UTC(協定世界時)によらないローカル日時の入力欄を作成する 995 * <og:input type="number" /> 数値の入力欄を作成する 996 * <og:input type="range" /> レンジの入力欄を作成する 997 * <og:input type="color" /> 色の入力欄を作成する 998 * 999 * @og.rev 5.7.1.0 (2013/12/06) HTML5 対応(新規追加) 1000 * 1001 * @param type HTML5用 [text/search/tel/url/email/datetime/date/month/week/time/datetime-local/number/range/color] 1002 */ 1003 public void setType( final String type ) { 1004 String tp = getRequestParameter( type ); 1005 1006 if( check( "|" + tp + "|" , CHECK_TYPE ) ) { 1007 set( "type",tp ); 1008 } 1009 else { 1010 String errMsg = "type 属性は、下記の中から選択してください。type=[" 1011 + tp + " in [" + CHECK_TYPE + "]"; 1012 throw new HybsSystemException( errMsg ); 1013 } 1014 } 1015 1016 /** 1017 * 【TAG】ResourceManager を使用しないかどうか[true/false]を指定します(初期値:false)。 1018 * 1019 * @og.tag 1020 * trueを指定すると、使用しない設定になります。 1021 * これは、データベースから検索した値そのものが返される カラムオブジェクトを使用することになります。 1022 * 「noResource」なので、意味が反転しているのをご注意ください。 1023 * 1024 * false(初期値)は、ResourceManager を使用します。 1025 * 1026 * @og.rev 5.7.3.0 (2014/02/07) 新規作成 1027 * 1028 * @param flag ResourceManager を使用しないかどうか [true:使用しない/false:使用する] 1029 */ 1030 public void setNoResource( final String flag ) { 1031 noResource = nval( getRequestParameter( flag ),noResource ); 1032 } 1033 1034 /** 1035 * 【TAG】レンデラ利用時のExcel出力でセルタイプを文字固定にするか[true/false]を指定します(初期値:システム定数のUSE_STRING_EXCEL_OUTPUT)。 1036 * 1037 * @og.tag 1038 * falseを指定すると、dbTypeに従ったセルタイプとなります。 1039 * TableWriter内部でdouble変換をするためエラーに注意してください。 1040 * (初期値:システム定数のUSE_STRING_EXCEL_OUTPUT[={@og.value org.opengion.hayabusa.common.SystemData#USE_STRING_EXCEL_OUTPUT}])。 1041 * 1042 * @og.rev 5.7.6.3 (2014/05/23) 新規作成 1043 * 1044 * @param flag レンデラ利用時のExcel出力でセルタイプを文字固定にするか [true:固定する/false:固定しない] 1045 */ 1046 public void setStringOutput( final String flag ) { 1047 stringOutput = nval( getRequestParameter( flag ),stringOutput ); 1048 } 1049 1050 /** 1051 * シリアライズ用のカスタムシリアライズ書き込みメソッド 1052 * 1053 * @og.rev 4.0.0.0 (2006/09/31) 新規追加 1054 * @serialData 一部のオブジェクトは、シリアライズされません。 1055 * 1056 * @param strm ObjectOutputStreamオブジェクト 1057 * @throws IOException シリアライズに関する入出力エラーが発生した場合 1058 */ 1059 private void writeObject( final ObjectOutputStream strm ) throws IOException { 1060 strm.defaultWriteObject(); 1061 } 1062 1063 /** 1064 * シリアライズ用のカスタムシリアライズ読み込みメソッド 1065 * 1066 * ここでは、transient 宣言された内部変数の内、初期化が必要なフィールドのみ設定します。 1067 * 1068 * @og.rev 4.0.0.0 (2006/09/31) 新規追加 1069 * @serialData 一部のオブジェクトは、シリアライズされません。 1070 * 1071 * @param strm ObjectInputStreamオブジェクト 1072 * @see #release2() 1073 * @throws IOException シリアライズに関する入出力エラーが発生した場合 1074 * @throws ClassNotFoundException クラスを見つけることができなかった場合 1075 */ 1076 private void readObject( final ObjectInputStream strm ) throws IOException , ClassNotFoundException { 1077 strm.defaultReadObject(); 1078 } 1079 1080 /** 1081 * このオブジェクトの文字列表現を返します。 1082 * 基本的にデバッグ目的に使用します。 1083 * 1084 * @return このクラスの文字列表現 1085 */ 1086 @Override 1087 public String toString() { 1088 return org.opengion.fukurou.util.ToString.title( this.getClass().getName() ) 1089 .println( "VERSION" ,VERSION ) 1090 .println( "tableId" ,tableId ) 1091 .println( "columns" ,columns ) 1092 .println( "allColumns" ,allColumns ) 1093 .println( "className" ,className ) 1094 .println( "size" ,size ) 1095 .println( "maxlength" ,maxlength ) 1096 .println( "writable" ,writable ) 1097 .println( "renderer" ,renderer ) 1098 .println( "editor" ,editor ) 1099 .println( "codeName" ,codeName ) 1100 .println( "dbType" ,dbType ) 1101 .println( "defaultVal" ,defaultVal ) 1102 .println( "parameter" ,parameter ) 1103 .println( "dbid" ,dbid ) 1104 .println( "addNoValue" ,addNoValue ) 1105 .println( "Other..." ,getAttributes().getAttribute() ) 1106 .fixForm().toString() ; 1107 } 1108}