Unable to search expired web content in the control panelUnable to search expired web content in the control panelhttps://liferay.dev/en/c/message_boards/find_thread?p_l_id=119785333&threadId=1204101912024-03-29T07:10:19Z2024-03-29T07:10:19ZRE: Unable to search expired web content in the control panelRussell Bohlhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1204240042020-11-10T16:44:20Z2020-11-10T16:43:37Z<p>A bug was filed here: <a href="https://issues.liferay.com/browse/LPS-123299">https://issues.liferay.com/browse/LPS-123299</a></p>Russell Bohl2020-11-10T16:43:37ZRE: RE: Unable to search expired web content in the control panelRussell Bohlhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1204238822020-11-10T14:54:09Z2020-11-10T14:54:09Z<p>Thanks for the report: I've shared your post and my attached GIF
internally with the team who works on Web Content, and they're looking
into it further.</p>
<p> </p>
<p>
<img src="/documents/14/120368684/expired-web-content_search.gif/32394699-1dbf-c33f-2c31-acdc09156e65?t=1605020035298&imagePreview=1" /></p>
<p> </p>Russell Bohl2020-11-10T14:54:09ZRE: Unable to search expired web content in the control panelDarryl Kpizinguihttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1204214372020-11-09T08:56:46Z2020-11-09T08:56:46Z<html><head></head><body><p>Hi,</p>
<p>I was able to create my override
of com.liferay.journal.web-4.0.21.jar. Now I can search and see my
expired contents</p>
<p>I also find that there might be a flaw in the implementation of the
method <b>JournalDisplayContext.buildSearchContext(...)</b></p>
<pre><code class="language-java">protected SearchContext buildSearchContext(int start, int end, boolean showVersions) {
SearchContext searchContext = new SearchContext();
searchContext.setAndSearch(false);
searchContext.setAttribute("head", Boolean.TRUE);
searchContext.setAttribute("latest", Boolean.TRUE);
LinkedHashMap&lt;String, Object&gt; params;
params = LinkedHashMapBuilder.&lt;String, Object&gt;put(
"expandoAttributes", getKeywords()
).put(
"keywords", getKeywords()
).build();
searchContext.setAttribute("params", params);
if (!showVersions) {
searchContext.setAttribute("showNonindexable", Boolean.TRUE);
}
//Flaw??? searchContext.setAttributes replace all the previous attributes
searchContext.setAttributes(
HashMapBuilder.&lt;String, Serializable&gt;put(Field.ARTICLE_ID, getKeywords())
.put(Field.CLASS_NAME_ID, JournalArticleConstants.CLASS_NAME_ID_DEFAULT)
.put(Field.CONTENT, getKeywords())
.put(Field.DESCRIPTION, getKeywords())
.put(Field.STATUS, getStatus())
.put(Field.TITLE, getKeywords())
.put("params", params)
.build());
//..
}</code></pre>
<p> </p></body></html>Darryl Kpizingui2020-11-09T08:56:46ZUnable to search expired web content in the control panelDarryl Kpizinguihttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1204101902020-11-08T12:17:49Z2020-11-08T12:17:49Z<html><head></head><body><p>Hi,</p>
<p>I did a migration from Liferay 6.2 to 7.3. The migration went well. I
realised that it not not possible in Liferay 7.3 to search for expired
or deprecated web content in the administration.</p>
<p>No web content is shown when a text is put in the search bar and the
filter "With with expired version" is selected.</p>
<p>Also the search is not working when the filter "Mine",
"Recent" or "Structure" is selected. As the
keyword typed in the search bar is not used to fetch the contents. I
can find that code in the class <strong>JournalDisplayContext.java in
the project Journal-Web.</strong></p>
<pre><code class="language-java"> private SearchContainer _getArticlesSearchContainer() throws PortalException {
if (isNavigationMine() || isNavigationRecent()) {
//Search keyword is not used here
List results = JournalArticleServiceUtil.getGroupArticles(
_themeDisplay.getScopeGroupId(), _themeDisplay.getUserId(),
getFolderId(), getStatus(), includeOwner,
articleSearchContainer.getStart(),
articleSearchContainer.getEnd(),
articleSearchContainer.getOrderByComparator());
articleSearchContainer.setResults(results);
}
else if (Validator.isNotNull(getDDMStructureKey())) {
//Search keyword is not used here
List results = JournalArticleServiceUtil.getArticlesByStructureId(
_themeDisplay.getScopeGroupId(), getDDMStructureKey(),
getStatus(), articleSearchContainer.getStart(),
articleSearchContainer.getEnd(),
articleSearchContainer.getOrderByComparator());
articleSearchContainer.setResults(results);
}
else if (isSearch()) {
Indexer indexer = JournalSearcher.getInstance();
/*
* Here the Keyword is used for the search, but no expired content is retrieved
*/
SearchContext searchContext = buildSearchContext(
folderIds, articleSearchContainer.getStart(),
articleSearchContainer.getEnd(), sort, false);
Hits hits = indexer.search(searchContext);
}
else {
//Default when no keyworkd is used
List results = JournalFolderServiceUtil.getFoldersAndArticles(
_themeDisplay.getScopeGroupId(), 0, getFolderId(), getStatus(),
_themeDisplay.getLocale(), articleSearchContainer.getStart(),
articleSearchContainer.getEnd(), folderOrderByComparator);
articleSearchContainer.setResults(results);
}
//...
}
</code></pre>
<p> </p>
<p>Do you know if is there a way I can eaily search for deprecated or
expired web content? I was n