List of usage examples for com.liferay.portal.kernel.portletdisplaytemplate PortletDisplayTemplateManager ENTRIES
String ENTRIES
To view the source code for com.liferay.portal.kernel.portletdisplaytemplate PortletDisplayTemplateManager ENTRIES.
Click Source Link
From source file:com.liferay.blogs.web.internal.template.BlogsPortletDisplayTemplateHandler.java
License:Open Source License
@Override public Map<String, TemplateVariableGroup> getTemplateVariableGroups(long classPK, String language, Locale locale) throws Exception { Map<String, TemplateVariableGroup> templateVariableGroups = super.getTemplateVariableGroups(classPK, language, locale);//from w w w . j a va2 s .c om String[] restrictedVariables = getRestrictedVariables(language); TemplateVariableGroup blogsUtilTemplateVariableGroup = new TemplateVariableGroup("blogs-util", restrictedVariables); blogsUtilTemplateVariableGroup.addVariable("blogs-util", BlogsUtil.class, "blogsUtil"); templateVariableGroups.put("blogs-util", blogsUtilTemplateVariableGroup); TemplateVariableGroup blogServicesTemplateVariableGroup = new TemplateVariableGroup("blog-services", restrictedVariables); blogServicesTemplateVariableGroup.setAutocompleteEnabled(false); blogServicesTemplateVariableGroup.addServiceLocatorVariables(BlogsEntryLocalService.class, BlogsEntryService.class); templateVariableGroups.put(blogServicesTemplateVariableGroup.getLabel(), blogServicesTemplateVariableGroup); TemplateVariableGroup fieldsTemplateVariableGroup = templateVariableGroups.get("fields"); fieldsTemplateVariableGroup.empty(); fieldsTemplateVariableGroup.addCollectionVariable("blog-entries", List.class, PortletDisplayTemplateManager.ENTRIES, "blog-entry", BlogsEntry.class, "curBlogEntry", "title"); return templateVariableGroups; }
From source file:com.liferay.document.library.web.internal.template.DocumentLibraryPortletDisplayTemplateHandler.java
License:Open Source License
@Override public Map<String, TemplateVariableGroup> getTemplateVariableGroups(long classPK, String language, Locale locale) throws Exception { Map<String, TemplateVariableGroup> templateVariableGroups = super.getTemplateVariableGroups(classPK, language, locale);/*from w w w .jav a2s .com*/ String[] restrictedVariables = getRestrictedVariables(language); TemplateVariableGroup documentUtilTemplateVariableGroup = new TemplateVariableGroup("document-util", restrictedVariables); documentUtilTemplateVariableGroup.addVariable("dl-util", DLUtil.class, "dlUtil"); templateVariableGroups.put("document-util", documentUtilTemplateVariableGroup); TemplateVariableGroup documentServicesTemplateVariableGroup = new TemplateVariableGroup("document-services", restrictedVariables); documentServicesTemplateVariableGroup.setAutocompleteEnabled(false); documentServicesTemplateVariableGroup.addServiceLocatorVariables(DLAppLocalService.class, DLAppService.class, DLFileEntryTypeLocalService.class, DLFileEntryTypeService.class); templateVariableGroups.put(documentServicesTemplateVariableGroup.getLabel(), documentServicesTemplateVariableGroup); TemplateVariableGroup fieldsTemplateVariableGroup = templateVariableGroups.get("fields"); fieldsTemplateVariableGroup.empty(); fieldsTemplateVariableGroup.addCollectionVariable("documents", List.class, PortletDisplayTemplateManager.ENTRIES, "document", FileEntry.class, "curFileEntry", "title"); return templateVariableGroups; }