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

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


   * @param contentId The Content id.
   * @return Il path di destinazione finale.
   */
  protected String getDestForwardPath(String contentId) {
    RequestContext reqCtx = (RequestContext) this.getRequest().getAttribute(RequestContext.REQCTX);
    Lang currentLang = null;
    if (null != reqCtx) {
      currentLang = (Lang) reqCtx.getExtraParam(SystemConstants.EXTRAPAR_CURRENT_LANG);
    } else {
      currentLang = this.getLangManager().getDefaultLang();
    }
View Full Code Here


   * @return the localized label
   */
  public String getLabel(ApsProperties labels) {
    String label = labels.getProperty(this.getCurrentLang().getCode());
    if (label == null || label.trim().length() == 0) {
      Lang defaultLang = this.getLangManager().getDefaultLang();
      label = labels.getProperty(defaultLang.getCode());
    }
    return label;
  }
View Full Code Here

public abstract class AbstractSurveyAction extends BaseAction {
 
  public String getLabel(ApsProperties labels) {
    String label = labels.getProperty(this.getCurrentLang().getCode());
    if (label == null || label.trim().length() == 0) {
      Lang defaultLang = this.getLangManager().getDefaultLang();
      label = labels.getProperty(defaultLang.getCode());
    }
    return label;
  }
View Full Code Here

    return label;
  }
 
  public Lang getCurrentLang() {
    RequestContext reqCtx = (RequestContext) this.getRequest().getAttribute(RequestContext.REQCTX);
    Lang currentLang = null;
    if (null != reqCtx) {
      currentLang = (Lang) reqCtx.getExtraParam(SystemConstants.EXTRAPAR_CURRENT_LANG);
    } else {
      currentLang = this.getLangManager().getDefaultLang();
    }
View Full Code Here

          String authorAttrName = this.getAuthorAttributeName(request);
        if (authorAttrName != null) {
          ITextAttribute authorAttribute = (ITextAttribute) content.getAttribute(authorAttrName);
          if (null != authorAttribute) {
            UserDetails user =  (UserDetails) request.getSession().getAttribute(SystemConstants.SESSIONPARAM_CURRENT_USER);
            Lang defaultLang = super.getLangManager().getDefaultLang();
            authorAttribute.setText(user.getUsername(), defaultLang.getCode());
          }
        }
        } catch (Throwable t) {
          ApsSystemUtils.logThrowable(t, this, "updateEntity");
          throw new RuntimeException("Errore on updateEntity", 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

  }
 
  public String getLabel(ApsProperties labels) {
    String label = labels.getProperty(this.getCurrentLang().getCode());
    if (label == null || label.trim().length() == 0) {
      Lang defaultLang = this.getLangManager().getDefaultLang();
      label = labels.getProperty(defaultLang.getCode());
    }
    return label;
  }
View Full Code Here

  public int doStartTag() throws JspException {
    HttpServletRequest req =  (HttpServletRequest) this.pageContext.getRequest();
    try {
      HttpSession session = req.getSession();
      RequestContext reqCtx = (RequestContext) req.getAttribute(RequestContext.REQCTX);
      Lang lang = (Lang) reqCtx.getExtraParam(SystemConstants.EXTRAPAR_CURRENT_LANG);
      req.getSession().setAttribute(JpmyportalplusSystemConstants.SESSIONPARAM_CURRENT_LANG, lang);
      UserDetails currentUser = (UserDetails) session.getAttribute(SystemConstants.SESSIONPARAM_CURRENT_USER);
      if (!currentUser.getUsername().equals(SystemConstants.GUEST_USER_NAME)) {
        PageUserConfigBean userConfigBean = (PageUserConfigBean) session.getAttribute(JpmyportalplusSystemConstants.SESSIONPARAM_CURRENT_CUSTOM_USER_PAGE_CONFIG);
        if (null == userConfigBean || !currentUser.getUsername().equals(userConfigBean.getUsername())) {
View Full Code Here

   * language code
   */
  private void fetchLocalizedFields() {
    Iterator<Lang> itr = this.getLangManager().getLangs().iterator();
    while (itr.hasNext()) {
      Lang currentLang = itr.next();
      Lang defaultLanguage = this.getLangManager().getDefaultLang();
      String currentLangCode = currentLang.getCode();
      String choiceKey = "choice-" + currentLangCode;
      String choice = this.getRequest().getParameter(choiceKey);
      if (null != choice && choice.trim().length() > 0) {
        this.getChoices().put(currentLangCode, choice.trim());
      } else {
        if (currentLang.getCode().equals(defaultLanguage.getCode())) {
          this.addActionError(this.getText("message.jpsurvey.defaultLangRequired", new String[]{defaultLanguage.getDescr(),this.getText("choice")}));
        }
      }
    }
  }
View Full Code Here

        return SUCCESS;
      }
      CustomPageConfig config = this.getCustomPageConfig();
      Widget[] customShowlets = (null == config || config.getConfig() == null) ? null : config.getConfig();
      Widget[] showletsToRender = this.getPageUserConfigManager().getShowletsToRender(currentPage, customShowlets);
      Lang currentLang = this.getCurrentLang();
      String voidShowletCode = this.getPageUserConfigManager().getVoidShowlet().getCode();
      for (int i = 0; i < showletsToRender.length; i++) {
        Frame frame = pageModel.getFrameConfigs()[i];
        Integer columnId = frame.getColumn();
        if (frame.isLocked() || null == columnId || i == this.getFrameWhereOpenSection().intValue()) continue;
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.