File Source: TemplateEditBean.java
/*
P/P * Method: org.apache.roller.weblogger.ui.struts2.editor.TemplateEditBean__static_init
*/
1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. The ASF licenses this file to You
4 * under the Apache License, Version 2.0 (the "License"); you may not
5 * 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. For additional information regarding
15 * copyright in this work, please see the NOTICE file in the top level
16 * directory of this distribution.
17 */
18
19 package org.apache.roller.weblogger.ui.struts2.editor;
20
21 import java.util.Locale;
22 import org.apache.roller.weblogger.WebloggerException;
23 import org.apache.roller.weblogger.pojos.WeblogTemplate;
24
25
26 /**
27 * Form bean for TemplateEdit action.
28 */
/*
P/P * Method: void org.apache.roller.weblogger.ui.struts2.editor.TemplateEditBean()
*
* Presumptions:
* init'ed(java.lang.Boolean.TRUE)
*
* Postconditions:
* this.autoContentType == java.lang.Boolean.TRUE
* (soft) init'ed(this.autoContentType)
* this.contents == null
* this.description == null
* this.id == null
* this.link == null
* this.manualContentType == null
* this.name == null
* this.templateLanguage == null
* this.hidden == 0
* ...
*/
29 public class TemplateEditBean {
30
31 private String id = null;
32 private String name = null;
33 private String description = null;
34 private String link = null;
35 private String contents = null;
36 private String templateLanguage = null;
37 private boolean navbar= false;
38 private boolean hidden = false;
39 private Boolean autoContentType = Boolean.TRUE;
40 private String manualContentType = null;
41
42
43 public String getId() {
/*
P/P * Method: String getId()
*
* Preconditions:
* init'ed(this.id)
*
* Postconditions:
* return_value == this.id
* init'ed(return_value)
*/
44 return this.id;
45 }
46
47 public void setId( String id ) {
/*
P/P * Method: void setId(String)
*
* Postconditions:
* this.id == id
* init'ed(this.id)
*/
48 this.id = id;
49 }
50
51 public String getName() {
/*
P/P * Method: String getName()
*
* Preconditions:
* init'ed(this.name)
*
* Postconditions:
* return_value == this.name
* init'ed(return_value)
*/
52 return this.name;
53 }
54
55 public void setName( String name ) {
/*
P/P * Method: void setName(String)
*
* Postconditions:
* this.name == name
* init'ed(this.name)
*/
56 this.name = name;
57 }
58
59 public String getDescription() {
/*
P/P * Method: String getDescription()
*
* Preconditions:
* init'ed(this.description)
*
* Postconditions:
* return_value == this.description
* init'ed(return_value)
*/
60 return this.description;
61 }
62
63 public void setDescription( String description ) {
/*
P/P * Method: void setDescription(String)
*
* Postconditions:
* this.description == description
* init'ed(this.description)
*/
64 this.description = description;
65 }
66
67 public String getLink() {
/*
P/P * Method: String getLink()
*
* Preconditions:
* init'ed(this.link)
*
* Postconditions:
* return_value == this.link
* init'ed(return_value)
*/
68 return this.link;
69 }
70
71 public void setLink( String link ) {
/*
P/P * Method: void setLink(String)
*
* Postconditions:
* this.link == link
* init'ed(this.link)
*/
72 this.link = link;
73 }
74
75 public String getContents() {
/*
P/P * Method: String getContents()
*
* Preconditions:
* init'ed(this.contents)
*
* Postconditions:
* return_value == this.contents
* init'ed(return_value)
*/
76 return this.contents;
77 }
78
79 public void setContents( String contents ) {
/*
P/P * Method: void setContents(String)
*
* Postconditions:
* this.contents == contents
* init'ed(this.contents)
*/
80 this.contents = contents;
81 }
82
83 public String getTemplateLanguage() {
/*
P/P * Method: String getTemplateLanguage()
*
* Preconditions:
* init'ed(this.templateLanguage)
*
* Postconditions:
* return_value == this.templateLanguage
* init'ed(return_value)
*/
84 return this.templateLanguage;
85 }
86
87 public void setTemplateLanguage( String templateLanguage ) {
/*
P/P * Method: void setTemplateLanguage(String)
*
* Postconditions:
* this.templateLanguage == templateLanguage
* init'ed(this.templateLanguage)
*/
88 this.templateLanguage = templateLanguage;
89 }
90
91 public boolean isNavbar() {
/*
P/P * Method: bool isNavbar()
*
* Preconditions:
* init'ed(this.navbar)
*
* Postconditions:
* return_value == this.navbar
* init'ed(return_value)
*/
92 return this.navbar;
93 }
94
95 public void setNavbar( boolean navbar ) {
/*
P/P * Method: void setNavbar(bool)
*
* Postconditions:
* this.navbar == navbar
* init'ed(this.navbar)
*/
96 this.navbar = navbar;
97 }
98
99 public boolean isHidden() {
/*
P/P * Method: bool isHidden()
*
* Preconditions:
* init'ed(this.hidden)
*
* Postconditions:
* return_value == this.hidden
* init'ed(return_value)
*/
100 return this.hidden;
101 }
102
103 public void setHidden( boolean hidden ) {
/*
P/P * Method: void setHidden(bool)
*
* Postconditions:
* this.hidden == hidden
* init'ed(this.hidden)
*/
104 this.hidden = hidden;
105 }
106
107 public Boolean getAutoContentType() {
/*
P/P * Method: Boolean getAutoContentType()
*
* Preconditions:
* init'ed(this.autoContentType)
*
* Postconditions:
* return_value == this.autoContentType
* init'ed(return_value)
*/
108 return autoContentType;
109 }
110
111 public void setAutoContentType(Boolean autoContentType) {
/*
P/P * Method: void setAutoContentType(Boolean)
*
* Postconditions:
* this.autoContentType == autoContentType
* init'ed(this.autoContentType)
*/
112 this.autoContentType = autoContentType;
113 }
114
115 public String getManualContentType() {
/*
P/P * Method: String getManualContentType()
*
* Preconditions:
* init'ed(this.manualContentType)
*
* Postconditions:
* return_value == this.manualContentType
* init'ed(return_value)
*/
116 return manualContentType;
117 }
118
119 public void setManualContentType(String manualContentType) {
/*
P/P * Method: void setManualContentType(String)
*
* Postconditions:
* this.manualContentType == manualContentType
* init'ed(this.manualContentType)
*/
120 this.manualContentType = manualContentType;
121 }
122
123
124 public void copyTo(WeblogTemplate dataHolder) {
125
/*
P/P * Method: void copyTo(WeblogTemplate)
*
* Preconditions:
* dataHolder != null
* init'ed(this.contents)
* (soft) init'ed(this.description)
* (soft) init'ed(this.hidden)
* (soft) init'ed(this.link)
* (soft) init'ed(this.name)
* (soft) init'ed(this.navbar)
* (soft) init'ed(this.templateLanguage)
*
* Test Vectors:
* org.apache.roller.weblogger.pojos.WeblogTemplate:isCustom(...)@130: {0}, {1}
*/
126 dataHolder.setContents(getContents());
127
128 // the rest of the template properties can only be modified when
129 // dealing with a CUSTOM weblog template
130 if(dataHolder.isCustom()) {
131 dataHolder.setName(getName());
132 dataHolder.setDescription(getDescription());
133 dataHolder.setLink(getLink());
134 dataHolder.setNavbar(isNavbar());
135 dataHolder.setHidden(isHidden());
136 dataHolder.setTemplateLanguage(getTemplateLanguage());
137 }
138 }
139
140
141 public void copyFrom(WeblogTemplate dataHolder) {
142
/*
P/P * Method: void copyFrom(WeblogTemplate)
*
* Preconditions:
* dataHolder != null
*
* Presumptions:
* init'ed(java.lang.Boolean.FALSE)
*
* Postconditions:
* this.autoContentType == One-of{old this.autoContentType, java.lang.Boolean.FALSE}
* init'ed(this.contents)
* init'ed(this.description)
* init'ed(this.hidden)
* init'ed(this.id)
* init'ed(this.link)
* init'ed(this.manualContentType)
* init'ed(this.name)
* init'ed(this.navbar)
* init'ed(this.templateLanguage)
*
* Test Vectors:
* org.apache.roller.weblogger.pojos.WeblogTemplate:getOutputContentType(...)@152: Addr_Set{null}, Inverse{null}
*/
143 this.id = dataHolder.getId();
144 this.name = dataHolder.getName();
145 this.description = dataHolder.getDescription();
146 this.link = dataHolder.getLink();
147 this.contents = dataHolder.getContents();
148 this.navbar = dataHolder.isNavbar();
149 this.hidden = dataHolder.isHidden();
150 this.templateLanguage = dataHolder.getTemplateLanguage();
151
152 setManualContentType(dataHolder.getOutputContentType());
153 if(getManualContentType() != null) {
154 setAutoContentType(Boolean.FALSE);
155 }
156 }
157
158 }
SofCheck Inspector Build Version : 2.18479
| TemplateEditBean.java |
2009-Jan-02 14:24:58 |
| TemplateEditBean.class |
2009-Sep-04 03:12:45 |