1 5 package org.exoplatform.services.portal.impl; 6 7 import org.exoplatform.services.portal.model.*; 8 import com.thoughtworks.xstream.XStream; 9 18 public class NodeNavigationData { 19 20 private String owner_ ; 21 transient private NodeNavigation node_ ; 22 23 public NodeNavigationData() { } 24 25 public NodeNavigationData(String 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 { 33 setNodeNavigation(node) ; 34 } 35 36 public NodeNavigationData(String xml) throws Exception { 37 setData(xml) ; 38 } 39 40 43 public String getId() { return owner_ ; } 44 public void setId(String owner) { owner_ = owner ; } 45 46 public String getOwner() { return owner_ ; } 47 public void setOwner(String owner) { owner_ = owner ; } 48 49 52 public String getData() throws Exception { 53 XStream xstream = PortalConfigServiceImpl.getXStreamInstance() ; 54 String xml = xstream.toXML(node_) ; 55 return xml ; 56 } 57 58 public void setData(String s) throws Exception { 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 |