use of com.helger.photon.core.requestparam.RequestParameterHandlerURLPathNamed in project phoss-smp by phax.
the class SMPWebAppListener method initGlobalSettings.
@Override
protected void initGlobalSettings() {
s_aStartupDateTime = PDTFactory.getCurrentOffsetDateTimeUTC();
// Enable JaxWS debugging?
if (SMPWebAppConfiguration.isGlobalDebugJaxWS())
WSHelper.setMetroDebugSystemProperties(true);
// JUL to SLF4J
SLF4JBridgeHandler.removeHandlersForRootLogger();
SLF4JBridgeHandler.install();
if (SMPServerConfiguration.isForceRoot()) {
// Enforce an empty context path according to the specs!
ServletContextPathHolder.setCustomContextPath("");
}
RequestParameterManager.getInstance().setParameterHandler(new RequestParameterHandlerURLPathNamed());
if (!GlobalDebug.isProductionMode()) {
RequestTrackerSettings.setLongRunningRequestsCheckEnabled(false);
RequestTrackerSettings.setParallelRunningRequestsCheckEnabled(false);
}
// Handled via the XServletSettings instead
UnifiedResponseDefaultSettings.setReferrerPolicy(null);
UnifiedResponseDefaultSettings.setXFrameOptions(null, null);
if (SMPServerConfiguration.getRESTType().isPeppol()) {
// Peppol SMP is always http only
UnifiedResponseDefaultSettings.removeStrictTransportSecurity();
}
// Avoid writing unnecessary stuff
setHandleStatisticsOnEnd(SMPWebAppConfiguration.isPersistStatisticsOnEnd());
// Check SMP ID
final String sSMPID = SMPServerConfiguration.getSMLSMPID();
if (StringHelper.hasNoText(sSMPID))
throw new IllegalArgumentException("The SMP ID is missing. It must match the regular expression '" + CSMPServer.PATTERN_SMP_ID + "'!");
if (!RegExHelper.stringMatchesPattern(CSMPServer.PATTERN_SMP_ID, sSMPID))
throw new IllegalArgumentException("The provided SMP ID '" + sSMPID + "' is not valid when used as a DNS name. It must match the regular expression '" + CSMPServer.PATTERN_SMP_ID + "'!");
if (LOGGER.isInfoEnabled())
LOGGER.info("This SMP has the ID '" + sSMPID + "'");
if (SMPWebAppConfiguration.isImprintEnabled() && StringHelper.hasNoText(SMPWebAppConfiguration.getImprintText()))
LOGGER.warn("The custom Imprint is enabled in the configuration file, but no imprint text is configured. Therefore no imprint will be shown.");
}
use of com.helger.photon.core.requestparam.RequestParameterHandlerURLPathNamed in project phoss-directory by phax.
the class AppWebAppListener method initGlobalSettings.
@Override
protected void initGlobalSettings() {
// Internal stuff:
VendorInfo.setVendorName("Philip Helger");
VendorInfo.setVendorURL("http://www.helger.com");
VendorInfo.setVendorEmail("pd@helger.com");
VendorInfo.setVendorLocation("Vienna, Austria");
VendorInfo.setInceptionYear(2015);
if (PDServerConfiguration.isForceRoot()) {
// Enforce an empty context path according to the specs!
ServletContextPathHolder.setCustomContextPath("");
}
if (GlobalDebug.isProductionMode())
ValueEnforcer.setEnabled(false);
// By disabling these settings, less audits are created hence less calls are
// blocking
RequestTrackerSettings.setLongRunningRequestsCheckEnabled(false);
RequestTrackerSettings.setParallelRunningRequestsCheckEnabled(false);
RequestParameterManager.getInstance().setParameterHandler(new RequestParameterHandlerURLPathNamed());
AppInternalErrorHandler.doSetup();
final ConfigurationFileManager aCfgMgr = ConfigurationFileManager.getInstance();
aCfgMgr.registerConfigurationFile(new ConfigurationFile(new ClassPathResource("log4j2.xml")).setDescription("log4j configuration file").setSyntaxHighlightLanguage(EConfigurationFileSyntax.XML));
aCfgMgr.registerAll(PDServerConfiguration.getConfig());
// Job scheduling etc
if (GlobalDebug.isDebugMode())
GlobalQuartzScheduler.getInstance().addJobListener(new LoggingJobListener());
}
use of com.helger.photon.core.requestparam.RequestParameterHandlerURLPathNamed in project peppol-practical by phax.
the class AppCommonUI method init.
public static void init() {
RequestParameterManager.getInstance().setParameterHandler(new RequestParameterHandlerURLPathNamed());
BootstrapDataTables.setConfigurator((aLEC, aTable, aDataTables) -> {
final IRequestWebScopeWithoutResponse aRequestScope = aLEC.getRequestScope();
aDataTables.setAutoWidth(false).setLengthMenu(LENGTH_MENU).setAjaxBuilder(new JQueryAjaxBuilder().url(CAjax.DATATABLES.getInvocationURL(aRequestScope)).data(new JSAssocArray().add(AjaxExecutorDataTables.OBJECT_ID, aTable.getID()))).setServerFilterType(EDataTablesFilterType.ALL_TERMS_PER_ROW).setTextLoadingURL(CAjax.DATATABLES_I18N.getInvocationURL(aRequestScope), AjaxExecutorDataTablesI18N.LANGUAGE_ID).addPlugin(new DataTablesPluginSearchHighlight());
});
// By default allow markdown in system message
BootstrapSystemMessage.setDefaultUseMarkdown(true);
// Register comment handlers
CommentThreadManager.getInstance().registerObjectType(CPPApp.OT_PAGE);
}
Aggregations