1 /* 2 * Copyright (c) 2002-2021, City of Paris 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 9 * 1. Redistributions of source code must retain the above copyright notice 10 * and the following disclaimer. 11 * 12 * 2. Redistributions in binary form must reproduce the above copyright notice 13 * and the following disclaimer in the documentation and/or other materials 14 * provided with the distribution. 15 * 16 * 3. Neither the name of 'Mairie de Paris' nor 'Lutece' nor the names of its 17 * contributors may be used to endorse or promote products derived from 18 * this software without specific prior written permission. 19 * 20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE 24 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 30 * POSSIBILITY OF SUCH DAMAGE. 31 * 32 * License 1.0 33 */ 34 package fr.paris.lutece.plugins.workflowcore.web.task; 35 36 import fr.paris.lutece.plugins.workflowcore.business.task.ITaskType; 37 import fr.paris.lutece.plugins.workflowcore.service.task.ITask; 38 39 import org.springframework.beans.factory.InitializingBean; 40 41 import java.util.Locale; 42 43 import javax.servlet.http.HttpServletRequest; 44 45 /** 46 * 47 * ITaskComponent 48 * 49 */ 50 public interface ITaskComponent extends InitializingBean 51 { 52 /** 53 * Set the task type 54 * 55 * @param taskType 56 * the task type 57 */ 58 void setTaskType( ITaskType taskType ); 59 60 /** 61 * Check if the component is invoked 62 * 63 * @param strKey 64 * the key of the task 65 * @return true if it is invoked, false otherwise 66 */ 67 boolean isInvoked( String strKey ); 68 69 /** 70 * Returns the informations which must be displayed in the tasks form 71 * 72 * @param nIdResource 73 * the resource id 74 * @param strResourceType 75 * the resource type 76 * @param request 77 * request 78 * @param locale 79 * locale 80 * @param task 81 * the task 82 * @return the information which must be displayed in the tasks form 83 */ 84 String getDisplayTaskForm( int nIdResource, String strResourceType, HttpServletRequest request, Locale locale, ITask task ); 85 86 /** 87 * Returns the informations which must be displayed in the task configuration 88 * 89 * @param request 90 * request 91 * @param locale 92 * locale 93 * @param task 94 * the task 95 * @return the information which must be displayed in the task configuration 96 */ 97 String getDisplayConfigForm( HttpServletRequest request, Locale locale, ITask task ); 98 99 /** 100 * Return for a document the informations store during processing task 101 * 102 * @param nIdHistory 103 * the document id 104 * @param request 105 * the request 106 * @param locale 107 * locale 108 * @param task 109 * the task 110 * @return the informations store during processing task 111 */ 112 String getDisplayTaskInformation( int nIdHistory, HttpServletRequest request, Locale locale, ITask task ); 113 114 /** 115 * validates the user input associated to the task 116 * 117 * @param nIdResource 118 * the resource id 119 * @param strResourceType 120 * the resource type 121 * @param request 122 * request 123 * @param locale 124 * locale 125 * @param task 126 * the task 127 * @return null if there is no error in the task form else return the error message url 128 */ 129 String doValidateTask( int nIdResource, String strResourceType, HttpServletRequest request, Locale locale, ITask task ); 130 131 /** 132 * Perform the task configuration 133 * 134 * @param request 135 * request 136 * @param locale 137 * locale 138 * @param task 139 * the task 140 * @return the url to go after perform task configuration 141 */ 142 String doSaveConfig( HttpServletRequest request, Locale locale, ITask task ); 143 }