1 package org.jahia.content; 2 3 import java.util.ArrayList ; 4 5 import org.jahia.exceptions.JahiaException; 6 import org.jahia.services.usermanager.JahiaUser; 7 import org.jahia.services.version.EntryLoadRequest; 8 9 18 public abstract class AbstractContentTreeVisitor implements ContentTreeVisitorInterface { 19 20 private int descendingPageLevel = 0; 21 private boolean withChildsContent = true; 22 private JahiaUser user; 23 private EntryLoadRequest loadRequest; 24 private String operationMode; 25 26 protected AbstractContentTreeVisitor(JahiaUser user, 27 EntryLoadRequest loadRequest, 28 String operationMode){ 29 this.user = user; 30 this.loadRequest = loadRequest; 31 this.operationMode = operationMode; 32 } 33 34 38 public JahiaUser getUser(){ 39 return this.user; 40 } 41 42 46 public void setUser(JahiaUser user){ 47 this.user = user; 48 } 49 50 54 public EntryLoadRequest getEntryLoadRequest(){ 55 return this.loadRequest; 56 } 57 58 62 public void setEntryLoadRequest(EntryLoadRequest loadRequest){ 63 this.loadRequest = loadRequest; 64 } 65 66 70 public String getOperationMode(){ 71 return this.operationMode; 72 } 73 74 78 public void setOperationMode(String operationMode){ 79 this.operationMode = operationMode; 80 } 81 82 86 public int getDescendingPageLevel(){ 87 return this.descendingPageLevel; 88 } 89 90 93 public void setDescendingPageLevel(int level){ 94 this.descendingPageLevel = level; 95 } 96 97 102 public abstract ContentTree getContentTree(); 103 104 109 public boolean withChildsContent(){ 110 return this.withChildsContent; 111 } 112 113 120 public void withChildsContent(boolean value){ 121 this.withChildsContent = value; 122 } 123 124 130 public abstract ContentTreeStatusInterface getContentTreeStatus(ContentObject contentObject, 131 int currentPageLevel) throws JahiaException; 132 133 140 public ArrayList getChilds(ContentObject contentObject, 141 int currentPageLevel) 142 throws JahiaException { 143 144 return this.getContentTree().getContentChilds(contentObject,user, 145 loadRequest,operationMode); 146 } 147 148 156 public void processContentObjectBeforeChilds( 157 ContentObject contentObject, int currentPageLevel) 158 throws JahiaException{ 159 } 161 162 169 public void processContentObjectAfterChilds( 170 ContentObject contentObject, int currentPageLevel) 171 throws JahiaException{ 172 } 174 175 184 public void stopProcessContentObjectAfterChilds( 185 ContentObject contentObject, int currentPageLevel) 186 throws JahiaException { 187 } 189 190 198 public void processLastContentPageField( 199 ContentObject contentObject, int currentPageLevel) 200 throws JahiaException{ 201 } 203 204 } 205 | Popular Tags |