META-INF.resources.subscribe.jsp 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
*/
--%>
<%@ include file="/init.jsp" %>
<%
JournalArticle article = (JournalArticle)request.getAttribute("info_panel.jsp-entry");
JournalFolder folder = (JournalFolder)request.getAttribute("info_panel.jsp-folder");
long folderId = JournalFolderConstants.DEFAULT_PARENT_FOLDER_ID;
if (folder != null) {
folderId = folder.getFolderId();
}
long ddmStructureId = ParamUtil.getLong(request, "ddmStructureId");
String subscribeActionName = StringPool.BLANK;
String unsubscribeActionName = StringPool.BLANK;
%>
<%
boolean subscribed = false;
boolean unsubscribable = true;
if (ddmStructureId > 0) {
subscribed = JournalUtil.isSubscribedToStructure(themeDisplay.getCompanyId(), scopeGroupId, user.getUserId(), ddmStructureId);
subscribeActionName = "/journal/subscribe_ddm_structure";
unsubscribeActionName = "/journal/unsubscribe_ddm_structure";
}
else if ((ddmStructureId <= 0) && (article != null)) {
subscribed = JournalUtil.isSubscribedToArticle(themeDisplay.getCompanyId(), scopeGroupId, user.getUserId(), article.getResourcePrimKey());
subscribeActionName = "/journal/subscribe_article";
unsubscribeActionName = "/journal/unsubscribe_article";
}
else {
subscribed = JournalUtil.isSubscribedToFolder(themeDisplay.getCompanyId(), scopeGroupId, user.getUserId(), folderId);
if (subscribed && !JournalUtil.isSubscribedToFolder(themeDisplay.getCompanyId(), scopeGroupId, user.getUserId(), folderId, false)) {
unsubscribable = false;
}
subscribeActionName = "/journal/subscribe_folder";
unsubscribeActionName = "/journal/unsubscribe_folder";
}
%>
© 2015 - 2024 Weber Informatics LLC | Privacy Policy