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.html;
017
018import org.opengion.hayabusa.common.HybsSystem;
019import org.opengion.hayabusa.db.DBTableModel;
020import org.opengion.fukurou.security.HybsCryptography;                          // 5.8.8.0 (2015/06/05)
021import org.opengion.fukurou.security.URLHashMap;
022import org.opengion.fukurou.util.StringUtil;
023import org.opengion.fukurou.util.Attributes;
024import org.opengion.fukurou.util.XHTMLTag;
025import org.opengion.fukurou.model.Formatter;
026import static org.opengion.fukurou.system.HybsConst.BUFFER_LARGE;               // 6.1.0.0 (2014/12/26) refactoring
027
028import java.util.concurrent.ConcurrentMap;                                                      // 6.4.3.3 (2016/03/04)
029import java.util.concurrent.ConcurrentHashMap;                                          // 6.4.3.1 (2016/02/12) refactoring
030import java.util.List;
031import java.util.ArrayList;
032import java.util.Arrays ;
033
034/**
035 * ViewLink インターフェース の実装オブジェクトです。
036 * これを,共通のスーパークラスとして 各種表示フォーム(例:HTML表示等)に使います。
037 *
038 * このクラスは、setter/getterメソッドのデフォルト実装を提供しています。
039 * 各種表示フォームに対応したサブクラス上で, create() をオーバーライドして下さい。
040 *
041 * @og.rev 2.1.0.3 (2002/11/08) エンコードの開始/終了アドレスを求める処理の修正
042 * @og.rev 4.0.0.0 (2005/08/31) 同一カラムの複数登録を許可します。
043 * @og.group 画面表示
044 *
045 * @version  4.0
046 * @author   Kazuhiko Hasegawa
047 * @since    JDK5.0,
048 */
049public class ViewLink_LINK implements ViewMarker {
050        private static final String REQ_KEY = HybsSystem.URL_HASH_REQ_KEY ;
051
052        private static final int        ACCS_LVL                = HybsSystem.sysInt( "URL_ACCESS_SECURITY_LEVEL" );
053        private static final int        MARK_NULL               = -1;   // リンク未設定
054        private static final int        MARK_TRUE               = 1;    // リンク作成
055        private static final int        MARK_FALSE              = 0;    // リンク作成せず
056
057        private List<Attributes>                markData        ;               // 4.0.0 (2005/08/31)
058        /** 6.4.3.1 (2016/02/12) PMD refactoring. HashMap → ConcurrentHashMap に置き換え。  */
059        private final ConcurrentMap<Integer,Formatter>  formMap         = new ConcurrentHashMap<>();    // 6.4.3.1 (2016/02/12)
060
061        /** 6.4.3.1 (2016/02/12) PMD refactoring. HashMap → ConcurrentHashMap に置き換え。  */
062        private final ConcurrentMap<Integer,List<Integer>>      clmMap  = new ConcurrentHashMap<>();    // 6.4.3.1 (2016/02/12)
063
064        private DBTableModel            table                   ;
065        private int[]                           markCmlNo               ;
066        private int[]                           isMark                  ;
067        // 2.1.0.3 (2002/11/08) エンコードの開始/終了アドレスを求める処理の修正
068        // 6.2.0.1 (2015/03/06) hrefアドレスのASCII以外の文字の、URLエンコードを行う。
069        private int[]                           hrefIn                  ;               // 初期値:範囲外 6.2.0.1 (2015/03/06)
070        private int[]                           encodeIn                ;               // 初期値:範囲外
071        private int[]                           encodeOut               ;               // 初期値:範囲外
072        // 3.5.2.0 (2003/10/20)
073        private String[]                        markKey                 ;
074        private String[]                        markLists               ;
075        private int[]                           markListNo              ;
076
077        private boolean[]                       useURLCheck             ;               // 4.3.7.1 (2009/06/08)
078        private String[]                        urlCheckUser    ;               // 4.3.7.1 (2009/06/08)
079        private long[]                          urlCheckTime    ;               // 4.3.7.1 (2009/06/08)
080        private HybsCryptography[]      urlCheckCrypt   ;               // 5.8.8.0 (2015/06/05)
081        private boolean[]                       useHrefEncode   ;               // 6.0.2.0 (2014/09/19)
082
083//      private String[]                        extToken                ;               // 5.8.2.1 (2014/12/13) 6.9.5.0 (2018/04/23) extToken 廃止
084
085        private int                                     editClmNo               ;               // 6.4.7.0 (2016/06/03) エディット機能で、rowCount カラムが存在するときのカラム番号。無ければ-1
086
087        /**
088         * デフォルトコンストラクター
089         *
090         * @og.rev 6.4.2.0 (2016/01/29) PMD refactoring. Each class should declare at least one constructor.
091         */
092        public ViewLink_LINK() { super(); }             // これも、自動的に呼ばれるが、空のメソッドを作成すると警告されるので、明示的にしておきます。
093
094        /**
095         * 内容をクリア(初期化)します。
096         *
097         * @og.rev 3.1.1.0 (2003/03/28) 同期メソッド(synchronized付き)を非同期に変更する。
098         * @og.rev 3.5.2.0 (2003/10/20) markLists,markListNo,markKey属性を追加
099         * @og.rev 3.5.6.1 (2004/06/25) formMap属性を追加
100         * @og.rev 4.3.7.1 (2009/06/08) URLチェック属性追加
101         * @og.rev 6.0.2.0 (2014/09/19) useHrefEncode属性追加
102         * @og.rev 5.8.2.1 (2014/12/13) extToken追加
103         * @og.rev 6.2.0.1 (2015/03/06) hrefアドレスのASCII以外の文字の、URLエンコードを行う。
104         * @og.rev 5.8.8.0 (2015/06/05) urlCheckCrypt追加
105         * @og.rev 6.4.3.1 (2016/02/12) PMD refactoring. HashMap → ConcurrentHashMap に置き換え。
106         * @og.rev 6.4.7.0 (2016/06/03) エディット機能で、rowCount カラムが存在するときのカラム番号。無ければ-1;
107         * @og.rev 6.9.5.0 (2018/04/23) extToken 廃止
108         */
109        public void clear() {
110                markData        = null;                 // 4.0.0 (2005/08/31)
111                formMap.clear();                        // 6.4.3.3 (2016/03/04)
112                table           = null;
113                isMark          = null;
114                hrefIn          = null;                 // 6.2.0.1 (2015/03/06)
115                encodeIn        = null;
116                encodeOut       = null;
117                markKey         = null;
118                markLists       = null;
119                markListNo      = null;
120                clmMap.clear();                         // 6.4.3.3 (2016/03/04)
121                useURLCheck             = null;         // 4.3.7.1 (2009/06/08)
122                urlCheckUser    = null;         // 4.3.7.1 (2009/06/08)
123                urlCheckTime    = null;         // 4.3.7.1 (2009/06/08)
124                urlCheckCrypt   = null;         // 5.8.8.0 (2015/06/05)
125                useHrefEncode   = null;         // 6.0.2.0 (2014/09/19)
126//              extToken                = null;         // 5.8.2.1 (2014/12/14)
127                editClmNo               = -1;           // 6.4.7.0 (2016/06/03)
128        }
129
130        /**
131         * カラムに対するリンクアトリビュートをセットします。
132         *
133         * @og.rev 3.1.0.0 (2003/03/20) Hashtable を使用している箇所で、非同期でも構わない箇所を、HashMap に置換え。
134         * @og.rev 3.1.1.0 (2003/03/28) 同期メソッド(synchronized付き)を非同期に変更する。
135         * @og.rev 4.0.0.0 (2005/08/31) 同一カラムの複数登録を許可します。
136         *
137         * @param       attri   リンクアトリビュート
138         */
139        public void addAttribute( final Attributes attri ) {
140                if( markData == null ) { markData = new ArrayList<>(); }
141                markData.add( attri );
142        }
143
144        /**
145         * このマーカーが、初期化されているかどうかを判定します。
146         *
147         * 使用できる状態の場合は、true , 初期化が出来ていない場合は、false を返します。
148         *
149         * @og.rev 6.7.2.0 (2017/01/16) caseKey,caseVal等で未使用のときの対応。
150         *
151         * @return      初期化状況 [true:初期化済み/false:未初期化]
152         */
153        public boolean isUsable() {
154//              return markData != null && markData.size() > 0 ;                // 本当は、ゼロということは無いはず。
155                return markData != null && !markData.isEmpty() ;                // 本当は、ゼロということは無いはず。            // 6.9.7.0 (2018/05/14) PMD
156        }
157
158        /**
159         * 内部に DBTableModel をセットします。
160         *
161         * @og.rev 2.1.0.3 (2002/11/08) エンコードの開始/終了アドレスを求める処理の修正
162         * @og.rev 3.1.1.0 (2003/03/28) 同期メソッド(synchronized付き)を非同期に変更する。
163         * @og.rev 3.5.2.0 (2003/10/20) markLists,markListNo,markKey属性を追加
164         * @og.rev 3.5.5.0 (2004/03/12) xlink 属性によるリンク情報作成方法の分岐を追加
165         * @og.rev 3.5.6.1 (2004/06/25) DBTableModel の再設定に対応。
166         * @og.rev 3.5.6.2 (2004/07/05) linkFormat をパラメータで取得するように変更。
167         * @og.rev 3.8.1.1 (2005/11/21) linkFormat が "[","]" をエンコードしてしまった場合に元に戻します。
168         * @og.rev 4.0.0.0 (2005/08/31) 同一カラムの複数登録を許可します。
169         * @og.rev 4.3.7.1 (2009/06/08) URLチェック機能追加
170         * @og.rev 6.0.2.0 (2014/09/19) useHrefEncode属性追加
171         * @og.rev 6.2.0.1 (2015/03/06) hrefアドレスのASCII以外の文字の、URLエンコードを行う。
172         * @og.rev 5.8.8.0 (2015/06/05) urlCheckCrypt対応
173         * @og.rev 6.4.3.3 (2016/03/04) Map#computeIfAbsent で対応する。
174         * @og.rev 6.4.3.4 (2016/03/11) Formatterに新しいコンストラクターを追加する。
175         * @og.rev 6.4.7.0 (2016/06/03) エディット機能で、rowCount カラムが存在するときのカラム番号。無ければ-1;
176         * @og.rev 6.7.6.0 (2017/03/17) strictCheck 追加。
177         * @og.rev 6.9.5.0 (2018/04/23) extToken 廃止
178         *
179         * @param  tbl DBTableModelオブジェクト
180         */
181        public void setDBTableModel( final DBTableModel tbl ) {
182                table = tbl;
183                final int count = markData.size();              // 4.0.0 (2005/08/31)
184
185                isMark          = new int[count];
186                markKey         = new String[count];
187                markCmlNo       = new int[count];
188                markLists       = new String[count];
189                markListNo      = new int[count];
190                hrefIn          = new int[count];                                       // 6.2.0.1 (2015/03/06)
191                encodeIn        = new int[count];
192                encodeOut       = new int[count];
193                useURLCheck     = new boolean[count];                           // 4.3.7.1 (2009/06/08)
194                urlCheckUser    = new String[count];                    // 4.3.7.1 (2009/06/08)
195                urlCheckTime    = new long[count];                              // 4.3.7.1 (2009/06/08)
196                urlCheckCrypt   = new HybsCryptography[count];  // 5.8.8.0 (2015/06/05)
197                useHrefEncode   = new boolean[count];                   // 6.0.2.0 (2014/09/19)
198//              extToken                = new String[count];                    // 5.8.2.1 (2014/12/13) 6.9.5.0 (2018/04/23) extToken 廃止
199
200                Arrays.fill( isMark,MARK_FALSE );               // リンクの表示可否
201                Arrays.fill( markCmlNo,-1 );                    // リンクの可否を判断するカラム番号
202                Arrays.fill( hrefIn   ,10000 );                 // 初期値:範囲外 6.2.0.1 (2015/03/06)
203                Arrays.fill( encodeIn ,10000 );                 // 初期値:範囲外
204                Arrays.fill( encodeOut,-1 );                    // 初期値:範囲外
205                Arrays.fill( useURLCheck, false );              // 4.3.7.1 (2009/06/08)
206                Arrays.fill( urlCheckTime, 0L );                // 4.3.7.1 (2009/06/08)
207                Arrays.fill( useHrefEncode, false );    // 6.0.2.0 (2014/09/19) 決め打ちに近いがとりあえず初期化は false
208
209                // 6.4.7.0 (2016/06/03) エディット機能で、rowCount カラムが存在するときのカラム番号。無ければ-1;
210                editClmNo       = table.getColumnNo( "rowCount" , false );
211
212                // 4.0.0 (2005/08/31) 同一カラムの複数登録を許可します。
213                for( int intKey=0; intKey<count; intKey++ ) {
214                        final Attributes attri = markData.get( intKey );
215
216                        final String column = attri.get( "column" );
217
218                        // 6.7.6.0 (2017/03/17) カラムのDBTableModel存在チェック。初期値が true なので、attri に無い場合も、true になる。
219                        final String strChk = attri.get( "strictCheck" );
220                        final boolean strictCheck = ! "false".equalsIgnoreCase( strChk );
221
222                        // 6.4.3.1 (2016/02/12) ConcurrentMap 系は、key,val ともに not null 制限です。
223                        final int clm = table.getColumnNo( column,strictCheck );        // 6.7.6.0 (2017/03/17) strictCheck で、true の場合は、clm番号が見つからないときは、Exception発生
224
225                        if( clm < 0 ) { continue; }             // 6.7.6.0 (2017/03/17) 存在しない場合、以下の処理を行わない。= clmMap に、カラムが登録されない。
226
227                        // 6.4.3.3 (2016/03/04) Map#compute で対応する。
228                        // Map#computeIfAbsent : 戻り値は、既存の、または計算された値。追加有り、置換なし、削除なし
229                        clmMap.computeIfAbsent( clm,k -> new ArrayList<>() ).add( intKey );
230
231                        String linkFormat = attri.get( "linkFormat" );
232                        linkFormat = StringUtil.replace( linkFormat,"%5B","[" );                // 3.8.1.1 (2005/11/21)
233                        linkFormat = StringUtil.replace( linkFormat,"%5D","]" );                // 3.8.1.1 (2005/11/21)
234
235                        final Formatter formatter = new Formatter( table,linkFormat );  // 6.4.3.4 (2016/03/11)
236                        // 6.4.3.1 (2016/02/12) ConcurrentMap 系は、key,val ともに not null 制限です。
237                        formMap.put( intKey, formatter );
238
239                        // URLエンコード用の範囲設定。この範囲内のデータをURLエンコードする。
240                        final String[] format = formatter.getFormat();
241                        boolean findHref = false;
242                        for( int j=0; j<format.length; j++ ) {
243                                // 6.2.0.1 (2015/03/06) hrefアドレスのASCII以外の文字の、URLエンコードを行う。
244                                if( format[j] != null && format[j].indexOf( "href" ) >= 0 ) { findHref = true; hrefIn[intKey] = j; }
245                                if( findHref && format[j].indexOf( '?'   ) >= 0 ) { encodeIn[intKey]  = j; }
246                                if( findHref && format[j].indexOf( "\" " ) >= 0 ) { encodeOut[intKey] = j; findHref = false; }
247                        }
248
249                        // 4.3.7.1 (2009/06/08)
250                        useURLCheck[intKey]  = StringUtil.nval( attri.get( "useURLCheck"  ), false );
251                        urlCheckUser[intKey] = StringUtil.nval( attri.get( "urlCheckUser" ), null );
252                        urlCheckTime[intKey] = StringUtil.nval( attri.get( "urlCheckTime" ), 0L   );
253                        final String cryptKey= StringUtil.nval( attri.get( "urlCheckCrypt" ), null );   // 5.8.8.0 (2015/06/05)
254                        urlCheckCrypt[intKey]= new HybsCryptography( cryptKey );                                                // 5.8.8.0 (2015/06/05)
255                        useHrefEncode[intKey]= StringUtil.nval( attri.get( "useHrefEncode"), false );   // 6.0.2.0 (2014/09/19)
256//                      extToken[intKey]     = StringUtil.nval( attri.get( "extToken" )    , null  );   // 5.8.2.1 (2014/12/14) 6.9.5.0 (2018/04/23) extToken 廃止
257                        makeOnLinkFormat( intKey,attri );
258                }
259        }
260
261        /**
262         * 指定の行列に対するマーカー文字列を返します。
263         * この値は,すでにマーカー文字列処理されている為, RendererValue で
264         * 変換する必要はありません。
265         * 引数の value はそのカラムの値として利用されます。この値は、修飾済みの
266         * 値を与えることが可能です。
267         *
268         * @og.rev 2.1.0.3 (2002/11/08) エンコードの開始/終了アドレスを求める処理の修正
269         * @og.rev 3.0.0.0 (2002/12/25) URLEncoder.encode を StringUtil#urlEncode に置換え
270         * @og.rev 3.0.0.1 (2003/02/14) リンクの引数部分に、RendererValue が適用される箇所を修正
271         * @og.rev 3.0.0.1 (2003/02/14) リンクの引数部分に、RendererValue が適用される箇所を修正
272         * @og.rev 3.5.6.1 (2004/06/25) formMap属性を使用します。
273         * @og.rev 3.7.0.3 (2005/03/01) "{I}" 文字列に、行番号(row)を割り当てます。
274         * @og.rev 3.8.5.0 (2006/03/20) "{I}" ⇒ "%7BI%7D" として、行番号(row)を割り当てます。
275         * @og.rev 4.3.7.1 (2009/06/08) URLチェック機能追加
276         * @og.rev 4.3.7.4 (2009/07/01) 循環参照を解消
277         * @og.rev 5.2.3.0 (2010/12/01) URLのハッシュ化/暗号化を行います。
278         * @og.rev 6.0.2.0 (2014/09/19) useHrefEncode属性追加
279         * @og.rev 5.8.2.1 (2014/12/13) トークンプラグイン対応
280         * @og.rev 6.2.0.1 (2015/03/06) ASCII以外の文字の、URLエンコードを行う。
281         * @og.rev 6.2.4.0 (2015/05/15) エンコード範囲内の value は、値を使う。(元に戻す)
282         * @og.rev 5.8.8.0 (2015/06/05) urlCheckCrypt対応
283         * @og.rev 6.4.3.3 (2016/03/04) HybsSystem.newInstance(String,String) への置き換え。
284         * @og.rev 6.4.3.4 (2016/03/11) hrefIn の部分エンコードと、?以下のパラメータエンコードの判定間違い、修正
285         * @og.rev 6.4.7.0 (2016/06/03) エディット機能で、rowCount カラムが存在するときのカラム番号。無ければ-1;
286         * @og.rev 6.9.5.0 (2018/04/23) extToken 廃止
287         *
288         * @param   row 指定の行
289         * @param   clm 指定の列
290         * @param   value カラムの値
291         *
292         * @return  row行,colum列 のマーカー文字列
293         */
294        public String getMarkerString( final int row,final int clm,final String value ) {
295                final int intKey = isOnLink(row,clm) ;
296                if( intKey < 0 ) { return value; }
297
298                final Formatter formatter = formMap.get( intKey );
299                final int[]    clmNo  = formatter.getClmNos();
300                final String[] format = formatter.getFormat();
301
302                final StringBuilder strLink = new StringBuilder( BUFFER_LARGE );
303                int j=0;
304                for( ; j<clmNo.length; j++ ) {
305
306                        strLink.append( format[j] );
307
308                        // 6.2.4.0 (2015/05/15) エンコード範囲内の value は、値を使う。(元に戻す)
309                        String val = formatter.getValue(row,clmNo[j]);
310
311                        // 6.4.3.4 (2016/03/11) hrefIn の部分エンコードと、?以下のパラメータエンコードの判定間違い、修正
312                        if( hrefIn[intKey] <= j && j < encodeOut[intKey] ) {                    // (href) encode範囲内
313                                if( encodeIn[intKey] <= j ) {
314                                        val = StringUtil.urlEncode( val );                      // パラメータはフルエンコード
315                                }
316                                else if( useHrefEncode[intKey] ) {                              // 6.0.2.0 (2014/09/19) useHrefEncode属性追加
317                                        val = StringUtil.urlEncode2( val );             // ファイル名などは、部分エンコード
318                                }
319                        }
320                        else {                                                                                                                  // encode範囲外
321                                // なにもしない。
322                                if( clm == clmNo[j] ) { val = value; }          // 一致する場合の valueは、通常レンデラー
323                        }
324
325                        strLink.append( val );
326                }
327                strLink.append( format[j] );
328
329                // 3.8.5.0 (2006/03/27) "{I}" と そのエンコード文字 "%7BI%7D" に、行番号(row)を割り当てます。
330                String rtn = strLink.toString();
331                final String sRow = String.valueOf( row );
332                rtn = StringUtil.replace( rtn,"{I}",sRow );
333                rtn = StringUtil.replace( rtn,"%7BI%7D",sRow );
334
335                // 4.3.7.1 (2009/06/08)
336                if( useURLCheck[intKey] ) {
337                        // 4.3.7.4 (2009/07/01)
338                        rtn = XHTMLTag.embedURLCheckKey( rtn, HybsSystem.URL_CHECK_KEY, urlCheckUser[intKey], urlCheckTime[intKey], urlCheckCrypt[intKey] ); // 5.8.8.0 (2015/06/05)
339                }
340
341//              // 5.8.2.1 (2014/12/13) トークンプラグイン対応
342//              // 6.9.5.0 (2018/04/23) extToken 廃止
343//              if( extToken[intKey] != null && extToken[intKey].length() > 0 ){
344//                      final String[] tokens = StringUtil.csv2Array( extToken[intKey] );
345//                      for( final String tk :tokens ){
346//                              final CreateToken ct = HybsSystem.newInstance( "CreateToken_" , tk );
347//                              rtn = ct.embedToken( rtn, urlCheckTime[intKey], null );
348//                      }
349//              }
350
351                // 5.2.3.0 (2010/12/01) URLのハッシュ化/暗号化
352                if( ACCS_LVL == 2 ) {
353                        // ACCS_LVL == 2 の場合は、外部のみ処理するので、extOnly=true をセットする。
354                        rtn = URLHashMap.makeUrlChange( rtn,REQ_KEY,true );
355                }
356                else if( ACCS_LVL == 3 ) {
357                        rtn = URLHashMap.makeUrlChange( rtn,REQ_KEY,false );
358                }
359
360                return rtn ;
361        }
362
363        /**
364         * リンクを張る/張らないの指定カラム番号を求めます。
365         * また、int[列番号] isMark を初期化します。
366         *
367         * @og.rev 3.5.2.0 (2003/10/20) markLists,markListNo,markKey属性を追加
368         *
369         * @param       intKey  カラムキーの番号
370         * @param       attri   アトリビュート
371         */
372        private void makeOnLinkFormat( final int intKey,final Attributes attri ) {
373                final String onMark   = attri.get( "onLink" );
374                final String markList = attri.get( "markList" );
375
376                // 3.5.6.0 (2004/06/18) nullポインタの参照外しバグの対応
377                // このロジックで値が設定済みであれば、以下の処理は不要である。
378                isMark[intKey] = MARK_NULL;
379                if( onMark == null || onMark.isEmpty() ||
380                        markList == null || markList.isEmpty() ) {
381                                isMark[intKey] = MARK_FALSE;
382                                return ;        // 3.5.6.0 (2004/06/18)
383                }
384                else if( onMark.charAt(0) != '[' && markList.charAt(0) != '[' ) {
385                        isMark[intKey] = markList.indexOf( onMark ) >= 0 ? MARK_TRUE : MARK_FALSE;
386                        return ;        // 3.5.6.0 (2004/06/18)
387                }
388
389                if( onMark.charAt(0) == '[' ) {
390                        markCmlNo[intKey] = table.getColumnNo( onMark.substring( 1,onMark.length()-1 ));
391                }
392                else {
393                        markCmlNo[intKey]  = -1;
394                        markKey[intKey]    = onMark ;
395                }
396
397                if( markList.charAt(0) == '[' ) {
398                        markListNo[intKey] = table.getColumnNo( markList.substring( 1,markList.length()-1 ));
399                }
400                else {
401                        markListNo[intKey] = -1;
402                        markLists[intKey] = markList;
403                }
404        }
405
406        /**
407         * リンクを張るかどうかを判断します。
408         * int[列番号] isMark には、 未設定 FALSE TRUE の状態を持っており、
409         * 列でリンクを張る状態が固定の場合(例えば,onLink属性がデフォルト "true" の場合)
410         * カラムに関係なく、同じ値を返すときに、使用します。
411         *
412         * @og.rev 3.5.2.0 (2003/10/20) markLists,markListNo,markKey属性を追加
413         * @og.rev 3.5.4.0 (2003/11/25) onMark ,markList が null(またはゼロストリング)の場合は、false とする。
414         * @og.rev 4.0.0.0 (2005/08/31) 同一カラムの複数登録を許可します。
415         *
416         * @param       row     列番号
417         * @param       clm     カラムキーの名称
418         *
419         * @return      処理するリスト番号、-1 の場合は、該当なし
420         */
421        private int isOnLink( final int row,final int clm ) {
422                if( editClmNo >= 0 && StringUtil.nval( table.getValue( row,editClmNo ) , null ) != null ) {
423                        return -1;
424                }
425
426                final List<Integer> list = clmMap.get( clm );
427                if( list == null ) { return -1; }
428
429                for( int i=0; i<list.size(); i++ ) {
430                        final int intKey = list.get( i );
431                        if( isMark[intKey] != MARK_NULL ) {
432                                if( isMark[intKey] == MARK_TRUE ) { return intKey; }
433                                else { continue; }
434                        }
435
436                        String onMark ;
437                        if( markCmlNo[intKey] < 0 ) { onMark = markKey[intKey] ; }
438                        else { onMark = table.getValue( row,markCmlNo[intKey] ); }
439
440                        // 3.5.4.0 (2003/11/25) 追加
441                        if( onMark == null || onMark.isEmpty() ) { continue; }
442
443                        String markList ;
444                        if( markListNo[intKey] < 0 ) { markList = markLists[intKey] ; }
445                        else { markList = table.getValue( row,markListNo[intKey] ); }
446
447                        // 3.5.4.0 (2003/11/25) 修正
448                        if( markList == null || markList.isEmpty() ) { continue; }
449
450                        if( markList.indexOf( onMark ) >= 0 ) { return intKey; }
451                }
452                return -1;
453        }
454
455        /**
456         * マーカーされたカラム番号の配列を返します。
457         *
458         * これは特殊処理で、Edit機能で、カラム列をキャッシュしているときに、
459         * JSPのソース等の変更時に、変更が反映されない対応を行う場合、
460         * 通常の ViewFormのサブクラスから、Edit専用の ViewForm_HTMLSeqClmTable で
461         * 制御する場合、ViewMarkerのEditMarkerでは、通常非表示(検索の場合)ですが
462         * Editのポップアップ画面に、表示されてしまうのを避けるため、noDisplay に
463         * 強制的にするカラム番号が必要です。
464         * あくまで、暫定処置です。Edit機能を改修するときに、この機能は削除します。
465         *
466         * ※ この処理は、EditMarkerでのみ有効にします。
467         *
468         * @og.rev 6.0.3.0 (2014/11/13) Edit機能で、JSPソース変更時の対応
469         *
470         * @return  マーカーされたカラム番号の配列(常に、長さ0の配列を返す)
471         */
472        public int[] getColumnNos() {
473                return new int[0];
474        }
475}