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 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 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 |