1 package org.infoglue.cms.applications.common.actions; 2 3 import java.util.Collection ; 4 5 import com.frovi.ss.Tree.INodeSupplier; 6 import com.frovi.ss.Tree.MakeTree; 7 8 12 13 public abstract class TreeViewAbstractAction extends InfoGlueAbstractAction 14 { 15 private Collection nodes; 16 private String exp=""; 17 private String rkey = ""; 18 private String akey = ""; 19 20 protected abstract INodeSupplier getNodeSupplier() throws Exception ; 22 23 24 protected Collection initialize(String expString) throws Exception 25 { 26 return new MakeTree(getNodeSupplier()).makeNodeList(expString); 27 } 28 29 public String doExecute() throws Exception 30 { 31 setExp(getExp().replaceAll(getRkey(), "") + getAkey()); 33 34 setNodes(this.initialize(getExp())); 36 getResponse().setBufferSize(0); 37 38 getResponse().setHeader("Cache-Control","no-cache"); 39 getResponse().setHeader("Pragma","no-cache"); 40 getResponse().setDateHeader ("Expires", 0); 41 42 return "success"; 44 } 45 46 50 protected void setNodes(Collection nodes) 51 { 52 this.nodes = nodes; 53 } 54 55 public Collection getNodes() throws Exception 56 { 57 return this.nodes; 58 } 59 60 64 public String getExp() { 65 return exp; 66 } 67 68 72 public void setExp(String expStr) { 73 this.exp = expStr; 74 } 75 76 77 81 public String getAkey() 82 { 83 return akey; 84 } 85 86 90 public String getRkey() 91 { 92 return rkey; 93 } 94 95 99 public void setAkey(String akey) 100 { 101 this.akey = akey; 102 } 103 104 108 public void setRkey(String rkey) 109 { 110 this.rkey = rkey; 111 } 112 113 } 114 | Popular Tags |