KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > infoglue > cms > entities > content > impl > simple > ContentImpl


1 /* ===============================================================================
2  *
3  * Part of the InfoGlue Content Management Platform (www.infoglue.org)
4  *
5  * ===============================================================================
6  *
7  * Copyright (C)
8  *
9  * This program is free software; you can redistribute it and/or modify it under
10  * the terms of the GNU General Public License version 2, as published by the
11  * Free Software Foundation. See the file LICENSE.html for more information.
12  *
13  * This program is distributed in the hope that it will be useful, but WITHOUT
14  * ANY WARRANTY, including the implied warranty of MERCHANTABILITY or FITNESS
15  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License along with
18  * this program; if not, write to the Free Software Foundation, Inc. / 59 Temple
19  * Place, Suite 330 / Boston, MA 02111-1307 / USA.
20  *
21  * ===============================================================================
22  */

23
24 package org.infoglue.cms.entities.content.impl.simple;
25
26 import org.infoglue.cms.entities.content.Content;
27 import org.infoglue.cms.entities.content.ContentVO;
28 import org.infoglue.cms.entities.kernel.BaseEntityVO;
29
30 public class ContentImpl implements Content
31 {
32     private ContentVO valueObject = new ContentVO();
33      
34     /**
35      * @see org.infoglue.cms.entities.kernel.BaseEntity#getVO()
36      */

37     public BaseEntityVO getVO()
38     {
39         return (BaseEntityVO) getValueObject();
40     }
41
42     /**
43      * @see org.infoglue.cms.entities.kernel.BaseEntity#setVO(BaseEntityVO)
44      */

45     public void setVO(BaseEntityVO valueObject)
46     {
47         setValueObject((ContentVO) valueObject);
48     }
49  
50     /**
51      * @see org.infoglue.cms.entities.kernel.BaseEntity#getId()
52      */

53     public Integer JavaDoc getId()
54     {
55         return getContentId();
56     }
57
58     public Object JavaDoc getIdAsObject()
59     {
60         return getId();
61     }
62
63     public ContentVO getValueObject()
64     {
65         return this.valueObject;
66     }
67
68         
69     public void setValueObject(ContentVO valueObject)
70     {
71         this.valueObject = valueObject;
72     }
73
74     private org.infoglue.cms.entities.management.impl.simple.ContentTypeDefinitionImpl contentTypeDefinition;
75     private java.util.Collection JavaDoc children = new java.util.ArrayList JavaDoc();
76     private org.infoglue.cms.entities.content.impl.simple.ContentImpl parentContent;
77     private java.util.Collection JavaDoc contentVersions = new java.util.ArrayList JavaDoc();
78     private org.infoglue.cms.entities.management.impl.simple.RepositoryImpl repository;
79     private java.util.Collection JavaDoc relatedContents = new java.util.ArrayList JavaDoc();
80     private java.util.Collection JavaDoc relatedByContents = new java.util.ArrayList JavaDoc();
81
82     // SS - 021007: TODO: Is this ok?
83
private Integer JavaDoc childCount;
84   
85     
86     public java.lang.Integer JavaDoc getContentId()
87     {
88         return this.valueObject.getContentId();
89     }
90             
91     public void setContentId(java.lang.Integer JavaDoc contentId)
92     {
93         this.valueObject.setContentId(contentId);
94     }
95       
96     public java.lang.String JavaDoc getName()
97     {
98         return this.valueObject.getName();
99     }
100             
101     public void setName(java.lang.String JavaDoc name)
102     {
103         this.valueObject.setName(name);
104     }
105       
106     public java.util.Date JavaDoc getPublishDateTime()
107     {
108         return this.valueObject.getPublishDateTime();
109     }
110             
111     public void setPublishDateTime(java.util.Date JavaDoc publishDateTime)
112     {
113         this.valueObject.setPublishDateTime(publishDateTime);
114     }
115       
116     public java.util.Date JavaDoc getExpireDateTime()
117     {
118         return this.valueObject.getExpireDateTime();
119     }
120             
121     public void setExpireDateTime(java.util.Date JavaDoc expireDateTime)
122     {
123         this.valueObject.setExpireDateTime(expireDateTime);
124     }
125       
126     public java.lang.Boolean JavaDoc getIsBranch()
127     {
128         return this.valueObject.getIsBranch();
129     }
130     
131     public void setIsBranch(java.lang.Boolean JavaDoc isBranch)
132     {
133         this.valueObject.setIsBranch(isBranch);
134     }
135
136   
137     public org.infoglue.cms.entities.management.impl.simple.ContentTypeDefinitionImpl getContentTypeDefinition()
138     {
139         return this.contentTypeDefinition;
140     }
141             
142     public void setContentTypeDefinition (org.infoglue.cms.entities.management.impl.simple.ContentTypeDefinitionImpl contentTypeDefinition)
143     {
144         this.contentTypeDefinition = contentTypeDefinition;
145         if(contentTypeDefinition != null)
146             this.valueObject.setContentTypeDefinitionId(contentTypeDefinition.getId());
147     }
148      
149     public Integer JavaDoc getContentTypeDefinitionId()
150     {
151         if(this.contentTypeDefinition != null)
152             return this.contentTypeDefinition.getId();
153         else
154             return null;
155     }
156
157     public java.util.Collection JavaDoc getChildren()
158     {
159         return this.children;
160     }
161             
162     public void setChildren (java.util.Collection JavaDoc children)
163     {
164         this.children = children;
165         if (this.getChildCount()!= null)
166         {
167             if(this.getChildCount().intValue() == 0)
168                 this.setChildCount(new Integer JavaDoc(children.size()) );
169         }
170         else
171             this.setChildCount(new Integer JavaDoc(children.size()) );
172     }
173       
174     public org.infoglue.cms.entities.content.impl.simple.ContentImpl getParentContent()
175     {
176         return this.parentContent;
177     }
178      
179            
180     public void setParentContent (org.infoglue.cms.entities.content.impl.simple.ContentImpl parentContent)
181     {
182         this.parentContent = parentContent;
183         
184         if(parentContent != null)
185             this.valueObject.setParentContentId(parentContent.getId());
186     }
187       
188     public java.util.Collection JavaDoc getContentVersions()
189     {
190         return this.contentVersions;
191     }
192             
193     public void setContentVersions (java.util.Collection JavaDoc contentVersions)
194     {
195         this.contentVersions = contentVersions;
196         if (this.getChildCount()!= null)
197         {
198             if(this.getChildCount().intValue() == 0)
199                 this.setChildCount(new Integer JavaDoc(contentVersions.size()) );
200         }
201         else
202             this.setChildCount(new Integer JavaDoc(contentVersions.size()) );
203     }
204       
205     public java.lang.String JavaDoc getCreator()
206     {
207         return this.valueObject.getCreatorName();
208     }
209             
210     public void setCreator (java.lang.String JavaDoc creator)
211     {
212         this.valueObject.setCreatorName(creator);
213     }
214       
215     public org.infoglue.cms.entities.management.impl.simple.RepositoryImpl getRepository()
216     {
217         return this.repository;
218     }
219             
220     public void setRepository (org.infoglue.cms.entities.management.impl.simple.RepositoryImpl repository)
221     {
222         this.repository = repository;
223         this.valueObject.setRepositoryId(repository.getRepositoryId());
224     }
225       
226     public java.util.Collection JavaDoc getRelatedContents()
227     {
228         return this.relatedContents;
229     }
230             
231     public void setRelatedContents (java.util.Collection JavaDoc relatedContents)
232     {
233         this.relatedContents = relatedContents;
234     }
235       
236     public java.util.Collection JavaDoc getRelatedByContents()
237     {
238         return this.relatedByContents;
239     }
240             
241     public void setRelatedByContents (java.util.Collection JavaDoc relatedByContents)
242     {
243         this.relatedByContents = relatedByContents;
244     }
245     /**
246      * Returns the childCount.
247      * @return Integer
248      */

249     public Integer JavaDoc getChildCount()
250     {
251         return this.valueObject.getChildCount();
252     }
253
254     /**
255      * Sets the childCount.
256      * @param childCount The childCount to set
257      */

258     public void setChildCount(Integer JavaDoc childCount)
259     {
260         this.valueObject.setChildCount(childCount);
261     }
262
263     public void setIsProtected(Integer JavaDoc isProtected)
264     {
265         this.valueObject.setIsProtected(isProtected);
266     }
267
268     public Integer JavaDoc getIsProtected()
269     {
270         return this.valueObject.getIsProtected();
271     }
272     
273     
274     /*
275     public String toString()
276     {
277         return "Content: " + this.getName() + "[" + this.getId() + "]" + this.getCreator() + this.getContentTypeDefinition() + this.getExpireDateTime() + this.getIsBranch() + this.getIsBranch() + this.getIsProtected() + this.getPublishDateTime();
278     }
279     */

280 }
281
Popular Tags