if (result.getType().size() > 0 && result.getTitle().contains("${")) { final IPortletWindow portletWindow = this.portletWindowRegistry.getPortletWindow( final SpELEnvironmentRoot spelEnvironment = new SpELEnvironmentRoot(portletDefinition); try { result.setTitle(spELService.getValue(result.getTitle(), spelEnvironment)); } catch (SpelParseException | SpelEvaluationException e) { result.setTitle("(Invalid portlet title) - see details in log file"); logger.error( "Invalid Spring EL expression {} in search result portlet title", result.getTitle(), e);
/** * @param portletSearchResults Results from a portlet * @param results Results collating object * @param httpServletRequest current request * @param portletWindowId Id of the portlet window that provided the results */ private void addSearchResults( SearchResults portletSearchResults, PortalSearchResults results, final HttpServletRequest httpServletRequest, final IPortletWindowId portletWindowId) { for (SearchResult result : portletSearchResults.getSearchResult()) { final String resultUrl = this.getResultUrl(httpServletRequest, result, portletWindowId); this.logger.debug("Created {} with from {}", resultUrl, result.getTitle()); modifySearchResultLinkTitle(result, httpServletRequest, portletWindowId); results.addPortletSearchResults(resultUrl, result); } }
AutocompleteResultsModel result = new AutocompleteResultsModel( cleanAndTrimString(searchResult.getTitle(), maxTextLength), cleanAndTrimString( searchResult.getSummary(), maxTextLength),