001    /**
002     * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.kernel.workflow;
016    
017    import com.liferay.portal.kernel.security.pacl.permission.PortalRuntimePermission;
018    import com.liferay.portal.kernel.util.OrderByComparator;
019    
020    import java.util.List;
021    
022    /**
023     * @author Micha Kiener
024     * @author Shuyang Zhou
025     * @author Brian Wing Shun Chan
026     * @author Raymond Augé
027     */
028    public class WorkflowLogManagerUtil {
029    
030            public static int getWorkflowLogCountByWorkflowInstance(
031                            long companyId, long workflowInstanceId, List<Integer> logTypes)
032                    throws WorkflowException {
033    
034                    return getWorkflowLogManager().getWorkflowLogCountByWorkflowInstance(
035                            companyId, workflowInstanceId, logTypes);
036            }
037    
038            public static int getWorkflowLogCountByWorkflowTask(
039                            long companyId, long workflowTaskId, List<Integer> logTypes)
040                    throws WorkflowException {
041    
042                    return getWorkflowLogManager().getWorkflowLogCountByWorkflowTask(
043                            companyId, workflowTaskId, logTypes);
044            }
045    
046            public static WorkflowLogManager getWorkflowLogManager() {
047                    PortalRuntimePermission.checkGetBeanProperty(
048                            WorkflowLogManagerUtil.class);
049    
050                    return _workflowLogManager;
051            }
052    
053            public static List<WorkflowLog> getWorkflowLogsByWorkflowInstance(
054                            long companyId, long workflowInstanceId, List<Integer> logTypes,
055                            int start, int end, OrderByComparator orderByComparator)
056                    throws WorkflowException {
057    
058                    return getWorkflowLogManager().getWorkflowLogsByWorkflowInstance(
059                            companyId, workflowInstanceId, logTypes, start, end,
060                            orderByComparator);
061            }
062    
063            public static List<WorkflowLog> getWorkflowLogsByWorkflowTask(
064                            long companyId, long workflowTaskId, List<Integer> logTypes,
065                            int start, int end, OrderByComparator orderByComparator)
066                    throws WorkflowException {
067    
068                    return getWorkflowLogManager().getWorkflowLogsByWorkflowTask(
069                            companyId, workflowTaskId, logTypes, start, end, orderByComparator);
070            }
071    
072            public void setWorkflowLogManager(WorkflowLogManager workflowLogManager) {
073                    PortalRuntimePermission.checkSetBeanProperty(getClass());
074    
075                    _workflowLogManager = workflowLogManager;
076            }
077    
078            private static WorkflowLogManager _workflowLogManager;
079    
080    }