MigCalendar bean wrapper released

Questions and answers on developing, deploying and using plugins and JavaBeans

Postby tweetie » Tue Nov 22, 2005 3:16 pm

Hi Fred,
I have downloaden today everything (22th november) and I have some questions and I am not sure if it a bug, or something i'm doing wrong

I downloaded also the Servoy solution of yours.

I have 3 events in a week, I only can move one or two of them to another location(date). And sometimes it changes the duration of the event

With the Mig_calendar solo I can create an event with a right-click of the mouse, in the wrapper it seems to be impossible.

And what does the setDoctors do? Been toying with it, but I dont see it.

Further, I need to congratulate you on this wrapper, it is a great addition
User avatar
tweetie
 
Posts: 345
Joined: Thu Jan 08, 2004 11:32 am
Location: Rotterdam, Netherlands

Postby fdoddridge » Wed Nov 23, 2005 7:10 am

Hi Tweetie,

tweetie wrote:I have 3 events in a week, I only can move one or two of them to another location(date). And sometimes it changes the duration of the event


I'm not sure why one of the events doesn't move, I'll look into that. One thing to remember about the events (and this might be one of the reasons you notice the duration change) is that they are draggable to another location, and also resizable to change the duration. The cursor arrows that appear over the event will determine how the event acts.

Also, the calendar displays a full 24 hours, but the hours before 9am and after 5pm are by default condensed so that events in that time frame appear smaller than they really are. If you drag an event that is in that area into the main time frame (between 9am and 5pm) it will appear to expand, but it really is the same.

tweetie wrote:With the Mig_calendar solo I can create an event with a right-click of the mouse, in the wrapper it seems to be impossible.


In the wrapper you need to program it to add an event. I didn't put an example of that in the sample solution - I will update that soon, but basically you will need to add a popup menu item that says something like "Add Event" to the bean, and then listen for it with the registered callback. When it is clicked you can display your events form and then add the event to the bean.

It has been slow going, I know, but I will soon have some more examples up on the site.

tweetie wrote:And what does the setDoctors do? Been toying with it, but I dont see it.


setDoctors adds event owners to the event filter tree. I am going to remove this method in the future, and replace it with setUsers or setOwners instead.

I will definitely have some more information available by Monday, but if you have any other questions please ask.

Thanks for using the bean :)
Fred
fdoddridge
 
Posts: 64
Joined: Mon Jul 18, 2005 4:30 pm
Location: SLC, UT

Postby cybersack » Wed Nov 23, 2005 8:40 am

Where is calendar data persisted ?
User avatar
cybersack
 
Posts: 302
Joined: Sun Jan 02, 2005 1:17 am

Postby fdoddridge » Wed Nov 23, 2005 9:17 am

The data for the calendar comes from your solution's database. I tried to create the bean so that most of the logic and data manipulation happens inside your Servoy forms. This way you have more control as a developer over how your data is handled.

For example, in your solution you would create a table called "events", or "activities" or something that has colums that look something like this:

table events (
eventsid - integer PK
label - text
ownerid - integer
categoryid - integer,
summary - text
)

You could also have two other tables that look something like this:

table users ( // or 'owners' or 'doctors', etc...
usersid - integer PK
name - text
hexcolor - text
)
table categories ( // or 'event_types', etc...
categoriesid - integer PK
label - text
hexcolor - text
)

Then you can open your events form when a user double-clicks on an event and load in the eventid...

For example, in your calendar form's onShow method:
Code: Select all
elements.scheduleBean.setEventOpenedCallback(onEventOpened);

then in your onEventOpened method:
Code: Select all
var eventid = arguments[0];  // the bean passes the identifier of the event that was double-clicked.

forms.my_events_form.showRecords(databaseManager.convertToDataSet(eventid));


Then after the user edits the event record, you could call an updateEvents method that did a query on your events table and set those events in the bean.

I hope this makes sense... I've been awake for far too long :shock: but I hope that this is what you meant in regards to the data. If not let me know.

Thanks,
Fred
fdoddridge
 
Posts: 64
Joined: Mon Jul 18, 2005 4:30 pm
Location: SLC, UT

Postby cybersack » Wed Nov 23, 2005 9:37 am

it is :)

thanks, J
User avatar
cybersack
 
Posts: 302
Joined: Sun Jan 02, 2005 1:17 am

Postby tweetie » Wed Nov 23, 2005 11:09 am

fdoddridge wrote:Hi Tweetie,

tweetie wrote:I have 3 events in a week, I only can move one or two of them to another location(date). And sometimes it changes the duration of the event

One thing to remember about the events (and this might be one of the reasons you notice the duration change) is that they are draggable to another location, and also resizable to change the duration. The cursor arrows that appear over the event will determine how the event acts.

I remembered it :D but still i cant move them, and sometimes an appointment with duration 2 hours would change in the duration of the other appointments.

I have a couple of other questions:
-what happens if an appointment has more than 1 user....ie an appointment has a n-n relation with users(tables: events, users, events_to_users). If so, what happens if you drag such an appointment to another date.Would it still be possible to check if overlapping of appointments would occur with all the users in 1 appointment? With the right SQL-queries it wouldn't be a problem to show the appointments, but I wonder if I can drag 1 appointment with multiple users to another date and still check every users if the appointment overlap
-is it possible to disable dragging the events, I want some users only to look at it and not touch. With scripting you could prevent the user from actually changing the date's....but I would preffer to disabling the dragging to prevent confusion.
-how about changing the skins and the shapes, like in Mig-calendar (especially something to show graphically the availability of a user when making an appointment)...check the attachment
-how about separating the components, especially the calendar on the left-lower part
-any idea about the pricing??

You wonder why so much questions....Welll I made something in Servoy with calendar/agenda....and it looked quit nice but a couple of things that i couldn't solve that could be solved with mig+wrapper
The problems i had:
-no dragging
-didn't work out how to show overlapping appointments, so I just didn't allow them
-it was a static agenda, meaning you could make max 40 appoitnments a day, and you could show agenda of max 7 people at the same time. If I wanted more I was forced to make addiotional forms.
Attachments
agenda.png
agenda.png (25.02 KiB) Viewed 8186 times
User avatar
tweetie
 
Posts: 345
Joined: Thu Jan 08, 2004 11:32 am
Location: Rotterdam, Netherlands

Postby fdoddridge » Tue Nov 29, 2005 2:29 am

tweetie wrote:I remembered it :D but still i cant move them, and sometimes an appointment with duration 2 hours would change in the duration of the other appointments.

Sorry for delay in replying... life has been busy. I have never seen this behavior before, but I think it may be related to event or category id conflicts... I'll look at it some more.

As for the other questions, all of the features you asked about are possible, but only a few of them are currently implemented.

I am just about finished separating some of the filter logic so that you can add more than one owner to an event and have act the way you want. It will always check for overlapping events and display the overlap effect.

Disabling the drag and drop is possible, but I haven't added that to the features list yet.

As for changing the skins and shapes, that is definitely possible, but I haven't added support in the bean for that either...

I am planning to create separate beans for each of the components, such as the calendar on the bottom left along with many others but they are not available at the moment.

I will update the pricing for the current ScheduleCalendar bean on the site tonight. I apologize for the hasty reply, I will try to get some more information to you soon.

Thanks,
Fred
fdoddridge
 
Posts: 64
Joined: Mon Jul 18, 2005 4:30 pm
Location: SLC, UT

Postby fdoddridge » Fri Dec 02, 2005 8:54 pm

I have put out a new build at http://www.servoybeans.com/ScheduleCalendar.jar

This one fixes some of the issues that tweetie reported about resizing/rescheduling events, as well as some other small issues related to tooltips and toolbar buttons.

I also updated the demo solution to show how to use most of the features in the bean ( http://www.servoybeans.com/CalendarDemo.zip ). The solution uses the sample crm database, just adding a few tables as necessary.

Also of note: if you have used the bean in a solution and have attempted to connect to that solution with a client machine running Java 1.5 you should upgrade to Servoy R2 2.2.3 or it may not work. See http://forum.servoy.com/viewtopic.php?t=5456 for more details.

Thanks,
Fred
fdoddridge
 
Posts: 64
Joined: Mon Jul 18, 2005 4:30 pm
Location: SLC, UT

Postby tweetie » Wed Dec 07, 2005 3:33 pm

Thaknx for the update....
I stumbled on a problem (maybe a bug)
Code: Select all
SetupCategories
elements.scheduleBean.setCategoriesNodeLabel("Event Type");
var query = "select * from event_categories";
var dataset = databaseManager.getDataSetByQuery(controller.getServerName(), query, null, -1);
if (dataset.getMaxRowIndex() > 0) {
   elements.scheduleBean.setCategories(dataset, "event_categoriesid", "label", "color");
}
elements.scheduleBean.addCategory("blah", "Some other category", "#fa7733");
elements.scheduleBean.updateCategoryTree();

Here you setup the categories. You have 2 categories in a table: Task and Meetings. In the method you add one category manually: Some other category.
In the form you only see: Tasks and Some other category.
If I put an event on Meetings, and try to see to show the calendar Servoy freezes up.
I also tried to change elements.scheduleBean.addCategory("blah", "Some other category", "#fa7733"); into elements.scheduleBean.addCategory(3, "Some other category", "#fa7733");....I also added a record in the eventscategory table...
but it still only shows 2 categories.

If I do an additional elements.scheduleBean.addCategory("test", "test category", "#fa7733"); it adds the category to the filter

Thought you might wanna know....
Gonna test it further and try to implement it our solution.
User avatar
tweetie
 
Posts: 345
Joined: Thu Jan 08, 2004 11:32 am
Location: Rotterdam, Netherlands

Postby tweetie » Mon Dec 12, 2005 3:29 pm

I found the error.....
There is no '#' in the table....you need to add '#' before the color at some point.
User avatar
tweetie
 
Posts: 345
Joined: Thu Jan 08, 2004 11:32 am
Location: Rotterdam, Netherlands

Postby tweetie » Wed Dec 14, 2005 12:44 pm

OK..Fred....now it's time to take some valium.
I have some questions (check attachment) and I would like to know what kind of time-frame those question will be implemented (if it all):
-near A : can the text Year and Events Filters be internationalized, or just plainly changed through a method?
-Near B : can the split-spane be set from methods?
-Near C : can the event-filter and the calendar be in separate beans/or be set off or on, but when I select a day...it still need to refresh schedule-part (right side)
-Near D : can the selection of year (arrows), or month or day on the calendar call a method??
-choosing of other themes?
-Near 31-day button: can the slider be set on or off?

The reason for my question Near D is the following: I noticed that updating the events will call all events from the table and stuff them into the bean. The business we are in a person can have 10 till 15 appointments a day....and then there are 5 persons....times 200 workingdays resulting in 15.000 appointments in a small company a year. How will the bean react to so much appointments (especially after a couple of years and larger companies). I preffer to make query based on a 1 month so the query will be less expensive and the bean doesn't have to put in that many events.

One other really important question....are you going to develop, and continue developing and supporting this wrapper in the future?

phew....that's all :D
Attachments
mig.png
screendump
mig.png (65.68 KiB) Viewed 8060 times
User avatar
tweetie
 
Posts: 345
Joined: Thu Jan 08, 2004 11:32 am
Location: Rotterdam, Netherlands

Postby fdoddridge » Thu Dec 15, 2005 8:44 am

tweetie wrote:-near A : can the text Year and Events Filters be internationalized, or just plainly changed through a method?

Yes, they are hard-coded for the version you are using but I will fix that (see below for timetable).

tweetie wrote:-Near B : can the split-spane be set from methods?

Do you mean the position of the split pane? If so, yes... the answer is the same as above.

tweetie wrote:-Near C : can the event-filter and the calendar be in separate beans/or be set off or on, but when I select a day...it still need to refresh schedule-part (right side)

Well I do have two beans in development (they've been on hold for quite a while now until I'm finished with this bean) that would do it. One is a dbTreeView like bean with a few more features, and the other is a little calendar component like the one on the bottom left. However, that doesn't really help you now does it..? I can modify the bean to programmatically hide the different sections. That would probably work just fine - I can't think of any potential problems at the moment. I'll put that into the timetable too...

tweetie wrote:-Near D : can the selection of year (arrows), or month or day on the calendar call a method??

Yes, that is possible. There is currently a callback for when a user selects a date range from the small calendar on the bottom left, setDateChangedCallback.

This would be a good time to answer the question below about updating the calendar with all of the events. In the demo solution I got lazy and did a query to select all events in the updateEvents() method. Using the setDateChangedCallback you can listen for these evens and update the calendar with only the events within that date range...

For example in the demo solution, add the following line to initializeCalendar():
Code: Select all
// Listen for when the user selects a new date range.
elements.scheduleBean.setDateChangedCallback(onDateChanged);


Add the method onDateChanged() to the form:
Code: Select all
var startDate = arguments[0];
var endDate = arguments[1];
updateEvents(startDate, endDate);


Modify updateEvents() to:
Code: Select all
var startDate = arguments[0];
var endDate = arguments[1];

var query = "select * from events";

if (! startDate) {
   startDate = elements.scheduleBean.getVisibleBeginDate();
}
if (! endDate) {
   endDate = elements.scheduleBean.getVisibleEndDate();
}

if (startDate) {
   query += " where start_datetime >= '" + startDate + "'";
   
   if (endDate) {
      query += " and end_datetime <= '" + endDate + "'";
   }
}

var dataset = databaseManager.getDataSetByQuery(controller.getServerName(), query, null, -1);
if (dataset.getMaxRowIndex() > 0) {
   elements.scheduleBean.setEvents(dataset, "eventsid", "ownerid", "categoryid", "summary", "start_datetime", "end_datetime")
}


I hope that helps a bit. The bean methods getVisibleBeginDate() and getVisibleEndDate() will return the currently visible date range in the main calendar view.

tweetie wrote:-choosing of other themes?

This is an interesting point... it is definitely possible to change the look and feel of the component using the MigCalendar Theme editor, but I haven't made that functionality available yet. There are some potential problems that it could introduce if the theme is changed in certain ways. This will require a bit more investigation, but maybe I could just come up with some guidelines that specify what items in the theme can and cannot be changed, then allow you to call a method like setTheme(myNewThemeFile) in the bean... that just might work.

I could also just make certain attributes of the theme configurable in the property editor as well...

tweetie wrote:-Near 31-day button: can the slider be set on or off?

Yes, in fact I'll make that a property in the bean.

tweetie wrote:One other really important question....are you going to develop, and continue developing and supporting this wrapper in the future?

Absolutely :) This wrapper, and hopefully many others. The past month has been somewhat difficult for me time-wise, and I apologize if I haven't been as responsive as I would have liked. The company I work for is putting out a major software release and we've all been taxed pretty hard. It is beginning to clear up now.

Ok, now for the timetable:

1. Internationalization: I will make bean properties for the "Year" and "Event Filters" header text, as well as some other hard-coded English text. So in the Developer you can edit them in the right-side properties panel.

2. Split-pane position: I will make these properties as well, unless you would like me to add methods for it. The only utility I can see for adding a method would be if you wanted to make it user-configurable in a preferences page or something...

3. Hide the separate components: This will be both a property and method.

4. Hide the slider: Property and method.

These are all relatively minor changes so I will have them ready in an update planned for this Friday Dec. 16.

There are some other feaure requests/bug fixes I'm working on as well that I will also have in that update.

There are also some features that will not be there yet like coloring of events by category instead of owner, and background coloring of columns... these will take a little bit longer, but hopefully will be done by Christmas.

On another note, I updated the site this weekend (servoybeans.com) but didn't test it on all browsers... I'm sure it's ugly, but it is somewhat functional now. There is also an updated blurb on "Installation Instructions" that could be helpful for those getting started - thanks for the suggestion Jan!

Off to work I go :)
Fred
fdoddridge
 
Posts: 64
Joined: Mon Jul 18, 2005 4:30 pm
Location: SLC, UT

Postby tweetie » Thu Dec 15, 2005 1:17 pm

ok...thankx for the info.....It gonna look good when we all done with it :D

To give you an Idea how I want my scheduler to look like...see attachment.

2 more question:
-you know allready the pricing?
-any chance of changing to format of the event itself...I would like to add more info in the event (besides the onHover and onSelect)

2. Split-pane position: I will make these properties as well, unless you would like me to add methods for it. The only utility I can see for adding a method would be if you wanted to make it user-configurable in a preferences page or something...

I just want to give the thing a fixed height for the message-box on the bottom instead of %. And let the scheduler adapt to...also the calendar would be nice to have a fixed heigth control.
Attachments
scrresnhot.jpg
screenshot
scrresnhot.jpg (87.42 KiB) Viewed 8023 times
User avatar
tweetie
 
Posts: 345
Joined: Thu Jan 08, 2004 11:32 am
Location: Rotterdam, Netherlands

Postby tweetie » Fri Dec 16, 2005 10:42 am

anyone has the following problem to?
I have updated Java to Java version 1.5.0_06-b05 (Windows 2000)

and now Servoy tells me the
Code: Select all
bean missing com.servoybeans.migcalendar.scheduler.ScheduleCalendar
I have uninstalled update 6 of Java Runtime and everything works fine again.

Servoy Developer
Version R2 2.2.3-build 335
Java version 1.5.0_06-b05 (Windows 2000)
User avatar
tweetie
 
Posts: 345
Joined: Thu Jan 08, 2004 11:32 am
Location: Rotterdam, Netherlands

Postby fdoddridge » Sat Dec 17, 2005 1:29 am

When java updates versions it will usually create a new directory for it's JRE. I think you may need to copy the migcalendar.jar file to the new JRE lib/ext path...

ex. [program files]/Java/jre1.5.0_06/lib/ext

Hope this helps :)
Fred
fdoddridge
 
Posts: 64
Joined: Mon Jul 18, 2005 4:30 pm
Location: SLC, UT

PreviousNext

Return to Plugins and Beans

Who is online

Users browsing this forum: No registered users and 5 guests