001    /**
002     * Copyright (c) 2000-2013 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.exception.PortalException;
018    import com.liferay.portal.kernel.exception.SystemException;
019    import com.liferay.portal.kernel.portlet.LiferayPortletRequest;
020    import com.liferay.portal.kernel.portlet.LiferayPortletResponse;
021    import com.liferay.portal.model.WorkflowDefinitionLink;
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    import javax.portlet.RenderRequest;
034    import javax.portlet.RenderResponse;
035    
036    /**
037     * @author Bruno Farache
038     * @author Macerllus Tavares
039     * @author Juan Fern??ndez
040     * @author Julio Camarero
041     */
042    public interface WorkflowHandler {
043    
044            public AssetRenderer getAssetRenderer(long classPK)
045                    throws PortalException, SystemException;
046    
047            public AssetRendererFactory getAssetRendererFactory();
048    
049            public String getClassName();
050    
051            public String getIconPath(LiferayPortletRequest liferayPortletRequest);
052    
053            /**
054             * @deprecated As of 7.0.0, replaced by {@link #getSummary(long,
055             *             PortletRequest, PortletResponse)}
056             */
057            @Deprecated
058            public String getSummary(long classPK, Locale locale);
059    
060            public String getSummary(
061                    long classPK, PortletRequest portletRequest,
062                    PortletResponse portletResponse);
063    
064            public String getTitle(long classPK, Locale locale);
065    
066            public String getType(Locale locale);
067    
068            public PortletURL getURLEdit(
069                    long classPK, LiferayPortletRequest liferayPortletRequest,
070                    LiferayPortletResponse liferayPortletResponse);
071    
072            public String getURLViewInContext(
073                    long classPK, LiferayPortletRequest liferayPortletRequest,
074                    LiferayPortletResponse liferayPortletResponse,
075                    String noSuchEntryRedirect);
076    
077            public WorkflowDefinitionLink getWorkflowDefinitionLink(
078                            long companyId, long groupId, long classPK)
079                    throws PortalException, SystemException;
080    
081            public boolean isAssetTypeSearchable();
082    
083            public boolean isScopeable();
084    
085            public boolean isVisible();
086    
087            public String render(
088                    long classPK, RenderRequest renderRequest,
089                    RenderResponse renderResponse, String template);
090    
091            public void startWorkflowInstance(
092                            long companyId, long groupId, long userId, long classPK,
093                            Object model, Map<String, Serializable> workflowContext)
094                    throws PortalException, SystemException;
095    
096            public Object updateStatus(
097                            int status, Map<String, Serializable> workflowContext)
098                    throws PortalException, SystemException;
099    
100    }