Search
Resources

JPlanner lets you associate resources with items via the Resources and Contacts collections and the setLocation and setTask methods of the Item class. The objects of these collections and methods are of the Resource, Contact, Location, and Task classes respectively. If you need to assign a resource to schedule items, you must also add this resource to the appropriate collection in the Schedule class, namely Resources, Contacts, Locations, or Tasks.

The timetable, week range and resource views let you display distinct rows or columns for selected resources and to group items by their associated resources. To enable that, add the resources of interest to the appropriate resource collection of the Calendar class (that is, Resources, Contacts, Locations, and Tasks respectively) and set the Calendar.GroupType property to the appropriate value.

The Resource class is the base of Contact, Location, and Task. It defines an Id, which must be unique among all resources in the schedule, and a pair of saveTo and loadFrom methods, which implement serialization.

You can define custom resources by deriving from Resource or from any of the Resource-derived classes. Custom resources are added to the schedule by adding them to the Resources collection. In order to enable serialization of custom resources, you have to provide a parameterless constructor and override the saveTo / loadFrom methods in the custom resource class. In addition you must register that class by calling registerResourceClass before any deserialization code takes place.