KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > dotmarketing > portlets > templates > model > Template


1 package com.dotmarketing.portlets.templates.model;
2
3 import java.io.Serializable JavaDoc;
4
5 import com.dotmarketing.beans.WebAsset;
6 import com.dotmarketing.portlets.folders.model.Folder;
7
8 /** @author Hibernate CodeGenerator */
9 public class Template extends WebAsset implements Serializable JavaDoc, Comparable JavaDoc {
10
11     private static final long serialVersionUID = 1L;
12
13     /** nullable persistent field */
14     private String JavaDoc body;
15
16     /** nullable persistent field */
17     private String JavaDoc selectedimage;
18     /** nullable persistent field */
19     private long image;
20
21     /** default constructor */
22     public Template() {
23         this.image = 0;
24         super.setType("template");
25     }
26
27     public String JavaDoc getURI(Folder folder) {
28         return folder.getPath() + this.getInode();
29     }
30
31     /**
32      * @return Returns the image.
33      */

34     public long getImage() {
35         return image;
36     }
37     /**
38      * @param image The image to set.
39      */

40     public void setImage(long image) {
41         this.image = image;
42     }
43     /**
44      * @return Returns the selectedimage.
45      */

46     public String JavaDoc getSelectedimage() {
47         return selectedimage;
48     }
49     /**
50      * @param selectedimage The selectedimage to set.
51      */

52     public void setSelectedimage(String JavaDoc selectedimage) {
53         this.selectedimage = selectedimage;
54     }
55     /** nullable persistent field */
56     private String JavaDoc header;
57
58     /** nullable persistent field */
59     private String JavaDoc footer;
60
61     public long getInode() {
62         return this.inode;
63     }
64
65     /**
66      * Sets the inode.
67      * @param inode The inode to set
68      */

69     public void setInode(long inode) {
70         this.inode = inode;
71     }
72
73     /**
74      * Returns the body.
75      * @return String
76      */

77     public String JavaDoc getBody() {
78         return body;
79     }
80
81     /**
82      * Sets the body.
83      * @param body The body to set
84      */

85     public void setBody(String JavaDoc body) {
86         this.body = body;
87     }
88
89     public void copy(Template currentTemplate) {
90         this.body = currentTemplate.getBody();
91         this.header = currentTemplate.getHeader();
92         this.footer = currentTemplate.getFooter();
93         super.copy(currentTemplate);
94     }
95
96     /**
97      * Returns the footer.
98      * @return String
99      */

100     public String JavaDoc getFooter() {
101         return footer;
102     }
103
104     /**
105      * Returns the header.
106      * @return String
107      */

108     public String JavaDoc getHeader() {
109         return header;
110     }
111
112     /**
113      * Sets the footer.
114      * @param footer The footer to set
115      */

116     public void setFooter(String JavaDoc footer) {
117         this.footer = footer;
118     }
119
120     /**
121      * Sets the header.
122      * @param header The header to set
123      */

124     public void setHeader(String JavaDoc header) {
125         this.header = header;
126     }
127
128     public int compareTo(Object JavaDoc compObject){
129
130         if(!(compObject instanceof Template))return -1;
131         
132         Template template = (Template) compObject;
133         return (template.getTitle().compareTo(this.getTitle()));
134
135     }
136
137 }
138
Popular Tags