Examples of LocalizedString


Examples of org.gatein.common.i18n.LocalizedString

         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

Examples of org.gatein.common.i18n.LocalizedString

         {
            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

Examples of org.gatein.common.i18n.LocalizedString

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

Examples of org.gatein.common.i18n.LocalizedString

         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);
               String lang = WSRPConstants.DEFAULT_LOCALE;
               if (prefInfo != null)
               {
                  displayName = prefInfo.getDisplayName();
                  if (displayName != null)
                  {
                     lang = WSRPUtils.toString(displayName.getDefaultLocale());
                  }
               }

               // todo: support multi-valued properties
               if (values.size() != 1)
View Full Code Here

Examples of org.gatein.common.i18n.LocalizedString

            // cause an improper Application name
            portletApplicationName = portletApplicationName.replace('/', '_');
            portletName = portletName.replace('/', '_');

            MetaInfo metaInfo = portlet.getInfo().getMeta();
            LocalizedString keywordsLS = metaInfo.getMetaValue(MetaInfo.KEYWORDS);

            //
            Set<String> categoryNames = new HashSet<String>();

            // Process keywords
            if (keywordsLS != null) {
                String keywords = keywordsLS.getDefaultString();
                if (keywords != null && keywords.length() != 0) {
                    for (String categoryName : keywords.split(",")) {
                        // Trim name
                        categoryName = categoryName.trim();
                        if (INTERNAL_PORTLET_TAG.equalsIgnoreCase(categoryName)) {
                            log.debug("Skipping portlet (" + portletApplicationName + "," + portletName
                                    + ") + tagged as internal");
                            continue portlet;
                        } else {
                            categoryNames.add(categoryName);
                        }
                    }
                }
            }

            ArrayList<String> permissions = new ArrayList<String>();
            permissions.add(UserACL.EVERYONE);
            // If no keywords, use the portlet application name
            if (categoryNames.isEmpty()) {
                categoryNames.add(portletApplicationName.trim());
            }

            // Additionally categorise the portlet as remote
            boolean remote = portlet.isRemote();
            if (remote) {
                categoryNames.add(REMOTE_CATEGORY_NAME);

                // add producer name to categories for easier finding of portlets for GTNPORTAL-823
                LocalizedString producerNameLS = metaInfo.getMetaValue(PRODUCER_NAME_META_INFO_KEY);
                if (producerNameLS != null) {
                    categoryNames.add(producerNameLS.getDefaultString() + PRODUCER_CATEGORY_NAME_SUFFIX);
                }
            }

            //
            log.info("Importing portlet (" + portletApplicationName + "," + portletName + ") in categories " + categoryNames);

            // Process category names
            for (String categoryName : categoryNames) {
                CategoryDefinition category = registry.getCategory(categoryName);

                //
                if (category == null) {
                    category = registry.createCategory(categoryName);
                    category.setDisplayName(categoryName);
                    category.setAccessPermissions(permissions);
                }

                //
                ContentDefinition app = category.getContentMap().get(portletName);
                if (app == null) {
                    LocalizedString descriptionLS = metaInfo.getMetaValue(MetaInfo.DESCRIPTION);
                    LocalizedString displayNameLS = metaInfo.getMetaValue(MetaInfo.DISPLAY_NAME);
                    String displayName = getLocalizedStringValue(displayNameLS, portletName);

                    ContentType<?> contentType;
                    String contentId;
                    if (remote) {
View Full Code Here

Examples of org.gatein.common.i18n.LocalizedString

   {

      if (child instanceof DescribableMetaData)
      {
         DescribableMetaData md = (DescribableMetaData)child;
         LocalizedString d = this.descriptions.getLocalizedString(md);
         md.setDescription(d);
      }

      // portlet app
      if (parent instanceof PortletApplication10MetaData)
View Full Code Here

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

Examples of org.gatein.common.i18n.LocalizedString

                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

Examples of org.gatein.common.i18n.LocalizedString

        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

Examples of org.gatein.common.i18n.LocalizedString

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