Search in sources :

Example 1 with SubsetIteratorFilter

use of org.apache.struts2.util.SubsetIteratorFilter in project entando-core by entando.

the class AdminPagerTag method doStartTag.

@Override
public int doStartTag() throws JspException {
    Object source = this.findValue(this.getSource());
    ServletRequest request = this.pageContext.getRequest();
    ValueStack stack = this.getStack();
    ComponentPagerVO compPagerVo = new ComponentPagerVO(stack);
    try {
        AdminPagerTagHelper helper = this.getPagerHelper();
        IPagerVO pagerVo = helper.getPagerVO((Collection) source, this.getPagerId(), this.getCount(), this.isAdvanced(), this.getOffset(), request);
        compPagerVo.initPager(pagerVo);
        stack.getContext().put(this.getObjectName(), compPagerVo);
        stack.setValue("#attr['" + this.getObjectName() + "']", compPagerVo, false);
    } catch (Throwable t) {
        _logger.error("Error creating the pager", t);
        // ApsSystemUtils.logThrowable(t, this, "doStartTag");
        throw new JspException("Error creating the pager", t);
    }
    SubsetIteratorFilter subsetIteratorFilter = new SubsetIteratorFilter();
    subsetIteratorFilter.setCount(this.getCount());
    subsetIteratorFilter.setDecider(null);
    subsetIteratorFilter.setSource(source);
    subsetIteratorFilter.setStart(compPagerVo.getBegin());
    subsetIteratorFilter.execute();
    this.setSubsetIteratorFilter(subsetIteratorFilter);
    this.getStack().push(subsetIteratorFilter);
    if (getId() != null) {
        pageContext.setAttribute(getId(), subsetIteratorFilter);
    }
    return EVAL_BODY_INCLUDE;
}
Also used : ServletRequest(javax.servlet.ServletRequest) JspException(javax.servlet.jsp.JspException) ValueStack(com.opensymphony.xwork2.util.ValueStack) ComponentPagerVO(com.agiletec.apsadmin.tags.util.ComponentPagerVO) AdminPagerTagHelper(com.agiletec.apsadmin.tags.util.AdminPagerTagHelper) SubsetIteratorFilter(org.apache.struts2.util.SubsetIteratorFilter) IPagerVO(com.agiletec.aps.tags.util.IPagerVO)

Aggregations

IPagerVO (com.agiletec.aps.tags.util.IPagerVO)1 AdminPagerTagHelper (com.agiletec.apsadmin.tags.util.AdminPagerTagHelper)1 ComponentPagerVO (com.agiletec.apsadmin.tags.util.ComponentPagerVO)1 ValueStack (com.opensymphony.xwork2.util.ValueStack)1 ServletRequest (javax.servlet.ServletRequest)1 JspException (javax.servlet.jsp.JspException)1 SubsetIteratorFilter (org.apache.struts2.util.SubsetIteratorFilter)1