use of com.agiletec.aps.system.services.page.widget.INavigatorParser in project entando-core by entando.
the class NavigatorTag method doStartTag.
@Override
public int doStartTag() throws JspException {
ServletRequest request = this.pageContext.getRequest();
try {
this._reqCtx = (RequestContext) request.getAttribute(RequestContext.REQCTX);
INavigatorParser navigatorParser = (INavigatorParser) ApsWebApplicationUtils.getBean(SystemConstants.NAVIGATOR_PARSER, this.pageContext);
IPage currPage = (IPage) this._reqCtx.getExtraParam(SystemConstants.EXTRAPAR_CURRENT_PAGE);
UserDetails currentUser = (UserDetails) this.pageContext.getSession().getAttribute(SystemConstants.SESSIONPARAM_CURRENT_USER);
if (this._spec == null) {
Widget currShowlet = (Widget) _reqCtx.getExtraParam((SystemConstants.EXTRAPAR_CURRENT_WIDGET));
ApsProperties showletConfig = currShowlet.getConfig();
String spec = (null != showletConfig) ? showletConfig.getProperty(CONFIG_PARAM_SPEC) : null;
this._targets = navigatorParser.parseSpec(spec, currPage, currentUser);
} else {
this._targets = navigatorParser.parseSpec(this._spec, currPage, currentUser);
}
if (this._targets == null || this._targets.isEmpty()) {
return SKIP_BODY;
}
this._index = 0;
NavigatorTarget currentTarget = this.getCurrentTarget();
this.pageContext.setAttribute(this.getVar(), currentTarget);
return EVAL_BODY_INCLUDE;
} catch (Throwable t) {
_logger.error("Error during tag initialization", t);
// ApsSystemUtils.logThrowable(t, this, "doStartTag");
throw new JspException("Error during tag initialization ", t);
}
}
Aggregations