KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > alfresco > web > config > ServerConfigElement


1 /*
2  * Copyright (C) 2005 Alfresco, Inc.
3  *
4  * Licensed under the Mozilla Public License version 1.1
5  * with a permitted attribution clause. You may obtain a
6  * copy of the License at
7  *
8  * http://www.alfresco.org/legal/license.txt
9  *
10  * Unless required by applicable law or agreed to in writing,
11  * software distributed under the License is distributed on an
12  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
13  * either express or implied. See the License for the specific
14  * language governing permissions and limitations under the
15  * License.
16  */

17 package org.alfresco.web.config;
18
19 import org.alfresco.config.ConfigElement;
20 import org.alfresco.config.element.ConfigElementAdapter;
21
22 /**
23  * Custom config element that represents the config data for the server
24  *
25  * @author gavinc
26  */

27 public class ServerConfigElement extends ConfigElementAdapter
28 {
29    private String JavaDoc errorPage;
30    private String JavaDoc loginPage;
31    
32    /**
33     * Default constructor
34     */

35    public ServerConfigElement()
36    {
37       super("server");
38    }
39    
40    /**
41     * Constructor
42     *
43     * @param name Name of the element this config element represents
44     */

45    public ServerConfigElement(String JavaDoc name)
46    {
47       super(name);
48    }
49    
50    public ConfigElement combine(ConfigElement configElement)
51    {
52       // NOTE: combining these would simply override the values so we just need
53
// to return a new instance of the given config element
54

55       ServerConfigElement combined = new ServerConfigElement();
56       combined.setErrorPage(((ServerConfigElement)configElement).getErrorPage());
57       combined.setLoginPage(((ServerConfigElement)configElement).getLoginPage());
58       return combined;
59    }
60    
61    /**
62     * @return The error page the application should use
63     */

64    public String JavaDoc getErrorPage()
65    {
66       return this.errorPage;
67    }
68
69    /**
70     * @param errorPage Sets the error page
71     */

72    public void setErrorPage(String JavaDoc errorPage)
73    {
74       this.errorPage = errorPage;
75    }
76    
77    /**
78     * @return Returns the login Page.
79     */

80    public String JavaDoc getLoginPage()
81    {
82       return this.loginPage;
83    }
84    
85    /**
86     * @param loginPage The login Page to set.
87     */

88    public void setLoginPage(String JavaDoc loginPage)
89    {
90       this.loginPage = loginPage;
91    }
92 }
93
Popular Tags