Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lps 72873 #49420

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -29,7 +29,7 @@
import com.liferay.exportimport.kernel.lar.StagedModelModifiedDateComparator;
import com.liferay.friendly.url.model.FriendlyURLEntry;
import com.liferay.friendly.url.service.FriendlyURLEntryLocalService;
import com.liferay.portal.kernel.comment.CommentManagerUtil;
import com.liferay.portal.kernel.comment.CommentManager;
import com.liferay.portal.kernel.comment.DiscussionStagingHandler;
import com.liferay.portal.kernel.dao.orm.QueryUtil;
import com.liferay.portal.kernel.exception.PortalException;
Expand Down Expand Up @@ -446,7 +446,7 @@ protected void importReferenceStagedModels(
}

DiscussionStagingHandler discussionStagingHandler =
CommentManagerUtil.getDiscussionStagingHandler();
_commentManager.getDiscussionStagingHandler();

String stagedModelClassName = null;

Expand Down Expand Up @@ -614,6 +614,10 @@ private void _importFriendlyURLEntries(
BlogsEntryStagedModelDataHandler.class);

private BlogsEntryLocalService _blogsEntryLocalService;

@Reference
private CommentManager _commentManager;

private ExportImportContentProcessor<String> _exportImportContentProcessor;
private FriendlyURLEntryLocalService _friendlyURLEntryLocalService;
private ImageLocalService _imageLocalService;
Expand Down
Expand Up @@ -23,7 +23,7 @@
import com.liferay.exportimport.kernel.lar.PortletDataHandlerControl;
import com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil;
import com.liferay.exportimport.kernel.lar.StagedModelType;
import com.liferay.portal.kernel.comment.CommentManagerUtil;
import com.liferay.portal.kernel.comment.CommentManager;
import com.liferay.portal.kernel.comment.DiscussionStagingHandler;
import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery;
import com.liferay.portal.kernel.exception.PortalException;
Expand All @@ -38,6 +38,7 @@

import org.osgi.service.component.annotations.Activate;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Reference;

/**
* @author Gergely Mathe
Expand All @@ -56,7 +57,7 @@ public class PageCommentsPortletDataHandler extends BasePortletDataHandler {
@Override
public StagedModelType[] getDeletionSystemEventStagedModelTypes() {
DiscussionStagingHandler discussionStagingHandler =
CommentManagerUtil.getDiscussionStagingHandler();
_commentManager.getDiscussionStagingHandler();

if (discussionStagingHandler == null) {
return new StagedModelType[0];
Expand All @@ -74,7 +75,7 @@ public StagedModelType[] getDeletionSystemEventStagedModelTypes() {
@Override
public PortletDataHandlerControl[] getExportControls() {
DiscussionStagingHandler discussionStagingHandler =
CommentManagerUtil.getDiscussionStagingHandler();
_commentManager.getDiscussionStagingHandler();

if (discussionStagingHandler == null) {
return new PortletDataHandlerControl[0];
Expand Down Expand Up @@ -117,7 +118,7 @@ protected PortletPreferences doDeleteData(
return portletPreferences;
}

CommentManagerUtil.deleteGroupComments(
_commentManager.deleteGroupComments(
portletDataContext.getScopeGroupId());

return portletPreferences;
Expand All @@ -130,7 +131,7 @@ protected String doExportData(
throws Exception {

DiscussionStagingHandler discussionStagingHandler =
CommentManagerUtil.getDiscussionStagingHandler();
_commentManager.getDiscussionStagingHandler();

if (discussionStagingHandler == null) {
return StringPool.BLANK;
Expand Down Expand Up @@ -161,7 +162,7 @@ protected PortletPreferences doImportData(
throws Exception {

ExportImportProcessCallbackRegistryUtil.registerCallback(
new ImportCommentsCallable(portletDataContext));
new ImportCommentsCallable(_commentManager, portletDataContext));

return null;
}
Expand All @@ -173,7 +174,7 @@ protected void doPrepareManifestSummary(
throws Exception {

DiscussionStagingHandler discussionStagingHandler =
CommentManagerUtil.getDiscussionStagingHandler();
_commentManager.getDiscussionStagingHandler();

if (discussionStagingHandler == null) {
return;
Expand All @@ -186,16 +187,23 @@ protected void doPrepareManifestSummary(
actionableDynamicQuery.performCount();
}

@Reference
private CommentManager _commentManager;

private static class ImportCommentsCallable implements Callable<Void> {

public ImportCommentsCallable(PortletDataContext portletDataContext) {
public ImportCommentsCallable(
CommentManager commentManager,
PortletDataContext portletDataContext) {

_commentManager = commentManager;
_portletDataContext = portletDataContext;
}

@Override
public Void call() throws PortalException {
DiscussionStagingHandler discussionStagingHandler =
CommentManagerUtil.getDiscussionStagingHandler();
_commentManager.getDiscussionStagingHandler();

if (discussionStagingHandler == null) {
return null;
Expand Down Expand Up @@ -224,6 +232,7 @@ public Void call() throws PortalException {
return null;
}

private final CommentManager _commentManager;
private final PortletDataContext _portletDataContext;

}
Expand Down
Expand Up @@ -19,7 +19,7 @@
import com.liferay.message.boards.kernel.exception.NoSuchMessageException;
import com.liferay.message.boards.kernel.exception.RequiredMessageException;
import com.liferay.portal.kernel.comment.Comment;
import com.liferay.portal.kernel.comment.CommentManagerUtil;
import com.liferay.portal.kernel.comment.CommentManager;
import com.liferay.portal.kernel.comment.DiscussionPermission;
import com.liferay.portal.kernel.json.JSONFactoryUtil;
import com.liferay.portal.kernel.json.JSONObject;
Expand Down Expand Up @@ -135,7 +135,7 @@ protected void deleteComment(HttpServletRequest request) throws Exception {

discussionPermission.checkDeletePermission(commentId);

CommentManagerUtil.deleteComment(commentId);
_commentManager.deleteComment(commentId);
}

@Reference(unbind = "-")
Expand All @@ -154,12 +154,12 @@ protected void subscribeToComments(
long classPK = ParamUtil.getLong(request, "classPK");

if (subscribe) {
CommentManagerUtil.subscribeDiscussion(
_commentManager.subscribeDiscussion(
themeDisplay.getUserId(), themeDisplay.getScopeGroupId(),
className, classPK);
}
else {
CommentManagerUtil.unsubscribeDiscussion(
_commentManager.unsubscribeDiscussion(
themeDisplay.getUserId(), className, classPK);
}
}
Expand Down Expand Up @@ -214,7 +214,7 @@ protected long updateComment(HttpServletRequest request) throws Exception {
themeDisplay.getCompanyId(), themeDisplay.getScopeGroupId(),
className, classPK);

commentId = CommentManagerUtil.addComment(
commentId = _commentManager.addComment(
user.getUserId(), className, classPK, user.getFullName(),
parentCommentId, subject, body, serviceContextFunction);
}
Expand All @@ -227,7 +227,7 @@ protected long updateComment(HttpServletRequest request) throws Exception {
// Update message

if (Validator.isNull(className) || (classPK == 0)) {
Comment comment = CommentManagerUtil.fetchComment(commentId);
Comment comment = _commentManager.fetchComment(commentId);

if (comment != null) {
className = comment.getClassName();
Expand All @@ -237,7 +237,7 @@ protected long updateComment(HttpServletRequest request) throws Exception {

discussionPermission.checkUpdatePermission(commentId);

commentId = CommentManagerUtil.updateComment(
commentId = _commentManager.updateComment(
themeDisplay.getUserId(), className, classPK, commentId,
subject, body, serviceContextFunction);
}
Expand All @@ -247,7 +247,7 @@ protected long updateComment(HttpServletRequest request) throws Exception {
boolean subscribe = ParamUtil.getBoolean(request, "subscribe");

if (subscribe) {
CommentManagerUtil.subscribeDiscussion(
_commentManager.subscribeDiscussion(
themeDisplay.getUserId(), themeDisplay.getScopeGroupId(),
className, classPK);
}
Expand All @@ -272,7 +272,7 @@ private DiscussionPermission _getDiscussionPermission(
throws PrincipalException {

DiscussionPermission discussionPermission =
CommentManagerUtil.getDiscussionPermission(
_commentManager.getDiscussionPermission(
themeDisplay.getPermissionChecker());

if (discussionPermission == null) {
Expand All @@ -282,6 +282,9 @@ private DiscussionPermission _getDiscussionPermission(
return discussionPermission;
}

@Reference
private CommentManager _commentManager;

@Reference
private Portal _portal;

Expand Down
Expand Up @@ -20,7 +20,7 @@
import com.liferay.comment.web.constants.CommentPortletKeys;
import com.liferay.portal.kernel.comment.Comment;
import com.liferay.portal.kernel.comment.CommentConstants;
import com.liferay.portal.kernel.comment.CommentManagerUtil;
import com.liferay.portal.kernel.comment.CommentManager;
import com.liferay.portal.kernel.comment.DiscussionPermission;
import com.liferay.portal.kernel.comment.WorkflowableComment;
import com.liferay.portal.kernel.exception.PortalException;
Expand Down Expand Up @@ -63,7 +63,7 @@ public AssetRenderer<WorkflowableComment> getAssetRenderer(
long classPK, int type)
throws PortalException {

Comment comment = CommentManagerUtil.fetchComment(classPK);
Comment comment = _commentManager.fetchComment(classPK);

if (!(comment instanceof WorkflowableComment)) {
return null;
Expand Down Expand Up @@ -114,7 +114,7 @@ public boolean hasPermission(
throws Exception {

DiscussionPermission discussionPermission =
CommentManagerUtil.getDiscussionPermission(permissionChecker);
_commentManager.getDiscussionPermission(permissionChecker);

return discussionPermission.hasPermission(classPK, actionId);
}
Expand All @@ -133,6 +133,9 @@ protected void setServletContext(ServletContext servletContext) {

private static final boolean _SELECTABLE = false;

@Reference
private CommentManager _commentManager;

private ServletContext _servletContext;

}
Expand Up @@ -16,7 +16,7 @@

import com.liferay.comment.web.constants.CommentPortletKeys;
import com.liferay.portal.kernel.comment.Comment;
import com.liferay.portal.kernel.comment.CommentManagerUtil;
import com.liferay.portal.kernel.comment.CommentManager;
import com.liferay.portal.kernel.portlet.bridges.mvc.MVCRenderCommand;
import com.liferay.portal.kernel.util.ParamUtil;
import com.liferay.portal.kernel.util.WebKeys;
Expand All @@ -26,6 +26,7 @@
import javax.portlet.RenderResponse;

import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Reference;

/**
* @author Lino Alves
Expand All @@ -46,11 +47,14 @@ public String render(

long commentId = ParamUtil.getLong(renderRequest, "commentId");

Comment comment = CommentManagerUtil.fetchComment(commentId);
Comment comment = _commentManager.fetchComment(commentId);

renderRequest.setAttribute(WebKeys.COMMENT, comment);

return "/edit_discussion.jsp";
}

@Reference
private CommentManager _commentManager;

}
4 changes: 2 additions & 2 deletions modules/apps/collaboration/document-library/.gitrepo
Expand Up @@ -4,8 +4,8 @@
[subrepo]
autopull = false
cmdver = liferay
commit = 62bbc72e9d9e8b76f72c091d32b32f7953fedf52
commit = 5831ff01180821b585c4ce40e787fc4deb855269
mergebuttonmergecommits = false
mode = push
parent = 828466a92bd177bfdbe0236fd6c0c52a902db24d
parent = 84bc1f079b8508b250cb091eb3c66edadfeeb0b4
remote = git@github.com:liferay/com-liferay-document-library.git
4 changes: 2 additions & 2 deletions modules/apps/collaboration/wiki/.gitrepo
Expand Up @@ -4,8 +4,8 @@
[subrepo]
autopull = false
cmdver = liferay
commit = 4e524cb9d2aef6ddbfaf80a5c551b43428f2592e
commit = f2df0065146539252b82142ced93a9b1cc53a37e
mergebuttonmergecommits = false
mode = push
parent = ea67a90abace7c7b500a4d16ec1dbcbb43b09c4a
parent = ec4321aca773fe9b073a6279e6ff00a81c785754
remote = git@github.com:liferay/com-liferay-wiki.git
4 changes: 2 additions & 2 deletions modules/apps/foundation/configuration-admin/.gitrepo
Expand Up @@ -4,8 +4,8 @@
[subrepo]
autopull = false
cmdver = liferay
commit = bd274eabfeb2868491e6dc6307656c9e4bd56faa
commit = 52d42caa9f2885537c99a802ff5e0a436d16436f
mergebuttonmergecommits = false
mode = push
parent = 14fb867929a5164a9111861735fbd50fe01fdb67
parent = d6dee14277b5c747afd97fc6425eb899464f828b
remote = git@github.com:liferay/com-liferay-configuration-admin.git
4 changes: 2 additions & 2 deletions modules/apps/foundation/frontend-css/.gitrepo
Expand Up @@ -4,8 +4,8 @@
[subrepo]
autopull = false
cmdver = liferay
commit = 74e1ae27d2ee9f13b7dc751eace7ec97db02fb3c
commit = b8bf21d316cd1fa300934de1d03b0ed44f94db9d
mergebuttonmergecommits = false
mode = push
parent = f59325b0734405d50724ffe75c15955f8f251810
parent = e84073e093becf6b6b8668d81744c05b7c35a763
remote = git@github.com:liferay/com-liferay-frontend-css.git
4 changes: 2 additions & 2 deletions modules/apps/foundation/frontend-editor/.gitrepo
Expand Up @@ -4,8 +4,8 @@
[subrepo]
autopull = false
cmdver = liferay
commit = 40740ebe0a32be802978af2ef17d4467fbd100e8
commit = 806dfd3afb05408c89e623337c8801213ccec7ed
mergebuttonmergecommits = false
mode = push
parent = bdaa44470e3c94814bfe4547364e6f7fbc89fbd0
parent = a5b7d6f98ca59aa39d2628e196709c1d5542f040
remote = git@github.com:liferay/com-liferay-frontend-editor.git
4 changes: 2 additions & 2 deletions modules/apps/foundation/frontend-js/.gitrepo
Expand Up @@ -4,8 +4,8 @@
[subrepo]
autopull = false
cmdver = liferay
commit = 23f23980d05daa1f8d471975f7d6aba3f55daf1a
commit = 092a1e92adadd6599859fb13d0bf112354e84052
mergebuttonmergecommits = false
mode = push
parent = 7f4e35b6522a3cdb3305df59edd7efb182c20893
parent = 637b76b9672570fc28b8d655c41710be6ad8d229
remote = git@github.com:liferay/com-liferay-frontend-js.git
4 changes: 2 additions & 2 deletions modules/apps/foundation/users-admin/.gitrepo
Expand Up @@ -4,8 +4,8 @@
[subrepo]
autopull = false
cmdver = liferay
commit = 13f74b6dafce678a7e8ca381d1774946fff0327b
commit = 14346031656b5ab3fda5a843eb985b6cf07cd891
mergebuttonmergecommits = false
mode = push
parent = 55c180d9902a11c2428efc268ebefa6d3ba12cbf
parent = 30da8b05ea7e2367dcd2480912455f8fdf4f8fdb
remote = git@github.com:liferay/com-liferay-users-admin.git
4 changes: 2 additions & 2 deletions modules/apps/web-experience/asset/.gitrepo
Expand Up @@ -4,8 +4,8 @@
[subrepo]
autopull = false
cmdver = liferay
commit = ca6624ce18ebbe6b28e5fc08a1150ee97c2b83d9
commit = a0a51554c05f15358fc6cfd72bbd91bad8218001
mergebuttonmergecommits = false
mode = push
parent = 9d87689d89ed89e17d670a54f0b32f95d3aa3bae
parent = dbab887818f445ef92c9d4acf82ad01bda649fa2
remote = git@github.com:liferay/com-liferay-asset.git