Examples of LocaleConfig


Examples of org.exoplatform.services.resources.LocaleConfig

      SelectItemOption localeItem = null;
      List<SelectItemOption> optionsList = new ArrayList<SelectItemOption>();

      for (Object object : configService.getLocalConfigs())
      {
         LocaleConfig localeConfig = (LocaleConfig)object;
         Locale locale = localeConfig.getLocale();
         String displayName = capitalizeFirstLetter(locale.getDisplayLanguage(currentLocale));
         String lang = locale.getLanguage();
         String country = locale.getCountry();
         String localedName = capitalizeFirstLetter(locale.getDisplayLanguage(locale));;
View Full Code Here

Examples of org.exoplatform.services.resources.LocaleConfig

         Util.getPortalRequestContext().setFullRender(false);
         if (language == null || language.trim().length() < 1)
            return;
         // if(!uiPortal.isModifiable()) return;
         LocaleConfigService localeConfigService = event.getSource().getApplicationComponent(LocaleConfigService.class);
         LocaleConfig localeConfig = localeConfigService.getLocaleConfig(language);
         if (localeConfig == null)
            localeConfig = localeConfigService.getDefaultLocaleConfig();
         uiApp.setLocale(localeConfig.getLocale());
         uiApp.setOrientation(localeConfig.getOrientation());
         uiApp.localizeNavigations();
         OrganizationService orgService = event.getSource().getApplicationComponent(OrganizationService.class);
         String remoteUser = event.getRequestContext().getRemoteUser();
         if (remoteUser != null)
         {
View Full Code Here

Examples of org.exoplatform.services.resources.LocaleConfig

   }
  

   private void localizeNavigation(Locale locale)
   {
      LocaleConfig localeConfig =
         getApplicationComponent(LocaleConfigService.class).getLocaleConfig(locale.getLanguage());
      String ownerType = edittedNavigation.getOwnerType();
      if (!PortalConfig.USER_TYPE.equals(ownerType))
      {
         String ownerId = edittedNavigation.getOwnerId();
         if (PortalConfig.GROUP_TYPE.equals(ownerType))
         {
            // Remove the trailing '/' for a group
            ownerId = ownerId.substring(1);
         }
         ResourceBundle res = localeConfig.getNavigationResourceBundle(ownerType, ownerId);
         for (PageNode node : edittedNavigation.getNodes())
         {
            resolveLabel(res, node);
         }
      }
View Full Code Here

Examples of org.exoplatform.services.resources.LocaleConfig

      invokeGetBindingBean(editPortal);
      ((UIFormStringInput)getChild(UIFormInputSet.class).getChildById(FIELD_NAME)).setValue(getPortalOwner());

      LocaleConfigService localeConfigService = getApplicationComponent(LocaleConfigService.class);
      LocaleConfig localeConfig = localeConfigService.getLocaleConfig(editPortal.getLocale());
      this.<UIFormInputSet> getChildById("PortalSetting").<UIFormSelectBox> getChildById(FIELD_LOCALE).setValue(
         localeConfig.getLanguage());
      setActions(new String[]{"Save", "Close"});
   }
View Full Code Here

Examples of org.exoplatform.services.resources.LocaleConfig

   private void createDefaultItem() throws Exception
   {
      UIPortal uiPortal = Util.getUIPortal();
      LocaleConfigService localeConfigService = getApplicationComponent(LocaleConfigService.class);
      Collection<?> listLocaleConfig = localeConfigService.getLocalConfigs();
      LocaleConfig defaultLocale = localeConfigService.getDefaultLocaleConfig();
      String defaultLanguage = defaultLocale.getLanguage();
      Locale currentLocate = Util.getPortalRequestContext().getLocale();
      Iterator<?> iterator = listLocaleConfig.iterator();
      while (iterator.hasNext())
      {
         LocaleConfig localeConfig = (LocaleConfig)iterator.next();
         SelectItemOption<String> option =
            new SelectItemOption<String>(localeConfig.getLocale().getDisplayName(currentLocate), localeConfig
               .getLanguage());
         if (defaultLanguage.equals(localeConfig.getLanguage()))
         {
            option.setSelected(true);
         }
         languages.add(option);
      }
View Full Code Here

Examples of org.exoplatform.services.resources.LocaleConfig

            UIPortalApplication uiApp = Util.getUIPortalApplication();           
            if (language == null || language.trim().length() < 1)
               return;
            LocaleConfigService localeConfigService =
               event.getSource().getApplicationComponent(LocaleConfigService.class);
            LocaleConfig localeConfig = localeConfigService.getLocaleConfig(language);
            if (localeConfig == null)
               localeConfig = localeConfigService.getDefaultLocaleConfig();
            uiApp.setLocale(localeConfig.getLocale());
            uiApp.setOrientation(localeConfig.getOrientation());
            uiApp.localizeNavigations();

            Util.getPortalRequestContext().addUIComponentToUpdateByAjax(
               uiApp.findFirstComponentOfType(UIWorkingWorkspace.class));
            Util.getPortalRequestContext().setFullRender(true);
View Full Code Here

Examples of org.exoplatform.services.resources.LocaleConfig

                log.warn("No locale set on PortalRequestContext! Falling back to 'en'.");
            locale = Locale.ENGLISH;
        }

        String localeName = LocaleContextInfo.getLocaleAsString(locale);
        LocaleConfig localeConfig = localeConfigService.getLocaleConfig(localeName);
        if (localeConfig == null) {
            if (log.isWarnEnabled())
                log.warn("Unsupported locale set on PortalRequestContext: " + localeName + "! Falling back to 'en'.");
            localeConfig = localeConfigService.getLocaleConfig(Locale.ENGLISH.getLanguage());
        }
        setOrientation(localeConfig.getOrientation());

        // -------------------------------------------------------------------------------
        context.setUIApplication(this);

        this.all_UIPortals = new HashMap<SiteKey, UIPortal>(5);
View Full Code Here

Examples of org.exoplatform.services.resources.LocaleConfig

        Locale currentLocale = Util.getPortalRequestContext().getLocale();
        SelectItemOption localeItem = null;
        List<SelectItemOption> optionsList = new ArrayList<SelectItemOption>();

        for (Object object : configService.getLocalConfigs()) {
            LocaleConfig localeConfig = (LocaleConfig) object;
            Locale locale = localeConfig.getLocale();
            String lang = locale.getLanguage();
            String country = locale.getCountry();

            ResourceBundle currentLocaleResourceBundle = getResourceBundle(currentLocale);
            ResourceBundle localeResourceBundle = getResourceBundle(locale);
View Full Code Here

Examples of org.exoplatform.services.resources.LocaleConfig

                return;
            }
            // if(!uiPortal.isModifiable()) return;

            LocaleConfigService localeConfigService = event.getSource().getApplicationComponent(LocaleConfigService.class);
            LocaleConfig localeConfig = localeConfigService.getLocaleConfig(language);
            if (localeConfig == null)
                localeConfig = localeConfigService.getDefaultLocaleConfig();
            prqCtx.setLocale(localeConfig.getLocale());

            if (prqCtx.getRequestLocale() != null) {
                NodeURL url = prqCtx.createURL(NodeURL.TYPE).setNode(Util.getUIPortal().getNavPath());
                url.setLocale(prqCtx.getLocale());
                prqCtx.sendRedirect(url.toString());
View Full Code Here

Examples of org.exoplatform.services.resources.LocaleConfig

        invokeGetBindingBean(editPortal);
        ((UIFormStringInput) getChild(UIFormInputSet.class).getChildById(FIELD_NAME)).setValue(getPortalOwner());

        LocaleConfigService localeConfigService = getApplicationComponent(LocaleConfigService.class);
        LocaleConfig localeConfig = localeConfigService.getLocaleConfig(editPortal.getLocale());
        String lang = localeConfig.getLanguage();
        if (localeConfig.getLocale().getCountry() != null && localeConfig.getLocale().getCountry().length() > 0) {
            lang += "_" + localeConfig.getLocale().getCountry();
        }

        this.<UIFormInputSet> getChildById("PortalSetting").<UIFormSelectBox> getChildById(FIELD_LOCALE).setValue(lang);
        setActions(new String[] { "Save", "Close" });
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.