Package de.peacei.gae.foodsupplier.data

Examples of de.peacei.gae.foodsupplier.data.Weekplan


 
  //@Override
  public Weekplan readWeekplanForWeek(String html, int weekNumber) {
   
    if(weekNumber == parseWeekNumber(html, weekNumber)) {
      Weekplan weekplan = new Weekplan();
      weekplan.setMensa(mensa);
      weekplan.setWeek(weekNumber);
      weekplan.setMenus(readMenus(html, new Date()));
   
      return weekplan;
    }
    else return null;
  }
View Full Code Here


  public Weekplan readCurrentWeekplanForMensaWeekAndYear(Mensa mensa, int weekNumber, int year, String content) {
    if (mensa != null) {
      try {
        MensaParser mensaParser = mensa.getParserClass().newInstance();
        Weekplan weekplan = null;
        if (content != null) {
          weekplan = mensaParser.readWeekplanForWeek(content, weekNumber);
        }
        return weekplan;
      } catch (InstantiationException e) {
View Full Code Here

         
        Date now = new Date();
        int week = CalendarUtil.getWeek(now);
        int year = CalendarUtil.getYear(now);
       
        Weekplan weekplan = mensaParserService.readCurrentWeekplanForMensaWeekAndYear(mensa, week, year, content);
        weekplan.setYear(year);
       
        mensaDAO.deleteWeekplansByMensaWeekAndYear(mensa, week, year);
        weekplanCache.removeFromCache(Finals.FORMAT_JSON, mensa.getId(), week, year);
        weekplanCache.removeFromCache(Finals.FORMAT_XML, mensa.getId(), week, year);
       
View Full Code Here

      osWriter.close();
     
      logger.info("supplied from memcache");
     
    } else {
      Weekplan weekplan = weekplanDAO.getWeekplanForMensaWeekAndYear(mensa, week, year);
      if (weekplan != null) {
        renderingService.renderWeekplan(weekplan, resp.getOutputStream(), format, callback);
        setContentType(resp, format);
        resp.setCharacterEncoding("UTF-8");
        resp.setStatus(HttpServletResponse.SC_OK);
View Full Code Here

        }
       
        Date now = new Date();
        int year = CalendarUtil.getYear(now);
                   
        Weekplan weekplan = mensaParserService.readCurrentWeekplanForMensaWeekAndYear(mensa, weekNumber, year, content);
        weekplan.setYear(year);
        if (commitData) {
          mensaDAO.deleteWeekplansByMensaWeekAndYear(mensa, weekNumber, year);
          weekplanCache.removeFromCache(Finals.FORMAT_JSON, mensa.getId(), weekNumber, year);
          weekplanCache.removeFromCache(Finals.FORMAT_XML, mensa.getId(), weekNumber, year);
         
View Full Code Here

public class WeekplanDAO {
 
  public WeekplanDAO() { };
 
  public Weekplan getWeekplanForMensaWeekAndYear(Mensa mensa, int week, int year) {
    Weekplan weekplan = null;
       
        PersistenceManager pm = PMF.get().getPersistenceManager();
        try {
          Query query = pm.newQuery(Weekplan.class, "mensa == m && week == w && year == y");
          query.declareParameters("Mensa m, int w, int y");
View Full Code Here

TOP

Related Classes of de.peacei.gae.foodsupplier.data.Weekplan

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.