1 package org.jahia.deprecated.taglibs.container; 2 3 import javax.servlet.jsp.JspException ; 4 5 import org.jahia.data.JahiaData; 6 import org.jahia.data.containers.JahiaContainerList; 7 import org.jahia.exceptions.JahiaException; 8 9 10 15 public class RelativeContainerListTag extends ContainerListTag { 16 17 private int windowSize = -1; 18 private int windowOffset = -1; 19 20 private int levelNb = 0; 21 22 public void setLevelNb(int nb) { 23 this.levelNb = nb; 24 } 25 26 public void setWindowSize(String windowSize) { 27 try { 28 this.windowSize = Integer.parseInt(windowSize); 29 } catch (NumberFormatException nfe) { 30 this.windowSize = -1; 31 } 32 } 33 34 39 40 public void setWindowOffset(String windowOffset) { 41 try { 42 this.windowOffset = Integer.parseInt(windowOffset); 43 } catch (NumberFormatException nfe) { 44 this.windowOffset = -1; 45 } 46 } 47 48 53 54 56 protected JahiaContainerList getContainerList( JahiaData jData, String listName ) throws JahiaException { 58 return jData.containers().getRelativeContainerList(listName, this.levelNb); 59 } 60 61 public int doEndTag() throws JspException { 62 super.doEndTag(); 65 windowSize = -1; 66 windowOffset = -1; 67 68 levelNb = 0; 69 return EVAL_PAGE; 70 } 71 72 } 73 | Popular Tags |