List of usage examples for com.liferay.portal.kernel.model Portlet getInitParams
public java.util.Map<String, String> getInitParams();
From source file:com.liferay.portlet.configuration.icon.locator.internal.LegacyConfigurationIconLocator.java
License:Open Source License
@Override public String getPath(PortletRequest portletRequest) { ThemeDisplay themeDisplay = (ThemeDisplay) portletRequest.getAttribute(WebKeys.THEME_DISPLAY); PortletDisplay portletDisplay = themeDisplay.getPortletDisplay(); String portletId = portletDisplay.getRootPortletId(); Portlet portlet = _portletLocalService.getPortletById(portletId); if (portlet == null) { return StringPool.BLANK; }// ww w. j a va 2 s. c o m Map<String, String> initParams = portlet.getInitParams(); boolean alwaysDisplayDefaultConfigurationIcons = GetterUtil .getBoolean(initParams.get("always-display-default-configuration-icons")); if (alwaysDisplayDefaultConfigurationIcons) { return StringPool.DASH; } return StringPool.BLANK; }
From source file:com.liferay.portlet.configuration.icon.locator.internal.MVCCommandPortletConfigurationIconLocator.java
License:Open Source License
@Override public List<String> getDefaultViews(String portletId) { List<String> defaultViews = new ArrayList<>(); Portlet portlet = _portletLocalService.getPortletById(portletId); if (portlet == null) { return defaultViews; }/*from w ww . j a v a 2 s . c o m*/ Map<String, String> initParams = portlet.getInitParams(); String[] mvcCommandNamesDefaultViews = StringUtil.split(initParams.get("mvc-command-names-default-views")); return ListUtil.fromArray(mvcCommandNamesDefaultViews); }
From source file:com.liferay.portlet.configuration.icon.locator.internal.MVCPortletConfigurationIconLocator.java
License:Open Source License
@Override public List<String> getDefaultViews(String portletId) { List<String> defaultViews = new ArrayList<>(); Portlet portlet = _portletLocalService.getPortletById(portletId); if (portlet == null) { return defaultViews; }/* ww w. j a v a 2 s.c o m*/ Map<String, String> initParams = portlet.getInitParams(); String viewTemplate = initParams.get("view-template"); if (Validator.isNotNull(viewTemplate)) { defaultViews.add(viewTemplate); } return defaultViews; }
From source file:com.liferay.portlet.configuration.icon.locator.internal.StrutsPortletConfigurationIconLocator.java
License:Open Source License
@Override public List<String> getDefaultViews(String portletId) { List<String> defaultViews = new ArrayList<>(); Portlet portlet = _portletLocalService.getPortletById(portletId); if (portlet == null) { return defaultViews; }//ww w .j a v a 2 s .c om Map<String, String> initParams = portlet.getInitParams(); String viewAction = initParams.get("view-action"); if (Validator.isNotNull(viewAction)) { defaultViews.add(viewAction); } return defaultViews; }