use of org.lastaflute.web.ruts.process.ActionRuntime in project fess by codelibs.
the class FessSearchAction method setupHtmlData.
@Override
protected void setupHtmlData(final ActionRuntime runtime) {
super.setupHtmlData(runtime);
systemHelper.setupSearchHtmlData(this, runtime);
runtime.registerData("osddLink", openSearchHelper.hasOpenSearchFile());
final List<Map<String, String>> labelTypeItems = labelTypeHelper.getLabelTypeItemList(SearchRequestType.SEARCH, request.getLocale() == null ? Locale.ROOT : request.getLocale());
runtime.registerData("labelTypeItems", labelTypeItems);
runtime.registerData("displayLabelTypeItems", labelTypeItems != null && !labelTypeItems.isEmpty());
Locale locale = ComponentUtil.getRequestManager().getUserLocale();
if (locale == null) {
locale = Locale.ENGLISH;
}
runtime.registerData("langItems", systemHelper.getLanguageItems(locale));
final String username = systemHelper.getUsername();
runtime.registerData("username", username);
runtime.registerData("editableUser", fessLoginAssist.getSavedUserBean().map(FessUserBean::isEditable).orElse(false));
runtime.registerData("adminUser", fessConfig.isAdminUser(username) || fessLoginAssist.getSavedUserBean().map(user -> user.hasRoles(fessConfig.getAuthenticationAdminRolesAsArray())).orElse(false));
runtime.registerData("pageLoginLink", fessConfig.isLoginLinkEnabled());
}
use of org.lastaflute.web.ruts.process.ActionRuntime in project fess by codelibs.
the class FessFwAssistantDirector method prepareWebDirection.
// ===================================================================================
// Web
// =====
@Override
protected void prepareWebDirection(final FwWebDirection direction) {
direction.directRequest(createUserLocaleProcessProvider(), createUserTimeZoneProcessProvider());
direction.directCookie(createCookieResourceProvider());
direction.directAdjustment(createActionAdjustmentProvider());
direction.directMessage(createMessageNameList(), "fess_label");
direction.directApiCall(createApiFailureHook());
direction.directMultipart(FessMultipartRequestHandler::new);
direction.directHtmlRendering(new JspHtmlRenderingProvider() {
@Override
protected String getShowErrorsForwardPath(final ActionRuntime runtime) {
if (FessAdminAction.class.isAssignableFrom(runtime.getActionType())) {
return "/admin/error/error.jsp";
}
return "/error/system.jsp";
}
});
}
Aggregations