Search in sources :

Example 1 with PagerTagHelper

use of com.agiletec.aps.tags.util.PagerTagHelper in project entando-core by entando.

the class PagerTag method doStartTag.

@Override
public int doStartTag() throws JspException {
    ServletRequest request = this.pageContext.getRequest();
    try {
        Object object = this.pageContext.getAttribute(this.getListName());
        Collection collection = (null != object && object instanceof SimpleSequence) ? ((SimpleSequence) object).toList() : (Collection) object;
        if (collection == null) {
            _logger.error("There is no list in the request");
        } else {
            PagerTagHelper helper = new PagerTagHelper();
            IPagerVO pagerVo = helper.getPagerVO(collection, this.getPagerId(), this.isPagerIdFromFrame(), this.getMax(), this.isAdvanced(), this.getOffset(), request);
            this.pageContext.setAttribute(this.getObjectName(), pagerVo);
        }
    } catch (Throwable t) {
        _logger.error("Error detected during tag initialization", t);
        // ApsSystemUtils.logThrowable(e, this, "doStartTag");
        throw new JspException("Error detected during tag initialization", t);
    }
    return EVAL_BODY_INCLUDE;
}
Also used : ServletRequest(javax.servlet.ServletRequest) PagerTagHelper(com.agiletec.aps.tags.util.PagerTagHelper) JspException(javax.servlet.jsp.JspException) Collection(java.util.Collection) IPagerVO(com.agiletec.aps.tags.util.IPagerVO) SimpleSequence(freemarker.template.SimpleSequence)

Aggregations

IPagerVO (com.agiletec.aps.tags.util.IPagerVO)1 PagerTagHelper (com.agiletec.aps.tags.util.PagerTagHelper)1 SimpleSequence (freemarker.template.SimpleSequence)1 Collection (java.util.Collection)1 ServletRequest (javax.servlet.ServletRequest)1 JspException (javax.servlet.jsp.JspException)1