001    /**
002     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.comment.display.context;
016    
017    import com.liferay.portal.kernel.comment.Discussion;
018    import com.liferay.portal.kernel.comment.DiscussionComment;
019    import com.liferay.portal.kernel.comment.DiscussionPermission;
020    import com.liferay.portal.kernel.comment.display.context.CommentSectionDisplayContext;
021    import com.liferay.portal.kernel.comment.display.context.CommentTreeDisplayContext;
022    
023    import javax.servlet.http.HttpServletRequest;
024    import javax.servlet.http.HttpServletResponse;
025    
026    /**
027     * @author Adolfo P??rez
028     */
029    public class CommentDisplayContextProviderUtil {
030    
031            public static CommentSectionDisplayContext getCommentSectionDisplayContext(
032                    HttpServletRequest request, HttpServletResponse response,
033                    DiscussionPermission discussionPermission, Discussion discussion) {
034    
035                    return _commentDisplayContextProvider.getCommentSectionDisplayContext(
036                            request, response, discussionPermission, discussion);
037            }
038    
039            public static CommentTreeDisplayContext getCommentTreeDisplayContext(
040                    HttpServletRequest request, HttpServletResponse response,
041                    DiscussionPermission discussionPermission,
042                    DiscussionComment discussionComment) {
043    
044                    return _commentDisplayContextProvider.getCommentTreeDisplayContext(
045                            request, response, discussionPermission, discussionComment);
046            }
047    
048            private static final CommentDisplayContextProvider
049                    _commentDisplayContextProvider =
050                            new CommentDisplayContextProviderImpl();
051    
052    }