META-INF.resources.wiki.app_view_search_entry.jspf Maven / Gradle / Ivy
<%--
/**
* SPDX-FileCopyrightText: (c) 2000 Liferay, Inc. https://liferay.com
* SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06
*/
--%>
<%
String description = StringUtil.shorten(HtmlUtil.stripHtml(formattedContent), 200);
String linkTitle = wikiPage.getTitle();
if (Validator.isNotNull(description)) {
linkTitle += " - " + description;
}
Summary summary = new Summary(wikiPage.getTitle(), description);
summary.setEscape(true);
summary.setHighlight(wikiPortletInstanceSettingsHelper.isEnableHighlighting());
Hits hits = wikiSearchDisplayContext.getHits();
summary.setQueryTerms(hits.getQueryTerms());
%>
" data-title="<%= HtmlUtil.escapeAttribute(StringUtil.shorten(wikiPage.getTitle(), 60)) %>">
<%
List
> fileEntryRelatedSearchResults = searchResult.getFileEntryRelatedSearchResults();
%>
<%
for (RelatedSearchResult fileEntryRelatedSearchResult : fileEntryRelatedSearchResults) {
FileEntry fileEntry = fileEntryRelatedSearchResult.getModel();
AssetRendererFactory> assetRendererFactory = AssetRendererFactoryRegistryUtil.getAssetRendererFactoryByClassName(DLFileEntry.class.getName());
AssetRenderer> assetRenderer = assetRendererFactory.getAssetRenderer(fileEntry.getFileEntryId());
summary = fileEntryRelatedSearchResult.getSummary();
summary.setHighlight(wikiPortletInstanceSettingsHelper.isEnableHighlighting());
summary.setQueryTerms(hits.getQueryTerms());
%>
<%
}
%>
<%
List> commentRelatedSearchResults = searchResult.getCommentRelatedSearchResults();
%>
<%
for (RelatedSearchResult commentRelatedSearchResult : commentRelatedSearchResults) {
Comment comment = commentRelatedSearchResult.getModel();
User userDisplay = comment.getUser();
summary = commentRelatedSearchResult.getSummary();
summary.setHighlight(wikiPortletInstanceSettingsHelper.isEnableHighlighting());
summary.setQueryTerms(hits.getQueryTerms());
%>
<%= summary.getHighlightedContent() %>
<%
}
%>