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.9.18.1 (2017/03/07)" ; 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 * @og.rev 5.9.18.1 (2017/03/24) DATALIST_R用のIEのHTML5機能が無効の場合の処理を追加 415 * 416 * @param dbColumn カラムオブジェクト 417 * 418 * @return カスタマイズされた DBColumnConfig 419 */ 420 private DBColumnConfig getModifyConfig( final DBColumn dbColumn ) { 421 // 5.7.3.0 (2014/02/07) noResource 属性を追加 422 if( noResource ) { 423 labelData = new LabelData( dbColumn.getName() ); 424 renderer = "LABEL"; 425 } 426 427 DBColumnConfig config = dbColumn.getConfig(); 428 429 // 5.7.6.2 (2014/05/16) IEのHTML5機能が無効の場合の処理 430 String ieHTML5 = (String)getSessionAttribute( HybsSystem.IE_HTML5_KEY ); 431 if( "FALSE".equalsIgnoreCase( ieHTML5 ) ) { 432 if( "DATALIST".equalsIgnoreCase( editor ) || 433 "DATALIST".equalsIgnoreCase( config.getEditor() ) ) { 434 editor = "INDBMENU"; 435 } 436 437 // 5.9.18.1 (2017/03/24) IEのHTML5機能が無効の場合の処理(DATALIST_R用) 438 if( "DATALIST_R".equalsIgnoreCase( editor ) || 439 "DATALIST_R".equalsIgnoreCase( config.getEditor() )){ 440 editor = "INMENU"; 441 } 442 } 443 444 String lang = get( "lang" ); // 4.0.0 (2005/01/31) super クラスで受けます。 445 446 if( lang != null ) { config.setLang( lang ); } 447 if( labelData != null ) { config.setLabelData( labelData ); } // 4.0.0 (2005/01/31) 448 if( className != null ) { config.setClassName( className ); } 449 if( size != null ) { config.setViewLength(size ); } 450 if( maxlength != null ) { config.setMaxlength( maxlength ); } // 3.5.5.5 (2004/04/23) 451 if( writable != null ) { config.setWritable( writable ); } 452 if( renderer != null ) { config.setRenderer( renderer ); } 453 if( editor != null ) { config.setEditor( editor ); } 454 if( dbType != null ) { config.setDbType( dbType ); } 455 if( defaultVal != null ) { config.setDefault( defaultVal ); } // 5.1.8.0 (2010/07/01) 456 if( parameter != null ) { config.setParameter( parameter ); } 457 if( dbid != null ) { config.setDbid( dbid ); } 458 if( eventColumn != null ) { config.setEventColumn(eventColumn); } // 4.3.6.0 (2009/04/01) 459 if( eventURL != null ) { config.setEventURL( eventURL ); } // 4.3.6.0 (2009/04/01) 460 if( rawParameter != null ){ config.setRawParameter( rawParameter ); } // 4.3.6.0 (2009/04/01) 461 if( useSLabel != null ) { config.setUseSLabel( useSLabel ); } // 5.6.2.3 (2013/03/22) 462 if( noDisplayVal != null ) { config.setNoDisplayVal( noDisplayVal ); } // 5.6.2.3 (2013/03/22) 463 464 // 4.0.0 (2005/11/30) ロールを指定 465 String roles = get( "roles" ); 466 if( roles != null ) { config.setRoles( roles ); } 467 468 // 4.0.0 (2005/01/31) 469 if( codeName != null ) { 470 CodeData codeData = getResource().getCodeData( codeName ) ; 471 config.setCodeData( codeData ); 472 } 473 474 // codeName で指定のリソースでも、サブセットが作成できます。 475 // 5.1.9.0 (2010/08/01) codeList 属性を追加(Codeリソースのサブセット) 476 if( codeList != null ) { 477 CodeData codeData = config.getCodeData() ; 478 if( codeData != null ) { 479 config.setCodeData( codeData.subsetList( codeList ) ); 480 } 481 } 482 483 // 5.1.9.0 (2010/08/01) codeGroup 属性を追加(Codeリソースのサブセット) 484 if( codeGroup != null ) { 485 CodeData codeData = config.getCodeData() ; 486 if( codeData != null && codeData.useGroup() ) { 487 config.setCodeData( codeData.subsetGroup( codeGroup ) ); 488 } 489 } 490 491 // 3.5.5.9 (2004/06/07) 492 // 注意:addNoValue は、互換性の関係で、値が指定された場合のみ、 493 // config に設定します。 494 // editor="DBMENU" が、指定された場合は、addNoValue が指定されていない場合のみ、 495 // 従来との互換性の関係より、このクラスのデフォルト(true)を、config に設定します。 496 if( addNoValue != null ) { 497 boolean anv = Boolean.valueOf( addNoValue ).booleanValue() ; 498 config.setAddNoValue( anv ); 499 } 500 501 // 3.5.1.0 (2003/10/03) 親クラスをCommonTagSupportからHTMLTagSupportに変更。 502 config.setEditorAttributes( getAttributes() ); 503 504 // 4.3.4.0 (2008/12/01) ラベルデータの動的取得に対応します。 505 if( useLabelMap && labelMap != null ) { 506 LabelData ldata = labelMap.get( dbColumn.getName() ); 507 if( ldata != null ) { 508 config.setLabelData( ldata ); 509 } 510 } 511 512 // 5.7.6.3 (2014/05/23) 513 config.setStringOutput( stringOutput ); 514 515 return config ; 516 } 517 518 /** 519 * 【TAG】カラム名をセットします。 520 * 521 * @og.tag 522 * カラム名をセットします。 523 * columns と同時にはセットできません。 524 * 値に"*"を指定することで、全カラムを対象とすることができます。 525 * また、"PN*,CDK*"等のように前方一致でのワイルドカード指定も可能です。 526 * 527 * @og.rev 3.7.0.5 (2005/04/11) 複数カラムを同時設定できる columns 属性を追加 528 * @og.rev 3.8.8.5 (2007/03/09) 全カラム が指定されたことにする allColumns 属性を追加 529 * 530 * @param clm ネーム 531 */ 532 public void setColumn( final String clm ) { 533 if( columns != null ) { 534 String errMsg = "columns との同時セットは出来ません。: " + HybsSystem.CR 535 + "column=[" + clm + "] , " 536 + "columns=[" + StringUtil.array2csv( columns ) + "]"; 537 throw new HybsSystemException( errMsg ); 538 } 539 String column = getRequestParameter( clm ); 540 if( column != null && column.length() > 0 ) { 541 columns = new String[] { column }; 542 allColumns = column.indexOf( '*' ) >= 0 ; // 3.8.8.5 (2007/03/09) 543 } 544 } 545 546 /** 547 * 【TAG】カラム名をカンマ区切りで複数セットします。 548 * 549 * @og.tag 550 * カラム名をセットします。 551 * column と同時にはセットできません。 552 * 分解方法は、通常のパラメータ取得後に、CSV分解します。 553 * 値に"*"を指定することで、全カラムを対象とすることができます。 554 * また、"PN*,CDK*"等のように前方一致でのワイルドカード指定も可能です。 555 * 556 * @og.rev 3.7.0.5 (2005/04/11) 複数カラムを同時設定できる columns 属性を追加 557 * @og.rev 3.8.8.5 (2007/03/09) 通常のパラメータ取得後に、CSV分解に戻します。 558 * @og.rev 3.8.8.5 (2007/03/09) 全カラム が指定されたことにする allColumns 属性を追加 559 * 560 * @param clms CSV形式のカラム名 561 */ 562 public void setColumns( final String clms ) { 563 if( columns != null ) { 564 String errMsg = "column との同時セットは出来ません。: " + HybsSystem.CR 565 + "column=[" + StringUtil.array2csv( columns ) + "] , " 566 + "columns=[" + clms + "]" ; 567 throw new HybsSystemException( errMsg ); 568 } 569 String column = nval( getRequestParameter( clms ),null ); 570 if( column != null ) { 571 allColumns = column.indexOf( '*' ) >= 0 ; // 3.8.8.5 (2007/03/09) 572 columns = StringUtil.csv2Array( column ); 573 if( columns.length == 0 ) { columns = null; } 574 } 575 } 576 577 /** 578 * 【TAG】ラベルリソースに定義されたラベルIDをセットします。 579 * 580 * @og.tag 581 * ラベルをセットします。 582 * 583 * @og.rev 2.3.1.2 (2003/01/28) ラベルリソースからラベル名を取得するように修正 584 * @og.rev 4.0.0.0 (2005/01/31) キーより、ラベルデータオブジェクトを取得します。 585 * 586 * @param lbl ラベル 587 */ 588 public void setLabel( final String lbl ) { 589 labelData = getResource().getLabelData( getRequestParameter( lbl ) ) ; // 4.0.0 (2005/01/31) 590 } 591 592 /** 593 * 【TAG】カラムのクラス名(VARCHAR2,NUMBER など)をセットします。 594 * 595 * @og.tag 596 * カラムのクラス名をセットします。 597 * 598 * @param cls カラムのクラス 599 */ 600 public void setClassName ( final String cls ) { 601 className = nval( getRequestParameter( cls ),className ); 602 } 603 604 /** 605 * 【TAG】カラムの入力文字制限数をセットします。 606 * 607 * @og.tag 608 * カラムの入力文字制限数をセットします。 609 * 610 * @param len カラムの入力文字制限数 611 */ 612 public void setMaxlength( final String len ) { 613 maxlength = nval( getRequestParameter( len ),maxlength ); 614 } 615 616 /** 617 * 【TAG】カラムの表示サイズをセットします(大きさだけで入力文字制限ではありません)。 618 * 619 * @og.tag 620 * カラムのサイズをセットします。 621 * 622 * @og.rev 3.5.5.5 (2004/04/23) 入力欄の大きさを指定する viewSize 属性を追加。 623 * 624 * @param siz カラムのサイズ 625 */ 626 public void setSize( final String siz ) { 627 size = nval( getRequestParameter( siz ),size ); 628 } 629 630 /** 631 * 【TAG】カラムが書き込み可能かどうか[true/false]をセットします(初期値:null)。 632 * 633 * @og.tag 634 * カラムの書き込み可能をセットします。 635 * 636 * @param flag カラムの書き込み可能かどうか(true:可能/false:付加) 637 */ 638 public void setWritable ( final String flag ) { 639 writable = nval( getRequestParameter( flag ),writable ); 640 } 641 642 /** 643 * 【TAG】カラムの表示用レンデラー({@og.doc03Link renderer Renderer_****})をセットします。 644 * 645 * @og.tag 646 * これは、plugin.column 以下の Renderer_**** クラスの **** を与えます。 647 * これらは、CellRenderer インターフェースを継承したサブクラスです。 648 * 属性クラス定義の {@link org.opengion.hayabusa.db.CellRenderer Renderer} を参照願います。 649 * {@og.doc03Link renderer Renderer_**** クラス} 650 * 651 * @param rdr カラムの表示用レンデラー(Renderer_**** の ****) 652 * @see org.opengion.hayabusa.db.CellRenderer 653 */ 654 public void setRenderer ( final String rdr ) { 655 renderer = nval( getRequestParameter( rdr ),renderer ); 656 } 657 658 /** 659 * 【TAG】カラムの編集用エディター({@og.doc03Link editor Editor_****})をセットします。 660 * 661 * @og.tag 662 * これは、plugin.column 以下の Editor_**** クラスの **** を 663 * 与えます。これらは、CellEditor インターフェースを継承したサブクラスです。 664 * 属性クラス定義の {@link org.opengion.hayabusa.db.CellEditor Editor} を参照願います。 665 * {@og.doc03Link editor Editor_**** クラス} 666 * 667 * @param ed カラムの編集用エディター(Editor_**** の ****) 668 * @see org.opengion.hayabusa.db.CellEditor 669 */ 670 public void setEditor ( final String ed ) { 671 editor = nval( getRequestParameter( ed ),editor ); 672 } 673 674 /** 675 * 【TAG】DBタイプ({@og.doc03Link dbType DBType_****})をセットします。 676 * 677 * @og.tag 678 * これは、org.opengion.hayabusa.db.column 以下の DBType_**** クラスの **** を 679 * 与えます。これらは、DBType インターフェースを継承したサブクラスです。 680 * 属性クラス定義の {@link org.opengion.hayabusa.db.DBType DBType} を参照願います。 681 * {@og.doc03Link dbType DBType_**** クラス} 682 * 683 * @param dt パラメータ 684 * @see org.opengion.hayabusa.db.DBType DBType_**** の **** 685 */ 686 public void setDbType( final String dt ) { 687 dbType = nval( getRequestParameter( dt ),dbType ); 688 } 689 690 /** 691 * 【TAG】コードセレクトのユニークキー(コード名称)をセットします。 692 * 693 * @og.tag 694 * このキーを元に、CodeSelectionオブジェクトを構築します。 695 * 696 * @og.rev 3.5.5.7 (2004/05/10) 新規作成 697 * 698 * @param name メニューのユニークキー(コード名称) 699 */ 700 public void setCodeName( final String name ) { 701 codeName = nval( getRequestParameter( name ),codeName ); 702 } 703 704 /** 705 * 【TAG】コードセレクトのサブセットとなるコードをCSV形式で指定します。 706 * 707 * @og.tag 708 * この値に限定された、コードリソースを、既存の、CodeSelection の 709 * サブセットとして作成します。 710 * codeName で指定されたリソースでも、サブセットを作成する事ができます。 711 * 712 * @og.rev 5.1.9.0 (2010/08/01) 新規作成 713 * 714 * @param list コードセレクトのサブセットとなるコード 715 */ 716 public void setCodeList( final String list ) { 717 codeList = nval( getRequestParameter( list ),codeList ); 718 } 719 720 /** 721 * 【TAG】コードセレクトのサブセットとなるグループを指定します。 722 * 723 * @og.tag 724 * この値に限定された、コードリソースを、既存の、CodeData の 725 * サブセットとして作成します。 726 * codeName で指定されたリソースでも、サブセットを作成する事ができます。 727 * 728 * @og.rev 5.1.9.0 (2010/08/01) 新規作成 729 * 730 * @param group コードセレクトのサブセットとなるグループ 731 */ 732 public void setCodeGroup( final String group ) { 733 codeGroup = nval( getRequestParameter( group ),codeGroup ); 734 } 735 736 /** 737 * 【廃止】パラメータをセットします(param 属性を使用してください)。 738 * 739 * @og.tag 740 * ここで指定したパラメータは、renderer、editor、dbType すべてのパラメータに 741 * セットされます。 742 * パラメータをセットします。 743 * 744 * @og.rev 5.1.7.0 (2010/06/01) 動的プルダウン実装見直し 745 * @og.rev 5.6.4.3 (2013/05/24) 廃止します。param 属性を使用してください。 746 * @og.rev 5.9.1.3 (2015/10/30) コメントアウトされていたので復活させる 747 * 748 * @param prm パラメータ 749 * @see #setParam( String ) 750 * @deprecated lbl 属性を使用してください。 751 */ 752 @Deprecated public void setParameter( final String prm ) { 753 setParam( prm ); // 5.6.4.3 (2013/05/24) 廃止に伴い、新しいメソッド側へ振ります。 754 } 755 756 /** 757 * 【TAG】パラメータをセットします。 758 * 759 * @og.tag 760 * ここで指定したパラメータは、renderer、editor、dbType すべてのパラメータに 761 * セットされます。 762 * パラメータをセットします。 763 * 764 * @og.rev 5.6.4.3 (2013/05/24) 新規追加 765 * 766 * @param prm パラメータ 767 */ 768 public void setParam( final String prm ) { 769 parameter = nval( getRequestParameter( prm ),parameter ); 770 rawParameter = nval( prm, parameter ); 771 } 772 773 /** 774 * 【TAG】初期値をセットします。 775 * 776 * @og.tag 777 * 初期値をセットします。 778 * 779 * @param dv 初期値 780 */ 781 public void setDefaultVal( final String dv ) { 782 defaultVal = nval( getRequestParameter( dv ),defaultVal ); 783 } 784 785 /** 786 * 【TAG】コンボボックスの値なしのOptionの有無[true/false]を指定します(初期値:falseと同等)。 787 * 788 * @og.tag 789 * コンボボックスの場合、値なしのOptionをSelectに含めるかどうかを指定します。 790 * ここでは、検索結果の登録画面に使用されるケースが多いため、なにも指定されない 791 * 場合は、なにもセットしません。(Coderesourceの指定どおり) 792 * 動作としては、初期値は、含めない("false") と同等です。 793 * 794 * <og:columnEditor column="CDBK" addNoValue="false" /> 795 * 796 * @param flag [true:含める/それ以外:含めない] 797 */ 798 public void setAddNoValue( final String flag ) { 799 addNoValue = nval( getRequestParameter( flag ),addNoValue ); 800 } 801 802 /** 803 * 【TAG】SQL文を指定してラベル情報を動的に読み込むかどうか[true/false]指定します(初期値:false)。 804 * 805 * @og.tag 806 * trueを指定すると、body部分に記述されたSQL文よりラベル情報を生成して、 807 * 動的にラベル表示を切り替えます。 808 * 809 * ワイルドカードを使用した、カラムの複数指定と組み合わせることで、外部から設定 810 * されたラベル情報で一括で変更することができます。 811 * 812 * 発行するクエリでは、第1カラムにラベルキーを、第2カラムにラベル名称を設定します。 813 * 第3カラムが存在する場合は、名称(短)として使用されます。(必須ではありません) 814 * 815 * ここで作成されたラベル情報は、カラムエディターを適用したDBTableModelのみで 816 * 有効であり、内部的にもキャッシュされません。 817 * 818 * 初期値は、false(動的読込しない)です。 819 * 820 * @og.rev 4.3.4.0 (2008/12/01) 新規作成 821 * 822 * @param flag 動的読込 [true:する/false:しない] 823 */ 824 public void setUseLabelMap( final String flag ) { 825 useLabelMap = nval( getRequestParameter( flag ),useLabelMap ); 826 } 827 828 /** 829 * 【TAG】MENU,DBMENUでSLABELを利用するかどうか[auto/true/false]を指定します(初期値:null)。 830 * 831 * @og.tag 832 * 通常はセレクトメニューは一覧とそれ以外で短縮ラベルの利用が自動で切り替わります。 833 * 強制的にSLABELを利用させたい場合にこの属性をtrue/falseにセットして下さい。 834 * auto/true/false以外を指定した場合はfalse扱いとします。 835 * ここでの初期値は、値の変更を行わないということで、null です。 836 * 837 * @og.rev 5.6.2.3 (2013/03/22) columnタグに実装されているので移植 838 * 839 * @param prm [auto:自動/true:利用する/false:利用しない] 840 */ 841 public void setUseSLabel( final String prm ) { 842 useSLabel = nval( getRequestParameter( prm ),useSLabel ); 843 if( useSLabel != null && 844 !"auto".equalsIgnoreCase( useSLabel ) && 845 !"true".equalsIgnoreCase( useSLabel ) && 846 !"false".equalsIgnoreCase( useSLabel ) ) { 847 String errMsg = "useSLabel は、[auto:自動/true:利用する/false:利用しない] から選んでください。" 848 + "useSLabel=[" + prm + "]" + HybsSystem.CR ; 849 throw new HybsSystemException( errMsg ); 850 } 851 } 852 853 /** 854 * 【TAG】非表示文字列を指定します(初期値:null)。 855 * 856 * @og.tag 857 * これは、例えば、数字型の場合は、0 がデフォルトなどの場合、 858 * あえて表示したくないなどのケースに使います。 859 * そのような状況が設定されていない場合は、null が返されます。 860 * 初期値は、null です。 861 * 862 * @og.rev 5.6.2.3 (2013/03/22) 新規追加 863 * 864 * @param prm [auto:自動/true:利用する/false:利用しない] 865 */ 866 public void setNoDisplayVal( final String prm ) { 867 noDisplayVal = nval( getRequestParameter( prm ),noDisplayVal ); 868 } 869 870 /** 871 * 【TAG】(通常は使いません)結果のDBTableModelを、sessionに登録するときのキーを指定します 872 * (初期値:HybsSystem#TBL_MDL_KEY[={@og.value org.opengion.hayabusa.common.HybsSystem#TBL_MDL_KEY}])。 873 * 874 * @og.tag 875 * 検索結果より、DBTableModelオブジェクトを作成します。これを、下流のviewタグ等に 876 * 渡す場合に、通常は、session を利用します。その場合の登録キーです。 877 * query タグを同時に実行して、結果を求める場合、同一メモリに配置される為、 878 * この tableId 属性を利用して、メモリ空間を分けます。 879 * (初期値:HybsSystem#TBL_MDL_KEY[={@og.value org.opengion.hayabusa.common.HybsSystem#TBL_MDL_KEY}])。 880 * 881 * @param id sessionに登録する時の ID 882 */ 883 public void setTableId( final String id ) { 884 tableId = nval( getRequestParameter( id ),tableId ); 885 } 886 887 /** 888 * 【TAG】データベースへ接続する場合のID。 889 * 890 * @og.tag 891 * データベース接続を使用するエディター、レンデラーを使用する場合に使用する接続先IDを指定します。 892 * カラムオブジェクトは、query処理ではなく、view処理時に適用されるため、データベース 893 * 接続先を指定する必要があります。 894 * 初期値は、null(DEFAULT 接続) です。 895 * 896 * @og.rev 4.0.0.0 (2006/04/02) 新規追加 897 * 898 * @param id 接続先ID 899 */ 900 public void setDbid( final String id ) { 901 dbid = nval( getRequestParameter( id ),dbid ); 902 } 903 904 /** 905 * 【TAG】イベントカラム(親カラム)のセット。 906 * 907 * @og.tag 908 * 親子関係を持った項目の動的な入れ替えを行う場合に利用します。 909 * このカラムを変化させるトリガとなるカラムの名前をセットします。 910 * 911 * ※詳細はcolumnTagのeventURL属性の説明をご覧下さい。 912 * 913 * なお、columnEditorで、Viewに対して、SQL文の定義(置き換え定義)をする場合でも、 914 * 他カラムの値の参照は、columnタグの場合と同様に、{@XXXX}または$nの変数により行います。 915 * この場合、これらの変数は、"自身と同一行のカラム"を意味します。 916 * 917 * @og.rev 4.3.6.0 (2009/04/01) 918 * @og.rev 5.1.7.0 (2010/06/01) コメント大幅修正 919 * 920 * @param col 親カラム 921 */ 922 public void setEventColumn( final String col ) { 923 eventColumn = nval( getRequestParameter( col ), eventColumn ); 924 } 925 926 /** 927 * 【TAG】eventColumn利用時に呼ばれるJSPのURL。 928 * 929 * @og.tag 930 * イベントカラム指定時に部品を作成するJSPを指定します。 931 * 初期値はシステムリソースのEVENT_COLUMN_URLです。 932 * (例:eventURL="makeColumn_custom.jsp") 933 * 934 * ※詳細はcolumnTagのeventURL属性の説明をご覧下さい。 935 * 936 * @og.rev 4.3.6.0 (2009/04/01) 937 * 938 * @param url JSPのURL 939 */ 940 public void setEventURL( final String url ) { 941 eventURL = nval( getRequestParameter( url ), eventURL ); 942 } 943 944 /** 945 * 【TAG】eventColumn実行後のcallbak関数指定。 946 * 947 * @og.tag 948 * eventColumnの動作終了後に実行するCallback関数の指定を行います。 949 * 関数名のみを指定して下さい。 950 * ex) sampleCallback()を実行する場合はeventCallback="sampleCallback" 951 * 実行する関数の第一引数には自動的に次の要素が入った配列が渡されます 952 * [0] 変更された子カラムのID属性値 953 * [1] evnetColumn実行後の子カラムの値 954 * [2] eventColumn実行前の子カラムの値 955 * 956 * この属性は、optionAttributesへの設定と同様の動作を行います。 957 * 958 * @og.rev 5.5.4.0 (2012/07/02) 新規追加 959 * 960 * @param callback Callback関数 961 */ 962 public void setEventCallback( final String callback ) { 963 // optionAttributes扱いで登録します。 964 if( callback != null && callback.length() > 0 ){ 965 add( "optionAttributes", "eventCallback='"+getRequestParameter( callback )+"'" ); 966 } 967 } 968 969 /** 970 * 【HTML5】表示形式を指定します(初期値:text)。 971 * 972 * @og.tag 973 * ColumnTagは、カラムリソースで作成される為、タイプは固定です。 974 * しかし、HTML5 で追加された形式には、有用なタイプも存在する為、 975 * それらへの書き換えをできるようにします。 976 * よって、ここでは、従来型のタイプへの書き換えはできません。 977 * (textだけは例外で戻せるようにします)。 978 * 979 * [search/tel/url/email/datetime/date/month/week/time/datetime-local/number/range/color] 980 * が、設定できます。 981 * 982 * HTML5 の機能を有効にするには、ネイティブモードで動作させる必要があります。 983 * @ USE_IE7_HEADER = "false" に設定する。 984 * A USE_HTML5_HEADER = "true" に設定する。 985 * B IEのツール⇒互換表示設定で、互換表示に追加したWebサイトから削除する。 986 * C 同上の設定で、イントラサイトを互換表示で表示するのチェックを外す。 987 * 必要があります。 988 * 989 * <og:input type="text" /> テキストボックスを表示 990 * 991 * HTML5 で追加されたタイプ 992 * <og:input type="search" /> 検索テキストの入力欄を作成する 993 * <og:input type="tel" /> 電話番号の入力欄を作成する 994 * <og:input type="url" /> URLの入力欄を作成する 995 * <og:input type="email" /> メールアドレスの入力欄を作成する 996 * <og:input type="datetime" /> UTC(協定世界時)による日時の入力欄を作成する 997 * <og:input type="date" /> 日付の入力欄を作成する 998 * <og:input type="month" /> 月の入力欄を作成する 999 * <og:input type="week" /> 週の入力欄を作成する 1000 * <og:input type="time" /> 時間の入力欄を作成する 1001 * <og:input type="datetime-local" /> UTC(協定世界時)によらないローカル日時の入力欄を作成する 1002 * <og:input type="number" /> 数値の入力欄を作成する 1003 * <og:input type="range" /> レンジの入力欄を作成する 1004 * <og:input type="color" /> 色の入力欄を作成する 1005 * 1006 * @og.rev 5.7.1.0 (2013/12/06) HTML5 対応(新規追加) 1007 * 1008 * @param type HTML5用 [text/search/tel/url/email/datetime/date/month/week/time/datetime-local/number/range/color] 1009 */ 1010 public void setType( final String type ) { 1011 String tp = getRequestParameter( type ); 1012 1013 if( check( "|" + tp + "|" , CHECK_TYPE ) ) { 1014 set( "type",tp ); 1015 } 1016 else { 1017 String errMsg = "type 属性は、下記の中から選択してください。type=[" 1018 + tp + " in [" + CHECK_TYPE + "]"; 1019 throw new HybsSystemException( errMsg ); 1020 } 1021 } 1022 1023 /** 1024 * 【TAG】ResourceManager を使用しないかどうか[true/false]を指定します(初期値:false)。 1025 * 1026 * @og.tag 1027 * trueを指定すると、使用しない設定になります。 1028 * これは、データベースから検索した値そのものが返される カラムオブジェクトを使用することになります。 1029 * 「noResource」なので、意味が反転しているのをご注意ください。 1030 * 1031 * false(初期値)は、ResourceManager を使用します。 1032 * 1033 * @og.rev 5.7.3.0 (2014/02/07) 新規作成 1034 * 1035 * @param flag ResourceManager を使用しないかどうか [true:使用しない/false:使用する] 1036 */ 1037 public void setNoResource( final String flag ) { 1038 noResource = nval( getRequestParameter( flag ),noResource ); 1039 } 1040 1041 /** 1042 * 【TAG】レンデラ利用時のExcel出力でセルタイプを文字固定にするか[true/false]を指定します(初期値:システム定数のUSE_STRING_EXCEL_OUTPUT)。 1043 * 1044 * @og.tag 1045 * falseを指定すると、dbTypeに従ったセルタイプとなります。 1046 * TableWriter内部でdouble変換をするためエラーに注意してください。 1047 * (初期値:システム定数のUSE_STRING_EXCEL_OUTPUT[={@og.value org.opengion.hayabusa.common.SystemData#USE_STRING_EXCEL_OUTPUT}])。 1048 * 1049 * @og.rev 5.7.6.3 (2014/05/23) 新規作成 1050 * 1051 * @param flag レンデラ利用時のExcel出力でセルタイプを文字固定にするか [true:固定する/false:固定しない] 1052 */ 1053 public void setStringOutput( final String flag ) { 1054 stringOutput = nval( getRequestParameter( flag ),stringOutput ); 1055 } 1056 1057 /** 1058 * シリアライズ用のカスタムシリアライズ書き込みメソッド 1059 * 1060 * @og.rev 4.0.0.0 (2006/09/31) 新規追加 1061 * @serialData 一部のオブジェクトは、シリアライズされません。 1062 * 1063 * @param strm ObjectOutputStreamオブジェクト 1064 * @throws IOException シリアライズに関する入出力エラーが発生した場合 1065 */ 1066 private void writeObject( final ObjectOutputStream strm ) throws IOException { 1067 strm.defaultWriteObject(); 1068 } 1069 1070 /** 1071 * シリアライズ用のカスタムシリアライズ読み込みメソッド 1072 * 1073 * ここでは、transient 宣言された内部変数の内、初期化が必要なフィールドのみ設定します。 1074 * 1075 * @og.rev 4.0.0.0 (2006/09/31) 新規追加 1076 * @serialData 一部のオブジェクトは、シリアライズされません。 1077 * 1078 * @param strm ObjectInputStreamオブジェクト 1079 * @see #release2() 1080 * @throws IOException シリアライズに関する入出力エラーが発生した場合 1081 * @throws ClassNotFoundException クラスを見つけることができなかった場合 1082 */ 1083 private void readObject( final ObjectInputStream strm ) throws IOException , ClassNotFoundException { 1084 strm.defaultReadObject(); 1085 } 1086 1087 /** 1088 * このオブジェクトの文字列表現を返します。 1089 * 基本的にデバッグ目的に使用します。 1090 * 1091 * @return このクラスの文字列表現 1092 */ 1093 @Override 1094 public String toString() { 1095 return org.opengion.fukurou.util.ToString.title( this.getClass().getName() ) 1096 .println( "VERSION" ,VERSION ) 1097 .println( "tableId" ,tableId ) 1098 .println( "columns" ,columns ) 1099 .println( "allColumns" ,allColumns ) 1100 .println( "className" ,className ) 1101 .println( "size" ,size ) 1102 .println( "maxlength" ,maxlength ) 1103 .println( "writable" ,writable ) 1104 .println( "renderer" ,renderer ) 1105 .println( "editor" ,editor ) 1106 .println( "codeName" ,codeName ) 1107 .println( "dbType" ,dbType ) 1108 .println( "defaultVal" ,defaultVal ) 1109 .println( "parameter" ,parameter ) 1110 .println( "dbid" ,dbid ) 1111 .println( "addNoValue" ,addNoValue ) 1112 .println( "Other..." ,getAttributes().getAttribute() ) 1113 .fixForm().toString() ; 1114 } 1115}