KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > blandware > atleap > model > core > ContentPage


1 /*
2  * Copyright 2004 Blandware (http://www.blandware.com)
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package com.blandware.atleap.model.core;
17
18
19 /**
20  * <p>Content page with virtual uri.</p>
21  * <p>Content Page (CP) is a page which is based on particular {@link Layout}. It
22  * inherits {@link ContentField}s, menu structure (through {@link MenuItem}s)
23  * and tiles definition used to figure out how the page will look. Content Page
24  * has an URI that will identify it to the system, and that page will be output
25  * to the user responding to request to that URI.</p>
26  * <p>As other {@link Localizable}s, Content Page contains {@link ContentField}s.
27  * Their positions on the page are specified by corresponding Layout.</p>
28  * <p>Content Pages are more <em>static</em>, and {@link ActionPage}s are more
29  * <em>dynamic</em>, because Content Pages are based on fixed Layout.</p>
30  * <p><b>active</b> property means for Active Page that it's ready for publication.
31  * If a Content Page is not ready for publication, then when user tries to view
32  * such page, he will get HTTP 503 (Service Unavailable) error code.</p>
33  * <p>Every Content Page has a list of {@link Role}s that are allowed to access it.
34  * If that list is empty, everyone is allowed to access such Content Page, otherwise
35  * only users that have at least one role from that list can access the Content Page.</p>
36  * <p><a HREF="ContentPage.java.htm"><i>View Source</i></a>
37  * </p>
38  * <p/>
39  *
40  * @author Andrey Grebnev <a HREF="mailto:andrey.grebnev@blandware.com">&lt;andrey.grebnev@blandware.com&gt;</a>
41  * @version $Revision: 1.28 $ $Date: 2005/12/18 16:43:42 $
42  * @struts.form include-all="false" extends="BaseForm"
43  * @hibernate.joined-subclass table="`al_core_content_page`" lazy="false"
44  * @hibernate.joined-subclass-key column="`page_id`"
45  */

46 public class ContentPage extends Page {
47
48     //~ Instance variables
49

50     /**
51      * Layout on which this content page is based
52      */

53     protected Layout layout = null;
54     /**
55      * <p>The max age of content page response in browser. If the max age is lesser than zero - no-cache.<p>
56      * <p>If value is <code>null</code> it means the default value from global properties will be used</p>
57      */

58     protected Long JavaDoc cacheMaxAge = null;
59
60     //~ Methods
61

62     /**
63      * Returns the layout of this content page
64      *
65      * @return layout
66      * @hibernate.many-to-one column="`layout_id`" not-null="true" outer-join="false" lazy="false"
67      * @struts.form-field
68      */

69     public Layout getLayout() {
70         return layout;
71     }
72
73     /**
74      * Sets the layout of this content page
75      *
76      * @param layout the layout to set
77      */

78     public void setLayout(Layout layout) {
79         this.layout = layout;
80     }
81
82     /**
83      * <p>Returns the max age of content page response in browser. If the max age is less than zero - no-cache.<p>
84      * <p>If value is <code>null</code> it means the default value from global properties will be used</p>
85      *
86      * @return max age
87      * @hibernate.property column="`cache_maxage`" not-null="false"
88      * @struts.form-field
89      * @struts.validator type="integer"
90      * @struts.validator-args arg0resource="core.contentPage.form.cacheMaxAge"
91      */

92     public Long JavaDoc getCacheMaxAge() {
93         return cacheMaxAge;
94     }
95
96     /**
97      * Sets max age for caching this page
98      *
99      * @param cacheMaxAge max age
100      * @see ContentPage#getCacheMaxAge()
101      */

102     public void setCacheMaxAge(Long JavaDoc cacheMaxAge) {
103         this.cacheMaxAge = cacheMaxAge;
104     }
105
106 }
107
Popular Tags