KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > dotmarketing > portlets > htmlpages > model > HTMLPage


1 package com.dotmarketing.portlets.htmlpages.model;
2
3 import java.io.Serializable JavaDoc;
4 import java.util.Map JavaDoc;
5
6 import com.dotmarketing.beans.Identifier;
7 import com.dotmarketing.beans.WebAsset;
8 import com.dotmarketing.factories.IdentifierFactory;
9 import com.dotmarketing.portlets.folders.model.Folder;
10
11 /** @author Hibernate CodeGenerator */
12 public class HTMLPage extends WebAsset implements Serializable JavaDoc, Comparable JavaDoc {
13
14     private static final long serialVersionUID = 1L;
15
16     /** identifier field */
17     private long parent;
18
19     /** nullable persistent field */
20     private String JavaDoc metadata;
21
22     /** nullable persistent field */
23     private java.util.Date JavaDoc startDate;
24
25     /** nullable persistent field */
26     private java.util.Date JavaDoc endDate;
27
28     /** nullable persistent field */
29     private String JavaDoc webStartDate;
30
31     /** nullable persistent field */
32     private String JavaDoc webEndDate;
33
34     /** nullable persistent field */
35     private String JavaDoc pageUrl;
36
37     /** nullable persistent field */
38     private boolean httpsRequired;
39
40     /** nullable persistent field */
41     private String JavaDoc redirect;
42
43    
44     /** default constructor */
45     public HTMLPage() {
46         super.setType("htmlpage");
47         startDate = new java.util.Date JavaDoc();
48         endDate = new java.util.Date JavaDoc();
49         metadata = com.dotmarketing.util.Config.getStringProperty("METADATA_DEFAULT");
50     }
51
52     public String JavaDoc getURI(Folder folder) {
53         return folder.getPath() + this.getPageUrl();
54     }
55
56     public String JavaDoc getURI() {
57         Identifier id = IdentifierFactory.getIdentifierByInode(this);
58         return id.getURI();
59     }
60     
61     public void copy(HTMLPage currentHTMLPage) {
62         this.metadata = currentHTMLPage.getMetadata();
63         this.startDate = currentHTMLPage.getStartDate();
64         this.endDate = currentHTMLPage.getEndDate();
65         this.pageUrl = currentHTMLPage.getPageUrl();
66         this.httpsRequired = currentHTMLPage.isHttpsRequired();
67         this.redirect = currentHTMLPage.getRedirect();
68         super.copy(currentHTMLPage);
69     }
70
71     /**
72      * Returns the endDate.
73      * @return java.util.Date
74      */

75     public java.util.Date JavaDoc getEndDate() {
76         return endDate;
77     }
78
79     /**
80      * Returns the httpsRequired.
81      * @return boolean
82      */

83     public boolean isHttpsRequired() {
84         return httpsRequired;
85     }
86
87     /**
88      * Returns the inode.
89      * @return long
90      */

91     public long getInode() {
92         return inode;
93     }
94
95     /**
96      * Returns the metadata.
97      * @return String
98      */

99     public String JavaDoc getMetadata() {
100         return metadata;
101     }
102
103     /**
104      * Returns the pageUrl.
105      * @return String
106      */

107     public String JavaDoc getPageUrl() {
108         return pageUrl;
109     }
110
111     /**
112      * Returns the parent.
113      * @return long
114      */

115     public long getParent() {
116         return parent;
117     }
118
119     /**
120      * Returns the redirect.
121      * @return String
122      */

123     public String JavaDoc getRedirect() {
124         return redirect;
125     }
126
127     /**
128      * Returns the startDate.
129      * @return java.util.Date
130      */

131     public java.util.Date JavaDoc getStartDate() {
132         return startDate;
133     }
134
135     /**
136      * Sets the endDate.
137      * @param endDate The endDate to set
138      */

139     public void setEndDate(java.util.Date JavaDoc endDate) {
140         this.endDate = endDate;
141     }
142
143     /**
144      * Sets the httpsRequired.
145      * @param httpsRequired The httpsRequired to set
146      */

147     public void setHttpsRequired(boolean httpsRequired) {
148         this.httpsRequired = httpsRequired;
149     }
150
151     /**
152      * Sets the inode.
153      * @param inode The inode to set
154      */

155     public void setInode(long inode) {
156         this.inode = inode;
157     }
158
159     /**
160      * Sets the metadata.
161      * @param metadata The metadata to set
162      */

163     public void setMetadata(String JavaDoc metadata) {
164         this.metadata = metadata;
165     }
166
167     /**
168      * Sets the pageUrl.
169      * @param pageUrl The pageUrl to set
170      */

171     public void setPageUrl(String JavaDoc pageUrl) {
172         this.pageUrl = pageUrl;
173     }
174
175     /**
176      * Sets the parent.
177      * @param parent The parent to set
178      */

179     public void setParent(long parent) {
180         this.parent = parent;
181     }
182
183     /**
184      * Sets the redirect.
185      * @param redirect The redirect to set
186      */

187     public void setRedirect(String JavaDoc redirect) {
188         this.redirect = redirect;
189     }
190
191     /**
192      * Sets the startDate.
193      * @param startDate The startDate to set
194      */

195     public void setStartDate(java.util.Date JavaDoc startDate) {
196         this.startDate = startDate;
197     }
198
199     /**
200      * Returns the webEndDate.
201      * @return String
202      */

203     public String JavaDoc getWebEndDate() {
204         return webEndDate;
205     }
206
207     /**
208      * Returns the webStartDate.
209      * @return String
210      */

211     public String JavaDoc getWebStartDate() {
212         return webStartDate;
213     }
214
215     /**
216      * Sets the webEndDate.
217      * @param webEndDate The webEndDate to set
218      */

219     public void setWebEndDate(String JavaDoc webEndDate) {
220         this.webEndDate = webEndDate;
221     }
222
223     /**
224      * Sets the webStartDate.
225      * @param webStartDate The webStartDate to set
226      */

227     public void setWebStartDate(String JavaDoc webStartDate) {
228         this.webStartDate = webStartDate;
229     }
230
231     public int compareTo(Object JavaDoc compObject){
232
233         if(!(compObject instanceof HTMLPage))return -1;
234         
235         HTMLPage htmlPage = (HTMLPage) compObject;
236         return (htmlPage.getTitle().compareTo(this.getTitle()));
237
238     }
239     
240     public Map JavaDoc<String JavaDoc, Object JavaDoc> getMap () {
241         Map JavaDoc<String JavaDoc, Object JavaDoc> map = super.getMap();
242         map.put("parent", parent);
243         map.put("metadata", metadata);
244         map.put("startDate", startDate);
245         map.put("endDate", endDate);
246         map.put("webStartDate", webStartDate);
247         map.put("webEndDate", webEndDate);
248         map.put("pageUrl", pageUrl);
249         map.put("httpsRequired", httpsRequired);
250         map.put("redirect", redirect);
251         return map;
252     }
253
254 }
255
Popular Tags