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.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,
056                            OrderByComparator<WorkflowLog> orderByComparator)
057                    throws WorkflowException {
058    
059                    return getWorkflowLogManager().getWorkflowLogsByWorkflowInstance(
060                            companyId, workflowInstanceId, logTypes, start, end,
061                            orderByComparator);
062            }
063    
064            public static List<WorkflowLog> getWorkflowLogsByWorkflowTask(
065                            long companyId, long workflowTaskId, List<Integer> logTypes,
066                            int start, int end,
067                            OrderByComparator<WorkflowLog> orderByComparator)
068                    throws WorkflowException {
069    
070                    return getWorkflowLogManager().getWorkflowLogsByWorkflowTask(
071                            companyId, workflowTaskId, logTypes, start, end, orderByComparator);
072            }
073    
074            public void setWorkflowLogManager(WorkflowLogManager workflowLogManager) {
075                    PortalRuntimePermission.checkSetBeanProperty(getClass());
076    
077                    _workflowLogManager = workflowLogManager;
078            }
079    
080            private static WorkflowLogManager _workflowLogManager;
081    
082    }