KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jahia > data > beans > JahiaBean


1 package org.jahia.data.beans;
2
3 import org.jahia.exceptions.JahiaException;
4 import org.jahia.params.ParamBean;
5 import org.jahia.registries.ServicesRegistry;
6 import org.jahia.services.sites.JahiaSite;
7
8 /**
9  * <p>Title: </p>
10  * <p>Description: </p>
11  * <p>Copyright: Copyright (c) 2002</p>
12  * <p>Company: Jahia Ltd</p>
13  * @author Serge Huber
14  * @version 1.0
15  */

16
17 public class JahiaBean {
18
19     private static org.apache.log4j.Logger logger =
20         org.apache.log4j.Logger.getLogger(JahiaBean.class);
21
22     private ParamBean paramBean;
23
24     public JahiaBean() {
25     }
26
27     public JahiaBean(ParamBean paramBean) {
28         this.paramBean = paramBean;
29     }
30
31     public SiteBean getSite(String JavaDoc name) {
32         try {
33             JahiaSite jahiaSite = ServicesRegistry.getInstance().getJahiaSitesService().getSite(name);
34             SiteBean siteBean = new SiteBean(jahiaSite, paramBean);
35             return siteBean;
36         } catch (JahiaException je) {
37             logger.error("Cannot find site " + name + ":", je);
38             return null;
39         }
40
41     }
42 }
Popular Tags