package com.ejie.ab63.service.plantillas;

import java.util.List;

import com.ejie.ab63.clientesWS.ab61WebService.Ab61Exception;
import com.ejie.ab63.model.plantillas.Plantillas;
import com.ejie.x38.dto.JQGridRequestDto;
import com.ejie.x38.dto.JQGridResponseDto;
import com.ejie.x38.dto.JerarquiaDto;
import com.ejie.x38.dto.TableRowDto;

/**
 * PlantillasService  
 * 
 *  
 */

public interface PlantillasService {

	/**
	 * Finds a single row in the Plantillas table.
	 *
	 * @param plantillas
	 *            Plantillas
	 * @return Plantillas
	 */
	Plantillas find(Plantillas plantillas);

	/**
	 * Deletes a single row in the Plantillas table.
	 *
	 * @param plantillas
	 *            Plantillas
	 */
	void remove(Plantillas plantillas);

	/**
	 * Finds a list of rows in the Plantillas table.
	 *
	 * @param plantillas
	 *            Plantillas
	 * @param jqGridRequestDto
	 *            JQGridRequestDto
	 * @return List<Plantillas>
	 */
	List<Plantillas> findAll(Plantillas plantillas, JQGridRequestDto jqGridRequestDto);

	/**
	 * Finds rows in the Plantillas table using like.
	 *
	 * @param plantillas
	 *            Plantillas
	 * @param jqGridRequestDto
	 *            JQGridRequestDto
	 * @param startsWith
	 *            Boolean
	 * @return List<Plantillas>
	 */
	List<Plantillas> findAllLike(Plantillas plantillas, JQGridRequestDto jqGridRequestDto, Boolean startsWith);

	/*
	 * OPERACIONES RUP_TABLE
	 */

	/**
	 * Removes rows from the Plantillas table.
	 *
	 * @param filterPlantillas
	 *            Plantillas
	 * @param jqGridRequestDto
	 *            JQGridRequestDto
	 * @param startsWith
	 *            Boolean
	 */
	void removeMultiple(Plantillas filterPlantillas, JQGridRequestDto jqGridRequestDto, Boolean startsWith);

	/**
	 * Filter method in the Plantillas table.
	 *
	 * @param filterPlantillas
	 *            Plantillas
	 * @param jqGridRequestDto
	 *            JQGridRequestDto
	 * @param startsWith
	 *            Boolean
	 * @return JQGridResponseDto<Plantillas>
	 */
	JQGridResponseDto<Plantillas> filter(Plantillas filterPlantillas, JQGridRequestDto jqGridRequestDto,
			Boolean startsWith);

	/**
	 * Searches rows in the Plantillas table.
	 *
	 * @param filterPlantillas
	 *            Plantillas
	 * @param searchPlantillas
	 *            Plantillas
	 * @param jqGridRequestDto
	 *            JQGridRequestDto
	 * @param startsWith
	 *            Boolean
	 * @return List<TableRowDto<Plantillas>>
	 */
	List<TableRowDto<Plantillas>> search(Plantillas filterPlantillas, Plantillas searchPlantillas,
			JQGridRequestDto jqGridRequestDto, Boolean startsWith);

	/**
	 * Reorder the selection made in Plantillas table.
	 *
	 * @param filterPlantillas
	 *            Plantillas
	 * @param jqGridRequestDto
	 *            JQGridRequestDto
	 * @param startsWith
	 *            Boolean
	 * @return Object
	 */
	Object reorderSelection(Plantillas filterPlantillas, JQGridRequestDto jqGridRequestDto, Boolean startsWith);

	/*
	 * OPERACIONES RUP_TABLE JERARQUIA
	 */

	/**
	 * Finder method in the hierarchical the Plantillas table.
	 *
	 * @param filterPlantillas
	 *            Plantillas
	 * @param jqGridRequestDto
	 *            JQGridRequestDto
	 * @param startsWith
	 *            Boolean
	 * @return JQGridResponseDto<JerarquiaDto<Plantillas>>
	 */
	JQGridResponseDto<JerarquiaDto<Plantillas>> jerarquia(Plantillas filterPlantillas,
			JQGridRequestDto jqGridRequestDto, Boolean startsWith);

	/**
	 * Finder method for siblings rows in the hierarchical the Plantillas table.
	 *
	 * @param filterPlantillas
	 *            Plantillas
	 * @param jqGridRequestDto
	 *            JQGridRequestDto
	 * @return JQGridResponseDto<JerarquiaDto<Plantillas>>
	 */
	JQGridResponseDto<JerarquiaDto<Plantillas>> jerarquiaChildren(Plantillas filterPlantillas,
			JQGridRequestDto jqGridRequestDto);

	/**
	 * llama al webService que realiza la tarea indicada
	 * 
	 * @param idPlantilla
	 *            Integer
	 * @param procedureId
	 *            String
	 * @param folderId
	 *            String
	 * @param n38Login
	 *            String
	 * @return String
	 * @throws Ab61Exception
	 */
	public String aportarDocumento(Integer idPlantilla, String procedureId, String folderId, String n38Login,
			String usuario) throws Ab61Exception;
}
