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