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.exception.PortalException;
018    import com.liferay.portal.kernel.portlet.LiferayPortletRequest;
019    import com.liferay.portal.kernel.portlet.LiferayPortletResponse;
020    import com.liferay.portal.model.WorkflowDefinitionLink;
021    import com.liferay.portal.service.ServiceContext;
022    import com.liferay.portlet.asset.model.AssetRenderer;
023    import com.liferay.portlet.asset.model.AssetRendererFactory;
024    
025    import java.io.Serializable;
026    
027    import java.util.Locale;
028    import java.util.Map;
029    
030    import javax.portlet.PortletRequest;
031    import javax.portlet.PortletResponse;
032    import javax.portlet.PortletURL;
033    
034    import javax.servlet.http.HttpServletRequest;
035    import javax.servlet.http.HttpServletResponse;
036    
037    /**
038     * @author Bruno Farache
039     * @author Macerllus Tavares
040     * @author Juan Fern??ndez
041     * @author Julio Camarero
042     */
043    public interface WorkflowHandler<T> {
044    
045            public AssetRenderer<T> getAssetRenderer(long classPK)
046                    throws PortalException;
047    
048            public AssetRendererFactory<T> getAssetRendererFactory();
049    
050            public String getClassName();
051    
052            public String getIconCssClass();
053    
054            /**
055             * @deprecated As of 7.0.0, with no direct replacement
056             */
057            @Deprecated
058            public String getIconPath(LiferayPortletRequest liferayPortletRequest);
059    
060            /**
061             * @deprecated As of 7.0.0, replaced by {@link #getSummary(long,
062             *             PortletRequest, PortletResponse)}
063             */
064            @Deprecated
065            public String getSummary(long classPK, Locale locale);
066    
067            public String getSummary(
068                    long classPK, PortletRequest portletRequest,
069                    PortletResponse portletResponse);
070    
071            public String getTitle(long classPK, Locale locale);
072    
073            public String getType(Locale locale);
074    
075            public PortletURL getURLEdit(
076                    long classPK, LiferayPortletRequest liferayPortletRequest,
077                    LiferayPortletResponse liferayPortletResponse);
078    
079            public String getURLEditWorkflowTask(
080                            long workflowTaskId, ServiceContext serviceContext)
081                    throws PortalException;
082    
083            public PortletURL getURLViewDiffs(
084                    long classPK, LiferayPortletRequest liferayPortletRequest,
085                    LiferayPortletResponse liferayPortletResponse);
086    
087            public String getURLViewInContext(
088                    long classPK, LiferayPortletRequest liferayPortletRequest,
089                    LiferayPortletResponse liferayPortletResponse,
090                    String noSuchEntryRedirect);
091    
092            public WorkflowDefinitionLink getWorkflowDefinitionLink(
093                            long companyId, long groupId, long classPK)
094                    throws PortalException;
095    
096            public boolean include(
097                    long classPK, HttpServletRequest request, HttpServletResponse response,
098                    String template);
099    
100            public boolean isAssetTypeSearchable();
101    
102            public boolean isScopeable();
103    
104            public boolean isVisible();
105    
106            public void startWorkflowInstance(
107                            long companyId, long groupId, long userId, long classPK, T model,
108                            Map<String, Serializable> workflowContext)
109                    throws PortalException;
110    
111            public T updateStatus(int status, Map<String, Serializable> workflowContext)
112                    throws PortalException;
113    
114    }