KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jahia > data > webapps > JahiaWebAppDef


1 //
2
// ____.
3
// __/\ ______| |__/\. _______
4
// __ .____| | \ | +----+ \
5
// _______| /--| | | - \ _ | : - \_________
6
// \\______: :---| : : | : | \________>
7
// |__\---\_____________:______: :____|____:_____\
8
// /_____|
9
//
10
// . . . i n j a h i a w e t r u s t . . .
11
//
12
//
13
//
14
// JahiaWebAppDef
15
//
16
// NK 16.01.2001
17
//
18
//
19

20 package org.jahia.data.webapps;
21
22 import java.util.Enumeration JavaDoc;
23 import java.util.Vector JavaDoc;
24
25
26 /**
27  * Holds Informations about a WebApp Definition
28  *
29  * A web app contains a set of servlet element
30  *
31  * <servlet>
32  * <servlet-name>FilemanagerServlet</servlet-name>
33  * <display-name>Filemanager Portlet</display-name>
34  * <desc>no desc</desc>
35  * <servlet-class>org.jahia.portlets.filemanager.FilemanagerServlet</servlet-class>
36  * <init-param>
37  * <param-name>properties</param-name>
38  * <param-value>WEB-INF/conf/filemanager.properties</param-value>
39  * </init-param>
40  * </servlet>
41  *
42  * @author Khue ng
43  * @version 1.0
44  */

45 public class JahiaWebAppDef {
46
47     /** The Display name of the web App **/
48     private String JavaDoc m_Name = "";
49     /** The desc **/
50     private String JavaDoc m_desc = "";
51     /** The Context Root Folder **/
52     private String JavaDoc m_ContextRoot;
53     /** The set of servlets *
54      * @associates Servlet_Element*/

55     private Vector JavaDoc m_Servlets = new Vector JavaDoc();
56     /** The set of roles *
57      * @associates Security_Role*/

58     private Vector JavaDoc m_Roles = new Vector JavaDoc();
59    
60    
61     /**
62      * Constructor
63      *
64      */

65     public JahiaWebAppDef (
66                             String JavaDoc name,
67                             String JavaDoc contextRoot )
68     {
69         m_Name = name;
70         m_ContextRoot = contextRoot;
71     }
72
73    
74     /**
75      * Return the webApp display name
76      *
77      * @return (String) the name of the webApp
78      */

79     public String JavaDoc getName(){
80       
81         return m_Name;
82     }
83
84
85     /**
86      * Set the display name
87      * @param (String) the name of the webApp
88      */

89     public void setName(String JavaDoc name){
90       
91         m_Name = name;
92     }
93
94
95     /**
96      * Return the Context Root
97      *
98      * @return (String) the context root
99      */

100     public String JavaDoc getContextRoot(){
101       
102         return m_ContextRoot;
103     }
104
105
106     /**
107      * Set the Context Root
108      * @param (String) the Context Root
109      */

110     public void setContextRoot(String JavaDoc contextRoot){
111       
112         m_ContextRoot = contextRoot;
113     }
114
115
116     /**
117      * Return the Web App desc
118      *
119      * @return (String) the desc
120      */

121     public String JavaDoc getdesc(){
122       
123         return m_desc;
124     }
125
126
127     /**
128      * Set the desc
129      * @param (String) the desc
130      */

131     public void setdesc(String JavaDoc descr){
132       
133         m_desc = descr;
134     }
135
136
137     /**
138      * add a Servlet Element
139      *
140      * @param (Servlet_Element) a servlet element
141      */

142     public void addServlet(Servlet_Element servlet){
143         m_Servlets.add(servlet);
144     }
145     
146
147     /**
148      * append a Vector of Servlet Element at the end of the servlets list
149      *
150      * @param (Vector) a vector of servlet element
151      */

152     public void addServlets(Vector JavaDoc servlets){
153         m_Servlets.addAll(servlets);
154     }
155
156
157     /**
158      * get a Vector of the Servlets
159      *
160      * @return (Vector) return an enumeration of servlets
161      */

162     public Vector JavaDoc getServlets(){
163         return m_Servlets;
164     }
165
166
167     /**
168      * add a Security_Role
169      *
170      * @param (Security_Role) a role element
171      */

172     public void addRole(Security_Role role){
173         m_Roles.add(role);
174     }
175     
176
177     /**
178      * append a Vector of Roles at the end of the roles list
179      *
180      * @param (Vector) a vector of role element
181      */

182     public void addRoles(Vector JavaDoc roles){
183         m_Roles.addAll(roles);
184     }
185
186
187     /**
188      * get a Vector of the roles
189      *
190      * @return (Enumeration) return the enumeration of Roles
191      */

192     public Enumeration JavaDoc getRoles(){
193         return m_Roles.elements();
194     }
195
196     
197     
198     
199     
200 } // end JahiaWebAppDef
201
Popular Tags