myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jurgen Lust <Jurgen.L...@gmail.com>
Subject Re: Schedule tomahawk
Date Wed, 01 Aug 2007 12:34:42 GMT
Hmm, I think the getCurrentSession() will fail, because normally there
is no hibernate session when you start a request. Also the transaction
stuff isn't required, since it is only a read operation.

Jurgen

Op woensdag 01-08-2007 om 03:00 uur [tijdzone -0700], schreef
ignicolist:
> Hi, this is my loadentries in SimplesScheduleModel.java, can i do  this? Is
> this correct? Because it give me error. I want to know if this is the
> correct thing to do.
> 
> 
> 
> protected Collection loadEntries(Date startDate, Date endDate)
>     {
> 
> Session session = HibernateUtil.getSessionFactory().getCurrentSession();
>         session.beginTransaction();
>         
>         List scheduleResult = session.createQuery("select s.cod_id,
> s.location, s.comments, s.end, s.start, s.title from " +
>                 "AddSchedule as s").list();
>          
>         session.getTransaction().commit();
>       
>         for(int i = 0; i < scheduleResult.size();i++){
>         	scheduleItems.add(new
> SelectItem(scheduleResult.get(i).toString()));
>         	
>      
>         }
>          
>          return scheduleItems;
>     
>     }
> 
> 
> Tks for all.
> 
> 
> 
> 
> 
> Jurgen Lust-2 wrote:
> > 
> > Hi,
> > 
> > In order to use a database as the source for the schedule, you need to
> > write
> > an implementation of the
> > org.apache.myfaces.custom.schedule.model.ScheduleModel interface. You can
> > extend the class
> > org.apache.myfaces.custom.schedule.model.AbstractScheduleModel for
> > convenience. Now you just need to implement the methods
> > loadEntries(Date,Date) and loadDayAttributes(Date). In the first method,
> > you
> > load the entries for the specified period of time from the database.
> > 
> > Jurgen
> > 
> > 2007/7/31, ignicolist <ignicolist@gmail.com>:
> >>
> >>
> >> Hi, i am making a project using myfaces schedule. and everything is
> >> working
> >> fine, but my problem is how i coud make the the entries of schedule could
> >> be
> >> read by a database?
> >>
> >> And how to put the views day,week and moth using the same model? Because
> >> if
> >> i use diferent models the entries in day view for example dont apear in
> >> month view!
> >> --
> >> View this message in context:
> >> http://www.nabble.com/Schedule-tomahawk-tf4192737.html#a11923285
> >> Sent from the MyFaces - Users mailing list archive at Nabble.com.
> >>
> >>
> > 
> > 
> 

Mime
View raw message