Search in sources :

Example 1 with HCHead

use of com.helger.html.hc.html.metadata.HCHead in project phoss-directory by phax.

the class PublicHTMLProvider method fillBody.

@Override
protected void fillBody(@Nonnull final ISimpleWebExecutionContext aSWEC, @Nonnull final HCHtml aHtml) throws ForcedRedirectException {
    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(CPDPublisher.getApplicationTitle(), " - ", aMenuItem.getDisplayText(aDisplayLocale)));
    AppCommonUI.addFavIcons(aHead);
    final IHCNode aNode = getContent(aLEC);
    aBody.addChild(aNode);
}
Also used : Locale(java.util.Locale) IRequestWebScopeWithoutResponse(com.helger.web.scope.IRequestWebScopeWithoutResponse) LayoutExecutionContext(com.helger.photon.core.execcontext.LayoutExecutionContext) HCBody(com.helger.html.hc.html.sections.HCBody) HCHead(com.helger.html.hc.html.metadata.HCHead) IMenuItemPage(com.helger.photon.core.menu.IMenuItemPage) IHCNode(com.helger.html.hc.IHCNode)

Example 2 with HCHead

use of com.helger.html.hc.html.metadata.HCHead 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();
    }
}
Also used : Locale(java.util.Locale) IRequestWebScopeWithoutResponse(com.helger.web.scope.IRequestWebScopeWithoutResponse) LayoutExecutionContext(com.helger.photon.core.execcontext.LayoutExecutionContext) HCBody(com.helger.html.hc.html.sections.HCBody) InternalErrorBuilder(com.helger.photon.core.interror.InternalErrorBuilder) HCHead(com.helger.html.hc.html.metadata.HCHead) IMenuItemPage(com.helger.photon.core.menu.IMenuItemPage) ForcedRedirectException(com.helger.xservlet.forcedredirect.ForcedRedirectException) IHCNode(com.helger.html.hc.IHCNode)

Example 3 with HCHead

use of com.helger.html.hc.html.metadata.HCHead in project phoss-directory by phax.

the class SecureHTMLProvider method fillBody.

@Override
protected void fillBody(@Nonnull final ISimpleWebExecutionContext aSWEC, @Nonnull final HCHtml aHtml) throws ForcedRedirectException {
    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(CPDPublisher.getApplicationTitle(), " - ", aMenuItem.getDisplayText(aDisplayLocale)));
    AppCommonUI.addFavIcons(aHead);
    final IHCNode aNode = getContent(aLEC);
    aBody.addChild(aNode);
}
Also used : Locale(java.util.Locale) IRequestWebScopeWithoutResponse(com.helger.web.scope.IRequestWebScopeWithoutResponse) LayoutExecutionContext(com.helger.photon.core.execcontext.LayoutExecutionContext) HCBody(com.helger.html.hc.html.sections.HCBody) HCHead(com.helger.html.hc.html.metadata.HCHead) IMenuItemPage(com.helger.photon.core.menu.IMenuItemPage) IHCNode(com.helger.html.hc.IHCNode)

Aggregations

IHCNode (com.helger.html.hc.IHCNode)3 HCHead (com.helger.html.hc.html.metadata.HCHead)3 HCBody (com.helger.html.hc.html.sections.HCBody)3 LayoutExecutionContext (com.helger.photon.core.execcontext.LayoutExecutionContext)3 IMenuItemPage (com.helger.photon.core.menu.IMenuItemPage)3 IRequestWebScopeWithoutResponse (com.helger.web.scope.IRequestWebScopeWithoutResponse)3 Locale (java.util.Locale)3 InternalErrorBuilder (com.helger.photon.core.interror.InternalErrorBuilder)1 ForcedRedirectException (com.helger.xservlet.forcedredirect.ForcedRedirectException)1