use of fi.otavanopisto.pyramus.framework.PyramusViewController in project pyramus by otavanopisto.
the class IndexViewController method process.
@Override
public void process(PageRequestContext requestContext) {
if (shouldRedirect(requestContext)) {
String muikkuHost = MuikkuPluginTools.getMuikkuHost();
if (StringUtils.isNotBlank(muikkuHost)) {
requestContext.setRedirectURL(String.format("https://%s", muikkuHost));
return;
}
}
PyramusViewController originalViewController = (PyramusViewController) RequestControllerMapper.getRequestController("index.page.masked");
originalViewController.process(requestContext);
}
use of fi.otavanopisto.pyramus.framework.PyramusViewController in project pyramus by otavanopisto.
the class BreadcrumbFilter method doFilter.
@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
try {
if (request instanceof HttpServletRequest) {
HttpServletRequest httpRequest = (HttpServletRequest) request;
String uri = httpRequest.getRequestURI();
String ctxPath = httpRequest.getContextPath();
String controllerName = uri.substring(ctxPath.length() + 1);
// TODO: Needed??
// if (StringUtils.isNotBlank(applicationPath)) {
// controllerName = controllerName.substring(applicationPath.length());
// }
RequestController requestController = RequestControllerMapper.getRequestController(controllerName);
if ((requestController instanceof PyramusViewController || requestController instanceof PyramusViewController2) && requestController instanceof Breadcrumbable) {
BreadcrumbHandler breadcrumbHandler = getBreadcrumbHandler(httpRequest);
if (request.getParameter("resetbreadcrumb") != null) {
breadcrumbHandler.clear();
}
if (requestController instanceof Breadcrumbable && "GET".equals(httpRequest.getMethod())) {
Breadcrumbable breadcrumbable = (Breadcrumbable) requestController;
breadcrumbHandler.process(httpRequest, breadcrumbable);
}
}
}
} finally {
chain.doFilter(request, response);
}
}
Aggregations