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

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


    page.setGroup("free");
    page.setModel(new PageModel() );

    reqCtx.addExtraParam(SystemConstants.EXTRAPAR_CURRENT_PAGE, page);

    Lang lang = new Lang();
    lang.setCode("it");
    reqCtx.addExtraParam(SystemConstants.EXTRAPAR_CURRENT_LANG, lang);

    MockHttpServletRequest request = (MockHttpServletRequest) reqCtx.getRequest();
    request.setRemoteAddr(ip);
    request.addHeader("Referer", "homeTest");
View Full Code Here


    page.setGroup("free");
    page.setModel(new PageModel() );

    reqCtx.addExtraParam(SystemConstants.EXTRAPAR_CURRENT_PAGE, page);

    Lang lang = new Lang();
    lang.setCode("it");
    reqCtx.addExtraParam(SystemConstants.EXTRAPAR_CURRENT_LANG, lang);

    MockHttpServletRequest request = (MockHttpServletRequest) reqCtx.getRequest();
    request.setRemoteAddr("255.255.255.255");
    request.addHeader("Referer", "homeTest");
View Full Code Here

          _log.info("CAS - Redirecting to " + loginUrl.toString());
          reqCtx.addExtraParam(RequestContext.EXTRAPAR_REDIRECT_URL, loginUrl.toString());
          retStatus = ControllerManager.REDIRECT;
        } else {
          _log.info("CAS - user authenticated but not authorized");
          Lang currentLang = (Lang) reqCtx.getExtraParam(SystemConstants.EXTRAPAR_CURRENT_LANG);
                String notAuthPageCode = this.getCasClientConfig().getNotAuthPage();
                IPage page = this.getPageManager().getPage(notAuthPageCode);
                String url = this.getUrlManager().createUrl(page, currentLang, new HashMap<String, String>());
                _log.info("CAS - Redirecting to " + url);
                reqCtx.addExtraParam(RequestContext.EXTRAPAR_REDIRECT_URL, url);
View Full Code Here

      (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) {
      page = (IPage) reqCtx.getExtraParam(SystemConstants.EXTRAPAR_CURRENT_PAGE);
    }
    if (page == null) {
      page = pageManager.getRoot();
    }
    StringBuffer url = new StringBuffer();
    String serverBaseUrl = casClientConfigManager.getClientConfig().getServerBaseURL();
    if (serverBaseUrl.endsWith("/")) {
      serverBaseUrl = serverBaseUrl.substring(0, serverBaseUrl.length()-1);
    }

    url.append(serverBaseUrl);
    url.append(reqCtx.getRequest().getContextPath()).append('/');

    if (!this.isUrlStyleBreadcrumbs(configManager)) {
      url.append(lang.getCode()).append('/');
      url.append(page.getCode()).append(".page");
    } else {
      url.append("pages/");
      url.append(lang.getCode()).append('/');
      StringBuffer fullPath = PageUtils.getFullPath(page, "/");
      url.append(fullPath.append("/"));
    }

    String queryString = this.getQueryStringWithoutTicketParam(reqCtx.getRequest());
View Full Code Here

  }

  protected void addLabelGroups(String key, String defaultValue) throws ApsSystemException {
    try {
      ApsProperties properties = new ApsProperties();
      Lang defaultLang = super.getLangManager().getDefaultLang();
      properties.put(defaultLang.getCode(), defaultValue);
      this.getI18nManager().addLabelGroup(key, properties);
    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "addLabelGroups");
      throw new RuntimeException("Error adding label groups - key '" + key + "'", t);
    }
View Full Code Here

  }
 
  protected void addLabelGroups(String key, String defaultValue) throws ApsSystemException {
    try {
      ApsProperties properties = new ApsProperties();
      Lang defaultLang = super.getLangManager().getDefaultLang();
      properties.put(defaultLang.getCode(), defaultValue);
      this.getI18nManager().addLabelGroup(key, properties);
    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "addLabelGroups");
      throw new RuntimeException("Error adding label groups - key '" + key + "'", t);
    }
View Full Code Here

            List<String> listaIds = this._commentManager.searchCommentIds(null);
      assertEquals(0, listaIds.size());

            RequestContext e = new RequestContext();
            e.addExtraParam(SystemConstants.EXTRAPAR_CURRENT_WIDGET, widget);
            Lang lang = new Lang();
        lang.setCode("en");
            e.addExtraParam(SystemConstants.EXTRAPAR_CURRENT_LANG, lang);
            this.getRequest().setAttribute(RequestContext.REQCTX, e);

      this.initAction("/do/jpcontentfeedback/FrontEnd/contentfeedback", "insert");
      this.addParameter("formContentId", contentId);
View Full Code Here

            showlet.setConfig(prop);
            showlet.setPublishedContent(contentId);

            RequestContext e = new RequestContext();
            e.addExtraParam(SystemConstants.EXTRAPAR_CURRENT_WIDGET, showlet);
            Lang lang = new Lang();
        lang.setCode("en");
            e.addExtraParam(SystemConstants.EXTRAPAR_CURRENT_LANG, lang);
            this.getRequest().setAttribute(RequestContext.REQCTX, e);

            List<String> listaIds = this._commentManager.searchCommentIds(null);
      assertEquals(0, listaIds.size());
View Full Code Here

            prop.put(ContentFeedbackWidgetAction.WIDGET_PARAM_RATE_CONTENT, "true");
            showlet.setConfig(prop);

            RequestContext e = new RequestContext();
            e.addExtraParam(SystemConstants.EXTRAPAR_CURRENT_WIDGET, showlet);
            Lang lang = new Lang();
        lang.setCode("en");
            e.addExtraParam(SystemConstants.EXTRAPAR_CURRENT_LANG, lang);
            this.getRequest().setAttribute(RequestContext.REQCTX, e);

      this.setUserOnSession("admin");
      this.initAction("/do/jpcontentfeedback/FrontEnd/contentfeedback", "intro");
View Full Code Here

  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

TOP

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

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.