KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > dotmarketing > portlets > containers > model > Container


1 package com.dotmarketing.portlets.containers.model;
2
3 import java.io.Serializable JavaDoc;
4
5 import org.apache.commons.lang.builder.ToStringBuilder;
6
7 import com.dotmarketing.beans.WebAsset;
8 import com.dotmarketing.portlets.folders.model.Folder;
9
10 /** @author Hibernate CodeGenerator */
11 public class Container extends WebAsset implements Serializable JavaDoc, Comparable JavaDoc {
12
13     private static final long serialVersionUID = 1L;
14
15     /** nullable persistent field */
16     private String JavaDoc code;
17
18     /** nullable persistent field */
19     private int maxContentlets;
20
21
22     /** nullable persistent field */
23     private boolean useDiv;
24
25     /** nullable persistent field */
26     private String JavaDoc sortContentletsBy;
27
28     private String JavaDoc preLoop;
29     private String JavaDoc postLoop;
30     private boolean staticify;
31     
32     private String JavaDoc luceneQuery;
33     
34     public String JavaDoc getURI(Folder folder) {
35         return folder.getPath() + this.getInode();
36     }
37     
38     /** default constructor */
39     public Container() {
40         super.setType("containers");
41     }
42
43     public long getInode() {
44         return this.inode;
45     }
46
47     /**
48      * Returns the code.
49      * @return String
50      */

51     public String JavaDoc getCode() {
52         return code;
53     }
54
55     /**
56      * Sets the code.
57      * @param code The code to set
58      */

59     public void setCode(String JavaDoc code) {
60         this.code = code;
61     }
62
63     /**
64      * Sets the inode.
65      * @param inode The inode to set
66      */

67     public void setInode(long inode) {
68         this.inode = inode;
69     }
70
71     //Every Web Asset should implement this method!!!
72
public void copy(Container newContainer) {
73         this.setCode(newContainer.getCode());
74         this.setMaxContentlets(newContainer.getMaxContentlets());
75         this.setPreLoop(newContainer.getPreLoop());
76         this.setPostLoop(newContainer.getPostLoop());
77         this.setLuceneQuery(newContainer.getLuceneQuery());
78         this.setStaticify(newContainer.getStaticify());
79         this.setSortContentletsBy(newContainer.getSortContentletsBy());
80         this.setUseDiv(newContainer.isUseDiv());
81         super.copy(newContainer);
82     }
83     /**
84      * Returns the maxContentlets.
85      * @return int
86      */

87     public int getMaxContentlets() {
88         return maxContentlets;
89     }
90
91     /**
92      * Sets the maxContentlets.
93      * @param maxContentlets The maxContentlets to set
94      */

95     public void setMaxContentlets(int maxContentlets) {
96         this.maxContentlets = maxContentlets;
97     }
98
99     /**
100      * Returns the sortContentletsBy.
101      * @return String
102      */

103     public String JavaDoc getSortContentletsBy() {
104         return sortContentletsBy;
105     }
106
107     /**
108      * Sets the sortContentletsBy.
109      * @param sortContentletsBy The sortContentletsBy to set
110      */

111     public void setSortContentletsBy(String JavaDoc sortContentletsBy) {
112         this.sortContentletsBy = sortContentletsBy;
113     }
114
115     /**
116      * Returns the useDiv.
117      * @return boolean
118      */

119     public boolean isUseDiv() {
120         return useDiv;
121     }
122
123     /**
124      * Sets the useDiv.
125      * @param useDiv The useDiv to set
126      */

127     public void setUseDiv(boolean useDiv) {
128         this.useDiv = useDiv;
129     }
130     
131     public int compareTo(Object JavaDoc contObject){
132
133         if(!(contObject instanceof Container))return -1;
134         
135         Container container = (Container) contObject;
136         return (container.getTitle().compareTo(this.getTitle()));
137
138     }
139
140     /**
141      * Returns the postLoop.
142      * @return String
143      */

144     public String JavaDoc getPostLoop() {
145         return postLoop;
146     }
147
148     /**
149      * Returns the preLoop.
150      * @return String
151      */

152     public String JavaDoc getPreLoop() {
153         return preLoop;
154     }
155
156     /**
157      * Sets the postLoop.
158      * @param postLoop The postLoop to set
159      */

160     public void setPostLoop(String JavaDoc postLoop) {
161         this.postLoop = postLoop;
162     }
163
164     /**
165      * Sets the preLoop.
166      * @param preLoop The preLoop to set
167      */

168     public void setPreLoop(String JavaDoc preLoop) {
169         this.preLoop = preLoop;
170     }
171
172     /**
173      * Returns the staticify.
174      * @return boolean
175      */

176     public boolean isStaticify() {
177         return staticify;
178     }
179     /**
180      * Returns the staticify.
181      * @return boolean
182      */

183     public boolean getStaticify() {
184         return staticify;
185     }
186     /**
187      * Sets the staticify.
188      * @param staticify The staticify to set
189      */

190     public void setStaticify(boolean staticify) {
191         this.staticify = staticify;
192     }
193     
194     public String JavaDoc getLuceneQuery() {
195         return luceneQuery;
196     }
197
198     public void setLuceneQuery(String JavaDoc luceneQuery) {
199         this.luceneQuery = luceneQuery;
200     }
201
202     /* (non-Javadoc)
203      * @see java.lang.Object#toString()
204      */

205     public String JavaDoc toString() {
206         return ToStringBuilder.reflectionToString(this);
207     }
208     
209 }
210
Popular Tags