All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.resources.message_boards.view_threads.jspf Maven / Gradle / Ivy

<%--
/**
 * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */
--%>



	<%
	String emptyResultsMessage = null;

	if (mvcRenderCommandName.equals("/message_boards/view_my_subscriptions")) {
		emptyResultsMessage = "you-are-not-subscribed-to-any-threads";
	}
	else {
		emptyResultsMessage = "there-are-no-threads-in-this-category";
	}

	searchContainer.setEmptyResultsMessage(emptyResultsMessage);
	%>

	

		<%
		if (useAssetEntryQuery) {
			AssetEntryQuery assetEntryQuery = new AssetEntryQuery(MBMessage.class.getName(), searchContainer);

			assetEntryQuery.setEnablePermissions(true);
			assetEntryQuery.setExcludeZeroViewCount(false);

			total = AssetEntryServiceUtil.getEntriesCount(assetEntryQuery);

			searchContainer.setTotal(total);

			assetEntryQuery.setEnd(searchContainer.getEnd());
			assetEntryQuery.setStart(searchContainer.getStart());

			results = AssetEntryServiceUtil.getEntries(assetEntryQuery);
		}
		else if (mvcRenderCommandName.equals("/message_boards/view_my_subscriptions")) {
			total = MBThreadServiceUtil.getGroupThreadsCount(scopeGroupId, groupThreadsUserId, WorkflowConstants.STATUS_APPROVED, true);

			searchContainer.setTotal(total);

			results = MBThreadServiceUtil.getGroupThreads(scopeGroupId, groupThreadsUserId, WorkflowConstants.STATUS_APPROVED, true, searchContainer.getStart(), searchContainer.getEnd());
		}

		searchContainer.setResults(results);
		%>

	

	
		<%@ include file="/message_boards/thread_cast_result.jspf" %>

		<%
		MBMessage message = MBMessageLocalServiceUtil.fetchMBMessage(thread.getRootMessageId());

		if (message == null) {
			_log.error("Thread requires missing root message id " + thread.getRootMessageId());

			message = new MBMessageImpl();

			row.setSkip(true);
		}

		message = message.toEscapedModel();

		row.setBold(!MBThreadFlagLocalServiceUtil.hasThreadFlag(themeDisplay.getUserId(), thread));
		row.setRestricted(!MBMessagePermission.contains(permissionChecker, message, ActionKeys.VIEW));
		%>

		
			
			
		

		<%@ include file="/message_boards/user_thread_columns.jspf" %>
	

	




© 2015 - 2025 Weber Informatics LLC | Privacy Policy