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            // 3.5.4.8 (2004/02/23) USE_MULTI_KEY_SELECT を定義ã—ã¦ãŠãã¾ã™ã?
053            private final boolean USE_MULTI_KEY_SELECT      = HybsSystem.sysBool( "USE_MULTI_KEY_SELECT" ) ;
054            private final long        DB_CACHE_TIME                 = (long)HybsSystem.sysInt( "DB_CACHE_TIME" ) ;
055    
056            private final boolean   isMultiSelect ;
057            private final boolean   isShortLavel ;          // 短縮ラベルを使用ã§ãã‚‹ã‹ã©ã?‹
058            private final long              createTime ;            // キャãƒ?‚·ãƒ¥ã®ç ´æ£?‚¿ã‚¤ãƒŸãƒ³ã‚°ã‚’計るãŸã‚ã®ä½œæ?時間
059    
060            private final int[]             ADRS  ;
061            private final String    CACHE ;
062            private final int               LEN      ;
063            private final int[]             LADRS  ; // 5.1.3.0 (2010/02/01)
064            private final String    LCACHE ; // 5.1.3.0 (2010/02/01)
065            private final int               LLEN   ; // 5.1.3.0 (2010/02/01)
066            private final Map<String,Integer> map  ;
067    
068            private final String[]  value ;         // 値
069            private final String[]  label ;         // ラベル
070            private final String[]  slabel ;        // 短縮ラベル
071    
072            private static final int VAL  = 0;
073            private static final int LBL  = 1;
074            private static final int SLBL = 2;
075            private static final int GRP  = 3;
076            private static final int CLS  = 4;
077    
078            // 3.8.7.0 (2006/12/15) アクセスログå–å¾—ã?為,ApplicationInfoオブジェクトを設å®?
079            private static final ApplicationInfo appInfo;
080            static {
081                    /** コãƒã‚¯ã‚·ãƒ§ãƒ³ã«ã‚¢ãƒ—リケーションæƒ??を追記ã™ã‚‹ã‹ã©ã?‹æŒ?®?*/
082                    boolean USE_DB_APPLICATION_INFO  = HybsSystem.sysBool( "USE_DB_APPLICATION_INFO" ) ;
083    
084                    // 3.8.7.0 (2006/12/15) アクセスログå–å¾—ã?為,ApplicationInfoオブジェクトを設å®?
085                    if( USE_DB_APPLICATION_INFO ) {
086                            String SYSTEM_ID = HybsSystem.sys( "SYSTEM_ID" );
087                            appInfo = new ApplicationInfo();
088                            // ユーザーID,IPアドレス,ホストå
089                            appInfo.setClientInfo( SYSTEM_ID,HybsSystem.HOST_ADRS,HybsSystem.HOST_NAME );
090                            // ç”»é¢ID,æ“ä½?プログラãƒ?D
091                            appInfo.setModuleInfo( "Selection_DB",null,null );
092                    }
093                    else {
094                            appInfo = null;
095                    }
096            }
097    
098            /**
099             * コンストラクター
100             *
101             * ?¤?¢æ¤œç´¢ç”¨ã®?³?±?¬æ–?‚’与ãˆã¦ã€å?期化ã—ã¾ã™ã?
102             * SQLæ–??ã€KEY,LNAME [,SNAME] ã§ã€ç¬¬?“é?ãŒãªã‘れã°ã€LNAME を使用ã—ã¾ã™ã?
103             * LNAME ã¯ã€??常ã®å€¤ã‚’è¿”ã™å ´åˆã«ã€SNAME ã¯ã€ä¸?¦§è¡¨ç¤ºã®å€¤ã‚’è¿”ã™å ´åˆã«ä½¿ç”¨ã—ã¾ã™ã?
104             * 特別ã«ã€KEY ã®ã¿ã®å ´åˆã?ã€lang ã«åŸºã¥ã?ResourceManager ã‹ã‚‰?—ï¾ï¾žï¾™ã‚’å–å¾—ã—ã¾ã™ã?
105             * ãŸã ã—ã?ãã?å ´åˆã?ã€ã‚ªãƒ¼ãƒŠã?(SYSTEM_ID)ã¯é¸ã¹ã¾ã›ã‚“ã€?
106             *
107             * @og.rev 3.5.4.2 (2003/12/15) コンストラクター æ–°è¦è¿½åŠ?
108             * @og.rev 3.6.0.9 (2004/12/03) isMultiSelect ã®åˆ¤å®šã‚’ラベル部ã®ãƒ¦ãƒ‹ã?ク度ã§åˆ¤å®šã—ã¾ã™ã?
109             * @og.rev 3.8.7.0 (2006/12/15) アクセスログå–å¾—ã?為,ApplicationInfoオブジェクトを設å®?
110             * @og.rev 3.8.9.2 (2007/07/28) グループã¨ã€ã‚¯ãƒ©ã‚¹ã‚’追åŠ??Selectæ–??第?“ã?第?”引数ã¨ã—ã¦æŒ?®šã?
111             * @og.rev 4.0.0.0 (2006/11/15) lang 属æ?を追åŠ?—ã¾ã™ã?
112             * @og.rev 4.3.8.0 (2009/08/01) ãƒ??ルãƒãƒƒãƒ—表示機è?追åŠ?
113             * @og.rev 5.1.3.0 (2010/02/01) ラベル(短)ãŒnullã®å ´åˆã§ã‚‚ã?ラベル(短)ã§è¡¨ç¤ºã•れã¦ã—ã¾ã?ƒã‚°ã‚’修正
114             * @og.rev 5.1.3.0 (2010/02/01) ä¸?¦§è¡¨ç¤ºä»¥å¤–ã?ã€ãƒ„ールãƒãƒƒãƒ—表示ã—ãªã?
115             *
116             * @param newQuery      DB検索(SQL)æ–?­—å?
117             * @param dbid          ãƒ??タベã?ス接続å?ID
118             * @param lang          リソースを使用ã™ã‚‹å ´åˆã?è¨?ª?
119             */
120            public Selection_DB( final String newQuery,final String dbid,final String lang ) {
121    
122                    String[][] cols = DBUtil.dbExecute( newQuery,null,appInfo,dbid );       // 3.8.7.0 (2006/12/15)
123                    int count = cols.length;
124    
125                    value   = new String[count];
126                    label   = new String[count];
127                    slabel  = new String[count];
128                    ADRS    = new int[count];
129                    map             = new HashMap<String,Integer>(count);
130    
131                    int len = ( count > 0 ) ? cols[0].length : 0 ;
132    //              isShortLavel = ( len >= 3 ) ? true : false ;
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 ){
186                            if( isShortLavel && slabel[i] != null && slabel[i].length() > 0 ){ // 5.1.3.0 (2010/02/01)
187                                    if( !label[i].equals( slabel[i] ) ){ // slabelã¨labelãŒç•°ãªã‚‹å?åˆã?ã¿
188                                            buf.append( " title=\"" ).append( label[i] ).append( "\"" );
189                                    }
190                                    buf.append( ">" ).append( slabel[i] );
191                            }
192                            else{
193                                    buf.append( ">" ).append( label[i] );
194                            }
195                            buf.append( "</option>" );
196    
197                            // 3.6.0.9 (2004/12/03)
198                            if( flag && label[i].length() > 0 ) {
199                                    flag = set.add( label[i].substring(0,1) );      // é‡è¤?™‚㯠false
200                            }
201                    }
202                    if( isGrp && ! "".equals( bkGroupKey ) ) {
203                            buf.append( "</optgroup>" );
204                    }
205    
206                    CACHE = buf.toString();
207                    LEN   = CACHE.length() + 30;
208    
209                    // 5.1.3.0 (2010/02/01) ãƒ??ルãƒãƒƒãƒ—表示ãŒé©ç”¨ã•れã¦ã?‚‹å ´åˆã?ã¿ã€ãƒ„ールãƒãƒƒãƒ—ãªã—ã?状態ã?optionをキャãƒ?‚·ãƒ¥ã™ã‚‹ã€?
210                    if( CACHE.indexOf( "title=\"" ) < 0 ) {
211                            LADRS  = null;
212                            LCACHE = null;
213                            LLEN   = 0;
214                    }
215                    else {
216                            LADRS  = new int[count];
217                            StringBuilder lbuf = new StringBuilder( HybsSystem.BUFFER_LARGE );
218    
219                            bkGroupKey = "";
220                            for( int i=0; i<count; i++ ) {
221                                    if( isGrp ) {
222                                            String groupKey = cols[i][GRP];
223                                            if( !groupKey.equals( bkGroupKey ) ) {
224                                                    if( ! "".equals( bkGroupKey ) ) { lbuf.append( "</optgroup>" ); }
225                                                    if( ! "".equals( groupKey ) )   { lbuf.append( "<optgroup label=\"" + groupKey + "\">" ); }
226                                                    bkGroupKey = groupKey;
227                                            }
228                                    }
229                                    lbuf.append( "<option value=\"" ).append( value[i] ).append( "\"" );
230                                    LADRS[i] = lbuf.length() ;
231                                    if( isCls && ! "".equals( cols[i][CLS] ) ) {
232                                            lbuf.append( " class=\"" ).append( cols[i][CLS] ).append( "\"" );
233                                    }
234                                    lbuf.append( ">" ).append( label[i] ).append( "</option>" );
235                            }
236                            if( isGrp && ! "".equals( bkGroupKey ) ) {
237                                    lbuf.append( "</optgroup>" );
238                            }
239                            LCACHE = lbuf.toString();
240                            LLEN   = LCACHE.length() + 30;
241                    }
242    
243                    isMultiSelect = ( USE_MULTI_KEY_SELECT && ! flag ) ;    // flag ã®åè»¢ã«æ³¨æ„?
244                    createTime = System.currentTimeMillis() ;
245            }
246    
247            /**
248             * åˆæœŸå€¤ãŒé¸æŠžæ¸ˆã¿ã® é¸æŠžè‚¢(オプション)ã‚’è¿”ã—ã¾ã™ã?
249             * ã“ã?オプションã¯ã€å¼•æ•°ã®å€¤ã‚’å?期å?ã¨ã™ã‚‹ã‚ªãƒ—ションタグを返ã—ã¾ã™ã?
250             * ã“ã?メソãƒ?ƒ‰ã§ã¯ã€ãƒ©ãƒ™ãƒ«(短)ãŒè¨­å®šã•れã¦ã?‚‹å ´åˆã§ã‚‚ã?ã“れを使用ã›ãšã«å¿?šãƒ©ãƒ™ãƒ«(é•·)を使用ã—ã¾ã™ã?
251             *
252             * @og.rev 3.6.0.6 (2004/10/22) シーケンスアクセス機è?を指定ã™ã‚?seqFlag ã‚’å°Žå?
253             * @og.rev 4.0.0.0 (2005/01/31) selectValue ãŒã?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            public String getOption( final String selectValue,final boolean seqFlag, final boolean useShortLabel ) {
281                    int[] adrs = null;
282                    String cache = null;
283                    int len = 0;
284                    if( !useShortLabel && LCACHE != null && LCACHE.length() > 0 ) {
285                            adrs = LADRS;
286                            cache = LCACHE;
287                            len = LLEN;
288                    }
289                    else {
290                            adrs = ADRS;
291                            cache = CACHE;
292                            len = LEN;
293                    }
294    
295                    // マッãƒã™ã‚‹ã‚¢ãƒ‰ãƒ¬ã‚¹ã‚’探ã™ã?
296                    Integer sel = map.get( selectValue );
297    
298                    if( sel == null ) {
299                            // 4.0.0 (2005/01/31)
300                            if( selectValue != null && selectValue.length() > 0 ) {
301                                    String errMsg = "DBコードã«å­˜åœ¨ã—ãªã??ãŒæŒ‡å®šã•れã¾ã—ãŸã€?
302                                                            + " value=[" + selectValue + "]"
303                                                            + HybsSystem.CR ;
304                                    LogWriter.log( errMsg );
305                            }
306                            return cache;
307                    }
308                    else {
309                            int selected = sel.intValue();
310                            StringBuilder buf = new StringBuilder( len );
311                            // 3.6.0.6 (2004/10/22) シーケンスアクセス機è?を指定ã™ã‚?seqFlag ã‚’å°Žå?
312                            if( seqFlag ) {
313                                    buf.append( "<option value=\"" ).append( value[selected] ).append( "\"" );
314                            }
315                            else {
316                                    buf.append( cache.substring( 0,adrs[selected] ) );
317                            }
318                            buf.append( " selected=\"selected\"" );
319                            buf.append( cache.substring( adrs[selected] ) );
320                            return buf.toString() ;
321                    }
322            }
323    
324            /**
325             * åˆæœŸå€¤ãŒé¸æŠžæ¸ˆã¿ã® é¸æŠžè‚¢(オプション)ã‚’è¿”ã—ã¾ã™ã?
326             * ã“ã?オプションã¯ã€å¼•æ•°ã®å€¤ã‚’å?期å?ã¨ã™ã‚‹ã‚ªãƒ—ションタグを返ã—ã¾ã™ã?
327             * ※ ã“ã?クラスã§ã¯å®Ÿè£?•れã¦ã?¾ã›ã‚“ã€?
328             *
329             * @og.rev 2.1.0.1 (2002/10/17) é¸æŠžãƒªã‚¹ãƒˆã‚’ã€æ­£æ–¹å‘ã«ã—ã‹é¸ã¹ãªã?‚ˆã?«ã™ã‚‹ sequenceFlag ã‚’å°Žå?ã™ã‚‹
330             * @og.rev 3.8.6.0 (2006/09/29) useLabel 属æ? 追åŠ?
331             *
332             * @param   name         ラジオ㮠name
333             * @param   selectValue  é¸æŠžã•れã¦ã?‚‹å€¤
334             * @param   useLabel     ãƒ©ãƒ™ãƒ«è¡¨ç¤ºã®æœ‰ç„¡ [true:æœ?false:ç„¡]
335             *
336             * @return  オプションタグ
337             */
338            public String getRadio( final String name,final String selectValue,final boolean useLabel ) {
339                    String errMsg = "ã“ã?クラスã§ã¯å®Ÿè£?•れã¦ã?¾ã›ã‚“ã€?;
340                    throw new UnsupportedOperationException( errMsg );
341            }
342    
343            /**
344             * åˆæœŸå€¤ãŒé¸æŠžæ¸ˆã¿ã® é¸æŠžè‚¢(オプション)ã‚’è¿”ã—ã¾ã™ã?
345             * ã“ã?オプションã¯ã€å¼•æ•°ã®å€¤ã‚’å?期å?ã¨ã™ã‚‹ã‚ªãƒ—ションタグを返ã—ã¾ã™ã?
346             * ※ ã“ã?クラスã§ã¯å®Ÿè£?•れã¦ã?¾ã›ã‚“ã€?
347             *
348             * @param   selectValue  é¸æŠžã•れã¦ã?‚‹å€¤
349             *
350             * @return  オプションタグ
351             */
352            public String getRadioLabel( final String selectValue ) {
353                    String errMsg = "ã“ã?クラスã§ã¯å®Ÿè£?•れã¦ã?¾ã›ã‚“ã€?;
354                    throw new UnsupportedOperationException( errMsg );
355            }
356    
357            /**
358             * é¸æŠžè‚¢(value)ã«å¯¾ã™ã‚‹ãƒ©ãƒ™ãƒ«ã‚’è¿”ã—ã¾ã™ã?
359             * é¸æŠžè‚¢(value)ãŒã?存在ã—ãªã‹ã£ãŸå?åˆã?ã€?¸æŠžè‚¢ãã?ã‚‚ã?ã‚’è¿”ã—ã¾ã™ã?
360             * getValueLabel( XX ) ã¯ã€getValueLabel( XX,false ) ã¨åŒã˜ã§ã™ã?
361             *
362             * @param   selectValue é¸æŠžè‚¢ã®å€¤
363             *
364             * @return  é¸æŠžè‚¢ã®ãƒ©ãƒ™ãƒ«
365             * @see     #getValueLabel( String,boolean )
366             */
367            public String getValueLabel( final String selectValue ) {
368                    return getValueLabel( selectValue,false );
369            }
370    
371            /**
372             * é¸æŠžè‚¢(value)ã«å¯¾ã™ã‚‹ãƒ©ãƒ™ãƒ«ã‚’è¿”ã—ã¾ã™ã?
373             * é¸æŠžè‚¢(value)ãŒã?存在ã—ãªã‹ã£ãŸå?åˆã?ã€?¸æŠžè‚¢ãã?ã‚‚ã?ã‚’è¿”ã—ã¾ã™ã?
374             * ã“ã?メソãƒ?ƒ‰ã§ã¯ã€çŸ­ç¸®ãƒ©ãƒ™ãƒ«ã‚’è¿”ã™ã‹ã©ã?‹ã‚’指定ã™ã‚‹ãƒ•ラグを指定ã—ã¾ã™ã?
375             * getValueLabel( XX,false ) ã¯ã€getValueLabel( XX ) ã¨åŒã˜ã§ã™ã?
376             *
377             * @og.rev 4.0.0.0 (2005/11/30) を追�
378             * @og.rev 5.3.5.0 (2011/05/01) åç§°(短)表示時ã«åç§°(é•·)をツールãƒãƒƒãƒ—ã§è¡¨ç¤ºã™ã‚‹ã€?
379             *
380             * @param       selectValue     é¸æŠžè‚¢ã®å€¤
381             * @param       flag    短縮ラベルを使用ã™ã‚‹ [true:使用ã™ã‚‹/false:ã—ãªã„]
382             *
383             * @return  é¸æŠžè‚¢ã®ãƒ©ãƒ™ãƒ«
384             * @see     #getValueLabel( String )
385             */
386            public String getValueLabel( final String selectValue,final boolean flag ) {
387                    // マッãƒã™ã‚‹ã‚¢ãƒ‰ãƒ¬ã‚¹ã‚’探ã™ã?
388                    Integer sel = map.get( selectValue );
389    
390                    if( sel == null ) {
391                            return selectValue;
392                    }
393                    else {
394                            if( isShortLavel && flag ) {
395    //                              return slabel[sel.intValue()];
396                                    return "<span title=\""+label[sel.intValue()]+"\">"+slabel[sel.intValue()]+"</span>";
397                            }
398                            else {
399                                    return label[sel.intValue()] ;
400                            }
401                    }
402            }
403    
404            /**
405             * マルãƒã?キーセレクトを使用ã™ã‚‹ã‹ã©ã?‹ã‚’è¿”ã—ã¾ã™ã?
406             * true?šä½¿ç”¨ã™ã‚‹ã€‚false:使用ã—ãªã?ã§ã™ã?
407             * ãŸã ã—ã?実際ã«ä½¿ç”¨ã™ã‚‹ã‹ã©ã?‹ã¯ã€HTMLå‡ºåŠ›æ™‚ã«æ±ºã‚ã‚‹ã“ã¨ãŒå?æ¥ã¾ã™ã?
408             * ã“ã“ã§ã¯ã€USE_MULTI_KEY_SELECT ã?true ã§ã€USE_SIZE(=20)以上ã?å ´åˆã«
409             * true ã‚’è¿”ã—ã¾ã™ã?
410             *
411             * @og.rev 3.5.5.7 (2004/05/10) æ–°è¦ä½œæ?
412             *
413             * @return  é¸æŠžãƒªã‚¹ãƒˆã§ã€ã?ルãƒã?キーセレクトを使用ã™ã‚‹ã‹ã©ã?‹(true:使用ã™ã‚‹)
414             */
415            public boolean useMultiSelect() {
416                    return isMultiSelect;
417            }
418    
419            /**
420             * オブジェクトã?キャãƒ?‚·ãƒ¥ãŒæ™‚é–“å?れã‹ã©ã?‹ã‚’è¿”ã—ã¾ã™ã?
421             * キャãƒ?‚·ãƒ¥ãŒæ™‚é–“å?ã‚?無効)ã§ã‚れã°ã€true ã‚’ã?有効ã§ã‚れã°ã€?
422             * false ã‚’è¿”ã—ã¾ã™ã?
423             *
424             * @og.rev 4.0.0.0 (2005/01/31) æ–°è¦ä½œæ?
425             *
426             * @return  キャãƒ?‚·ãƒ¥ãŒæ™‚é–“å?れãªã‚?true
427             */
428            public boolean isTimeOver() {
429                    return ( System.currentTimeMillis() - createTime > DB_CACHE_TIME ) ;
430            }
431    }