Package javango.polls.model

Examples of javango.polls.model.Poll


      throw new HttpException(e);
    }
  }
 
  public HttpResponse detail(HttpRequest request, Long poll_id) throws HttpException {
    Poll p = javango.getObjectOr404(Poll.class,poll_id);
   
    VoteForm form = javango.newForm(VoteForm.class).setPoll(p);
   
    Map<String, Object> context = new HashMap<String, Object>();
    context.put("poll", p);
View Full Code Here


                 
    return renderToResponse("javango/polls/templates/detail.ftl", context);
  }

  public HttpResponse results(HttpRequest request, Long poll_id) throws HttpException {
    Poll p = javango.getObjectOr404(Poll.class, poll_id);
   
    Map<String, Object> context = new HashMap<String, Object>();
    context.put("poll", p);
   
    return renderToResponse("javango/polls/templates/results.ftl", context);
View Full Code Here

    return renderToResponse("javango/polls/templates/results.ftl", context);

  }
 
  public HttpResponse vote(HttpRequest request, Long poll_id) throws HttpException {
    Poll p = javango.getObjectOr404(Poll.class, poll_id);
   
    VoteForm form = javango.newForm(VoteForm.class).setPoll(p);
    form.bind(request.getParameterMap());     
   
    if (!form.isValid()) {
View Full Code Here

    }
  }
 
  public HttpResponse detail(HttpRequest request, Long poll_id) throws HttpException {
    try {
      Poll p = modelFactory.dao(Poll.class).get(poll_id);
      if (p == null) {
        return new SimpleHttpResponse("Unable to find poll with id = " + poll_id);
      }
     
      VoteForm form = (VoteForm)formFactory.newForm(VoteForm.class);
View Full Code Here

    }
  }

  public HttpResponse results(HttpRequest request, Long poll_id) throws HttpException {
    try {
      Poll p = modelFactory.dao(Poll.class).get(poll_id);
      Map<String, Object> context = new HashMap<String, Object>();
      context.put("poll", p);
     
      return renderToResponse("src/main/webapp/templates/results.html", context);
    } catch (DaoException e) {
View Full Code Here

    }   
  }
 
  public HttpResponse vote(HttpRequest request, Long poll_id) throws HttpException {
    try {
      Poll p = modelFactory.dao(Poll.class).get(poll_id);
     
      VoteForm form = (VoteForm)formFactory.newForm(VoteForm.class).bind(request.getParameterMap());
      form.updateChoices(p);
     
      if (!form.isValid()) {
View Full Code Here

TOP

Related Classes of javango.polls.model.Poll

Copyright © 2018 www.massapicom. 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.