1 23 24 package org.infoglue.cms.applications.structuretool.actions; 25 26 import javax.servlet.http.Cookie ; 27 28 import org.infoglue.cms.applications.common.actions.InfoGlueAbstractAction; 29 import org.infoglue.cms.util.CmsPropertyHandler; 30 31 36 37 public class ViewSiteNodeTreeAction extends InfoGlueAbstractAction 38 { 39 private static final long serialVersionUID = 1L; 40 41 private Integer repositoryId; 42 private Integer siteNodeId; 43 private String tree; 44 private String hideLeafs; 45 46 public void setRepositoryId(Integer repositoryId) 47 { 48 this.repositoryId = repositoryId; 49 } 50 51 public Integer getRepositoryId() 52 { 53 return this.repositoryId; 54 } 55 56 public void setSiteNodeId(Integer siteNodeId) 57 { 58 this.siteNodeId = siteNodeId; 59 } 60 61 public Integer getSiteNodeId() 62 { 63 return this.siteNodeId; 64 } 65 66 public void setHideLeafs(String hideLeafs) 67 { 68 this.hideLeafs = hideLeafs; 69 } 70 71 public String getHideLeafs() 72 { 73 return this.hideLeafs; 74 } 75 76 public String doExecute() throws Exception 77 { 78 if (tree != null) 80 { 81 Cookie t = new Cookie ("tree", tree); 84 getResponse().addCookie(t); 85 } 86 else 87 { 88 Cookie [] cookies = getRequest().getCookies(); 90 if(cookies != null) 91 for (int i=0; i < cookies.length; i++) 92 { 93 if (cookies[i].getName().compareTo("tree") == 0) 94 setTree(cookies[i].getValue()); 95 } 96 } 97 98 if (tree == null) 100 setTree(CmsPropertyHandler.getTree()); 101 102 if (tree == null) 104 setTree("applet"); 105 106 107 return "success"; 108 } 109 110 114 public String getTree() 115 { 116 return tree; 117 } 118 119 123 public void setTree(String tree) 124 { 125 this.tree = tree; 126 } 127 128 } 129 | Popular Tags |