use of com.helger.photon.core.interror.InternalErrorBuilder in project phoss-directory by phax.
the class PDMetaManager method onAfterInstantiation.
@Override
protected void onAfterInstantiation(@Nonnull final IScope aScope) {
try {
m_aLucene = new PDLucene();
m_aStorageMgr = new PDStorageManager(m_aLucene);
m_aIndexerMgr = new PDIndexerManager(m_aStorageMgr);
LOGGER.info(ClassHelper.getClassLocalName(this) + " was initialized");
} catch (final Exception ex) {
if (GlobalDebug.isProductionMode()) {
new InternalErrorBuilder().setThrowable(ex).addErrorMessage(ClassHelper.getClassLocalName(this) + " init failed").handle();
}
throw new InitializationException("Failed to init " + ClassHelper.getClassLocalName(this), ex);
}
}
use of com.helger.photon.core.interror.InternalErrorBuilder in project phoss-directory by phax.
the class PDPMetaManager method onAfterInstantiation.
@Override
protected void onAfterInstantiation(@Nonnull final IScope aScope) {
try {
m_aSMLInfoMgr = new SMLInfoManager(SML_INFO_XML);
final URI aFixedSMPURI = PDServerConfiguration.getFixedSMPURI();
if (aFixedSMPURI != null) {
// Use only the configured SMP
PDMetaManager.setBusinessCardProvider(SMPBusinessCardProvider.createForFixedSMP(PDServerConfiguration.getSMPMode(), aFixedSMPURI));
} else {
// Auto detect SMLs
PDMetaManager.setBusinessCardProvider(SMPBusinessCardProvider.createWithSMLAutoDetect(PDServerConfiguration.getSMPMode(), PDServerConfiguration.getURLProvider(), m_aSMLInfoMgr::getAllSorted));
}
LOGGER.info(ClassHelper.getClassLocalName(this) + " was initialized");
} catch (final Exception ex) {
if (GlobalDebug.isProductionMode()) {
new InternalErrorBuilder().setThrowable(ex).addErrorMessage(ClassHelper.getClassLocalName(this) + " init failed").handle();
}
throw new InitializationException("Failed to init " + ClassHelper.getClassLocalName(this), ex);
}
}
use of com.helger.photon.core.interror.InternalErrorBuilder in project phoss-smp by phax.
the class SMPLayoutHTMLProvider method fillBody.
@Override
protected void fillBody(@Nonnull final ISimpleWebExecutionContext aSWEC, @Nonnull final HCHtml aHtml) {
final IRequestWebScopeWithoutResponse aRequestScope = aSWEC.getRequestScope();
final Locale aDisplayLocale = aSWEC.getDisplayLocale();
final IMenuItemPage aMenuItem = RequestSettings.getMenuItem(aRequestScope);
final LayoutExecutionContext aLEC = new LayoutExecutionContext(aSWEC, aMenuItem);
final HCHead aHead = aHtml.head();
final HCBody aBody = aHtml.body();
// Add menu item in page title
aHead.setPageTitle(StringHelper.getConcatenatedOnDemand(CSMP.getApplicationTitle(), " - ", aMenuItem.getDisplayText(aDisplayLocale)));
try {
final IHCNode aNode = m_aFactory.apply(aLEC);
aBody.addChild(aNode);
} catch (final ForcedRedirectException ex) {
throw ex;
} catch (final RuntimeException ex) {
new InternalErrorBuilder().setDisplayLocale(aDisplayLocale).setRequestScope(aRequestScope).setThrowable(ex).setUIErrorHandlerFor(aBody).handle();
}
}
use of com.helger.photon.core.interror.InternalErrorBuilder in project phoss-smp by phax.
the class SMPInternalErrorHandler method createInternalErrorBuilder.
@Nonnull
public static InternalErrorBuilder createInternalErrorBuilder() {
final InternalErrorBuilder ret = new InternalErrorBuilder();
ret.setDisplayLocale(CSMPServer.DEFAULT_LOCALE);
return ret;
}
Aggregations