Examples of PeticionBO


Examples of es.ua.dccia.negocio.PeticionBO

@WebServlet("/peticion")
public class GetPeticion extends MustacheServlet {

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        PeticionBO pbo = new PeticionBO();
        long id = Long.parseLong(req.getParameter("id"));
        Peticion peticion = pbo.getPeticion(id);
        Map m = new HashMap();
        m.put("peticion", peticion);
        render(m, "peticion", resp);
    }
View Full Code Here

Examples of es.ua.dccia.negocio.PeticionBO

@WebServlet("/index")
public class Index extends MustacheServlet {

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        PeticionBO pbo = new PeticionBO();
        Map m = new HashMap();
        List<Peticion> destacadas = pbo.listarDestacadas(5);
        m.put("destacadas", destacadas);
        render(m, "index", resp);
    }
View Full Code Here

Examples of es.ua.dccia.negocio.PeticionBO

public class PeticionResource {
    @POST
    @Consumes(MediaType.APPLICATION_JSON)
    @RolesAllowed(Tokens.DEFAULT_USER_ROLE)
    public Response crearPeticion(@Valid Peticion peticion, @Context SecurityContext sc, @Context UriInfo uriInfo) {
       long idPeticion = new PeticionBO().crearPeticion(peticion, sc.getUserPrincipal().getName());
       URI uri = uriInfo.getAbsolutePathBuilder().path("{id}").build(idPeticion);   
       return Response.created(uri).build();
    }
View Full Code Here

Examples of es.ua.dccia.negocio.PeticionBO

   
    @Path("{id}")
    @GET
    @Produces(MediaType.APPLICATION_JSON)
    public Peticion getPeticion(@PathParam("id") long id) {
        PeticionBO peticionBO = new PeticionBO();
        Peticion peticion = peticionBO.getPeticion(id);
        if (peticion!=null) {
            peticion.setActualizaciones(null);
            peticion.setFirmas(null);
            peticion.setDestinatarios(null);
            //peticion.setCreador(null);
View Full Code Here

Examples of es.ua.dccia.negocio.PeticionBO

    @Consumes(MediaType.APPLICATION_JSON)
    public Response firmarPeticion(@PathParam("id") long idPeticion, FirmaTO firmaTO, @Context SecurityContext sc, @Context UriInfo uriInfo) {
        String autentificado = null;
        if (sc.getUserPrincipal()!=null)
            autentificado = sc.getUserPrincipal().getName();
        PeticionBO peticionBO = new PeticionBO();
        long idFirma = peticionBO.firmarPeticion(idPeticion, firmaTO, autentificado);
        URI uri = uriInfo.getAbsolutePathBuilder().path("{idFirma}").build(idFirma);   
        return Response.created(uri).build();
    }
View Full Code Here

Examples of es.ua.dccia.negocio.PeticionBO

   
    @Path("{idPeticion}/firmas/{idFirma}")
    @GET
    @Produces(MediaType.APPLICATION_JSON)
    public Firma obtenerFirma(@PathParam("idPeticion") long idPeticion, @PathParam("idFirma") long idFirma) {
        return new PeticionBO().getFirma(idFirma);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.