use of com.agiletec.aps.system.services.url.PageURL in project entando-core by entando.
the class ErrorManager method service.
@Override
public int service(RequestContext reqCtx, int status) {
if (status == ControllerManager.CONTINUE || status == ControllerManager.OUTPUT) {
return ControllerManager.OUTPUT;
}
int retStatus = ControllerManager.INVALID_STATUS;
_logger.debug("Intervention of the error service");
try {
PageURL url = this.getUrlManager().createURL(reqCtx);
url.setPageCode(this.getErrorPageCode());
String redirUrl = url.getURL();
_logger.debug("Redirecting to " + redirUrl);
reqCtx.clearError();
reqCtx.addExtraParam(RequestContext.EXTRAPAR_REDIRECT_URL, redirUrl);
retStatus = ControllerManager.REDIRECT;
} catch (Throwable t) {
_logger.debug("Error detected while processing the request", t);
retStatus = ControllerManager.SYS_ERROR;
reqCtx.setHTTPError(HttpServletResponse.SC_SERVICE_UNAVAILABLE);
}
return retStatus;
}
use of com.agiletec.aps.system.services.url.PageURL in project entando-core by entando.
the class SystemInfoWrapper method getPageURLWithWidget.
public String getPageURLWithWidget(String widgetCode) {
String url = null;
try {
IPage page = this.getPageWithWidget(widgetCode);
if (null == page)
return url;
IURLManager urlManager = (IURLManager) ApsWebApplicationUtils.getBean(SystemConstants.URL_MANAGER, this.getReqCtx().getRequest());
PageURL pageUrl = urlManager.createURL(this.getReqCtx());
pageUrl.setPage(page);
url = pageUrl.getURL();
} catch (Throwable t) {
_logger.error("Error getting pageUrl with widget: {}", widgetCode, t);
// ApsSystemUtils.logThrowable(t, this, "getPageURLWithWidget", "Error getting pageUrl with widget: " + widgetCode);
return null;
}
return url;
}
use of com.agiletec.aps.system.services.url.PageURL in project entando-core by entando.
the class ActionURLTag method doEndTag.
@Override
public int doEndTag() throws JspException {
ServletRequest request = this.pageContext.getRequest();
RequestContext reqCtx = (RequestContext) request.getAttribute(RequestContext.REQCTX);
IURLManager urlManager = (IURLManager) ApsWebApplicationUtils.getBean(SystemConstants.URL_MANAGER, this.pageContext);
try {
PageURL pageUrl = urlManager.createURL(reqCtx);
IPage currPage = (IPage) reqCtx.getExtraParam(SystemConstants.EXTRAPAR_CURRENT_PAGE);
Integer currentFrame = (Integer) reqCtx.getExtraParam(SystemConstants.EXTRAPAR_CURRENT_FRAME);
pageUrl.setPage(currPage);
pageUrl.addParam(InternalServletTag.REQUEST_PARAM_ACTIONPATH, this.getPath());
pageUrl.addParam(InternalServletTag.REQUEST_PARAM_FRAMEDEST, currentFrame.toString());
if (null != this.getParameters()) {
Iterator<String> iter = this.getParameters().keySet().iterator();
while (iter.hasNext()) {
String name = (String) iter.next();
pageUrl.addParam(name, this.getParameters().get(name));
}
}
String path = pageUrl.getURL();
if (null != this.getVar()) {
this.pageContext.setAttribute(this.getVar(), path);
} else {
this.pageContext.getOut().print(path);
}
} catch (IOException e) {
_logger.error("Error closing tag", e);
// ApsSystemUtils.logThrowable(e, this, "doEndTag");
throw new JspException("Error closing tag ", e);
}
this.release();
return EVAL_PAGE;
}
use of com.agiletec.aps.system.services.url.PageURL in project entando-core by entando.
the class NavigatorTarget method getUrl.
/**
* Restituisce il link alla pagina corrente.
*
* @return Il link alla pagina.
*/
public String getUrl() {
IURLManager urlManager = (IURLManager) ApsWebApplicationUtils.getBean(SystemConstants.URL_MANAGER, this._reqCtx.getRequest());
PageURL pageUrl = urlManager.createURL(this._reqCtx);
pageUrl.setPage(this.getPage());
String urlString = pageUrl.getURL();
return urlString;
}
Aggregations