use of com.agiletec.aps.tags.util.HeadInfoContainer in project entando-core by entando.
the class CheckHeadInfoOutputterTag method doStartTag.
public int doStartTag() throws JspException {
ServletRequest request = this.pageContext.getRequest();
RequestContext reqCtx = (RequestContext) request.getAttribute(RequestContext.REQCTX);
HeadInfoContainer headInfo = (HeadInfoContainer) reqCtx.getExtraParam(SystemConstants.EXTRAPAR_HEAD_INFO_CONTAINER);
List<Object> infos = headInfo.getInfos(this.getType());
if (infos == null || infos.size() == 0) {
return SKIP_BODY;
} else {
return EVAL_BODY_INCLUDE;
}
}
use of com.agiletec.aps.tags.util.HeadInfoContainer in project entando-core by entando.
the class HeadInfoOutputterTag method doStartTag.
public int doStartTag() throws JspException {
ServletRequest request = this.pageContext.getRequest();
RequestContext reqCtx = (RequestContext) request.getAttribute(RequestContext.REQCTX);
HeadInfoContainer headInfo = (HeadInfoContainer) reqCtx.getExtraParam(SystemConstants.EXTRAPAR_HEAD_INFO_CONTAINER);
int retVal;
List<Object> infos = headInfo.getInfos(this.getType());
if (infos != null) {
this._infos = infos;
this._index = 0;
retVal = EVAL_BODY_INCLUDE;
} else {
retVal = SKIP_BODY;
}
return retVal;
}
use of com.agiletec.aps.tags.util.HeadInfoContainer in project entando-core by entando.
the class HeadInfoTag method doEndTag.
@Override
public int doEndTag() throws JspException {
ServletRequest request = this.pageContext.getRequest();
RequestContext reqCtx = (RequestContext) request.getAttribute(RequestContext.REQCTX);
try {
HeadInfoContainer headInfo = (HeadInfoContainer) reqCtx.getExtraParam(SystemConstants.EXTRAPAR_HEAD_INFO_CONTAINER);
if (_type != null && (_info != null || _var != null)) {
Object info = _info;
if (_info != null) {
info = _info;
} else {
info = this.extractAttribute();
}
headInfo.addInfo(_type, info);
}
} catch (Throwable t) {
_logger.error("Error closing tag", t);
throw new JspException("Error closing tag ", t);
}
return super.doEndTag();
}
use of com.agiletec.aps.tags.util.HeadInfoContainer in project entando-core by entando.
the class WidgetExecutorService method service.
@Override
public void service(RequestContext reqCtx) {
try {
reqCtx.addExtraParam(SystemConstants.EXTRAPAR_HEAD_INFO_CONTAINER, new HeadInfoContainer());
IPage page = (IPage) reqCtx.getExtraParam(SystemConstants.EXTRAPAR_CURRENT_PAGE);
String[] widgetOutput = new String[page.getWidgets().length];
reqCtx.addExtraParam("ShowletOutput", widgetOutput);
this.buildWidgetsOutput(reqCtx, page, widgetOutput);
String redirect = (String) reqCtx.getExtraParam(SystemConstants.EXTRAPAR_EXTERNAL_REDIRECT);
if (null != redirect) {
HttpServletResponse response = (HttpServletResponse) reqCtx.getResponse();
response.sendRedirect(redirect);
return;
}
} catch (Throwable t) {
String msg = "Error detected during widget preprocessing";
_logger.error(msg, t);
throw new RuntimeException(msg, t);
}
return;
}
Aggregations