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

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


  }
 
  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


      if (feedvalue.trim().length() > 0) {
        ((HypertextAttribute)attr).setText(feedvalue, this.getDefaultLangCode());
      } else {
        Iterator<Lang> langIt = this.getLangManager().getLangs().iterator();
        while (langIt.hasNext()) {
          Lang current = langIt.next();
          String code = current.getCode();
          String defaultValue = this.getMultiLangDafaultValue(element, code);
          ((HypertextAttribute)attr).setText(defaultValue, code);
        }
      }
    } else if(attr instanceof TextAttribute) {
      if (feedvalue.trim().length() > 0) {
        ((TextAttribute)attr).setText(feedvalue, this.getDefaultLangCode());
      } else {
        Iterator<Lang> langIt = this.getLangManager().getLangs().iterator();
        while (langIt.hasNext()) {
          Lang current = langIt.next();
          String code = current.getCode();
          String defaultValue = this.getMultiLangDafaultValue(element, code);
          ((TextAttribute)attr).setText(defaultValue, code);
        }
      }
    } else if(attr instanceof MonoTextAttribute) {
View Full Code Here

    public int doStartTag() throws JspException {
        RequestContext reqCtx = (RequestContext) this.pageContext.getRequest().getAttribute(RequestContext.REQCTX);
        List<WidgetCheckInfo> checkInfos = new ArrayList<WidgetCheckInfo>();
        IPageUserConfigManager pageUserConfigManager = (IPageUserConfigManager) ApsWebApplicationUtils.getBean(JpmyportalplusSystemConstants.PAGE_USER_CONFIG_MANAGER, pageContext);
        try {
            Lang currentLang = (Lang) this.pageContext.getSession().getAttribute(JpmyportalplusSystemConstants.SESSIONPARAM_CURRENT_LANG);
            IPage currentPage = (IPage) reqCtx.getExtraParam(SystemConstants.EXTRAPAR_CURRENT_PAGE);
            Widget[] customShowletConfig = this.getCustomShowletConfig(currentPage);
            Widget[] showletsToRender = pageUserConfigManager.getShowletsToRender(currentPage, customShowletConfig);
            List<String> allowedShowlets = new ArrayList<String>();
            Map<String, WidgetType> customizableShowlets = this.getCustomizableShowlets(pageUserConfigManager);
View Full Code Here

  }

  public String getDestForwardPath() {
    String pathDest = null;
    try {
      Lang currentLanguage = this.getCurrentSessionLang();
      if (null == currentLanguage) {
        currentLanguage = this.getLangManager().getDefaultLang();
      }
      IPage currentPage = this.getCurrentPage();
      String pathDestFirst = this.getUrlManager().createUrl(currentPage, currentLanguage, null);
View Full Code Here

      MyPortalPageModel pageModel = (MyPortalPageModel) currentPage.getModel();
      Integer currentColumnId = pageModel.getFrameConfigs()[currentFrame].getColumn();
      if (null == currentColumnId) {
        return super.doStartTag();
      }
      Lang currentLang = (Lang) this.pageContext.getSession().getAttribute(JpmyportalplusSystemConstants.SESSIONPARAM_CURRENT_LANG);
      Widget[] customShowletConfig = this.getCustomShowletConfig(currentPage, pageUserConfigManager);
      Widget[] showletsToRender = pageUserConfigManager.getShowletsToRender(currentPage, customShowletConfig);

      String voidShowletCode = pageUserConfigManager.getVoidShowlet().getCode();
      for (int i = 0; i < showletsToRender.length; i++) {
View Full Code Here

  private void fetchLocalizedFields() {
    Iterator<Lang> itr = this.getLangManager().getLangs().iterator();
    Survey survey = null;
    try {
      while (itr.hasNext()) {
        Lang currentLang = itr.next();
        Lang defaultLanguage = this.getLangManager().getDefaultLang();
        String currentLangCode = currentLang.getCode();
        String titleKey = "title-" + currentLangCode;
        String descriptionKey = "description-" + currentLangCode;
        String imageDescriptionKey = "imageDescription-" + currentLangCode;
        String title = this.getRequest().getParameter(titleKey);
        String description = this.getRequest().getParameter(descriptionKey);
        String imageDescription = this.getRequest().getParameter(imageDescriptionKey);
        if (null != title && title.trim().length() > 0) {
          this.getTitles().put(currentLangCode, title.trim());
        } else {
          if (currentLang.getCode().equals(defaultLanguage.getCode())) {
            String[] args = { defaultLanguage.getDescr(), this.getText("title") };
            this.addFieldError(titleKey, this.getText("message.jpsurvey.defaultLangRequired", args));
          }
        }
        if (null != description && description.trim().length() > 0) {
          this.getDescriptions().put(currentLangCode,  description.trim());
        } else {
          if (currentLang.getCode().equals(defaultLanguage.getCode())) {
            String[] args = { defaultLanguage.getDescr(), this.getText("description") };
            this.addFieldError(descriptionKey, this.getText("message.jpsurvey.defaultLangRequired", args));
          }
        }
        if (this.getStrutsAction() == ApsAdminSystemConstants.EDIT) {
          // image description is required if and only if an image has been associated to the current editing _survey
          survey = this.getSurveyManager().loadSurvey(this.getSurveyId());
          // there shouldn't be the need to check for the lenght of the imageId...
          if (null != survey && null != survey.getImageId()) {
            if (null != imageDescriptionKey  && null != imageDescription && imageDescription.trim().length() > 0) {
              this.getImageDescriptions().put(currentLangCode, imageDescription.trim());
            } else {
              if (currentLang.getCode().equals(defaultLanguage.getCode())) {
                String[] args = { defaultLanguage.getDescr(), this.getText("imageDescription") };
                this.addFieldError(imageDescriptionKey,  this.getText("message.jpsurvey.defaultLangRequired", args));
              }
            }
          }
        }
View Full Code Here

  private List<CloudInfoBean> buildCloudsInfoBeans(Map<ITreeNode, Integer> occurrences) throws Throwable {
    List<CloudInfoBean> beans = new ArrayList<CloudInfoBean>();
    try {
      ServletRequest request = this.pageContext.getRequest();
      RequestContext reqCtx = (RequestContext) request.getAttribute(RequestContext.REQCTX);
      Lang currentLang = (Lang) reqCtx.getExtraParam(SystemConstants.EXTRAPAR_CURRENT_LANG);
      int[] minMax = this.extractMinMax(occurrences);
      int interval = (minMax[1] - minMax[0]);
      double delta = ((double)interval)/9d;
      Iterator<ITreeNode> iter = occurrences.keySet().iterator();
      while (iter.hasNext()) {
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.