Package com.agiletec.aps.system.services.lang

Examples of com.agiletec.aps.system.services.lang.ILangManager


  }

  private void init() throws Exception {
    try {
      DataSource dataSource = (DataSource) this.getApplicationContext().getBean("servDataSource");
      ILangManager langManager = (ILangManager) this.getService(SystemConstants.LANGUAGE_MANAGER);
      this._messageManager = (IMessageManager) this.getService(JpwebdynamicformSystemConstants.MESSAGE_MANAGER);
      this._helper = new JpwebdynamicformTestHelper(dataSource, langManager, this._messageManager);
    } catch (Throwable e) {
      throw new Exception(e);
    }
View Full Code Here


*/
public class CasClientUtils {

  public String getURLStringWithoutTicketParam(PageURL pageUrl, RequestContext reqCtx){
    String langCode = pageUrl.getLangCode();
    ILangManager langManager =
      (ILangManager) ApsWebApplicationUtils.getBean(SystemConstants.LANGUAGE_MANAGER, reqCtx.getRequest());
    BaseConfigManager configManager =
      (BaseConfigManager) ApsWebApplicationUtils.getBean(SystemConstants.BASE_CONFIG_MANAGER, reqCtx.getRequest());
    ICasClientConfigManager casClientConfigManager =
        (ICasClientConfigManager) ApsWebApplicationUtils.getBean(CasClientPluginSystemCostants.JPCASCLIENT_CONFIG_MANAGER, reqCtx.getRequest());
    IPageManager pageManager =
      (IPageManager) ApsWebApplicationUtils.getBean(SystemConstants.PAGE_MANAGER, reqCtx.getRequest());
    Lang lang = langManager.getLang(langCode);
    if (lang == null) {
      lang = (Lang) reqCtx.getExtraParam(SystemConstants.EXTRAPAR_CURRENT_LANG);
      if (lang == null) {
        lang = langManager.getDefaultLang();
      }
    }
    String pageCode = pageUrl.getPageCode();
    IPage page = pageManager.getPage(pageCode);
    if (page == null) {
View Full Code Here

 
  @Override
  public String intercept(ActionInvocation invocation) throws Exception {
    HttpServletRequest request = ServletActionContext.getRequest();
    Map<String, Object> params = invocation.getInvocationContext().getParameters();
    ILangManager langManager = (ILangManager) ApsWebApplicationUtils.getBean(SystemConstants.LANGUAGE_MANAGER, request);
    String langCode = (String) this.findParameter(params, "langCode");
    Lang currentLang = (null != langCode) ? langManager.getLang(langCode) : null;
    if (null == currentLang) {
      currentLang = langManager.getDefaultLang();
    }
    Locale locale = new Locale(currentLang.getCode(), "");
    invocation.getInvocationContext().setLocale(locale);
    return invocation.invoke();
  }
View Full Code Here

  @Override
  public String intercept(ActionInvocation invocation) throws Exception {
    HttpServletRequest request = ServletActionContext.getRequest();
    Lang currentLang = (Lang) request.getSession().getAttribute(JpFrontShortcutSystemConstants.CONTENT_LANG_SESSION_PARAM);
    if (null == currentLang) {
      ILangManager langManager = (ILangManager) ApsWebApplicationUtils.getBean(SystemConstants.LANGUAGE_MANAGER, request);
      currentLang = langManager.getDefaultLang();
    }
    Locale locale = new Locale(currentLang.getCode(), "");
    invocation.getInvocationContext().setLocale(locale);
    return invocation.invoke();
  }
View Full Code Here

  }

  private void init() throws Exception {
    try {
      DataSource dataSource = (DataSource) this.getApplicationContext().getBean("servDataSource");
      ILangManager langManager = (ILangManager) this.getService(SystemConstants.LANGUAGE_MANAGER);
      this._messageManager = (IMessageManager) this.getService(JpwebdynamicformSystemConstants.MESSAGE_MANAGER);
      this._helper = new JpwebdynamicformTestHelper(dataSource, langManager, this._messageManager);
    } catch (Throwable e) {
      throw new Exception(e);
    }
View Full Code Here

        String title = facetNode.getTitles().getProperty(currentLang.getCode());
        if (this.isFullTitle()) {
          title = facetNode.getFullTitle(currentLang.getCode(), separator);
        }
        if (null == title || title.trim().length() == 0) {
          ILangManager langManager = (ILangManager) ApsWebApplicationUtils.getBean(SystemConstants.LANGUAGE_MANAGER, this.pageContext);
          Lang defaultLang = langManager.getDefaultLang();
          title = facetNode.getTitles().getProperty(defaultLang.getCode());
          if (this.isFullTitle()) {
            title = facetNode.getFullTitle(defaultLang.getCode(), separator);
          }
        }
View Full Code Here

    return params;
  }

  private String getLangForLinkCreation(IUserProfile profile) {
    ILangManager langManager = this.getLangManager();
    String langCode = this.getFieldValue(profile, JpUserRegSystemConstants.ATTRIBUTE_ROLE_LANGUAGE);
    if (null == langCode || langCode.length() == 0 || langManager.getLang(langCode)==null) {
      langCode = langManager.getDefaultLang().getCode();
    }
    return langCode;
  }
View Full Code Here

 
  private void init() {
    AddressBookDAO addressBookDAO = new AddressBookDAO();
    DataSource dataSource = (DataSource) this.getApplicationContext().getBean("servDataSource");
    addressBookDAO.setDataSource(dataSource);
    ILangManager langManager = (ILangManager) this.getService(SystemConstants.LANGUAGE_MANAGER);
    addressBookDAO.setLangManager(langManager);
    this._addressBookDAO = addressBookDAO;
   
    this._helper = new JpaddressbookTestHelper(this.getApplicationContext());
  }
View Full Code Here

    DataSource dataSource = (DataSource) applicationContext.getBean("servDataSource");
    this.setDataSource(dataSource);
   
    this._addressBookDAO = new AddressBookDAO();
    this._addressBookDAO.setDataSource(dataSource);
    ILangManager langManager = (ILangManager) applicationContext.getBean(SystemConstants.LANGUAGE_MANAGER);
    this._addressBookDAO.setLangManager(langManager);
   
    this._profileManager = (IUserProfileManager) applicationContext.getBean(SystemConstants.USER_PROFILE_MANAGER);
  }
View Full Code Here

public class LoadSurveyTag extends TagSupport {
 
  public int doStartTag() throws JspException {
    ISurveyManager surveyManager = (ISurveyManager) ApsWebApplicationUtils.getBean(SurveySystemConstants.SURVEY_MANAGER, pageContext);
    ILangManager langManager = (ILangManager) ApsWebApplicationUtils.getBean(SystemConstants.LANGUAGE_MANAGER,pageContext);
    IResourceManager resourceManager = (IResourceManager) ApsWebApplicationUtils.getBean(JacmsSystemConstants.RESOURCE_MANAGER, this.pageContext);
    SurveyRecord survey = null
    try {
      String defaultLang = langManager.getDefaultLang().getCode();
      survey = surveyManager.loadSurvey(this.getSurveyId());
      if (this._preferredLang == null) {
        this._preferredLang = defaultLang;
      }
      this.pageContext.setAttribute(this.getCtxName(), survey);
View Full Code Here

TOP

Related Classes of com.agiletec.aps.system.services.lang.ILangManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.