I
- The specific type of Business Object (extending BO
) that represents
scheduler items (e.g., appointments, events).C
- The specific type of Business Object (extending BO
) that represents
scheduler contacts (e.g., a person, an attendee, a resource).G
- The type of object taking the role of scheduler groups (e.g., departments, teams).
If group functionality is not used, this type can be set to Void
.public class FSchedulerBOModel<I extends BO,C extends BO,G>
extends de.ipcon.swing.scheduler.SchedulerModel<I,C,G>
SchedulerModel
responsible for performing
Create, Update, and Delete (CUD) actions on Business Objects (BOs) that serve
as data for the scheduler component. This class ensures that the already mapped
data for the MindFusion scheduler is kept in synchronization with the underlying BOs.
It bridges the gap between the application's core business logic (represented by BOs) and the scheduler's data requirements, handling the persistence and state management of scheduled items, contacts, and groups.
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.lang.String,com.mindfusion.scheduling.model.Contact> |
getAllContacts() |
java.util.Map<java.lang.String,de.ipcon.swing.scheduler.Group> |
getAllGroups() |
java.util.Map<java.lang.String,com.mindfusion.scheduling.model.Item> |
getItemsInRange(java.time.LocalDateTime start,
java.time.LocalDateTime end) |
static <I extends BO,C extends BO,G> |
of(ClientContextI ctx,
SchemaI schema,
java.util.function.Supplier<Transaction> rootTx,
BO rootBO,
java.lang.String contactAttr,
FSchedulerBOMapper<I,C,G> mapper)
Factory method to create a new instance of
FSchedulerBOModel . |
void |
refreshI(BO bo)
Refreshes the state of a specific item in the model.
|
void |
setNewItemFunc(TriFunction<BO,java.time.LocalDateTime,java.time.LocalDateTime,BO> newItemFunc)
Sets a custom function for creating new item BOs.
|
void |
verifyMapper(boolean viewOnly)
Verifies that the attributes used by the mapper for settable values exist and are actually
settable within the context of the Business Objects.
|
public static <I extends BO,C extends BO,G> FSchedulerBOModel<I,C,G> of(ClientContextI ctx, SchemaI schema, java.util.function.Supplier<Transaction> rootTx, BO rootBO, java.lang.String contactAttr, FSchedulerBOMapper<I,C,G> mapper)
FSchedulerBOModel
.
This method ensures that the model is created with the same generic types as the provided mapper, thereby guaranteeing type consistency between the domain data stored within this model and the mapping logic defined in the mapper.
I
- The specific type of Business Object for scheduler items.C
- The specific type of Business Object for scheduler contacts.G
- The type of object for scheduler groups.ctx
- The ClientContextI
for the current client session.schema
- The SchemaI
describing the BO structure.rootTx
- A Supplier
providing the root Transaction
for database operations.rootBO
- The root Business Object from which relations might be derived.contactAttr
- The name of the attribute in the root BO that points to contacts.mapper
- The FSchedulerBOMapper
instance that defines how domain BOs are
mapped to scheduler components.FSchedulerBOModel
.public void setNewItemFunc(TriFunction<BO,java.time.LocalDateTime,java.time.LocalDateTime,BO> newItemFunc)
This function will be invoked when a new scheduler item needs to be created in the domain layer. It allows for flexible creation logic beyond a simple default constructor, enabling custom initialization based on the associated Business Object, start time, and end time.
newItemFunc
- A TriFunction
that takes a Business Object, a LocalDateTime
start,
and a LocalDateTime
end, and returns a new Business Object (item).public void verifyMapper(boolean viewOnly)
This method performs checks to ensure data integrity and prevent runtime errors.
If viewOnly
is false
, it additionally verifies that attributes
intended for modification are writable. This is crucial if the model is used in a
context where modifications to BOs are expected.
viewOnly
- If true
, only checks for attribute existence. If false
,
also verifies that attributes configured for setting values are actually writable.public void refreshI(BO bo)
This method is used to update the internal representation of a Business Object item (I) and its corresponding scheduler item (Item) after external changes or manual modifications to the BO. It ensures data consistency between the domain model and the scheduler's display.
bo
- The Business Object item (I) that needs to be refreshed.public java.util.Map<java.lang.String,com.mindfusion.scheduling.model.Item> getItemsInRange(java.time.LocalDateTime start, java.time.LocalDateTime end)
public java.util.Map<java.lang.String,com.mindfusion.scheduling.model.Contact> getAllContacts()
Copyright © 2000-2025 OAshi S.à r.l. All Rights Reserved.