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.db;
017
018 import org.opengion.hayabusa.common.HybsSystem;
019 import org.opengion.fukurou.util.StringFormat;
020
021 /**
022 * 動的プルãƒ?‚¦ãƒ³ãªã©ã§åˆ©ç”¨ã•れるイベントカラãƒ??å?¨®æƒ??ã‚’ä¿æŒã™ã‚‹ãŸã‚ã®
023 * 管ç?‚¯ãƒ©ã‚¹ã§ã™ã?
024 *
025 * å†?®¹ã‚’ç½®ãæ›ãˆã‚‹ã‚«ãƒ©ãƒ?åカラãƒ?ã®åå‰ã‚’ã‚ーã«ã€ã‚¤ãƒ™ãƒ³ãƒˆã‚«ãƒ©ãƒ?親カラãƒ?ã‚??
026 * イベント発行時ã®å‡¦ç?RLç‰ã‚’管ç?—ã¾ã™ã?
027 *
028 * ã“れらã?æƒ??ã¯ã€ColumnTagã‚„SelectTagã€ViewFormTagãªã©ã§ç™»éŒ²ã•れã€ãã®çµæžœã‚?
029 * JavaScriptã®ã‚³ãƒ¼ãƒ‰ã¨ã—ã¦å‡ºåŠ›ã—ã¾ã™ã?(common/eventColumn.jsp)
030 *
031 * ã“ã“ã§å‡ºåŠ›ã•ã‚ŒãŸæƒ??をイベント発行時ã«ã€JavaScriptãŒå‚ç…§ã—ã?処ç?RLã«æ¸¡ã?
032 * ã“ã¨ã§ã€å‹•çš?ªé ?›®ã®å…¥ã‚Œæ›¿ãˆã‚’実ç¾ã—ã¦ã?¾ã™ã?
033 *
034 * @og.rev 5.1.7.0 (2010/06/01) æ–°è¦è¿½åŠ?
035 *
036 * @version 4.0
037 * @author Hiroki Nakamura
038 * @since JDK5.0,
039 */
040 public class DBEventColumn {
041
042 private static final String EVENT_COLUMN_URL = HybsSystem.sys( "JSP" ) + "/" + HybsSystem.sys( "EVENT_COLUMN_URL" );
043
044 final String name; // å†?®¹ã‚’ç½®ãæ›ãˆã‚‹ã‚«ãƒ©ãƒ?åカラãƒ?
045 final String evCol; // イベントカラãƒ?親カラãƒ??カンマ区åˆ?‚Š)
046 final String eventUrl; // イベント発行時ã®å‡¦ç?RL
047 final String renderer; // åカラãƒ??レンãƒ?ƒ©ãƒ¼
048 final String editor; // åカラãƒ??エãƒ?‚£ã‚¿ãƒ¼
049 final String rendParam; // åカラãƒ??表示パラメーター
050 final String editParam; // åカラãƒ??ç·¨é›?ƒ‘ラメーター
051
052 /**
053 * åˆæœŸæƒ??ã‚’å«ã‚“ã æ–°è¦ã‚ªãƒ–ジェクトを作æ?ã—ã¾ã™ã?
054 *
055 * @param name å†?®¹ã‚’ç½®ãæ›ãˆã‚‹ã‚«ãƒ©ãƒ?åカラãƒ?
056 * @param evCol イベントカラãƒ?親カラãƒ??カンマ区åˆ?‚Š)
057 * @param eventUrl イベント発行時ã®å‡¦ç?RL
058 * @param renderer åカラãƒ??レンãƒ?ƒ©ãƒ¼
059 * @param editor åカラãƒ??エãƒ?‚£ã‚¿ãƒ¼
060 * @param rendParam åカラãƒ??表示パラメーター
061 * @param editParam åカラãƒ??ç·¨é›?ƒ‘ラメーター
062 */
063 public DBEventColumn( final String name, final String evCol, final String eventUrl,
064 final String renderer, final String editor, final String rendParam, final String editParam ) {
065 this.name = name;
066 this.evCol = evCol;
067 // 5.1.9.0 (2010/08/01) 動的プルãƒ?‚¦ãƒ³ä¸å?åˆå¯¾å¿?
068 this.eventUrl = ( eventUrl != null && eventUrl.length() > 0 ) ? eventUrl : EVENT_COLUMN_URL;
069 this.renderer = renderer;
070 this.editor = editor;
071 this.rendParam = rendParam;
072 this.editParam = editParam;
073 }
074
075 /**
076 * å†?®¹ã‚’ç½®ãæ›ãˆã‚‹ã‚«ãƒ©ãƒ?åカラãƒ?ã‚’è¿”ã—ã¾ã™ã?
077 *
078 * @return å†?®¹ã‚’ç½®ãæ›ãˆã‚‹ã‚«ãƒ©ãƒ?åカラãƒ?
079 */
080 public String getName() { return name; }
081
082 /**
083 * イベントカラãƒ?親カラãƒ??カンマ区åˆ?‚Š)ã‚’è¿”ã—ã¾ã™ã?
084 *
085 * @return イベントカラãƒ?親カラãƒ??カンマ区åˆ?‚Š)
086 */
087 public String getEventColumn() { return evCol; }
088
089 /**
090 * イベント発行時ã®å‡¦ç?RLã‚’è¿”ã—ã¾ã™ã?
091 *
092 * @og.rev 5.1.8.0 (2010/07/01) getEventUrl â‡?getEventURL ã«å¤‰æ›´
093 *
094 * @return イベント発行時ã®å‡¦ç?RL
095 */
096 // public String getEventUrl() { return eventUrl; }
097 public String getEventURL() { return eventUrl; }
098
099 /**
100 * åカラãƒ??レンãƒ?ƒ©ãƒ¼ã‚’è¿”ã—ã¾ã™ã?
101 *
102 * @return åカラãƒ??レンãƒ?ƒ©ãƒ¼
103 */
104 public String getRenderer() { return renderer; }
105
106 /**
107 * åカラãƒ??エãƒ?‚£ã‚¿ãƒ¼ã‚’è¿”ã—ã¾ã™ã?
108 *
109 * @return åカラãƒ??エãƒ?‚£ã‚¿ãƒ¼
110 */
111 public String getEditor() { return editor; }
112
113 /**
114 * åカラãƒ??表示パラメーターを返ã—ã¾ã™ã?
115 *
116 * @return åカラãƒ??表示パラメーター
117 */
118 public String getRendParam() {
119 StringFormat sf = new StringFormat(
120 rendParam
121 ,"{@" + evCol.replace( ",", "}:{@" ) + "}"
122 ,name );
123 return sf.format();
124 }
125
126 /**
127 * åカラãƒ??ç·¨é›?ƒ‘ラメーターを返ã—ã¾ã™ã?
128 *
129 * @return åカラãƒ??ç·¨é›?ƒ‘ラメーター
130 */
131 public String getEditParam() {
132 StringFormat sf = new StringFormat(
133 editParam
134 ,"{@" + evCol.replace( ",", "}:{@" ) + "}"
135 ,name );
136 return sf.format();
137 }
138 }