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.db;
017
018 import org.opengion.hayabusa.common.HybsSystem;
019 import org.opengion.fukurou.util.LogWriter;
020 import org.opengion.hayabusa.resource.ResourceFactory;
021 import org.opengion.hayabusa.resource.ResourceManager;
022 import org.opengion.fukurou.db.DBUtil;
023 import org.opengion.fukurou.util.ApplicationInfo;
024
025 import java.util.Map;
026 import java.util.HashSet;
027 import java.util.HashMap;
028
029 /**
030 * ãƒ??ã‚¿ã®ã‚³ãƒ¼ãƒ‰æƒ…å ±ã‚’å–り扱ã?‚¯ãƒ©ã‚¹ã§ã™ã?
031 *
032 * コードã?ã‚ーã¨ãƒ©ãƒ™ãƒ«ã®æƒ??ã‹ã‚‰ã€HTMLã®ãƒ¡ãƒ‹ãƒ¥ãƒ¼ã‚?ƒªã‚¹ãƒˆã‚’作æ?ã™ã‚‹ãŸã‚㮠オプション
033 * タグを作æ?ã—ãŸã‚Šã?与ãˆã‚‰ã‚ŒãŸã‚ーをもã¨ã«ã€ãƒã‚§ãƒ?‚¯æ¸ˆã¿ã®ã‚ªãƒ—ションタグを作æ?ã—ãŸã‚?
034 * ã—ã¾ã™ã?
035 * QUERYã®ç¬¬?‘カラãƒ??ã€?¸æŠžã‚ーã«ãªã‚Šã¾ã™ã?第?’カラãƒ??ラベルã§ã™ã?ã“ã“ã¾ã§ã¯å¿??ã§ã™ã?
036 * 第?“カラãƒ?Œå˜åœ¨ã™ã‚‹å ´åˆã?ã€çŸç¸®ã‚«ãƒ©ãƒ?¨ã—ã¦èªè˜ã•れã¾ã™ã?å˜åœ¨ã—ãªã??åˆã?ã€?
037 * çŸç¸®ãƒ©ãƒ™ãƒ«ã¯ä½¿ç”¨ã—ã¾ã›ã‚“ã€?
038 *
039 * メニュー作æ?用ã«ã€SELECTæ–?‚’与ãˆã¾ã™ã?
040 * SELECT 値,ラベル[,グループ][,クラス] FROM XXXX ã§æŒ?®šã•れã?値ã€ãƒ©ãƒ™ãƒ«ã¾ã§ã¯å¿??ã€?
041 * グループã?ã€optgroup ã«å¯¾ã—ã¦æŒ?®šã™ã‚‹ãƒ©ãƒ™ãƒ«ã§ã™ã?クラスã¯ã€ãã®ã‚ªãƒ—ションã«
042 * 色ã¥ã‘ãªã©ã‚’行ã†ç‚ºã®æŒ?®šã§ã™ã?
043 * ãªãŠã?グループã?クラス ã¯ã€NULL(ã¾ãŸã?ã€ã‚¼ãƒæ–?—å?)ã®å ´åˆã?ã€?©ç”¨ã•れã¾ã›ã‚“ã€?
044 *
045 * @og.group é¸æŠžãƒ‡ãƒ¼ã‚¿åˆ¶å¾¡
046 *
047 * @version 4.0
048 * @author Kazuhiko Hasegawa
049 * @since JDK5.0,
050 */
051 // public class Selection_DB implements Selection {
052 public class Selection_DB extends Selection_NULL {
053 // 3.5.4.8 (2004/02/23) USE_MULTI_KEY_SELECT を定義ã—ã¦ãŠãã¾ã™ã?
054 private final boolean USE_MULTI_KEY_SELECT = HybsSystem.sysBool( "USE_MULTI_KEY_SELECT" ) ;
055 private final long DB_CACHE_TIME = (long)HybsSystem.sysInt( "DB_CACHE_TIME" ) ;
056
057 private final boolean isMultiSelect ;
058 private final boolean isShortLavel ; // çŸç¸®ãƒ©ãƒ™ãƒ«ã‚’使用ã§ãã‚‹ã‹ã©ã?‹
059 private final long createTime ; // ã‚ャãƒ?‚·ãƒ¥ã®ç ´æ£?‚¿ã‚¤ãƒŸãƒ³ã‚°ã‚’計るãŸã‚ã®ä½œæ?時間
060
061 private final int[] ADRS ;
062 private final String CACHE ;
063 private final int LEN ;
064 private final int[] LADRS ; // 5.1.3.0 (2010/02/01)
065 private final String LCACHE ; // 5.1.3.0 (2010/02/01)
066 private final int LLEN ; // 5.1.3.0 (2010/02/01)
067 private final Map<String,Integer> map ;
068
069 private final String[] value ; // 値
070 private final String[] label ; // ラベル
071 private final String[] slabel ; // çŸç¸®ãƒ©ãƒ™ãƒ«
072
073 private static final int VAL = 0;
074 private static final int LBL = 1;
075 private static final int SLBL = 2;
076 private static final int GRP = 3;
077 private static final int CLS = 4;
078
079 // 3.8.7.0 (2006/12/15) アクセスãƒã‚°å–å¾—ã?為,ApplicationInfoオブジェクトをè¨å®?
080 private static final ApplicationInfo appInfo;
081 static {
082 /** コãƒã‚¯ã‚·ãƒ§ãƒ³ã«ã‚¢ãƒ—リケーションæƒ??を追記ã™ã‚‹ã‹ã©ã?‹æŒ?®?*/
083 boolean USE_DB_APPLICATION_INFO = HybsSystem.sysBool( "USE_DB_APPLICATION_INFO" ) ;
084
085 // 3.8.7.0 (2006/12/15) アクセスãƒã‚°å–å¾—ã?為,ApplicationInfoオブジェクトをè¨å®?
086 if( USE_DB_APPLICATION_INFO ) {
087 String SYSTEM_ID = HybsSystem.sys( "SYSTEM_ID" );
088 appInfo = new ApplicationInfo();
089 // ユーザーID,IPアドレス,ホストå
090 appInfo.setClientInfo( SYSTEM_ID,HybsSystem.HOST_ADRS,HybsSystem.HOST_NAME );
091 // ç”»é¢ID,æ“ä½?プãƒã‚°ãƒ©ãƒ?D
092 appInfo.setModuleInfo( "Selection_DB",null,null );
093 }
094 else {
095 appInfo = null;
096 }
097 }
098
099 /**
100 * コンストラクター
101 *
102 * ?¤?¢æ¤œç´¢ç”¨ã®?³?±?¬æ–?‚’与ãˆã¦ã€å?期化ã—ã¾ã™ã?
103 * SQLæ–??ã€KEY,LNAME [,SNAME] ã§ã€ç¬¬?“é?ãŒãªã‘れã°ã€LNAME を使用ã—ã¾ã™ã?
104 * LNAME ã¯ã€??常ã®å€¤ã‚’è¿”ã™å ´åˆã«ã€SNAME ã¯ã€ä¸?¦§è¡¨ç¤ºã®å€¤ã‚’è¿”ã™å ´åˆã«ä½¿ç”¨ã—ã¾ã™ã?
105 * 特別ã«ã€KEY ã®ã¿ã®å ´åˆã?ã€lang ã«åŸºã¥ã?ResourceManager ã‹ã‚‰?—ï¾ï¾žï¾™ã‚’å–å¾—ã—ã¾ã™ã?
106 * ãŸã ã—ã?ãã?å ´åˆã?ã€ã‚ªãƒ¼ãƒŠã?(SYSTEM_ID)ã¯é¸ã¹ã¾ã›ã‚“ã€?
107 *
108 * @og.rev 3.5.4.2 (2003/12/15) コンストラクター æ–°è¦è¿½åŠ?
109 * @og.rev 3.6.0.9 (2004/12/03) isMultiSelect ã®åˆ¤å®šã‚’ラベル部ã®ãƒ¦ãƒ‹ã?ク度ã§åˆ¤å®šã—ã¾ã™ã?
110 * @og.rev 3.8.7.0 (2006/12/15) アクセスãƒã‚°å–å¾—ã?為,ApplicationInfoオブジェクトをè¨å®?
111 * @og.rev 3.8.9.2 (2007/07/28) グループã¨ã€ã‚¯ãƒ©ã‚¹ã‚’追åŠ??Selectæ–??第?“ã?第?”引数ã¨ã—ã¦æŒ?®šã?
112 * @og.rev 4.0.0.0 (2006/11/15) lang 属æ?を追åŠ?—ã¾ã™ã?
113 * @og.rev 4.3.8.0 (2009/08/01) ãƒ??ルãƒãƒƒãƒ—表示機è?追åŠ?
114 * @og.rev 5.1.3.0 (2010/02/01) ラベル(çŸ)ãŒnullã®å ´åˆã§ã‚‚ã?ラベル(çŸ)ã§è¡¨ç¤ºã•れã¦ã—ã¾ã?ƒã‚°ã‚’ä¿®æ£
115 * @og.rev 5.1.3.0 (2010/02/01) ä¸?¦§è¡¨ç¤ºä»¥å¤–ã?ã€ãƒ„ールãƒãƒƒãƒ—表示ã—ãªã?
116 *
117 * @param newQuery DB検索(SQL)æ–?—å?
118 * @param dbid ãƒ??タベã?ス接続å?ID
119 * @param lang リソースを使用ã™ã‚‹å ´åˆã?è¨?ª?
120 */
121 public Selection_DB( final String newQuery,final String dbid,final String lang ) {
122
123 String[][] cols = DBUtil.dbExecute( newQuery,null,appInfo,dbid ); // 3.8.7.0 (2006/12/15)
124 int count = cols.length;
125
126 value = new String[count];
127 label = new String[count];
128 slabel = new String[count];
129 ADRS = new int[count];
130 map = new HashMap<String,Integer>(count);
131
132 int len = ( count > 0 ) ? cols[0].length : 0 ;
133 isShortLavel = len > SLBL ; // >= 3 ã¨åŒæ„;
134 boolean isGrp = len > GRP ; // >= 4 ã¨åŒæ„;
135 boolean isCls = len > CLS ; // >= 5 ã¨åŒæ„;
136
137 boolean useLabelData = false ;
138 ResourceManager resource = null;
139 if( len == 1 ) {
140 useLabelData = true;
141 resource = ResourceFactory.newInstance( lang );
142 }
143
144 // 3.6.0.9 (2004/12/03)
145 HashSet<String> set = new HashSet<String>();
146 boolean flag = USE_MULTI_KEY_SELECT; // 判定å?ç?‚’行ã†ã€‚false ãªã‚‰åˆ¤å®šå?ç?‚‚行ã‚ãªã??
147
148 StringBuilder buf = new StringBuilder( HybsSystem.BUFFER_LARGE );
149 String bkGroupKey = "";
150 for( int i=0; i<count; i++ ) {
151 value[i] = cols[i][VAL];
152 if( useLabelData ) {
153 label[i] = resource.getLabel( value[i] );
154 }
155 else {
156 label[i] = cols[i][LBL];
157 if( isShortLavel ) { slabel[i] = cols[i][SLBL]; }
158 }
159 map.put( value[i], Integer.valueOf( i ) );
160
161 // 3.8.9.2 (2007/07/28)
162 if( isGrp ) {
163 String groupKey = cols[i][GRP];
164 if( !groupKey.equals( bkGroupKey ) ) { // ã‚ーブレイク
165 if( ! "".equals( bkGroupKey ) ) {
166 buf.append( "</optgroup>" );
167 }
168 if( ! "".equals( groupKey ) ) {
169 buf.append( "<optgroup label=\"" + groupKey + "\">" );
170 }
171 bkGroupKey = groupKey;
172 }
173 }
174
175 buf.append( "<option value=\"" ).append( value[i] ).append( "\"" );
176 ADRS[i] = buf.length() ;
177 if( isCls ) {
178 String classKey = cols[i][CLS];
179 if( ! "".equals( classKey ) ) {
180 buf.append( " class=\"" ).append( classKey ).append( "\"" );
181 }
182 }
183 // 4.3.8.0 (2009/08/01) slabel利用ã®å ´åˆã?labelã‚’title属æ?ã«ã‚»ãƒ?ƒˆ
184 //buf.append( ">" ).append( label[i] ).append( "</option>" );
185 if( isShortLavel && slabel[i] != null && slabel[i].length() > 0 ){ // 5.1.3.0 (2010/02/01)
186 if( !label[i].equals( slabel[i] ) ){ // slabelã¨labelãŒç•°ãªã‚‹å?åˆã?ã¿
187 buf.append( " title=\"" ).append( label[i] ).append( "\"" );
188 }
189 buf.append( ">" ).append( slabel[i] );
190 }
191 else{
192 buf.append( ">" ).append( label[i] );
193 }
194 buf.append( "</option>" );
195
196 // 3.6.0.9 (2004/12/03)
197 if( flag && label[i].length() > 0 ) {
198 flag = set.add( label[i].substring(0,1) ); // é‡è¤?™‚㯠false
199 }
200 }
201 if( isGrp && ! "".equals( bkGroupKey ) ) {
202 buf.append( "</optgroup>" );
203 }
204
205 CACHE = buf.toString();
206 LEN = CACHE.length() + 30;
207
208 // 5.1.3.0 (2010/02/01) ãƒ??ルãƒãƒƒãƒ—表示ãŒé©ç”¨ã•れã¦ã?‚‹å ´åˆã?ã¿ã€ãƒ„ールãƒãƒƒãƒ—ãªã—ã?状態ã?optionã‚’ã‚ャãƒ?‚·ãƒ¥ã™ã‚‹ã€?
209 if( CACHE.indexOf( "title=\"" ) < 0 ) {
210 LADRS = null;
211 LCACHE = null;
212 LLEN = 0;
213 }
214 else {
215 LADRS = new int[count];
216 StringBuilder lbuf = new StringBuilder( HybsSystem.BUFFER_LARGE );
217
218 bkGroupKey = "";
219 for( int i=0; i<count; i++ ) {
220 if( isGrp ) {
221 String groupKey = cols[i][GRP];
222 if( !groupKey.equals( bkGroupKey ) ) {
223 if( ! "".equals( bkGroupKey ) ) { lbuf.append( "</optgroup>" ); }
224 if( ! "".equals( groupKey ) ) { lbuf.append( "<optgroup label=\"" + groupKey + "\">" ); }
225 bkGroupKey = groupKey;
226 }
227 }
228 lbuf.append( "<option value=\"" ).append( value[i] ).append( "\"" );
229 LADRS[i] = lbuf.length() ;
230 if( isCls && ! "".equals( cols[i][CLS] ) ) {
231 lbuf.append( " class=\"" ).append( cols[i][CLS] ).append( "\"" );
232 }
233 lbuf.append( ">" ).append( label[i] ).append( "</option>" );
234 }
235 if( isGrp && ! "".equals( bkGroupKey ) ) {
236 lbuf.append( "</optgroup>" );
237 }
238 LCACHE = lbuf.toString();
239 LLEN = LCACHE.length() + 30;
240 }
241
242 isMultiSelect = USE_MULTI_KEY_SELECT && ! flag ; // flag ã®åè»¢ã«æ³¨æ„?
243 createTime = System.currentTimeMillis() ;
244 }
245
246 /**
247 * åˆæœŸå€¤ãŒé¸æŠžæ¸ˆã¿ã® é¸æŠžè‚¢(オプション)ã‚’è¿”ã—ã¾ã™ã?
248 * ã“ã?オプションã¯ã€å¼•æ•°ã®å€¤ã‚’å?期å?ã¨ã™ã‚‹ã‚ªãƒ—ションタグを返ã—ã¾ã™ã?
249 * ã“ã?メソãƒ?ƒ‰ã§ã¯ã€ãƒ©ãƒ™ãƒ«(çŸ)ãŒè¨å®šã•れã¦ã?‚‹å ´åˆã§ã‚‚ã?ã“れを使用ã›ãšã«å¿?šãƒ©ãƒ™ãƒ«(é•·)を使用ã—ã¾ã™ã?
250 *
251 * @og.rev 3.6.0.6 (2004/10/22) シーケンスアクセス機è?を指定ã™ã‚?seqFlag ã‚’å°Žå?
252 * @og.rev 4.0.0.0 (2005/01/31) selectValue ãŒã?null/ã‚¼ãƒæ–?—å?ã§ãªã??åˆã«ã€?¸æŠžè‚¢ã«ãªã??åˆã?ã€ã‚¨ãƒ©ãƒ¼
253 * @og.rev 5.7.7.1 (2014/06/13) Selection_NULL ã‚?継承ã™ã‚‹ãŸã‚ã€å‰Šé™¤
254 *
255 * @param selectValue é¸æŠžã•れã¦ã?‚‹å€¤
256 * @param seqFlag シーケンスアクセス機è? [true:ON/false:OFF]
257 *
258 * @return オプションタグ
259 * @see #getOption( String, boolean, boolean )
260 */
261 // public String getOption( final String selectValue,final boolean seqFlag ) {
262 // return getOption( selectValue, seqFlag, false );
263 // }
264
265 /**
266 * åˆæœŸå€¤ãŒé¸æŠžæ¸ˆã¿ã® é¸æŠžè‚¢(オプション)ã‚’è¿”ã—ã¾ã™ã?
267 * ã“ã?オプションã¯ã€å¼•æ•°ã®å€¤ã‚’å?期å?ã¨ã™ã‚‹ã‚ªãƒ—ションタグを返ã—ã¾ã™ã?
268 * ã“ã?メソãƒ?ƒ‰ã§ã¯ã€å¼•æ•°ã®useShortLabelãŒtrueã«æŒ?®šã•れãŸå ´åˆã«ã€ãƒ©ãƒ™ãƒ«(çŸ)ã‚’ã?ースã¨ã—ãŸ
269 * ãƒ??ルãƒãƒƒãƒ—表示を行ã„ã¾ã™ã?
270 *
271 * @og.rev 5.1.3.0 (2010/02/01) 追�
272 *
273 * @param selectValue é¸æŠžã•れã¦ã?‚‹å€¤
274 * @param seqFlag シーケンスアクセス機è? [true:ON/false:OFF]
275 * @param useShortLabel ラベル(çŸ)ã‚’ã?ースã¨ã—ãŸã‚ªãƒ—ション表示を行ã†ã‹ã©ã?‹ã€?
276 *
277 * @return オプションタグ
278 * @see #getOption( String, boolean )
279 */
280 @Override
281 public String getOption( final String selectValue,final boolean seqFlag, final boolean useShortLabel ) {
282 int[] adrs = null;
283 String cache = null;
284 int len = 0;
285 if( !useShortLabel && LCACHE != null && LCACHE.length() > 0 ) {
286 adrs = LADRS;
287 cache = LCACHE;
288 len = LLEN;
289 }
290 else {
291 adrs = ADRS;
292 cache = CACHE;
293 len = LEN;
294 }
295
296 // マッãƒã™ã‚‹ã‚¢ãƒ‰ãƒ¬ã‚¹ã‚’探ã™ã?
297 Integer sel = map.get( selectValue );
298
299 if( sel == null ) {
300 // 4.0.0 (2005/01/31)
301 if( selectValue != null && selectValue.length() > 0 ) {
302 String errMsg = "DBコードã«å˜åœ¨ã—ãªã??ãŒæŒ‡å®šã•れã¾ã—ãŸã€?
303 + " value=[" + selectValue + "]"
304 + HybsSystem.CR ;
305 LogWriter.log( errMsg );
306 }
307 return cache;
308 }
309 else {
310 int selected = sel.intValue();
311 StringBuilder buf = new StringBuilder( len );
312 // 3.6.0.6 (2004/10/22) シーケンスアクセス機è?を指定ã™ã‚?seqFlag ã‚’å°Žå?
313 if( seqFlag ) {
314 buf.append( "<option value=\"" ).append( value[selected] ).append( "\"" );
315 }
316 else {
317 buf.append( cache.substring( 0,adrs[selected] ) );
318 }
319 buf.append( " selected=\"selected\"" );
320 buf.append( cache.substring( adrs[selected] ) );
321 return buf.toString() ;
322 }
323 }
324
325 /**
326 * åˆæœŸå€¤ãŒé¸æŠžæ¸ˆã¿ã® é¸æŠžè‚¢(オプション)ã‚’è¿”ã—ã¾ã™ã?
327 * ã“ã?オプションã¯ã€å¼•æ•°ã®å€¤ã‚’å?期å?ã¨ã™ã‚‹ã‚ªãƒ—ションタグを返ã—ã¾ã™ã?
328 * ※ ã“ã?クラスã§ã¯å®Ÿè£?•れã¦ã?¾ã›ã‚“ã€?
329 *
330 * @og.rev 2.1.0.1 (2002/10/17) é¸æŠžãƒªã‚¹ãƒˆã‚’ã€æ£æ–¹å‘ã«ã—ã‹é¸ã¹ãªã?‚ˆã?«ã™ã‚‹ sequenceFlag ã‚’å°Žå?ã™ã‚‹
331 * @og.rev 3.8.6.0 (2006/09/29) useLabel 属æ? 追åŠ?
332 * @og.rev 5.7.7.1 (2014/06/13) Selection_NULL ã‚?継承ã™ã‚‹ãŸã‚ã€å‰Šé™¤
333 *
334 * @param name ラジオ㮠name
335 * @param selectValue é¸æŠžã•れã¦ã?‚‹å€¤
336 * @param useLabel ãƒ©ãƒ™ãƒ«è¡¨ç¤ºã®æœ‰ç„¡ [true:æœ?false:ç„¡]
337 *
338 * @return オプションタグ
339 */
340 // public String getRadio( final String name,final String selectValue,final boolean useLabel ) {
341 // String errMsg = "ã“ã?クラスã§ã¯å®Ÿè£?•れã¦ã?¾ã›ã‚“ã€?;
342 // throw new UnsupportedOperationException( errMsg );
343 // }
344
345 /**
346 * åˆæœŸå€¤ãŒé¸æŠžæ¸ˆã¿ã® é¸æŠžè‚¢(オプション)ã‚’è¿”ã—ã¾ã™ã?
347 * ã“ã?オプションã¯ã€å¼•æ•°ã®å€¤ã‚’å?期å?ã¨ã™ã‚‹ã‚ªãƒ—ションタグを返ã—ã¾ã™ã?
348 * ※ ã“ã?クラスã§ã¯å®Ÿè£?•れã¦ã?¾ã›ã‚“ã€?
349 *
350 * @og.rev 5.7.7.1 (2014/06/13) Selection_NULL ã‚?継承ã™ã‚‹ãŸã‚ã€å‰Šé™¤
351 *
352 * @param selectValue é¸æŠžã•れã¦ã?‚‹å€¤
353 *
354 * @return オプションタグ
355 */
356 // public String getRadioLabel( final String selectValue ) {
357 // String errMsg = "ã“ã?クラスã§ã¯å®Ÿè£?•れã¦ã?¾ã›ã‚“ã€?;
358 // throw new UnsupportedOperationException( errMsg );
359 // }
360
361 /**
362 * é¸æŠžè‚¢(value)ã«å¯¾ã™ã‚‹ãƒ©ãƒ™ãƒ«ã‚’è¿”ã—ã¾ã™ã?
363 * é¸æŠžè‚¢(value)ãŒã?å˜åœ¨ã—ãªã‹ã£ãŸå?åˆã?ã€?¸æŠžè‚¢ãã?ã‚‚ã?ã‚’è¿”ã—ã¾ã™ã?
364 * getValueLabel( XX ) ã¯ã€getValueLabel( XX,false ) ã¨åŒã˜ã§ã™ã?
365 *
366 * @og.rev 5.7.7.1 (2014/06/13) Selection_NULL ã‚?継承ã™ã‚‹ãŸã‚ã€å‰Šé™¤
367 *
368 * @param selectValue é¸æŠžè‚¢ã®å€¤
369 *
370 * @return é¸æŠžè‚¢ã®ãƒ©ãƒ™ãƒ«
371 * @see #getValueLabel( String,boolean )
372 */
373 // public String getValueLabel( final String selectValue ) {
374 // return getValueLabel( selectValue,false );
375 // }
376
377 /**
378 * é¸æŠžè‚¢(value)ã«å¯¾ã™ã‚‹ãƒ©ãƒ™ãƒ«ã‚’è¿”ã—ã¾ã™ã?
379 * é¸æŠžè‚¢(value)ãŒã?å˜åœ¨ã—ãªã‹ã£ãŸå?åˆã?ã€?¸æŠžè‚¢ãã?ã‚‚ã?ã‚’è¿”ã—ã¾ã™ã?
380 * ã“ã?メソãƒ?ƒ‰ã§ã¯ã€çŸç¸®ãƒ©ãƒ™ãƒ«ã‚’è¿”ã™ã‹ã©ã?‹ã‚’指定ã™ã‚‹ãƒ•ラグを指定ã—ã¾ã™ã?
381 * getValueLabel( XX,false ) ã¯ã€getValueLabel( XX ) ã¨åŒã˜ã§ã™ã?
382 *
383 * @og.rev 4.0.0.0 (2005/11/30) を追�
384 * @og.rev 5.3.5.0 (2011/05/01) åç§°(çŸ)表示時ã«åç§°(é•·)をツールãƒãƒƒãƒ—ã§è¡¨ç¤ºã™ã‚‹ã€?
385 *
386 * @param selectValue é¸æŠžè‚¢ã®å€¤
387 * @param flag çŸç¸®ãƒ©ãƒ™ãƒ«ã‚’使用ã™ã‚‹ [true:使用ã™ã‚‹/false:ã—ãªã„]
388 *
389 * @return é¸æŠžè‚¢ã®ãƒ©ãƒ™ãƒ«
390 * @see #getValueLabel( String )
391 */
392 @Override
393 public String getValueLabel( final String selectValue,final boolean flag ) {
394 // マッãƒã™ã‚‹ã‚¢ãƒ‰ãƒ¬ã‚¹ã‚’探ã™ã?
395 Integer sel = map.get( selectValue );
396
397 if( sel == null ) {
398 return selectValue;
399 }
400 else {
401 if( isShortLavel && flag ) {
402 return "<span title=\""+label[sel.intValue()]+"\">"+slabel[sel.intValue()]+"</span>";
403 }
404 else {
405 return label[sel.intValue()] ;
406 }
407 }
408 }
409
410 /**
411 * マルãƒã?ã‚ーセレクトを使用ã™ã‚‹ã‹ã©ã?‹ã‚’è¿”ã—ã¾ã™ã?
412 * true?šä½¿ç”¨ã™ã‚‹ã€‚false:使用ã—ãªã?ã§ã™ã?
413 * ãŸã ã—ã?実際ã«ä½¿ç”¨ã™ã‚‹ã‹ã©ã?‹ã¯ã€HTMLå‡ºåŠ›æ™‚ã«æ±ºã‚ã‚‹ã“ã¨ãŒå?æ¥ã¾ã™ã?
414 * ã“ã“ã§ã¯ã€USE_MULTI_KEY_SELECT ã?true ã§ã€USE_SIZE(=20)以上ã?å ´åˆã«
415 * true ã‚’è¿”ã—ã¾ã™ã?
416 *
417 * @og.rev 3.5.5.7 (2004/05/10) æ–°è¦ä½œæ?
418 *
419 * @return é¸æŠžãƒªã‚¹ãƒˆã§ã€ã?ルãƒã?ã‚ーセレクトを使用ã™ã‚‹ã‹ã©ã?‹(true:使用ã™ã‚‹)
420 */
421 @Override
422 public boolean useMultiSelect() {
423 return isMultiSelect;
424 }
425
426 /**
427 * オブジェクトã?ã‚ャãƒ?‚·ãƒ¥ãŒæ™‚é–“å?れã‹ã©ã?‹ã‚’è¿”ã—ã¾ã™ã?
428 * ã‚ャãƒ?‚·ãƒ¥ãŒæ™‚é–“å?ã‚?無効)ã§ã‚れã°ã€true ã‚’ã?有効ã§ã‚れã°ã€?
429 * false ã‚’è¿”ã—ã¾ã™ã?
430 *
431 * @og.rev 4.0.0.0 (2005/01/31) æ–°è¦ä½œæ?
432 *
433 * @return ã‚ャãƒ?‚·ãƒ¥ãŒæ™‚é–“å?れãªã‚?true
434 */
435 @Override
436 public boolean isTimeOver() {
437 return ( System.currentTimeMillis() - createTime ) > DB_CACHE_TIME ;
438 }
439 }