OK, I've kind-of started working on placing entries on the day and week views of the XPages calendar. I've come across a feature of dojo called dojox.gfx. This is a vector graphics engine for placing shapes on the screen and is also used in the dojo charting side of things. Now, I'm not sure if this is the best thing to use but is what I've found so far that kind-of matches what I need to do. However, this library seems to be client side JavaScript driven, at least that's the only way I've found to get stuff to show up on the page.
With the gfx engine being client side JavaScript this poses a few problems:
- I can't get at the sessionScope, viewScope and requestScope variables
- I'm not sure how to get at the data I need unless we put it in a hidden field, which is of course doable
While these aren't really that big of a deal there are other hurdles to leap that may become a big deal.
- You have to create a drawing surface to put shapes on and it is assigned a size, you then place a shape of a certain size onto the drawing surface. This is all controlled via x,y coordinates. While I could get the screen resolution of whatever browser is looking at the calendar, I would then have to accommodate all the different resolutions out there and figure out where to place a shape. This makes me shiver just thinking about it.
- In CSS when you define a size in pixels, it's not really that size and the size you define also includes the padding and margins. So if you say something is 75px tall with a 1px padding. It's actually 77px tall, at least the best I can tell, it may be different depending on the monitor. This makes figuring out how tall to make an entry kind-of difficult. I guess I could loop through the time span making only small shapes that are all jammed together to make one big shape.
On the plus side, this is very cool stuff to be working with and it's very easy. I was putting shapes on the screen in less than 5 minutes and with only 4 lines of code to put a movable rectangle on the screen, development should be pretty quick, theoretically at least. The dojox.gfx engine also allows you to do gradients and path type drawings, rotate shapes via a slider, resize shapes and I'm sure some other stuff. Very cool.
So, that's where I'm at. If someone has a better idea on how to put entries on a day/week view calendar and then show their duration I'm all ears (or eyes as the case may be).