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.plugin.table;
017
018 import org.opengion.hayabusa.common.HybsSystemException;
019 import org.opengion.hayabusa.db.AbstractTableFilter;
020 import org.opengion.hayabusa.db.DBTableModel;
021 import org.opengion.hayabusa.report2.QueueManager_DB;
022
023 import java.util.Map;
024
025 /**
026 * TableFilter_REPORTDATA は、TableFilter インターフェースを継承した、DBTableModel 処ç�?”¨の
027 * 実è£?‚¯ラスですã?
028 *
029 * ここでは、指定された要æ±?Oに対してGE51(帳票明細ãƒ??タ)をGE52(帳票レイアウトテーブル)の定義に従ってã€?
030 * åˆ?‰²しã?DBTableModelを生成しますã?
031 *
032 * パラメータは、tableFilterタグの keys, vals にそれぞれ記述するかã?BODY 部にCSS形式で記述しますã?
033 * 【パラメータã€?
034 * {
035 * SYSTEM_ID : ; 検索対象となるã?シスãƒ?ƒ ID(å¿??)
036 * LISTID : ; 検索対象となるã?帳票ID(å¿??)
037 * YKNO : ; 検索対象となるã?要求番号(å¿??)
038 * KBTEXT : ; H(ヘッãƒ??),F(フッター),B(ボディー)のã�?�šれかを指å®?å¿??)
039 * }
040 *
041 * @og.formSample
042 * ●形式ï¼?
043 * â‘?<og:tableFilter classId="REPORTDATA" keys="SYSTEM_ID,LISTID,YKNO,KBTEXT" vals="GF,GF0001,111100,B" />
044 *
045 * ② <og:tableFilter classId="REPORTDATA" >
046 * {
047 * SYSTEM_ID : GF ;
048 * LISTID : GF0001 ;
049 * YKNO : 111100 ;
050 * KBTEXT : B ;
051 * }
052 * </og:tableFilter>
053 *
054 * @see org.opengion.hayabusa.report2.QueueManager_DB.DBTableModelCreator
055 * @og.rev 5.1.2.0 (2010/01/01) 新規作æ?
056 * @og.rev 5.6.6.0 (2013/07/05) keys の整合æ?チェãƒ?‚¯を追åŠ?
057 *
058 * @version 0.9.0 2000/10/17
059 * @author Hiroki Nakamura
060 * @since JDK1.1,
061 */
062 public class TableFilter_REPORTDATA extends AbstractTableFilter {
063 //* こã?プログラãƒ??VERSIONæ–?—å?を設定しますã? {@value} */
064 private static final String VERSION = "5.6.6.1 (2013/07/12)" ;
065
066 /**
067 * keys の整合æ?チェãƒ?‚¯を行うための初期設定を行いますã?
068 *
069 * @og.rev 5.6.6.1 (2013/07/12) keys の整合æ?チェãƒ?‚¯対å¿?
070 *
071 * @param keysMap keys の整合æ?チェãƒ?‚¯を行うための Map
072 */
073 @Override
074 protected void init( final Map<String,String> keysMap ) {
075 keysMap.put( "SYSTEM_ID" , "検索対象となるã?シスãƒ?ƒ ID(å¿??)" );
076 keysMap.put( "LISTID" , "検索対象となるã?帳票ID(å¿??)" );
077 keysMap.put( "YKNO" , "検索対象となるã?要求番号(å¿??)" );
078 keysMap.put( "KBTEXT" , "H(ヘッãƒ??),F(フッター),B(ボディー)のã�?�šれかを指å®?å¿??)" );
079 }
080
081 /**
082 * DBTableModel処ç�?‚’実行しますã?
083 *
084 * @og.rev 5.5.2.6 (2012/05/25) protected変数をã?private化したためã?getterメソãƒ?ƒ‰で取得するよã�?�«変更
085 *
086 * @return 処ç�?µ�果のDBTableModel
087 */
088 public DBTableModel execute() {
089 String systemId = getValue( "SYSTEM_ID" );
090 String listId = getValue( "LISTID" );
091 String ykno = getValue( "YKNO" );
092 String kbtext = getValue( "KBTEXT" );
093
094 if( systemId == null || systemId.length() == 0
095 || listId == null || listId.length() == 0
096 || ykno == null || ykno.length() == 0
097 || kbtext == null || kbtext.length() == 0 ) {
098 String errMsg = "SYSTEM_ID,LISTID,YKNO,KBTEXTをå?てæŒ?®šして下さã�??";
099 throw new HybsSystemException( errMsg );
100 }
101
102 if( kbtext.length() > 1 || "HFB".indexOf( kbtext ) < 0 ) {
103 String errMsg = "KBTEXTは、H(ヘッãƒ??),F(フッター),B(ボディー)のã�?�šれかを指定して下さã�?;
104 throw new HybsSystemException( errMsg );
105 }
106
107 QueueManager_DB.DBTableModelCreator creator
108 // = new QueueManager_DB.DBTableModelCreator( systemId, listId, ykno, kbtext, resource );
109 = new QueueManager_DB.DBTableModelCreator( systemId, listId, ykno, kbtext, getResource() ); // 5.5.2.6 (2012/05/25)
110
111 return creator.getTable();
112 }
113 }