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