Liferay DockBar configured portlets but not found in the dialog box

Source: Internet
Author: User
Tags final locale resource

Since we often encounter situations in our previous projects that have been configured with Portlets but cannot be found in the dialog box, we will be careful to analyze where the text shown here comes from.

For the entire dialog, its code is/html/portlet/layout_configuration/view_category.jsp. We just want to focus on 2, one is where the category comes from, and where the portlet comes from:

Category text:

For the classification of the black word (such as our walmartplatformportaldemo here), the corresponding code in the view_category.jsp is as follows:

 

So it ends up calling the Languageutil get method, and the final content will read the resource bundle resource bundle according to your locale, and the incoming Portletcategory.getname () is when the defaultname is not found in the resource bundle because most of the names (the names we classify) are unique to the project and are unlikely to have the same name as the key in the resource bundle, so the final display in most cases is portletcategory.getname () The string value returned.

So our focus now is on how the Portletcategory.getname () value is fetched.

Above the view_category.jsp, we found:

<%@ include file= "/html/portlet/layout_configuration/init.jsp"%> 
     
<% 
portletcategory Portletcategory = (portletcategory) request.getattribute

(webkeys.portlet_category); 

So, we must think that the attribute value setting on this Request field is definitely given in the file containing the JSP. Because view_category.jsp was introduced to the layout_configuration/view.jsp in the loop, we found the corresponding code in VIEW.JSP:

    Portletcategory portletcategory = (portletcategory) webapppool.get

(Company.getcompanyid (), WebKeys.PORTLET_ CATEGORY); 
     
                Portletcategory = _getrelevantportletcategory (PermissionChecker, 

portletcategory, Panelselectedportlets, Layouttypeportlet, layout, user); 
     
                List categories = Listutil.fromcollection (Portletcategory.getcategories ()); 
     
                Categories = Listutil.sort (categories, new Portletcategorycomparator (locale)); 
     
                int portletcategoryindex = 0; 
     
                Iterator ITR = Categories.iterator (); 
     
                while (Itr.hasnext ()) { 
                    portletcategory curportletcategory = (portletcategory) itr.next (); 
     
                    if (Curportletcategory.ishidden ()) { 
                        continue 
                    } 
     
                    Request.setattribute (Webkeys.portlet_category, curportletcategory); 
...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.