KickJava   Java API By Example, From Geeks To Geeks.

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


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.*;
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_NODE_NAVIGATION"
17  */

18 public class NodeNavigationData {
19     
20   private String JavaDoc owner_ ;
21   transient private NodeNavigation node_ ;
22
23   public NodeNavigationData() { }
24   
25   public NodeNavigationData(String JavaDoc owner, PageNode node) {
26     owner_ = owner ;
27     node_ = new NodeNavigation() ;
28     node_.setOwner(owner) ;
29     node_.setNode(node) ;
30   }
31
32   public NodeNavigationData(NodeNavigation node) throws Exception JavaDoc {
33     setNodeNavigation(node) ;
34   }
35
36   public NodeNavigationData(String JavaDoc xml) throws Exception JavaDoc {
37      setData(xml) ;
38   }
39
40   /**
41    * @hibernate.id generator-class="assigned" unsaved-value="null"
42    ***/

43   public String JavaDoc getId() { return owner_ ; }
44   public void setId(String JavaDoc owner) { owner_ = owner ; }
45   
46   public String JavaDoc getOwner() { return owner_ ; }
47   public void setOwner(String JavaDoc owner) { owner_ = owner ; }
48   
49   /**
50    * @hibernate.property length="65535" type="org.exoplatform.services.database.impl.TextClobType"
51    **/

52   public String JavaDoc getData() throws Exception JavaDoc {
53     XStream xstream = PortalConfigServiceImpl.getXStreamInstance() ;
54     String JavaDoc xml = xstream.toXML(node_) ;
55     return xml ;
56   }
57
58   public void setData(String JavaDoc s) throws Exception JavaDoc {
59     XStream xstream = PortalConfigServiceImpl.getXStreamInstance() ;
60     node_ = (NodeNavigation)xstream.fromXML(s) ;
61     owner_ = node_.getOwner() ;
62   }
63   
64   public NodeNavigation getNodeNavigation() { return node_ ; }
65   public void setNodeNavigation(NodeNavigation obj) {
66     owner_ = obj.getOwner() ;
67     node_ = obj ;
68   }
69 }
Popular Tags