Package org.apache.jetspeed.om.portlet

Examples of org.apache.jetspeed.om.portlet.Language


                    bundleCache = portletResourceBundleCache.get(pdName);
                }
                bundle = bundleCache.get(locale);
                if (bundle == null)
                {
                    Language l = pd.getLanguage(locale);
                    if (pd.getResourceBundle() == null)
                    {
                        bundle = new InlinePortletResourceBundle(l.getTitle(), l.getShortTitle(), l.getKeywords());
                    }
                    else
                    {
                        ClassLoader paCl = classLoaderMap.get(paName);
                       
                        if (paCl == null)
                        {
                            throw new UnavailableException("Portlet Application " + paName + " not available");
                        }
                        ResourceBundle loadedBundle = loadResourceBundle(l.getLocale(), pd.getResourceBundle(), paCl);
                        if (loadedBundle != null)
                        {
                            bundle = new InlinePortletResourceBundle(l.getTitle(), l.getShortTitle(), l.getKeywords(), loadedBundle);
                        }
                        else
                        {
                            bundle = new InlinePortletResourceBundle(l.getTitle(), l.getShortTitle(), l.getKeywords());
                        }
                    }
                    bundleCache.put(locale, bundle);
                }
            }
View Full Code Here


        Preferences prefs = portlet.getPortletPreferences();
        Preference pref = prefs.addPreference("preference 1");
        pref.addValue("value 1");
        pref.addValue("value 2");
       
        Language language = portlet.addLanguage(Locale.getDefault());
        language.setTitle(title);
        language.setShortTitle(title);

        Supports supports = portlet.addSupports("html/text");
        supports.addPortletMode(MODE_EDIT);
        supports.addPortletMode(MODE_VIEW);
        supports.addPortletMode(MODE_HELP);
View Full Code Here

        Preferences prefs = portlet.getPortletPreferences();
        Preference pref = prefs.addPreference("preference 1");
        pref.addValue("value 1");
        pref.addValue("value 2");

        Language language = portlet.addLanguage(Locale.getDefault());
        language.setTitle("Portlet 1");
        language.setShortTitle("Portlet 1");

       
        Supports supports = portlet.addSupports("html/text");
        supports.addPortletMode("EDIT");
        supports.addPortletMode("VIEW");
View Full Code Here

            SecurityRoleRef jsrr = jpd.addSecurityRoleRef(srr.getRoleName());
            jsrr.setRoleLink(srr.getRoleLink());
        }
       
        // First load the required default PortletInfo Language using the English Locale
        Language defaultLanguage = addLanguage(jpd, pd.getPortletInfo(), JetspeedLocale.getDefaultLocale(), false);
        for (String localeString : pd.getSupportedLocales())
        {
            Locale locale = JetspeedLocale.convertStringToLocale(localeString);
            if (locale.equals(JetspeedLocale.getDefaultLocale()))
            {
                defaultLanguage.setSupportedLocale(true);
            }
            else
            {
                addLanguage(jpd, pd.getPortletInfo(), locale, true);
            }
View Full Code Here

        }
    }
   
    protected Language addLanguage(PortletDefinition jpd, PortletInfo info, Locale locale, boolean supportedLocale)
    {               
        Language l = jpd.addLanguage(locale);
        l.setSupportedLocale(supportedLocale);
        l.setTitle(info.getTitle());
        l.setShortTitle(info.getShortTitle());
        l.setKeywords(info.getKeywords());
        if (locale != null && jpd.getResourceBundle() != null)
        {
            try
            {
                ResourceBundle bundle = ResourceBundle.getBundle(jpd.getResourceBundle(), locale, Thread.currentThread().getContextClassLoader());
                String value = bundle.getString(Language.JAVAX_PORTLET_TITLE);
                if (value != null && !value.equals(""))
                {
                    // use the value provided by the resource bundle
                    l.setTitle(value);
                }
                value = bundle.getString(Language.JAVAX_PORTLET_SHORT_TITLE);
                if (value != null && !value.equals(""))
                {
                    // use the value provided by the resource bundle
                    l.setShortTitle(value);
                }
                value = bundle.getString(Language.JAVAX_PORTLET_KEYWORDS);
                if (value != null && !value.equals(""))
                {
                    // user the value provided by the resource bundle
                    l.setKeywords(value);
                }
            }
            catch (MissingResourceException e)
            {
                // ignore
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.om.portlet.Language

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.