1 package org.jahia.data.viewhelper.sitemap; 2 3 import java.util.List ; 4 5 import org.jahia.params.ParamBean; 6 import org.jahia.services.pages.ContentPage; 7 import org.jahia.services.pages.JahiaPage; 8 import org.jahia.services.pages.JahiaPageDefinition; 9 import org.jahia.services.usermanager.JahiaUser; 10 11 14 public abstract class PagesFilter { 15 private String fieldDefaultValue; 16 17 public abstract boolean filterForDisplay(ContentPage contentPage, 18 ParamBean jParams); 19 20 public abstract boolean filterForSelection(ContentPage contentPage, 21 ParamBean jParams); 22 23 public abstract boolean filterForRelease(ContentPage contentPage, 24 ParamBean jParams); 25 26 public abstract List filterChildren(ContentPage contentPage, 27 List childPages, ParamBean jParams); 28 29 protected static String getPageTemplateName(ContentPage aContentPage, 30 ParamBean aJParams) { 31 if (aContentPage == null) 32 return null; 33 34 JahiaPageDefinition pageTemplate = aContentPage 35 .getPageTemplate(aJParams); 36 if (pageTemplate == null) 37 return null; 38 39 return pageTemplate.getName(); 40 } 41 42 protected static String getPageTemplateName(JahiaPage aJahiaPage, 43 ParamBean aJParams) { 44 if (aJahiaPage == null) 45 return null; 46 47 JahiaPageDefinition pageTemplate = aJahiaPage.getPageTemplate(); 48 if (pageTemplate == null) 49 return null; 50 51 return pageTemplate.getName(); 52 } 53 54 public String getFieldDefaultValue() { 55 return fieldDefaultValue; 56 } 57 58 public void setFieldDefaultValue(String aFieldDefaultValue) { 59 this.fieldDefaultValue = aFieldDefaultValue; 60 } 61 62 public boolean isSearchTabRequired() { 63 return false; 64 } 65 66 public boolean isDirectPagesOnly() { 67 return true; 68 } 69 70 public abstract List getStartPages( 71 ContentPage startPage, 72 JahiaUser user, 73 int pageInfosFlag, 74 String languageCode, 75 ParamBean jParams); 76 } 77 | Popular Tags |