KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > services > portal > impl > PortalConfigData


1 /***************************************************************************
2  * Copyright 2001-2003 The eXo Platform SARL All rights reserved. *
3  * Please look at license.txt in info directory for more license detail. *
4  **************************************************************************/

5 package org.exoplatform.services.portal.impl;
6
7 import org.exoplatform.services.portal.model.PortalConfig;
8 import com.thoughtworks.xstream.XStream;
9 /**
10  * Created by The eXo Platform SARL .
11  * Author : Tuan Nguyen
12  * tuan08@users.sourceforge.net
13  * Date: Jun 14, 2003
14  * Time: 1:12:22 PM
15  *
16  * @hibernate.class table="EXO_PORTAL_CONFIG"
17  */

18 public class PortalConfigData extends PortalConfigDescriptionData {
19   transient private PortalConfig config_ ;
20
21   public PortalConfigData() { }
22
23   public PortalConfigData(String JavaDoc xml ) throws Exception JavaDoc {
24     setData(xml) ;
25   }
26
27   public PortalConfigData(PortalConfig config) throws Exception JavaDoc {
28     setPortalConfig(config) ;
29   }
30   
31   /**
32    * @hibernate.property length="65535" type="org.exoplatform.services.database.impl.TextClobType"
33    **/

34   public String JavaDoc getData() throws Exception JavaDoc {
35     XStream xstream = PortalConfigServiceImpl.getXStreamInstance() ;
36     String JavaDoc xml = xstream.toXML(config_) ;
37     return xml ;
38   }
39
40   public void setData(String JavaDoc s) throws Exception JavaDoc {
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