001    /**
002     * Copyright (c) 2000-2013 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, 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    }