1 5 package org.exoplatform.services.portal.impl; 6 7 import org.exoplatform.services.portal.model.PortalConfig; 8 import com.thoughtworks.xstream.XStream; 9 18 public class PortalConfigData extends PortalConfigDescriptionData { 19 transient private PortalConfig config_ ; 20 21 public PortalConfigData() { } 22 23 public PortalConfigData(String xml ) throws Exception { 24 setData(xml) ; 25 } 26 27 public PortalConfigData(PortalConfig config) throws Exception { 28 setPortalConfig(config) ; 29 } 30 31 34 public String getData() throws Exception { 35 XStream xstream = PortalConfigServiceImpl.getXStreamInstance() ; 36 String xml = xstream.toXML(config_) ; 37 return xml ; 38 } 39 40 public void setData(String s) throws Exception { 41 XStream xstream = PortalConfigServiceImpl.getXStreamInstance() ; 42 config_ = (PortalConfig) xstream.fromXML(s) ; 43 setOwner(config_.getOwner()) ; 44 viewPermission = config_.getViewPermission() ; 45 editPermission = config_.getViewPermission() ; 46 } 47 48 public PortalConfig getPortalConfig() { return config_ ; } 49 public void setPortalConfig(PortalConfig config) { 50 config_ = config ; 51 setOwner(config_.getOwner()) ; 52 viewPermission = config_.getViewPermission() ; 53 editPermission = config_.getViewPermission() ; 54 } 55 } | Popular Tags |