private Criteria criteriaPerfilturnoTableContent(HttpServletRequest request, Criteria c) throws IOException, ServletException { String param = ""; param = WebUtils.getStringParam(request, new PerfilesHelper().getIdperfilName()); if (param != null) TorqueUtils.addEqualCriteria(c, PerfilturnoPeer.IDPERFIL, param); param = WebUtils.getStringParam(request, new TurnosHelper().getIdturnoName()); if (param != null) TorqueUtils.addEqualCriteria(c, PerfilturnoPeer.IDTURNO, param); String paramSortCol = WebUtils.getStringParam(request, "sort_col"); String paramSortDir = WebUtils.getStringParam(request, "sort_dir"); int paramFiltro = WebUtils.getintParam(request, "filtro"); c = ordenacion(c, paramSortCol, paramSortDir); c = filtro(c, paramFiltro); return c; }
public void servicePerfilturnoTableContentPdf( HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { utf8RequestService(request); Criteria c = new Criteria(); String paramQuery = WebUtils.getStringParam(request, "query"); if ((paramQuery != null) && (paramQuery.compareTo("") != 0)) c = PerfilturnoManager.buildSearchCriteria(paramQuery); c = criteriaPerfilturnoTableContent(request, c); PerfilturnoGroupBean tgb = PerfilturnoManager.getPerfilturnos(c); String[] methodos = new String[] { PerfilturnoHelper.IDPERFIL_GET_METHOD_NAME + "PerfilturnoParsed", PerfilturnoHelper.IDTURNO_GET_METHOD_NAME + "PerfilturnoParsed", PerfilturnoHelper.VALORCOSTE_GET_METHOD_NAME + "PerfilturnoParsed" }; byte[] content = PdfUtils.getBytes( replaceStringBuffer(tgb.buildXml(methodos, null, "ISO-8859-1"), "n/a", " "), perfilturnos_transformer, "ISO-8859-1"); response.addHeader("content-disposition", "attachment;filename=ListaPerfilturno.pdf"); response.setContentType("application/pdf"); response.setHeader("Cache-Control", ""); // para que funcione en IE response.setContentLength(content.length); response.getOutputStream().write(content); response.getOutputStream().flush(); response.getOutputStream().close(); }
public void servicePerfilturnoUlContent(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { utf8RequestService(request); String[] methodos = new String[] {"getULContentPerfilturnoParsed"}; String param = WebUtils.getStringParam(request, "value"); PerfilturnoGroupBean mgb = PerfilturnoManager.getPerfilturnos(PerfilturnoManager.buildSearchCriteria(param)); simpleResponseService( response, AjaxUtils.buildAjaxULContentFromListObj( mgb.getAlmacen(), methodos, PerfilturnoHelper.COMPLEX_ID_GET_METHOD, "Perfilturno")); }
public static Trabajador createObj(HttpServletRequest req) throws TorqueException { Trabajador o = BaseTrabajadorHelper.getTrabajador(req); o.setId(WebUtils.getintParam(req, getIdName(o))); o.setNumero(WebUtils.getStringParam(req, getNumeroName(o))); o.setFechaAlta(WebUtils.getStringParam(req, getFechaAltaName(o))); o.setFechaBaja(WebUtils.getStringParam(req, getFechaBajaName(o))); o.setObs(WebUtils.getStringParam(req, getObsName(o))); o.setNombre(WebUtils.getStringParam(req, getNombreName(o))); o.setApellidos(WebUtils.getStringParam(req, getApellidosName(o))); o.setApellidosDos(WebUtils.getStringParam(req, getApellidosDosName(o))); o.setCif(WebUtils.getStringParam(req, getCifName(o))); o.setCosteHora(WebUtils.getdoubleParam(req, getCosteHoraName(o))); o.setDireccion(WebUtils.getStringParam(req, getDireccionName(o))); o.setLocalidadId( Integer.parseInt( FormatUtils.getFkIdFromString(WebUtils.getStringParam(req, getLocalidadIdName(o))))); o.setCp(WebUtils.getStringParam(req, getCpName(o))); o.setTlfno(WebUtils.getStringParam(req, getTlfnoName(o))); o.setMovil(WebUtils.getStringParam(req, getMovilName(o))); o.setEmail(WebUtils.getStringParam(req, getEmailName(o))); o.setCategoriaId( Integer.parseInt( FormatUtils.getFkIdFromString(WebUtils.getStringParam(req, getCategoriaIdName(o))))); return o; }