how to extract created appointements in IcalenderAgenda from JFXtras Api?

40 views Asked by At

I recently started using JFxtras IcalenderAgenda and learning how it functions, its appointments, the events...
So I created a table named planing, in the MySql database with columns like appointement_date, appointement_startTime, end_time, description, summary ...
my problem is that I don't know ( yet, understand) how can I save the details of an appointment created in JFxtras agenda into my database
to be more precise, it is not the connection to the database, but how can I extract the details of the created appointments after I press a button like save ...

I think my problem is that I don't understand what is an appointment from Agenda.appointment
i saw these functions of details extraction like (Appointment a)

a.getStartLocalDateTime()  
a.getStartTime()  
a.getSummary()  
a.getDescription()  

And I just want to use these

Thank You in Advance :)

1

There are 1 answers

8
tbeernot On

Agenda is a view component which is able to display any class that implements the Appointment interface that is defined inside Agenda. It is up to you to provide a class that does so.

https://github.com/JFXtras/jfxtras/blob/11/jfxtras-agenda/src/main/java/jfxtras/scene/control/agenda/Agenda.java

There are a few options to create that class.

  1. The easiest way is that your persisted class happens to implement the Agenda.Appointment interface, then you can simply provide Agenda with a list of those classes.

  2. If there is a difference for example the method names, you could provide a wrapper class that maps the Appointment interface methods to the one available in the persisted class.

  3. And finally you can use any of the AppointmentImpl* class in agenda, but then upon load you need to convert your persisted data to one of the AppointmentImpl*, and upon pressing Save back again.

I figure that the biggest question is how you get your data from the database. Do you use direct JDBC or something like JPA or EBeans?