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.taglib;
017
018import org.opengion.hayabusa.common.HybsSystemException;
019import org.opengion.fukurou.util.StringUtil;
020import org.opengion.fukurou.util.TagBuffer;
021
022/**
023 * 積上ガント(内部積上方式)でガント全体(ページ全体一つ設定)の指定を行います。
024 *
025 * iTask タグは、積上ガントのうち、内部積上方式の場合に使用します。
026 * 内部積上げとは、フレームワーク側で積上げ計算を行う方式の事です。
027 * 処理速度は増しますが、積上ガント(JavaScript版)は、積上と通常ガントの混在が
028 * 可能ですが、こちらは、積上のみの表示になります。
029 * それぞれの使い分けを考慮してください。
030 * このタグは、viewFormType = "HTMLStackedGanttTable" 、innerStack="true" を指定した view の後に記述します。
031 *
032 * @og.formSample
033 * ●形式:<og:iTask  ... />
034 * ●body:なし
035 * ●前提:headタグで、adjustEvent="Task" を指定してください。
036 *
037 * ●Tag定義:
038 *   <og:iTask
039 *       fixedCols          【TAG】左右2分割で、固定したいカラム数(必須)
040 *       debug              【TAG】デバッグ情報を出力するかどうか[true/false]を指定します(初期値:false)
041 *   />
042 *
043 * ●使用例
044 *   <og:view
045 *       viewFormType = "HTMLStackedGanttTable"
046 *       command      = "{@command}"
047 *       writable     = "false"
048 *       useScrollBar = "false"
049 *       useParam     = "true"
050 *       numberType   = "none"
051 *   >
052 *     <!-- stackParamでstackColumnsを指定しなかった場合はcustomTableとほぼ同じ処理となる -->
053 *     <og:stackParam
054 *         stackColumns = "NOORDER"
055 *         innerStack   = "true"
056 *         costColumns  = "COSTCLM,DYJYU,DYNOKI"
057 *         stackHoliday = "{@stackHoliday}"
058 *         capacityColumn = "CAPACITY"
059 *     />
060 *     <og:thead rowspan="2">
061 *       <tr>
062 *           <td>[NOORDER]</td>
063 *           <td rowspan="2" class="gantt zoom{@SZOOM}" style="text-align:left;background-image: url('../image/stackBG{@SZOOM}.gif');" >
064 *               <div style="position:relative;left:0px;z-index:101; " height="100%" width="100%" >
065 *                   <og:stackHeader
066 *                       startDate   = "{@MIN_DATE}"
067 *                       endDate     = "{@MAX_DATE}"
068 *                       zoom        = "{@SZOOM}"
069 *                       calDB       = "GE13"
070 *                       arg1        = "A"
071 *                   />
072 *               </div>
073 *           </td>
074 *       </tr>
075 *     </og:thead>
076 *     <og:tbody rowspan="2">
077 *       <tr>
078 *         <td>[NOORDER]</td>
079 *       </tr>
080 *     </og:tbody>
081 *   </og:view>
082 *
083 *   <og:iTask
084 *       fixedCols  = "4"
085 *   />
086 *  
087 *   @og.rev 5.6.3.2 (2013/04/12) 新規作成
088 * @og.group 画面部品
089 *
090 * @version  5.0
091 * @author       Kazuhiko Hasegawa
092 * @since    JDK6.0,
093 */
094public class ViewITaskTag extends CommonTagSupport {
095        //* このプログラムのVERSION文字列を設定します。   {@value} */
096        private static final String VERSION = "5.6.3.2 (2013/04/12)" ;
097
098        private static final long serialVersionUID = 563220130412L ;
099
100        private TagBuffer tag = new TagBuffer( "iTask" ) ;
101
102        /**
103         * Taglibの終了タグが見つかったときに処理する doEndTag() を オーバーライドします。
104         *
105         * @og.rev 5.8.1.0 (2014/11/07) HTML5対応。javaScriptで、BODYがないと入れ子になってしまう。
106         * @return      後続処理の指示
107         */
108        @Override
109        public int doEndTag() {
110                debugPrint();           // 4.0.0 (2005/02/28)
111
112                tag.setBody( "<!-- -->" );                // 5.8.1.0 (2014/11/07) HTML5対応。
113                jspPrint( tag.makeTag() );
114
115                return(EVAL_PAGE);              // ページの残りを評価する。
116        }
117
118        /**
119         * タグリブオブジェクトをリリースします。
120         * キャッシュされて再利用されるので、フィールドの初期設定を行います。
121         *
122         */
123        @Override
124        protected void release2() {
125                super.release2();
126                tag = new TagBuffer( "iTask" );
127        }
128
129        /**
130         * 【TAG】左右2分割で、固定したいカラム数を指定します(必須)。
131         *
132         * @og.tag
133         * 1段組でも2段組でも、固定したいカラム数を指定します。
134         *
135         * @param   fixedCols 固定したいカラム数
136         */
137        public void setFixedCols( final String fixedCols ) {
138                tag.add( "fixedCols",StringUtil.nval( getRequestParameter( fixedCols ),null ) );
139        }
140
141        /**
142         * タグの名称を、返します。
143         * 自分自身のクラス名より、自動的に取り出せないため、このメソッドをオーバーライドします。
144         *
145         * @return  タグの名称
146         */
147        @Override
148        protected String getTagName() {
149                return "iTask" ;
150        }
151
152        /**
153         * このオブジェクトの文字列表現を返します。
154         * 基本的にデバッグ目的に使用します。
155         *
156         * @return このクラスの文字列表現
157         */
158        @Override
159        public String toString() {
160                return org.opengion.fukurou.util.ToString.title( this.getClass().getName() )
161                                .println( "VERSION"             ,VERSION        )
162                                .println( "tag"                 ,tag.makeTag()  )
163                                .println( "Other..."    ,getAttributes().getAttribute() )
164                                .fixForm().toString() ;
165        }
166}