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.taglib;
017    
018    import org.opengion.hayabusa.resource.UserInfo;
019    import org.opengion.hayabusa.db.DBTableModel;
020    import org.opengion.hayabusa.db.Query;
021    import org.opengion.hayabusa.db.QueryFactory;
022    import org.opengion.fukurou.db.Transaction;
023    import org.opengion.fukurou.db.TransactionReal;
024    
025    import static org.opengion.fukurou.util.StringUtil.nval ;
026    
027    import java.util.Locale ;
028    import java.io.ObjectOutputStream;
029    import java.io.ObjectInputStream;
030    import java.io.IOException;
031    
032    /**
033     * ユーザーæƒ??を管ç?—ã¦ã?‚‹ã‚¿ã‚°ã§ã™ã?
034     *
035     * 設定ã—ãŸå?ã¯ã€{@USER.XXXX} å½¢å¼ã§ å–り出ã™ã“ã¨ãŒã§ãã¾ã™ã?
036     * ã¾ãŸã?command 属æ?㧠直接画é¢ã«å€¤ã‚’書ãå?ã™ã“ã¨ã‚‚å¯èƒ½ã§ã™ã?
037     *
038     * 以下ã?値㯠UserInfo オブジェクトã?é ?›®ã‹ã‚‰å–å¾—ã—ã¾ã™ã?
039     * ・USER.JNAME     ユーザー日本語åç§°
040     * ・USER.ID        ユーザー?©?¤
041     * ・USER.IDNO      USER.ID ãŒï¼•Byte以上ã?時ã?ã¿å…ˆé??‘文字を除ã?Ÿãƒ¦ãƒ¼ã‚¶ãƒ¼?©?¤
042     * ・USER.INFO      ユーザーæƒ??(ユーザーID?šæ—¥æœ¬èªžåç§°)
043     * ・USER.LANG      è¨?ª?
044     * ・USER.ROLES     ロール
045     * ・USER.IPADDRESS IPアドレス
046     * ・USER.LOGINTIME ログイン時刻
047     *
048     * 以下ã?値ã¯ã‚らã‹ã˜ã‚ã?å‹•çš„ã«ä½œæ?ã•れã¾ã™ã?
049     * ・USER.YMD       ?˜byte ã®ä»Šæ—¥ã®ã‚·ã‚¹ãƒ?ƒ æ—¥ä»?
050     * ・USER.YMDH    ?‘ï¼”byte ã®ä»Šæ—¥ã®ã‚·ã‚¹ãƒ?ƒ æ—¥æ™?
051     *
052     * ãれ以外ã?ã€å¤–部より設定ã•れãŸå€¤ã§ã™ã?
053     *
054     * ※ ã“ã?ã‚¿ã‚°ã¯ã€Transaction ã‚¿ã‚°ã®å¯¾è±¡ã§ã™ã?
055     *
056     * @og.formSample
057     * â—å½¢å¼ï¼?lt;og:userInfo command="[…]" key="[…]" value="[…]" />
058     * â—body?šã‚ã‚?EVAL_BODY_BUFFERED:BODYを評価ã—ã?{@XXXX} ã‚’è§£æžã—ã¾ã?
059     *
060     * â—Tag定義??
061     *   <og:userInfo
062     *       command            ã€TAG】コマンãƒ?SET,GET,NVLGET,REMOVE,SQL)ã‚’ã‚»ãƒ?ƒˆã—ã¾ã?åˆæœŸå€¤:SET)
063     *       key                ã€TAG】UserInfo ã«ç™»éŒ²ã™ã‚‹ã‚­ãƒ¼ã‚’ã‚»ãƒ?ƒˆã—ã¾ã?予ç´?ª?JNAME,ID,PASSWD,IDNO,INFO,LANG,ROLE,IPADDRESS,LOGINTIME)
064     *       value              ã€TAG】UserInfo ã«ç™»éŒ²ã™ã‚‹å€¤ã‚’ã‚»ãƒ?ƒˆã—ã¾ã?
065     *       dbid               ã€TAGã€?通常ã¯ä½¿ã?¾ã›ã‚“)Queryオブジェクトを作æ?ã™ã‚‹æ™‚ã?DB接続IDを指定ã—ã¾ã?
066     *       save               ã€TAG】UserInfo ã«ç™»éŒ²ã—ãŸå€¤ã‚’永続化ã™ã‚‹ã‹ã‚’æŒ?®šã—ã¾ã?
067     *       caseKey            ã€TAG】ã“ã®ã‚¿ã‚°è‡ªä½“を利用ã™ã‚‹ã‹ã©ã?‹ã®æ¡ä»¶ã‚­ãƒ¼ã‚’指定ã—ã¾ã?åˆæœŸå€¤:null)
068     *       caseVal            ã€TAG】ã“ã®ã‚¿ã‚°è‡ªä½“を利用ã™ã‚‹ã‹ã©ã?‹ã®æ¡ä»¶å€¤ã‚’指定ã—ã¾ã?åˆæœŸå€¤:null)
069     *       caseNN             ã€TAG】指定ã?値ãŒã?null/ゼロæ–?­—å? ã§ãªã??å?Not Null=NN)ã¯ã€ã“ã®ã‚¿ã‚°ã¯ä½¿ç”¨ã•れã¾ã?åˆæœŸå€¤:true)
070     *       caseNull           ã€TAG】指定ã?値ãŒã?null/ゼロæ–?­—å? ã®å ´åˆã?ã€ã“ã®ã‚¿ã‚°ã¯ä½¿ç”¨ã•れã¾ã?åˆæœŸå€¤:true)
071     *       debug              ã€TAG】デãƒãƒƒã‚°æƒ??ã‚’å?力ã™ã‚‹ã‹ã©ã?‹[true/false]を指定ã—ã¾ã?åˆæœŸå€¤:false)
072     *   >   ... Body ...
073     *   </og:userInfo>
074     *
075     * â—使用ä¾?
076     *      <og:userInfo
077     *         command       = "コマンãƒ?SET,GET,NVLGET,REMOVE,SQL)ã‚’ã‚»ãƒ?ƒˆã—ã¾ã?åˆæœŸå€¤:SET)ã€?quot;
078     *         key           = "UserInfo ã«ç™»éŒ²ã™ã‚‹ã‚­ãƒ¼ã‚’ã‚»ãƒ?ƒˆã—ã¾ã?予ç´?ª?JNAME,ID,PASSWD,IDNO,INFO,LANG,ROLE,IPADDRESS,LOGINTIME)ã€?quot;
079     *         value         = "UserInfo ã«ç™»éŒ²ã™ã‚‹å€¤ã‚’ã‚»ãƒ?ƒˆã—ã¾ã™ã?"
080     *         dbid          = "(通常ã¯ä½¿ã?¾ã›ã‚“)Queryオブジェクトを作æ?ã™ã‚‹æ™‚ã?DB接続IDを指定ã—ã¾ã™ã?"
081     *      >
082     *
083     * @og.group ãã?他部å“?
084     *
085     * @version  4.0
086     * @author   Kazuhiko Hasegawa
087     * @since    JDK5.0,
088     */
089    public class UserInfoTag extends CommonTagSupport {
090            //* ã“ã?プログラãƒ??VERSIONæ–?­—å?を設定ã—ã¾ã™ã?       {@value} */
091            private static final String VERSION = "5.3.8.0 (2011/08/01)" ;
092    
093            private static final long serialVersionUID = 538020110801L ;
094    
095            /** command å¼•æ•°ã«æ¸¡ã™äº‹ã?出æ¥ã‚?コマンãƒ? ã‚»ãƒ?ƒˆ {@value} */
096            public static final String CMD_SET   = "SET" ;
097            /** command å¼•æ•°ã«æ¸¡ã™äº‹ã?出æ¥ã‚?コマンãƒ? ゲãƒ?ƒˆ {@value} */
098            public static final String CMD_GET   = "GET" ;
099            /** command å¼•æ•°ã«æ¸¡ã™äº‹ã?出æ¥ã‚?コマンãƒ? ゲãƒ?ƒˆ {@value} */
100            public static final String CMD_REMOVE   = "REMOVE" ;
101            /** command å¼•æ•°ã«æ¸¡ã™äº‹ã?出æ¥ã‚?コマンãƒ? ゲãƒ?ƒˆ {@value} */
102            public static final String CMD_SQL   = "SQL" ;
103            // 3.5.5.3 (2004/04/09) 値ã?null ã®å ´åˆã?ã€?"(ゼロæ–?­—å?)ã‚’è¿”ã™NVLGETを採用
104            /** command å¼•æ•°ã«æ¸¡ã™äº‹ã?出æ¥ã‚?コマンãƒ? NVLゲãƒ?ƒˆ {@value} */
105            public static final String CMD_NVLGET   = "NVLGET" ;
106    
107            // 3.5.5.3 (2004/04/09) 値ã?null ã®å ´åˆã?ã€?"(ゼロæ–?­—å?)ã‚’è¿”ã™NVLGETを採用
108            /** command å¼•æ•°ã«æ¸¡ã™äº‹ã?出æ¥ã‚?コマンãƒ?リスãƒ? */
109            private static final String[] COMMAND_LIST = new String[] {
110                    CMD_SET , CMD_GET , CMD_NVLGET , CMD_REMOVE , CMD_SQL };
111    
112            // 3.5.6.0 (2004/06/18) ã™ã¹ã¦ã‚?protected ã‹ã‚‰ private ã«å¤‰æ›´ã—ã¾ã™ã?
113            private String                  command         = CMD_SET;
114            private String                  key                     = null;
115            private String                  value           = null;
116    //      private boolean                 isNullSet       = true;                 // NULL ã®ã¨ãã«ã‚»ãƒ?ƒˆã—ç›´ã™ã‹ã©ã?‹ã€?
117            private transient DBTableModel  table           = null;
118            // 4.0.0.0 (2007/10/10) dbid ã®åˆæœŸå€¤ã‚’ã?"DEFAULT" ã‹ã‚‰ null ã«å¤‰æ›´
119    //      private String                  dbid            = "DEFAULT";
120            private String                  dbid            = null;
121            private String                  sql                     = null;
122            // 4.3.4.0 (2008/12/01) save属æ?追åŠ?
123            private boolean                 save            = false;
124    
125            /**
126             * Taglibã®é–‹å§‹ã‚¿ã‚°ãŒè¦‹ã¤ã‹ã£ãŸã¨ãã«å‡¦ç?™ã‚?doStartTag() ã‚?オーãƒã?ライドã—ã¾ã™ã?
127             *
128             * @og.rev 5.2.2.0 (2010/11/01) caseKey ã€caseVal 属æ?対å¿?
129             *
130             * @return      後続å?ç??æŒ?¤º
131             */
132            @Override
133            public int doStartTag() {
134                    // 5.2.2.0 (2010/11/01) caseKey ã€caseVal 属æ?対å¿?
135    //              if( CMD_SQL.equals( command ) ) {
136                    if( useTag() && CMD_SQL.equals( command ) ) {
137                            return( EVAL_BODY_BUFFERED );           // Body を評価ã™ã‚‹
138                    }
139                    else {
140                            return( SKIP_BODY ); // Body を評価ã—ãªã?
141                    }
142            }
143    
144            /**
145             * Taglibã®ã‚¿ã‚°æœ¬ä½“を処ç?™ã‚?doAfterBody() ã‚?オーãƒã?ライドã—ã¾ã™ã?
146             *
147             * @og.rev 3.1.1.0 (2003/03/28) ボディã®å†?®¹ã‚’å–å¾—ã™ã‚‹å?ç?‚’ã€CommonTagSupport ã§è¡Œã†ã€?
148             * @og.rev 3.6.0.8 (2004/11/19) エラー発生時ã«ç¢ºå®Ÿã«ãƒªãƒªãƒ¼ã‚¹ã•れるよã?« try finally 追åŠ?
149             * @og.rev 3.8.6.3 (2006/11/30) SQL æ–??å‰å¾Œã?スペã?スをå–り除ãã¾ã™ã?
150             * @og.rev 3.8.7.0 (2006/12/15) アクセスログå–å¾—ã?為,ApplicationInfoオブジェクトを設å®?
151             * @og.rev 4.0.0.0 (2005/01/31) lang â‡?ResourceManager ã¸å¤‰æ›´
152             * @og.rev 5.1.9.0 (2010/08/01) TransactionTag 対応ã?上ä½ã« TransactionTag ãŒã‚れã?ã€ãã“ã‹ã‚‰Connection をもらã†ã€?
153             * @og.rev 5.3.7.0 (2011/07/01) TransactionReal ã®å¼•数変更
154             * @og.rev 5.3.8.0 (2011/08/01) Transaction発生ç®?‰€ã§close()
155             *
156             * @return      後続å?ç??æŒ?¤º(SKIP_BODY)
157             */
158            @Override
159            public int doAfterBody() {
160                    sql = getBodyString().trim();
161    
162                    Query query = QueryFactory.newInstance();               // 4.0.0 (2005/01/31)
163                    Transaction tran = null;
164                    try {
165                            // 5.1.9.0 (2010/08/01) TransactionTag 対�
166    //                      final Transaction tran ;
167                            TransactionTag tranTag = (TransactionTag)findAncestorWithClass( this,TransactionTag.class );
168                            if( tranTag == null ) {
169    //                              tran = new TransactionReal( dbid,getApplicationInfo() );
170                                    tran = new TransactionReal( getApplicationInfo() );             // 5.3.7.0 (2011/07/01) 引数変更
171                            }
172                            else {
173                                    tran = tranTag.getTransaction();
174                            }
175                            query.setTransaction( dbid,tran );      // 5.1.9.0 (2010/08/01) TransactionTag 対�
176    
177    //                      query.setConnectionID( dbid );
178                            query.setResourceManager( getResource() );      // 4.0.0 (2005/01/31)
179    
180                            query.setStatement( sql );
181    //                      query.setApplicationInfo( getApplicationInfo() );       // 3.8.7.0 (2006/12/15)
182                            query.execute();
183    
184                            table = query.getDBTableModel();
185                    }
186                    finally {
187    //                      if( query != null ) { query.close(); }
188                            QueryFactory.close( query );
189                            if( tran != null ) { tran.close(); }            // 5.3.8.0 (2011/08/01) Transaction発生ç®?‰€ã§close()
190                    }
191                    return(SKIP_BODY);
192            }
193    
194            /**
195             * Taglibã®çµ‚äº?‚¿ã‚°ãŒè¦‹ã¤ã‹ã£ãŸã¨ãã«å‡¦ç?™ã‚?doEndTag() ã‚?オーãƒã?ライドã—ã¾ã™ã?
196             *
197             * @og.rev 3.1.1.2 (2003/04/04) Tomcat4.1 対応ã?release2() ã‚?doEndTag()ã§å‘¼ã¶ã€?
198             * @og.rev 3.5.5.3 (2004/04/09) 値ã?null ã®å ´åˆã?ã€?"(ゼロæ–?­—å?)ã‚’è¿”ã™ãƒ•ラグを採用
199             * @og.rev 5.2.2.0 (2010/11/01) caseKey ã€caseVal 属æ?対å¿?
200             *
201             * @return      後続å?ç??æŒ?¤º
202             */
203            @Override
204            public int doEndTag() {
205                    debugPrint();           // 4.0.0 (2005/02/28)
206                    // 5.2.2.0 (2010/11/01) caseKey ã€caseVal 属æ?対å¿?
207    //              if( check( command, COMMAND_LIST ) ) {
208                    if( useTag() && check( command, COMMAND_LIST ) ) {
209                            commandExec( command );
210    
211                            if( CMD_GET.equals( command ) ) {
212                                    jspPrint( value );
213                            }
214                            else if( CMD_NVLGET.equals( command ) ) {       // 3.5.5.3 (2004/04/09)
215                                    jspPrint( nval(value,"") );
216                            }
217                    }
218    
219                    return(EVAL_PAGE);
220            }
221    
222            /**
223             * タグリブオブジェクトをリリースã—ã¾ã™ã?
224             * キャãƒ?‚·ãƒ¥ã•れã¦å†åˆ©ç”¨ã•れるã?ã§ã€ãƒ•ィールドã?åˆæœŸè¨­å®šã‚’行ã„ã¾ã™ã?
225             *
226             * @og.rev 2.0.0.4 (2002/09/27) カスタãƒ?‚¿ã‚°ã® release() メソãƒ?ƒ‰ã‚’ã?追åŠ?
227             * @og.rev 3.1.1.2 (2003/04/04) Tomcat4.1 対応ã?release2() ã‚?doEndTag()ã§å‘¼ã¶ã€?
228             * @og.rev 4.0.0.0 (2007/10/10) dbid ã®åˆæœŸå€¤ã‚’ã?"DEFAULT" ã‹ã‚‰ null ã«å¤‰æ›´
229             * @og.rev 4.3.4.0 (2008/12/01) save属æ?対å¿?
230             *
231             */
232            @Override
233            protected void release2() {
234                    super.release2();
235                    command         = CMD_SET;
236                    key                     = null;
237                    value           = null;
238    //              isNullSet       = true;                 // NULL ã®ã¨ãã«ã‚»ãƒ?ƒˆã—ç›´ã™ã‹ã©ã?‹ã€?
239                    table           = null;
240    //              dbid            = "DEFAULT";
241                    dbid            = null;
242                    sql                     = null;
243                    save            = false;
244            }
245    
246            /**
247             * コマンドを実行ã—ã¾ã™ã?
248             *
249             * コマンドã?,HTMLã‹ã‚‰(get/post)æŒ?®šã•れã¾ã™ã?ã§,setCommand()メソãƒ?ƒ‰ã§
250             * 登録ã—ã¾ã™ã?
251             * コマンドを登録ã™ã‚‹ã¨åŒæ™‚ã«,実行も行ãªã?¾ã™ã?
252             *
253             * @og.rev 3.5.5.3 (2004/04/09) 値ã?null ã®å ´åˆã?ã€?"(ゼロæ–?­—å?)ã‚’è¿”ã™ãƒ•ラグを採用
254             *
255             * @param   command コマンãƒ?public static final 宣è¨?•れã¦ã?‚‹æ–?­—å?)
256             * @see         <a href="../../../../constant-values.html#org.opengion.hayabusa.taglib.UserInfoTag.CMD_GET">コマンド定数</a>
257             */
258            protected void commandExec( final String command ) {
259                    if( CMD_SQL.equals( command ) ) { setSQLAttribute() ; }
260                    else if( CMD_SET.equals(    command ) ) { setAttribute() ;    }
261                    else if( CMD_GET.equals(    command ) ) { getAttribute() ;    }
262                    else if( CMD_NVLGET.equals( command ) ) { getAttribute() ;    } // 3.5.5.3 (2004/04/09)
263                    else if( CMD_REMOVE.equals( command ) ) { removeAttribute() ; }
264            }
265    
266            /**
267             * UserInfoã®æ–?­—å?を登録ã—ã¾ã™ã?
268             *
269             * @og.rev 4.3.4.0 (2008/12/01) GE20(ユーザー定数)ã¸ç™»éŒ²ã™ã‚‹ã‹ã?フラグを追åŠ?
270             *
271             */
272            private void setAttribute() {
273    //              if( isNullSet ) {
274    //                      setUserInfo( key, value );
275                            setUserInfo( key, value, save );
276    //              }
277            }
278    
279            /**
280             * UserInfoã®æ–?­—å?を作æ?ã—ã¾ã™ã?
281             *
282             */
283            private void getAttribute() {
284                    value = getUserInfo( key );
285            }
286    
287            /**
288             * UserInfoã®æ–?­—å?を削除ã—ã¾ã™ã?
289             *
290             * @og.rev 5.3.6.0 (2011/06/01) GE20(ユーザー定数)ã‹ã‚‰å‰Šé™¤ã™ã‚‹ã‹ã?フラグを追åŠ?
291             */
292            private void removeAttribute() {
293                    UserInfo userInfo = getUser();
294    //              userInfo.removeAttribute( key );
295                    userInfo.removeAttribute( key, save );
296            }
297    
298            /**
299             * UserInfoã®æ–?­—å?を指定ã?SQLæ–?‚ˆã‚Šä½œæ?ã—ã¾ã™ã?
300             *
301             * @og.rev 4.3.4.0 (2008/12/01) GE20(ユーザー定数)ã¸ç™»éŒ²ã™ã‚‹ã‹ã?フラグを追åŠ?
302             *
303             */
304            private void setSQLAttribute() {
305                    if( table == null || table.getRowCount() == 0 ) { return ; }
306    
307                    int row    = 0;
308                    int clmCnt = table.getColumnCount();
309                    for( int clm=0; clm<clmCnt; clm++ ) {
310                            String clmkey = table.getColumnName( clm );
311                            String clmval = table.getValue( row,clm );
312    //                      setUserInfo( clmkey,clmval );
313                            setUserInfo( clmkey, clmval, save );
314                    }
315            }
316    
317            /**
318             * ã€TAG】コマンãƒ?SET,GET,NVLGET,REMOVE,SQL)ã‚’ã‚»ãƒ?ƒˆã—ã¾ã?åˆæœŸå€¤:SET)ã€?
319             *
320             * @og.tag
321             * コマンドã?,HTMLã‹ã‚‰(get/post)æŒ?®šã•れã¾ã™ã?ã§,CMD_xxx ã§è¨­å®šã•れる
322             * フィールド定数値ã®ã?šã‚Œã‹ã‚’ã?æŒ?®šã§ãã¾ã™ã?
323             * 何も設定ã•れãªã??ã¾ãŸã?ã€null ã®å ´åˆã?ã€?SET" ãŒå?期å?ã«ã‚»ãƒ?ƒˆã•れã¾ã™ã?
324             * SQL ã®å ´åˆã?æ¤œç´¢çµæžœã®æˆ»ã‚Šå?ãŒè¤?•°å­˜åœ¨ã™ã‚‹å ´åˆã?ã€æœ€åˆã??‘ä»¶ç›®ã®ã¿ä½¿ç”¨ã—ã¾ã™ã?
325             *
326             * @param       cmd コマンãƒ?public static final 宣è¨?•れã¦ã?‚‹æ–?­—å?)
327             * @see         <a href="../../../../constant-values.html#org.opengion.hayabusa.taglib.UserInfoTag.CMD_SET">コマンド定数</a>
328             */
329            public void setCommand( final String cmd ) {
330                    String cmd2 = getRequestParameter( cmd );
331                    if( cmd2 != null && cmd2.length() > 0 ) { command = cmd2.toUpperCase(Locale.JAPAN); }
332            }
333    
334            /**
335             * ã€TAG】UserInfo ã«ç™»éŒ²ã™ã‚‹ã‚­ãƒ¼ã‚’ã‚»ãƒ?ƒˆã—ã¾ã?予ç´?ª?JNAME,ID,PASSWD,IDNO,INFO,LANG,ROLE,IPADDRESS,LOGINTIME)ã€?
336             *
337             * @og.tag UserInfo ã«ç™»éŒ²ã™ã‚‹ã‚­ãƒ¼ã‚’ã‚»ãƒ?ƒˆã—ã¾ã™ã?
338             *
339             * @param       inkey UserInfo ã«ç™»éŒ²ã™ã‚‹ã‚­ãƒ¼
340             */
341            public void setKey( final String inkey ) {
342                    key = getRequestParameter( inkey ).toUpperCase(Locale.JAPAN);
343                    if( key.startsWith( "USER." ) ) {
344                            key = key.substring( 5 );
345                    }
346            }
347    
348            /**
349             * ã€TAG】UserInfo ã«ç™»éŒ²ã™ã‚‹å€¤ã‚’ã‚»ãƒ?ƒˆã—ã¾ã™ã?
350             *
351             * @og.tag UserInfo ã«ç™»éŒ²ã™ã‚‹å€¤ã‚’ã‚»ãƒ?ƒˆã—ã¾ã™ã?
352             *
353             * @param       val     UserInfoã«ç™»éŒ²ã™ã‚‹å€¤
354             */
355            public void setValue( final String val ) {
356                    value = getRequestParameter( val );
357            }
358    
359            /**
360             * ã€TAG】UserInfo ã«ç™»éŒ²ã—ãŸå€¤ã‚’永続化ã™ã‚‹ã‹ã‚’æŒ?®šã—ã¾ã™ã?
361             *
362             * @og.tag
363             * UserInfo ã«ç™»éŒ²ã—ãŸå€¤ã‚’永続化ã™ã‚‹ã‹ã‚’æŒ?®šã—ã¾ã™ã?
364             * trueãŒæŒ‡å®šã•れãŸå ´åˆã?UserInfoã«è¨­å®šã•れãŸå€¤ã¯ã€GE20(ユーザー定数)ã«ä¿å­˜ã•れã?
365             * UserInfoãŒå?作æ?ã•れるタイミングã§è‡ªå‹•çš„ã«å¾©å…?•れã¾ã™ã?
366             * ã“ã“ã§ã€ç™»éŒ²ã•れãŸå?ã¯ã€ãã®ãƒ¦ãƒ¼ã‚¶ãƒ¼ã®å…¨ã¦ã®ãƒ­ãƒ¼ãƒ«ã«å¯¾ã—ã¦æœ‰åйã¨ãªã‚Šã¾ã™ã?
367             * åˆæœŸå€¤ã¯ã€false(永続化ã—ãªã?ã§ã™ã?
368             *
369             * @param       sv      登録値を永続化ã™ã‚‹ã?
370             */
371            public void setSave( final String sv ) {
372                    save = nval( getRequestParameter( sv ),save );
373            }
374    
375    //      /**
376    //       * ã€å»?­¢ã€‘Query を実行ã—ã¦ã€value ã«å€¤ã‚’ã‚»ãƒ?ƒˆã™ã‚‹ã‹ã©ã?‹ã‚’指定ã—ã¾ã™ã?
377    //       *
378    //       * @og.tag
379    //       * åˆæœŸå€¤ã¯ã€å®Ÿè¡Œã—ãªã?("false")
380    //       *
381    //       * @og.rev 3.1.0.1 (2003/03/26) query 属æ?ã‚’éžæŽ¨å¥¨å±žæ?ã¨ã—ã¾ã™ã?å†?ƒ¨ã§ã¯ä½¿ç”¨ã—ã¾ã›ã‚“ã€?
382    //       *
383    //       * @param   flag Query を実行ã™ã‚?("true")?実行ã—ãªã?ãれ以å¤?
384    //       * @deprecated
385    //       */
386    //      @Deprecated public void setQuery( final String flag ) {
387    //              // ã“ã“ã§ã¯å‡¦ç?‚’行ã„ã¾ã›ã‚“ã€?
388    //      }
389    
390    //      /**
391    //       * ã€å»?­¢ã€‘value ã?NULL ã®æ™‚ã«ã€è¨­å®šã™ã‚‹ã‹ã©ã?‹[true/false]を指定ã—ã¾ã?åˆæœŸå€¤:true)ã€?
392    //       *
393    //       * @og.tag
394    //       * true ã®å ´åˆã?, null ã®ã¨ãã§ã‚‚ã‚»ãƒ?ƒˆã—ã¾ã™ã?
395    //       * false ã®å ´åˆã?, null ã®ã¨ãã?ã€æ—¢å­˜ã?å€¤ã‚’ç½®ãæ›ãˆã¾ã›ã‚“ã€?
396    //       * åˆæœŸå€¤ã¯ã€null ã®ã¨ãã§ã‚‚ã‚»ãƒ?ƒˆã™ã‚‹ã§ã™ã? ("true")
397    //       *
398    //       * @param   flag NULL ã®æ™‚ã«ã€è¨­å®šã™ã‚?("true")?設定ã—ãªã?ãれ以å¤?
399    //       * @deprecated
400    //       */
401    //      @Deprecated public void setNullSet( final String flag ) {
402    //              isNullSet = nval( getRequestParameter( flag ),isNullSet );
403    //      }
404    
405            /**
406             * ã€TAGã€?通常ã¯ä½¿ã?¾ã›ã‚“)Queryオブジェクトを作æ?ã™ã‚‹æ™‚ã?DB接続IDを指定ã—ã¾ã™ã?
407             *
408             * @og.tag Queryオブジェクトを作æ?ã™ã‚‹æ™‚ã?DB接続IDを指定ã—ã¾ã™ã?
409             *
410             * @param       id ãƒ??タベã?ス接続ID
411             */
412            public void setDbid( final String id ) {
413                    dbid = nval( getRequestParameter( id ),dbid );
414            }
415    
416            /**
417             * シリアライズ用ã®ã‚«ã‚¹ã‚¿ãƒ?‚·ãƒªã‚¢ãƒ©ã‚¤ã‚ºæ›¸ãè¾¼ã¿ãƒ¡ã‚½ãƒ?ƒ‰
418             *
419             * @og.rev 4.0.0.0 (2006/09/31) æ–°è¦è¿½åŠ?
420             * @serialData ä¸?ƒ¨ã®ã‚ªãƒ–ジェクトã?ã€ã‚·ãƒªã‚¢ãƒ©ã‚¤ã‚ºã•れã¾ã›ã‚“ã€?
421             *
422             * @param       strm    ObjectOutputStreamオブジェク�
423             * @throws IOException  入出力エラーãŒç™ºç”Ÿã—ãŸå?å?
424             */
425            private void writeObject( final ObjectOutputStream strm ) throws IOException {
426                    strm.defaultWriteObject();
427            }
428    
429            /**
430             * シリアライズ用ã®ã‚«ã‚¹ã‚¿ãƒ?‚·ãƒªã‚¢ãƒ©ã‚¤ã‚ºèª­ã¿è¾¼ã¿ãƒ¡ã‚½ãƒ?ƒ‰
431             *
432             * ã“ã“ã§ã¯ã€transient 宣è¨?•れãŸå†?ƒ¨å¤‰æ•°ã®å†??åˆæœŸåŒ–ãŒå¿?¦ãªãƒ•ィールドã?ã¿è¨­å®šã—ã¾ã™ã?
433             *
434             * @og.rev 4.0.0.0 (2006/09/31) æ–°è¦è¿½åŠ?
435             * @serialData ä¸?ƒ¨ã®ã‚ªãƒ–ジェクトã?ã€ã‚·ãƒªã‚¢ãƒ©ã‚¤ã‚ºã•れã¾ã›ã‚“ã€?
436             *
437             * @param       strm    ObjectInputStreamオブジェク�
438             * @see #release2()
439             * @throws IOException  シリアライズã«é–¢ã™ã‚‹å…¥å‡ºåŠ›ã‚¨ãƒ©ãƒ¼ãŒç™ºç”Ÿã—ãŸå?å?
440             * @throws ClassNotFoundException       クラスを見ã¤ã‘ã‚‹ã“ã¨ãŒã§ããªã‹ã£ãŸå?å?
441             */
442            private void readObject( final ObjectInputStream strm ) throws IOException , ClassNotFoundException {
443                    strm.defaultReadObject();
444            }
445    
446            /**
447             * ã“ã?オブジェクトã?æ–?­—å?表ç¾ã‚’è¿”ã—ã¾ã™ã?
448             * 基本çš?«ãƒ?ƒãƒ?‚°ç›®çš?«ä½¿ç”¨ã—ã¾ã™ã?
449             *
450             * @return ã“ã?ã‚¯ãƒ©ã‚¹ã®æ–?­—å?表ç¾
451             */
452            @Override
453            public String toString() {
454                    return org.opengion.fukurou.util.ToString.title( this.getClass().getName() )
455                                    .println( "VERSION"                     ,VERSION        )
456                                    .println( "command"                     ,command        )
457                                    .println( "key"                         ,key            )
458                                    .println( "value"                       ,value          )
459    //                              .println( "isNullSet"           ,isNullSet      )
460                                    .println( "dbid"                        ,dbid           )
461                                    .println( "sql"                         ,sql            )
462                                    .println( "save"                        ,save           )
463                                    .println( "COMMAND_LIST"        ,COMMAND_LIST   )
464                                    .println( "Other..."    ,getAttributes().getAttribute() )
465                                    .fixForm().toString() ;
466            }
467    }