Search in sources :

Example 16 with ILangManager

use of com.agiletec.aps.system.services.lang.ILangManager in project entando-core by entando.

the class PageInfoTag method extractPageTitle.

protected void extractPageTitle(IPage page, Lang currentLang) {
    ApsProperties titles = page.getTitles();
    String value = null;
    if ((this.getLangCode() == null) || (this.getLangCode().equals("")) || (currentLang.getCode().equalsIgnoreCase(this.getLangCode()))) {
        value = titles.getProperty(currentLang.getCode());
    } else {
        value = titles.getProperty(this.getLangCode());
    }
    if (value == null || value.trim().equals("")) {
        ILangManager langManager = (ILangManager) ApsWebApplicationUtils.getBean(SystemConstants.LANGUAGE_MANAGER, this.pageContext);
        value = titles.getProperty(langManager.getDefaultLang().getCode());
    }
    this.setValue(value);
}
Also used : ILangManager(com.agiletec.aps.system.services.lang.ILangManager) ApsProperties(com.agiletec.aps.util.ApsProperties)

Example 17 with ILangManager

use of com.agiletec.aps.system.services.lang.ILangManager in project entando-core by entando.

the class NavigatorTarget method getTitle.

/**
 * Restituisce il titolo della pagina nella lingua corrente. Nel caso il
 * titolo nella lingua corrente sia assente, viene restituito il titolo
 * nella lingua di default.
 *
 * @return Il titolo della pagina.
 */
public String getTitle() {
    Lang lang = (Lang) this._reqCtx.getExtraParam(SystemConstants.EXTRAPAR_CURRENT_LANG);
    String title = this.getPage().getTitle(lang.getCode());
    if (title == null || title.trim().equals("")) {
        ILangManager langManager = (ILangManager) ApsWebApplicationUtils.getBean(SystemConstants.LANGUAGE_MANAGER, this._reqCtx.getRequest());
        title = this.getPage().getTitle(langManager.getDefaultLang().getCode());
    }
    if (title == null || title.trim().equals("")) {
        title = this.getPage().getCode();
    }
    return title;
}
Also used : ILangManager(com.agiletec.aps.system.services.lang.ILangManager) Lang(com.agiletec.aps.system.services.lang.Lang)

Aggregations

ILangManager (com.agiletec.aps.system.services.lang.ILangManager)17 Lang (com.agiletec.aps.system.services.lang.Lang)8 RequestContext (com.agiletec.aps.system.RequestContext)4 ApsSystemException (com.agiletec.aps.system.exception.ApsSystemException)3 ConfigInterface (com.agiletec.aps.system.services.baseconfig.ConfigInterface)3 ServletRequest (javax.servlet.ServletRequest)3 DataSource (javax.sql.DataSource)3 IURLManager (com.agiletec.aps.system.services.url.IURLManager)2 HttpServletRequest (javax.servlet.http.HttpServletRequest)2 JspException (javax.servlet.jsp.JspException)2 WidgetType (org.entando.entando.aps.system.services.widgettype.WidgetType)2 AttributeInterface (com.agiletec.aps.system.common.entity.model.attribute.AttributeInterface)1 CompositeAttribute (com.agiletec.aps.system.common.entity.model.attribute.CompositeAttribute)1 MonoListAttribute (com.agiletec.aps.system.common.entity.model.attribute.MonoListAttribute)1 ICategoryManager (com.agiletec.aps.system.services.category.ICategoryManager)1 II18nManager (com.agiletec.aps.system.services.i18n.II18nManager)1 IKeyGeneratorManager (com.agiletec.aps.system.services.keygenerator.IKeyGeneratorManager)1 IPageManager (com.agiletec.aps.system.services.page.IPageManager)1 IPageModelManager (com.agiletec.aps.system.services.pagemodel.IPageModelManager)1 IRoleManager (com.agiletec.aps.system.services.role.IRoleManager)1