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