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.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.PortletURL;
031    import javax.portlet.RenderRequest;
032    import javax.portlet.RenderResponse;
033    
034    /**
035     * @author Bruno Farache
036     * @author Macerllus Tavares
037     * @author Juan Fern??ndez
038     * @author Julio Camarero
039     */
040    public interface WorkflowHandler {
041    
042            public AssetRenderer getAssetRenderer(long classPK)
043                    throws PortalException, SystemException;
044    
045            public AssetRendererFactory getAssetRendererFactory();
046    
047            public String getClassName();
048    
049            public String getIconPath(LiferayPortletRequest liferayPortletRequest);
050    
051            public String getSummary(long classPK, Locale locale);
052    
053            public String getTitle(long classPK, Locale locale);
054    
055            public String getType(Locale locale);
056    
057            public PortletURL getURLEdit(
058                    long classPK, LiferayPortletRequest liferayPortletRequest,
059                    LiferayPortletResponse liferayPortletResponse);
060    
061            public String getURLViewInContext(
062                    long classPK, LiferayPortletRequest liferayPortletRequest,
063                    LiferayPortletResponse liferayPortletResponse,
064                    String noSuchEntryRedirect);
065    
066            public WorkflowDefinitionLink getWorkflowDefinitionLink(
067                            long companyId, long groupId, long classPK)
068                    throws PortalException, SystemException;
069    
070            public boolean isAssetTypeSearchable();
071    
072            public boolean isScopeable();
073    
074            public boolean isVisible();
075    
076            public String render(
077                    long classPK, RenderRequest renderRequest,
078                    RenderResponse renderResponse, String template);
079    
080            public void startWorkflowInstance(
081                            long companyId, long groupId, long userId, long classPK,
082                            Object model, Map<String, Serializable> workflowContext)
083                    throws PortalException, SystemException;
084    
085            public Object updateStatus(
086                            int status, Map<String, Serializable> workflowContext)
087                    throws PortalException, SystemException;
088    
089    }