如何列出日期从数据库到JFXtras议程作为约会:Google日历风格事件列表 [英] How to list dates from database onto JFXtras Agenda as Appointments: Google Calender style event listing

查看:280
本文介绍了如何列出日期从数据库到JFXtras议程作为约会:Google日历风格事件列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有 活动日期,标题,地点,参加者,开始&结束时间,位置和其他元数据 ,然后存储在mysql数据库表中。我想从数据库中检索事件,并将其列入Google日历样式 。到目前为止,我只知道 JFXtras Agenda 有这样的实现。



我一直在尝试很长时间使用JFXtras议程,但我坚持从数据库检索事件,并将其作为约会列在议程上。



我如何去做?我准备好尝试任何其他实现,列出像Google Calender这样的数据库中的事件。



提前感谢。



Ps。



我认为我的问题是我不明白约会组来自



从API:

$ b $


解决方案

1)创建自定义模型

  public class Event {

GregorianCalendar startTime;
GregorianCalendar endTime;
...

public GregorianCalendar getStartTime(){
return startTime;
}

public void setStartTime(GregorianCalendar startTime){
this.startTime = startTime;
}

public GregorianCalendar getEndTime(){
return endTime;
}

public void setEndTime(GregorianCalendar endTime){
this.endTime = endTime;
}
...
}

从数据库到 List< Event> myEvents



3)填写您的议程

 议程lAgenda =新议程(); 
...
for(Event e:myEvents){
lAgenda.appointments()。add(
new Agenda.AppointmentImpl()
.withStartTime getStartTime())
.withEndTime(e.getEndTime()));
...
}


I have event dates, titles, venues, attendees, start & end times, location and other metadata collected from users via forms then stored in a mysql database table. I would like to retrieve the events from the database and list them in Google Calender style. So far I only know of JFXtras Agenda having this kind of implementation.

I've been trying for a long time now to work with JFXtras Agenda but I'm stuck at retrieving the events from the database and listing them on the Agenda as Appointments.

How do I go about it? I'm ready to try out any other implementation that lists events from data base like Google Calender does.

Thank you in advance.

Ps.

I think my problem is that I don't understand what an appointment group is from AppointmentGroup Interface (Class Agenda.AppointmentImpl) is supposed to do/ what it is....

From the API: ".......An appointment group is a binding element between appointments; it contains information about visualization....."

What does "binding element between appointments" mean?

解决方案

1) Create custom model

public class Event {

    GregorianCalendar startTime;
    GregorianCalendar endTime;
    ...

    public GregorianCalendar getStartTime() {
        return startTime;
    }

    public void setStartTime(GregorianCalendar startTime) {
        this.startTime = startTime;
    }

    public GregorianCalendar getEndTime() {
        return endTime;
    }

    public void setEndTime(GregorianCalendar endTime) {
        this.endTime = endTime;
    }
    ...
}

2) Retrive events from database to List<Event> myEvents

3) Fill your Agenda

Agenda lAgenda = new Agenda();
...
for (Event e : myEvents) {
    lAgenda.appointments().add(
        new Agenda.AppointmentImpl()
        .withStartTime(e.getStartTime())
        .withEndTime(e.getEndTime()));
        ...
}

这篇关于如何列出日期从数据库到JFXtras议程作为约会:Google日历风格事件列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆