Package com.gracevallorani.jpa.entities

Examples of com.gracevallorani.jpa.entities.Feature


      Model model,
      @RequestParam(value = "id", required = false, defaultValue = "0") int id) {
    form.setId(id);
   
    if (id != 0) {
      Feature feature;
     
      IJpaFactory<Feature> strategy = new FeatureFactory(new J2eeConfig());
     
      try {
        feature = strategy.get(id);           
      } finally {
        strategy.close();
      }

      form.setId(id);
      form.setOrder(feature.getOrder());
      form.setSummary(feature.getSummary());
      form.setTitle(feature.getTitle());
      form.setTrailer(feature.getTrailer());
      form.setTrailerHeight(feature.getTrailerHeight());
      form.setTrailerWidth(feature.getTrailerWidth());
      form.setWebsiteUrl(feature.getWebsiteUrl());
    }
   
    return JSP_EDIT;
  }
View Full Code Here


  public String postEdit(@Valid FeatureForm form, BindingResult result, Model model) throws Exception {
    if (result.hasErrors()) {
      return JSP_EDIT;
    }
   
    Feature feature;
    IJpaFactory<Feature> strategy = new FeatureFactory(new J2eeConfig());
    strategy.setTransactional(true);
   
    try {
      if (form.getId() == 0) {
        feature = new Feature();
      } else {
        feature = strategy.get(form.getId());
      }     

      feature.setOrder(form.getOrder());
      feature.setSummary(form.getSummary());
      feature.setTitle(form.getTitle());
      feature.setTrailer(form.getTrailer());
      feature.setTrailerHeight(form.getTrailerHeight());
      feature.setTrailerWidth(form.getTrailerWidth());
      feature.setWebsiteUrl(form.getWebsiteUrl());

      if (form.getId() == 0) {
        strategy.add(feature);             
      } else {
        strategy.refresh(feature);
View Full Code Here

  @RequestMapping(value = "delete", method = RequestMethod.GET)
  public String getDelete(@RequestParam(value = "id", required = true, defaultValue = "0") int id) throws Exception {   
    IJpaFactory<Feature> strategy = new FeatureFactory(new J2eeConfig());
       
    try {
      Feature feature = strategy.get(id);
      strategy.setTransactional(true);
      strategy.delete(feature);
    } finally {
      strategy.close();
    }
View Full Code Here

    List<Feature> l = (List<Feature>)q.getResultList();
   
    if (l.size() == 0) {
      em.getTransaction().begin();

      Feature f = new Feature();
      f.setTitle("How to Stop Being a Loser");
      f.setOrder(10);
      f.setSummary("More comming soon");
      f.setWebsiteUrl("http://uk.imdb.com/title/tt1727506/");
      em.persist(f);

      f = new Feature();
      f.setTitle("The Last 7");
      f.setOrder(20);
      f.setSummary("The film tells the story of a cataclysmic event that leaves only 7 remaining people on earth and their desperate struggle to understand the events as they are hunted one by one by a demonic power.");
      f.setTrailer("<object width='640' height='385'><param name='movie' value='http://www.youtube.com/v/1sgDqyJM2po?fs=1&amp;hl=en_GB'></param><param name='allowFullScreen' value='true'></param><param name='allowscriptaccess' value='always'></param><embed src='http://www.youtube.com/v/1sgDqyJM2po?fs=1&amp;hl=en_GB' type='application/x-shockwave-flash' allowscriptaccess='always' allowfullscreen='true' width='640' height='385'></embed></object>");
      f.setTrailerWidth(680);
      f.setTrailerHeight(425);
      f.setWebsiteUrl("http://www.thelastseven.co.uk/");
      em.persist(f);     
     
      f = new Feature();
      f.setTitle("Harry Brown");
      f.setOrder(30);
      f.setSummary("In England, retired marine Harry Brown spends his lonely life between the hospital, where his beloved wife Kath is terminally ill, and playing chess with his only friend Leonard Attwell in the Barge pub owned by Sid Rourke. After the death of Kath, Len tells his grieving friend that the local gang is harassing him and he is carrying an old bayonet for self-defense; the widower suggests him to go to the police. When Len is beaten to death in an underground passage, Inspector Alice Frampton and her partner Sergeant Terry Hicock are sent to investigate. They pay Harry a visit but don't have good news; the police have not found any other evidence, other than the bayonet, in order to arrest the hoodlums. This mean that should the case go to trial the gang would claim self-defense. Harry Brown sees that justice will not be granted and decides to take matters into his own hands.");
      f.setTrailer("<object width='640' height='385'><param name='movie' value='http://www.youtube.com/v/OVOSfHFNlcI?fs=1&amp;hl=en_GB'></param><param name='allowFullScreen' value='true'></param><param name='allowscriptaccess' value='always'></param><embed src='http://www.youtube.com/v/OVOSfHFNlcI?fs=1&amp;hl=en_GB' type='application/x-shockwave-flash' allowscriptaccess='always' allowfullscreen='true' width='640' height='385'></embed></object>");
      f.setTrailerWidth(680);
      f.setTrailerHeight(425);
      f.setWebsiteUrl("http://www.harrybrownthemovie.co.uk/");
      em.persist(f);
                         
      f = new Feature();
      f.setTitle("Umbrage");
      f.setOrder(40);
      f.setSummary("Jacob, an unscrupulous antiques dealer, moves to a remote farmhouse with his pregnant young wife, Lauren (Grace Vallorani), and his difficult ward, Rachel. His goals are clear: to pass this near-priceless mirror to the highest bidder, and to prevent these two women from ripping each other apart.");
      f.setTrailer("<object width='640' height='385'><param name='movie' value='http://www.youtube.com/v/W_QaUWwHG3Y?fs=1&amp;hl=en_GB'></param><param name='allowFullScreen' value='true'></param><param name='allowscriptaccess' value='always'></param><embed src='http://www.youtube.com/v/W_QaUWwHG3Y?fs=1&amp;hl=en_GB' type='application/x-shockwave-flash' allowscriptaccess='always' allowfullscreen='true' width='640' height='385'></embed></object>");
      f.setTrailerWidth(680);
      f.setTrailerHeight(425);
      f.setWebsiteUrl("http://www.umbragethemovie.co.uk/");
      em.persist(f);
     
      f = new Feature();
      f.setTitle("Do Elephants Pray?");
      f.setOrder(50);
      f.setSummary("Callum Cutter (Jonnie Hurn), fastidious 30something Head of his own failing Advertising company who burdens his employees with his increasingly erratic ways, struggles to find meaning in the soulless world he is shackled as he faces the challenge of selling the unsellable product.<br/><img src='/files/features/dep/photos.jpg'/>");
      f.setTrailer("<embed id='VideoPlayback' style='width:400px;height:326px' allowFullScreen='true' src='http://video.google.com/googleplayer.swf?docid=-4417431645801357503&hl=en&fs=true' type='application/x-shockwave-flash'/>");
      f.setTrailerWidth(440);
      f.setTrailerHeight(366);
      f.setWebsiteUrl("http://www.doelephantspray.com/");
      em.persist(f);

      f = new Feature();
      f.setTitle("School Without Walls");
      f.setOrder(60);
      f.setSummary("In this story, six students discover themselves locked inside the school together and unknowingly meeting the same inevitable challenge. The students have to break out of the same school they got themselves locked in. All the students encounter situations that require them to utilize their own techniques when communicating, whether it be verbal or non verbal. This story puts emphasis on not what we say but more so how we react. Both in the community and school, miscommunication causes problematical tensions. Once they all come to realize that their community, their homes, their friends and families are at risk due to the rioting. They declare in their individual ways, that what is happening outside of the schools walls are more essential than their reason of why they are locked inside. It is how they leave, that determines their reality. A chain of events that lead to a frenzied Riot in the NewHam Borough of East London, takes place in the Afro-Caribbean Community of Carrolton (a fictional place). The plot takes place on the particular day of April 3rd.");
      f.setTrailer("<object width='480' height='385'><param name='movie' value='http://www.youtube.com/v/VX9f0dFlzYI?fs=1&amp;hl=en_GB'></param><param name='allowFullScreen' value='true'></param><param name='allowscriptaccess' value='always'></param><embed src='http://www.youtube.com/v/VX9f0dFlzYI?fs=1&amp;hl=en_GB' type='application/x-shockwave-flash' allowscriptaccess='always' allowfullscreen='true' width='480' height='385'></embed></object>");
      f.setTrailerWidth(520);
      f.setTrailerHeight(425);
      f.setWebsiteUrl("http://www.facebook.com/group.php?gid=25466958201");
      em.persist(f);
     
      em.getTransaction().commit();         
    }   
  }
View Full Code Here

TOP

Related Classes of com.gracevallorani.jpa.entities.Feature

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.