@Override public Object getAttribute(String name) { return ((PortletRequest)wrapped).getAttribute(name); }
private void _initAttributes() { if (_attributes != null) { return; } _attributes = new HashMap<>(); Enumeration<String> enumeration = _portletRequest.getAttributeNames(); while (enumeration.hasMoreElements()) { String name = enumeration.nextElement(); Object value = _portletRequest.getAttribute(name); _attributes.put(name, value); } }
@Override public HttpServletRequest getServletRequest(PortletRequest portletRequest) { Object request = portletRequest.getAttribute( _PORTLET_CONTAINER_SERVLET_REQUEST); if (request == null) { request = portletRequest.getAttribute( PortletServlet.PORTLET_SERVLET_REQUEST); } return (HttpServletRequest)request; }
@Override public HttpServletResponse getServletResponse( PortletRequest portletRequest, PortletResponse portletResponse) { Object response = portletRequest.getAttribute( _PORTLET_CONTAINER_SERVLET_RESPONSE); if (response == null) { response = portletRequest.getAttribute( PortletServlet.PORTLET_SERVLET_RESPONSE); } return (HttpServletResponse)response; }
protected Locale getLocale(PortletRequest portletRequest) { ThemeDisplay themeDisplay = (ThemeDisplay)portletRequest.getAttribute( WebKeys.THEME_DISPLAY); return themeDisplay.getLocale(); }
public void setPreference( PortletRequest portletRequest, String name, String[] values) { Map<String, String[]> portletPreferencesMap = (Map<String, String[]>)portletRequest.getAttribute( WebKeys.PORTLET_PREFERENCES_MAP); if (portletPreferencesMap == null) { portletPreferencesMap = new HashMap<>(); portletRequest.setAttribute( WebKeys.PORTLET_PREFERENCES_MAP, portletPreferencesMap); } portletPreferencesMap.put(name, values); }
@Override public ServletConfig getServletConfig( PortletConfig portletConfig, PortletRequest portletRequest) { PortletContext portletContext = portletConfig.getPortletContext(); Object servletConfig = portletContext.getAttribute( _PORTLET_CONTAINER_SERVLET_CONFIG); if (servletConfig == null) { servletConfig = portletRequest.getAttribute( PortletServlet.PORTLET_SERVLET_CONFIG); } return (ServletConfig)servletConfig; }
protected String translate(PortletRequest portletRequest, String key) { ThemeDisplay themeDisplay = (ThemeDisplay)portletRequest.getAttribute( WebKeys.THEME_DISPLAY); ResourceBundle resourceBundle = getResourceBundle( themeDisplay.getLocale()); return LanguageUtil.get(resourceBundle, key); }
protected String translate( PortletRequest portletRequest, String key, Object... arguments) { ThemeDisplay themeDisplay = (ThemeDisplay)portletRequest.getAttribute( WebKeys.THEME_DISPLAY); ResourceBundle resourceBundle = getResourceBundle( themeDisplay.getLocale()); return LanguageUtil.format(resourceBundle, key, arguments); }
protected String getPath( PortletRequest portletRequest, PortletResponse portletResponse) { String mvcPath = portletRequest.getParameter("mvcPath"); if (mvcPath == null) { mvcPath = (String)portletRequest.getAttribute( getMVCPathAttributeName(portletResponse.getNamespace())); } // Check deprecated parameter if (mvcPath == null) { mvcPath = portletRequest.getParameter("jspPage"); } return mvcPath; }
public static RequestBackedPortletURLFactory create( PortletRequest portletRequest) { PortletResponse portletResponse = (PortletResponse)portletRequest.getAttribute( JavaConstants.JAVAX_PORTLET_RESPONSE); if (portletResponse == null) { return create(PortalUtil.getHttpServletRequest(portletRequest)); } return new LiferayPortletResponseRequestBackedPortletURLFactory( PortalUtil.getLiferayPortletRequest(portletRequest), PortalUtil.getLiferayPortletResponse(portletResponse)); }
protected boolean isDisplaySuccessMessage(PortletRequest portletRequest) { if (!SessionErrors.isEmpty(portletRequest)) { return false; } ThemeDisplay themeDisplay = (ThemeDisplay)portletRequest.getAttribute( WebKeys.THEME_DISPLAY); Layout layout = themeDisplay.getLayout(); if (layout.isTypeControlPanel()) { return true; } String portletId = (String)portletRequest.getAttribute( WebKeys.PORTLET_ID); LayoutTypePortlet layoutTypePortlet = themeDisplay.getLayoutTypePortlet(); if (layoutTypePortlet.hasPortletId(portletId)) { return true; } Portlet portlet = PortletLocalServiceUtil.getPortletById( themeDisplay.getCompanyId(), portletId); if (portlet.isAddDefaultResource()) { return true; } return false; }
protected static ExportImportConfiguration addExportImportConfiguration( PortletRequest portletRequest, int type) throws PortalException { ThemeDisplay themeDisplay = (ThemeDisplay)portletRequest.getAttribute( WebKeys.THEME_DISPLAY); long groupId = ParamUtil.getLong(portletRequest, "groupId"); if (type == ExportImportConfigurationConstants.TYPE_EXPORT_LAYOUT) { groupId = ParamUtil.getLong(portletRequest, "liveGroupId"); } String name = ParamUtil.getString(portletRequest, "name"); String description = ParamUtil.getString(portletRequest, "description"); Map<String, Serializable> settingsMap = ExportImportConfigurationSettingsMapFactoryUtil.buildSettingsMap( portletRequest, groupId, type); Map<String, String[]> parameterMap = (Map<String, String[]>)settingsMap.get("parameterMap"); if ((parameterMap != null) && (type == ExportImportConfigurationConstants.TYPE_PUBLISH_LAYOUT_LOCAL)) { parameterMap.put( PortletDataHandlerKeys.PERFORM_DIRECT_BINARY_IMPORT, new String[] {Boolean.TRUE.toString()}); } return ExportImportConfigurationLocalServiceUtil. addExportImportConfiguration( themeDisplay.getUserId(), groupId, name, description, type, settingsMap, new ServiceContext()); }
public static ExportImportConfiguration buildDefaultLocalPublishingExportImportConfiguration( PortletRequest portletRequest) throws PortalException { ThemeDisplay themeDisplay = (ThemeDisplay)portletRequest.getAttribute( WebKeys.THEME_DISPLAY); long sourceGroupId = ParamUtil.getLong(portletRequest, "sourceGroupId"); long targetGroupId = ParamUtil.getLong(portletRequest, "targetGroupId"); boolean privateLayout = ParamUtil.getBoolean( portletRequest, "privateLayout"); Map<String, String[]> parameterMap = _getParameterMap(portletRequest); return buildDefaultLocalPublishingExportImportConfiguration( themeDisplay.getUser(), sourceGroupId, targetGroupId, privateLayout, parameterMap); }
PortletRequest portletRequest, PortletResponse portletResponse) { ThemeDisplay themeDisplay = (ThemeDisplay)portletRequest.getAttribute( WebKeys.THEME_DISPLAY);
protected static ExportImportConfiguration updateExportImportConfiguration( PortletRequest portletRequest, int type) throws PortalException { ThemeDisplay themeDisplay = (ThemeDisplay)portletRequest.getAttribute( WebKeys.THEME_DISPLAY); long exportImportConfigurationId = ParamUtil.getLong( portletRequest, "exportImportConfigurationId"); long groupId = ParamUtil.getLong(portletRequest, "groupId"); String name = ParamUtil.getString(portletRequest, "name"); String description = ParamUtil.getString(portletRequest, "description"); Map<String, Serializable> settingsMap = ExportImportConfigurationSettingsMapFactoryUtil.buildSettingsMap( portletRequest, groupId, type); return ExportImportConfigurationLocalServiceUtil. updateExportImportConfiguration( themeDisplay.getUserId(), exportImportConfigurationId, name, description, settingsMap, new ServiceContext()); }
public static Calendar getCalendar( PortletRequest portletRequest, String paramPrefix, boolean timeZoneSensitive) { ThemeDisplay themeDisplay = (ThemeDisplay)portletRequest.getAttribute( WebKeys.THEME_DISPLAY); int dateMonth = ParamUtil.getInteger( portletRequest, paramPrefix + "Month"); int dateDay = ParamUtil.getInteger(portletRequest, paramPrefix + "Day"); int dateYear = ParamUtil.getInteger( portletRequest, paramPrefix + "Year"); int dateHour = ParamUtil.getInteger( portletRequest, paramPrefix + "Hour"); int dateMinute = ParamUtil.getInteger( portletRequest, paramPrefix + "Minute"); int dateAmPm = ParamUtil.getInteger( portletRequest, paramPrefix + "AmPm"); return getCalendar( dateAmPm, dateYear, dateMonth, dateDay, dateHour, dateMinute, themeDisplay.getLocale(), themeDisplay.getTimeZone(), timeZoneSensitive); }
public static ExportImportConfiguration buildDefaultRemotePublishingExportImportConfiguration( PortletRequest portletRequest) throws PortalException { ThemeDisplay themeDisplay = (ThemeDisplay)portletRequest.getAttribute( WebKeys.THEME_DISPLAY); long sourceGroupId = ParamUtil.getLong(portletRequest, "sourceGroupId"); boolean privateLayout = ParamUtil.getBoolean( portletRequest, "privateLayout"); String remoteAddress = ParamUtil.getString( portletRequest, "remoteAddress"); int remotePort = ParamUtil.getInteger(portletRequest, "remotePort"); String remotePathContext = ParamUtil.getString( portletRequest, "remotePathContext"); boolean secureConnection = ParamUtil.getBoolean( portletRequest, "secureConnection"); long remoteGroupId = ParamUtil.getLong(portletRequest, "remoteGroupId"); Map<String, String[]> parameterMap = _getParameterMap(portletRequest); return buildDefaultRemotePublishingExportImportConfiguration( themeDisplay.getUser(), sourceGroupId, privateLayout, remoteAddress, remotePort, remotePathContext, secureConnection, remoteGroupId, parameterMap); }
public AssetEntryQuery( long[] classNameIds, SearchContainer<?> searchContainer) { this(); setClassNameIds(classNameIds); _start = searchContainer.getStart(); _end = searchContainer.getEnd(); if (Validator.isNotNull(searchContainer.getOrderByCol())) { setOrderByCol1(searchContainer.getOrderByCol()); setOrderByType1(searchContainer.getOrderByType()); } PortletRequest portletRequest = searchContainer.getPortletRequest(); ThemeDisplay themeDisplay = (ThemeDisplay)portletRequest.getAttribute( WebKeys.THEME_DISPLAY); _groupIds = new long[] {themeDisplay.getScopeGroupId()}; long categoryId = ParamUtil.getLong(portletRequest, "categoryId"); if (categoryId > 0) { _allCategoryIds = new long[] {categoryId}; } String tagName = ParamUtil.getString(portletRequest, "tag"); if (Validator.isNotNull(tagName)) { _allTagIds = AssetTagLocalServiceUtil.getTagIds( PortalUtil.getSiteGroupId(themeDisplay.getScopeGroupId()), new String[] {tagName}); if (_allTagIds.length == 0) { _allTagIds = new long[] {0}; } _allTagIdsArray = new long[][] {_allTagIds}; } }
throws PortalException { ThemeDisplay themeDisplay = (ThemeDisplay)portletRequest.getAttribute( WebKeys.THEME_DISPLAY);