001: /*
002: * Copyright (c) 2001 - 2005 ivata limited.
003: * All rights reserved.
004: * -----------------------------------------------------------------------------
005: * ivata groupware may be redistributed under the GNU General Public
006: * License as published by the Free Software Foundation;
007: * version 2 of the License.
008: *
009: * These programs are free software; you can redistribute them and/or
010: * modify them under the terms of the GNU General Public License
011: * as published by the Free Software Foundation; version 2 of the License.
012: *
013: * These programs are distributed in the hope that they will be useful,
014: * but WITHOUT ANY WARRANTY; without even the implied warranty of
015: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
016: *
017: * See the GNU General Public License in the file LICENSE.txt for more
018: * details.
019: *
020: * If you would like a copy of the GNU General Public License write to
021: *
022: * Free Software Foundation, Inc.
023: * 59 Temple Place - Suite 330
024: * Boston, MA 02111-1307, USA.
025: *
026: *
027: * To arrange commercial support and licensing, contact ivata at
028: * http://www.ivata.com/contact.jsp
029: * -----------------------------------------------------------------------------
030: * $Log: SearchItemContentDO.java,v $
031: * Revision 1.7 2005/10/02 14:08:57 colinmacleod
032: * Added/improved log4j logging.
033: *
034: * Revision 1.6 2005/09/29 13:22:46 colinmacleod
035: * Added read-only functionality to data object classes (with a check on each
036: * setter).
037: *
038: * Revision 1.5 2005/09/14 15:54:13 colinmacleod
039: * Removed unused local and class variables.
040: * Added serialVersionUID.
041: *
042: * Revision 1.4 2005/04/29 02:48:20 colinmacleod
043: * Data bugfixes.
044: * Changed primary key back to Integer.
045: *
046: * Revision 1.3 2005/04/10 20:09:48 colinmacleod
047: * Added new themes.
048: * Changed id type to String.
049: * Changed i tag to em and b tag to strong.
050: * Improved PicoContainerFactory with NanoContainer scripts.
051: *
052: * Revision 1.2 2005/04/09 17:19:55 colinmacleod
053: * Changed copyright text to GPL v2 explicitly.
054: *
055: * Revision 1.1.1.1 2005/03/10 17:52:38 colinmacleod
056: * Restructured ivata op around Hibernate/PicoContainer.
057: * Renamed ivata groupware.
058: *
059: * Revision 1.2 2004/09/30 15:01:44 colinmacleod
060: * Fixed hibernate tags.
061: *
062: * Revision 1.1 2004/08/01 11:40:28 colinmacleod
063: * Moved search classes to separate subproject.
064: *
065: * -----------------------------------------------------------------------------
066: */
067: package com.ivata.groupware.business.search.item.content;
068:
069: import org.apache.log4j.Logger;
070:
071: import com.ivata.groupware.business.search.item.SearchItemDO;
072: import com.ivata.groupware.container.persistence.BaseDO;
073:
074: /**
075: * <p>
076: * Each item searched for in <strong>ivata groupware</strong> can have different
077: * content associated with it. Whether it is a page in a library item, or a
078: * comment about a library item, for example, it is more efficient to index
079: * these separately so they can be updated separately when they change.
080: * </p>
081: *
082: * @since Aug 1, 2004
083: * @author Colin MacLeod
084: * <a href='mailto:colin.macleod@ivata.com'>colin.macleod@ivata.com</a>
085: * @version $Revision: 1.7 $
086: *
087: * @hibernate.class
088: * table="search_item_content"
089: * @hibernate.cache
090: * usage="read-write"
091: */
092: public class SearchItemContentDO extends BaseDO {
093: /**
094: * Logger for this class.
095: */
096: private static final Logger logger = Logger
097: .getLogger(SearchItemContentDO.class);
098:
099: /**
100: * Serialization version (for <code>Serializable</code> interface).
101: */
102: private static final long serialVersionUID = 1L;
103: /**
104: * <p>
105: * This refers to the item which contains this content.
106: * </p>
107: */
108: private SearchItemDO item;
109: /**
110: * <p> Unique identifier of the object being indexed. </p>
111: */
112: private Integer targetId;
113:
114: /**
115: * <p> This is a text to describe the type of the object being indexed. In
116: * <strong>ivata groupware</strong>, this always refers to the class of the
117: * indexed object. </p>
118: */
119: private String type;
120:
121: /**
122: * <p>
123: * This refers to the item which contains this content.
124: * </p>
125: *
126: * @return Returns the item.
127: * @hibernate.many-to-one
128: * column="search_item"
129: */
130: public final SearchItemDO getItem() {
131: if (logger.isDebugEnabled()) {
132: logger.debug("getItem() - start");
133: }
134:
135: if (logger.isDebugEnabled()) {
136: logger.debug("getItem() - end - return value = " + item);
137: }
138: return item;
139: }
140:
141: /**
142: * <p>
143: * Unique identifier of the object being indexed.
144: * </p>
145: *
146: * @return Returns the targetId.
147: * @hibernate.property
148: * column="target_id"
149: */
150: public final Integer getTargetId() {
151: if (logger.isDebugEnabled()) {
152: logger.debug("getTargetId() - start");
153: }
154:
155: if (logger.isDebugEnabled()) {
156: logger.debug("getTargetId() - end - return value = "
157: + targetId);
158: }
159: return targetId;
160: }
161:
162: /**
163: * <p>
164: * This is a text to describe the type of the object being indexed. In
165: * <strong>ivata groupware</strong>, this always refers to the class of the
166: * indexed object.
167: * </p>
168: *
169: * @return Returns the type.
170: * @hibernate.property
171: */
172: public final String getType() {
173: if (logger.isDebugEnabled()) {
174: logger.debug("getType() - start");
175: }
176:
177: if (logger.isDebugEnabled()) {
178: logger.debug("getType() - end - return value = " + type);
179: }
180: return type;
181: }
182:
183: /**
184: * <p>
185: * This refers to the item which contains this content.
186: * </p>
187: *
188: * @param item The item to set.
189: */
190: public final void setItem(final SearchItemDO item) {
191: if (logger.isDebugEnabled()) {
192: logger.debug("setItem(SearchItemDO item = " + item
193: + ") - start");
194: }
195:
196: checkSetter();
197: this .item = item;
198:
199: if (logger.isDebugEnabled()) {
200: logger.debug("setItem(SearchItemDO) - end");
201: }
202: }
203:
204: /**
205: * <p>
206: * Unique identifier of the object being indexed.
207: * </p>
208: *
209: * @param targetId The targetId to set.
210: */
211: public final void setTargetId(final Integer targetId) {
212: if (logger.isDebugEnabled()) {
213: logger.debug("setTargetId(Integer targetId = " + targetId
214: + ") - start");
215: }
216:
217: checkSetter();
218: this .targetId = targetId;
219:
220: if (logger.isDebugEnabled()) {
221: logger.debug("setTargetId(Integer) - end");
222: }
223: }
224:
225: /**
226: * <p>
227: * This is a text to describe the type of the object being indexed. In
228: * <strong>ivata groupware</strong>, this always refers to the class of the
229: * indexed object.
230: * </p>
231: *
232: * @param type The type to set.
233: */
234: public final void setType(final String type) {
235: if (logger.isDebugEnabled()) {
236: logger.debug("setType(String type = " + type + ") - start");
237: }
238:
239: checkSetter();
240: this .type = type;
241:
242: if (logger.isDebugEnabled()) {
243: logger.debug("setType(String) - end");
244: }
245: }
246: }
|