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