Package org.gatein.common.i18n

Examples of org.gatein.common.i18n.LocalizedString


            PortletInfo info = portlet.getInfo();

            // in the remote case, the "application name" will be the name of the remote invoker
            String appName;
            if (remote) {
                LocalizedString producerNameLS = info.getMeta().getMetaValue(PRODUCER_NAME_META_INFO_KEY);
                if (producerNameLS != null) {
                    appName = producerNameLS.getDefaultString();
                } else {
                    throw new IllegalStateException("Missing PortletInvoker id in remote portlet metadata");
                }
            } else {
                appName = info.getApplicationName();
View Full Code Here


                return null;
            }
        }

        private String getMetaValue(String metaKey, String defaultValue) {
            LocalizedString metaValue = portletInfo_.getMeta().getMetaValue(metaKey);
            if (metaValue == null || metaValue.getDefaultString() == null) {
                return defaultValue;
            }
            return metaValue.getDefaultString();
        }
View Full Code Here

        Set<Portlet> portlets = remote ? portletInvoker.getRemotePortlets() : portletInvoker.getLocalPortlets();
        List<Application> applications = new ArrayList<Application>(portlets.size());
        for (Portlet portlet : portlets) {
            PortletInfo info = portlet.getInfo();

            LocalizedString descriptionLS = info.getMeta().getMetaValue(MetaInfo.DESCRIPTION);
            LocalizedString displayNameLS = info.getMeta().getMetaValue(MetaInfo.DISPLAY_NAME);

            String portletName = info.getName();
            Application app = new Application();
            app.setApplicationName(portletName);
            // app.setApplicationGroup(info.getApplicationName());
View Full Code Here

         return portletInfo_.getPreferences();
      }

      private String getMetaValue(String metaKey, String defaultValue)
      {
         LocalizedString metaValue = portletInfo_.getMeta().getMetaValue(metaKey);
         if (metaValue == null || metaValue.getDefaultString() == null)
            return defaultValue;
         return metaValue.getDefaultString();
      }
View Full Code Here

         if (propertyNb > 0)
         {
            PreferenceInfo prefInfo;
            String key;
            List<String> values;
            LocalizedString displayName;

            for (Map.Entry<String, List<String>> entry : properties.entrySet())
            {
               key = entry.getKey();
               values = entry.getValue();
               prefInfo = info.getPreferences().getPreference(key);
               displayName = prefInfo.getDisplayName();
               String lang = WSRPUtils.toString(displayName.getDefaultLocale());

               // todo: support multi-valued properties
               if (values.size() != 1)
               {
                  throw new UnsupportedOperationException("Currently doesn't support multi-valued properties!");
View Full Code Here

      for (CustomPortletModeMetaData customPortletModeMD : portletApplicationMD.getCustomPortletModes().values())
      {
         org.gatein.pc.api.Mode mode = org.gatein.pc.api.Mode.create(customPortletModeMD.getPortletMode());

         //
         LocalizedString description = customPortletModeMD.getDescription();

         //
         ContainerModeInfo modeInfo;
         if (customPortletModeMD.isPortalManaged())
         {
            if (description != null)
            {
               modeInfo = new ContainerModeInfo(mode, description);
            }
            else
            {
               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)
            {
               modeInfo = new ContainerPortletManagedModeInfo(mode, description, displayName);
            }
            else
            {
               modeInfo = new ContainerPortletManagedModeInfo(mode, displayName);
            }
         }

         //
         customModes.put(mode, modeInfo);
      }

      // Build custom window state infos for reuse in portlet info
      for (CustomWindowStateMetaData customPortletModeMD : portletApplicationMD.getCustomWindowStates().values())
      {
         org.gatein.pc.api.WindowState windowState = WindowState.create(customPortletModeMD.getWindowState());

         //
         LocalizedString description = customPortletModeMD.getDescription();

         //
         ContainerWindowStateInfo windowStateInfo;
         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

         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

         {
            tmp.put(Locale.ENGLISH, inlines[i]);
         }

         //
         LocalizedString ls = new LocalizedString(tmp, Locale.ENGLISH);
         containerMeta.addMetaValue(key, ls);
      }

      // Add stuff coming from deployment descriptor
      containerMeta.addMetaValue(MetaInfo.DESCRIPTION, portletMD.getDescription());
View Full Code Here

         //
         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

TOP

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

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.