1 23 24 package org.infoglue.cms.applications.contenttool.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 ViewContentTreeAction extends InfoGlueAbstractAction implements ViewContentTreeActionInterface 38 { 39 private static final long serialVersionUID = 1L; 40 41 private Integer repositoryId; 42 private Integer contentId; 43 private String tree; 44 private String hideLeafs; 45 private String bodyClass; 46 47 public void setRepositoryId(Integer repositoryId) 48 { 49 this.repositoryId = repositoryId; 50 } 51 52 public Integer getRepositoryId() 53 { 54 return this.repositoryId; 55 } 56 57 public void setContentId(Integer contentId) 58 { 59 this.contentId = contentId; 60 } 61 62 public Integer getContentId() 63 { 64 return this.contentId; 65 } 66 67 public void setHideLeafs(String hideLeafs) 68 { 69 this.hideLeafs = hideLeafs; 70 } 71 72 public String getHideLeafs() 73 { 74 return this.hideLeafs; 75 } 76 77 public String doExecute() throws Exception 78 { 79 if (tree != null) 81 { 82 Cookie t = new Cookie ("tree", tree); 85 getResponse().addCookie(t); 86 } 87 else 88 { 89 Cookie [] cookies = getRequest().getCookies(); 91 if(cookies != null) 92 for (int i=0; i < cookies.length; i++) 93 { 94 if (cookies[i].getName().compareTo("tree") == 0) 95 setTree(cookies[i].getValue()); 96 } 97 } 98 99 if (tree == null) 101 setTree(CmsPropertyHandler.getTree()); 102 103 if (tree == null) 105 setTree("applet"); 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 public String getBodyClass() 129 { 130 return bodyClass; 131 } 132 133 public void setBodyClass(String bodyClass) 134 { 135 this.bodyClass = bodyClass; 136 } 137 } 138 | Popular Tags |