Package org.gatein.common.i18n

Examples of org.gatein.common.i18n.ResourceBundleManager


            }
         }
      }

      //
      ResourceBundleManager bundleManager = PortletResourceBundleFactory.createResourceBundleManager(info.getBundleManager(), info);

      // Portlet config object
      PortletConfig config = new PortletConfigImpl(info, application.info, application.portletContext, bundleManager);

      // Finally initialize the porlet instance
View Full Code Here


               modeInfo = new ContainerModeInfo(mode);
            }
         }
         else
         {
            ResourceBundleManager bundleMgr = context.getBundleManager();

            //
            LocalizedString displayName = bundleMgr.getLocalizedValue(
               "javax.portlet.app.custom-portlet-mode." + mode + ".decoration-name",
               "" + mode);

            //
            if (description != null)
View Full Code Here

   }

   private ContainerParameterInfo build(PublicRenderParameterMetaData parameterMD)
   {
      QName name = getName(parameterMD.getQname(), parameterMD.getName());
      ResourceBundleManager bundleMgr = context.getBundleManager();

      LocalizedString description = bundleMgr.getLocalizedValue(
         "javax.portlet.app.public-render-parameter." + name + ".description",
         getDefaultStringFor(parameterMD.getDescription(), "Description of public render parameter " + name));

      //
      return new ContainerParameterInfo(
View Full Code Here

   }

   private ContainerEventInfo build(EventDefinitionMetaData eventDefinitionMD) throws NoSuchClassException
   {
      QName name = getName(eventDefinitionMD.getQname(), eventDefinitionMD.getName());
      ResourceBundleManager bundleMgr = context.getBundleManager();

      //
      String valueType = eventDefinitionMD.getValueType();
      ContainerTypeInfo type = null;
      if (valueType != null)
      {
         Class clazz = context.getClass(valueType);
         type = new ContainerTypeInfo(clazz);
      }

      //
      LocalizedString displayName = bundleMgr.getLocalizedValue(
         "javax.portlet.app.event-definition." + name + ".display-name",
         "Event " + name);
      LocalizedString description = bundleMgr.getLocalizedValue(
         "javax.portlet.app.event-definition." + name + ".description",
         getDefaultStringFor(eventDefinitionMD.getDescription(), "Description of event " + name));

      //
      return new ContainerEventInfo(name, type, displayName, description);
View Full Code Here

   private ContainerMetaInfo buildContainerMeta(PortletMetaData portletMD)
   {
      ContainerMetaInfo containerMeta = new ContainerMetaInfo();

      //
      ResourceBundleManager bundleMgr = context.getBundleManager(portletMD);

      // Capture inline values
      PortletInfoMetaData portletInfoMD = portletMD.getPortletInfo();
      String[] inlines = null;
      if (portletInfoMD != null)
      {
         // JBoss XB would give null for an empty title, but we know that
         // there must be a title according to the schema
         String title = portletInfoMD.getTitle();
         if (title == null)
         {
            title = "";
         }

         //
         inlines = new String[]{
            title,
            portletInfoMD.getShortTitle(),
            portletInfoMD.getKeywords()
         };
      }

      // Construct info from resource bundle manager
      for (int i = 0; i < KEYS.length; i++)
      {
         String key = KEYS[i];

         //
         Map<Locale, String> tmp = new HashMap<Locale, String>();

         //
         List<Locale> locales = getSupportedLocales(portletMD);

         // Add english locale
         locales.add(Locale.ENGLISH);

         // Feed with the known locales (perhaps should try more locales)
         for (Locale locale : locales)
         {
            ResourceBundle bundle = bundleMgr.getResourceBundle(locale);

            //
            if (bundle != null)
            {
               try
View Full Code Here

      {
         //
         containerPreferences = new ContainerPreferencesInfo(preferencesMD.getPreferenceValidator());

         //
         ResourceBundleManager bundleMgr = context.getBundleManager(portletMD);

         //
         for (PortletPreferenceMetaData portletPreferenceMD : preferencesMD.getPortletPreferences().values())
         {
            List<String> value = portletPreferenceMD.getValue();
            LocalizedString displayName = bundleMgr.getLocalizedValue("javax.portlet.preference.name." + portletPreferenceMD.getName(), portletPreferenceMD.getName());
            LocalizedString description = bundleMgr.getLocalizedValue("javax.portlet.preference.description." + portletPreferenceMD.getName(), portletPreferenceMD.getName());
            containerPreferences.addContainerPreference(portletPreferenceMD.getName(), value, portletPreferenceMD.isReadOnly(), displayName, description);
         }
      }

      //
View Full Code Here

               modeInfo = new ContainerModeInfo(mode);
            }
         }
         else
         {
            ResourceBundleManager bundleMgr = context.getBundleManager();

            //
            LocalizedString displayName = bundleMgr.getLocalizedValue(
               "javax.portlet.app.custom-portlet-mode." + mode + ".decoration-name",
               "" + mode);

            //
            if (description != null)
View Full Code Here

   }

   private ContainerParameterInfo build(PublicRenderParameterMetaData parameterMD)
   {
      QName name = getName(parameterMD.getQname(), parameterMD.getName());
      ResourceBundleManager bundleMgr = context.getBundleManager();

      LocalizedString description = bundleMgr.getLocalizedValue(
         "javax.portlet.app.public-render-parameter." + name + ".description",
         getDefaultStringFor(parameterMD.getDescription(), "Description of public render parameter " + name));

      //
      return new ContainerParameterInfo(
View Full Code Here

   }

   private ContainerEventInfo build(EventDefinitionMetaData eventDefinitionMD) throws NoSuchClassException
   {
      QName name = getName(eventDefinitionMD.getQname(), eventDefinitionMD.getName());
      ResourceBundleManager bundleMgr = context.getBundleManager();

      //
      String valueType = eventDefinitionMD.getValueType();
      ContainerTypeInfo type = null;
      if (valueType != null)
      {
         Class clazz = context.getClass(valueType);
         type = new ContainerTypeInfo(clazz);
      }

      //
      LocalizedString displayName = bundleMgr.getLocalizedValue(
         "javax.portlet.app.event-definition." + name + ".display-name",
         "Event " + name);
      LocalizedString description = bundleMgr.getLocalizedValue(
         "javax.portlet.app.event-definition." + name + ".description",
         getDefaultStringFor(eventDefinitionMD.getDescription(), "Description of event " + name));

      //
      return new ContainerEventInfo(name, type, displayName, description);
View Full Code Here

   private ContainerMetaInfo buildContainerMeta(PortletMetaData portletMD)
   {
      ContainerMetaInfo containerMeta = new ContainerMetaInfo();

      //
      ResourceBundleManager bundleMgr = context.getBundleManager(portletMD);

      // Capture inline values
      PortletInfoMetaData portletInfoMD = portletMD.getPortletInfo();
      String[] inlines = null;
      if (portletInfoMD != null)
      {
         // JBoss XB would give null for an empty title, but we know that
         // there must be a title according to the schema
         String title = portletInfoMD.getTitle();
         if (title == null)
         {
            title = "";
         }

         //
         inlines = new String[]{
            title,
            portletInfoMD.getShortTitle(),
            portletInfoMD.getKeywords()
         };
      }

      // Construct info from resource bundle manager
      for (int i = 0; i < KEYS.length; i++)
      {
         String key = KEYS[i];

         //
         Map<Locale, String> tmp = new HashMap<Locale, String>();

         //
         List<Locale> locales = getSupportedLocales(portletMD);

         // Add english locale
         locales.add(Locale.ENGLISH);

         // Feed with the known locales (perhaps should try more locales)
         for (Locale locale : locales)
         {
            ResourceBundle bundle = bundleMgr.getResourceBundle(locale);

            //
            if (bundle != null)
            {
               try
View Full Code Here

TOP

Related Classes of org.gatein.common.i18n.ResourceBundleManager

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.