1 13 package info.magnolia.context; 14 15 import info.magnolia.cms.core.HierarchyManager; 16 import info.magnolia.cms.core.search.QueryManager; 17 import info.magnolia.cms.security.AccessManager; 18 import info.magnolia.cms.security.User; 19 20 import java.util.Map ; 21 22 23 28 public class ContextDecorator extends AbstractContext { 29 30 protected Context ctx; 31 32 35 public ContextDecorator(Context ctx) { 36 this.ctx = ctx; 37 } 38 39 42 public AccessManager getAccessManager(String repositoryId, String workspaceId) { 43 return this.ctx.getAccessManager(repositoryId, workspaceId); 44 } 45 46 49 public Object getAttribute(String name, int scope) { 50 return this.ctx.getAttribute(name, scope); 51 } 52 53 56 public Map getAttributes(int scope) { 57 return this.ctx.getAttributes(scope); 58 } 59 60 63 public HierarchyManager getHierarchyManager(String repositoryId, String workspaceId) { 64 return this.ctx.getHierarchyManager(repositoryId, workspaceId); 65 } 66 67 70 public User getUser() { 71 return this.ctx.getUser(); 72 } 73 74 77 public void setAttribute(String name, Object value, int scope) { 78 this.ctx.setAttribute(name, value, scope); 79 } 80 81 84 public void setUser(User user) { 85 this.ctx.setUser(user); 86 } 87 88 91 public QueryManager getQueryManager(String repositoryId, String workspaceId) { 92 return this.ctx.getQueryManager(repositoryId, workspaceId); 93 } 94 95 98 public void removeAttribute(String name, int scope) { 99 this.ctx.removeAttribute(name, scope); 100 } 101 102 106 public Context getWrappedContext() { 107 return this.ctx; 108 } 109 110 } 111 | Popular Tags |