The contributing-item-creation-policy dictates how contributing items are created (if at all) in a MutableRepository. This attribute can have a value of eager, lazy, or none.

eager
When users create a new composite item via the createItem() method in MutableCompositeRepository, then new instances of the primary item and of all contributing items will be created. So, for example, if you have a user item type defined in your composite repository that borrows properties from the SQL and LDAP repositories, then any new user composite repository item that is created will create both a SQL repository item and an LDAP repository item. However, before these items can be added to their respective repositories, the correct link needs to exist between them. If the items are linked by a certain property, then this property needs to be set on the primary item before the items are added, otherwise an error will occur since there’s no way in the future to link those two items back together.

lazy
If this option is chosen, contributing items will be created only when they are needed. In this case, when users call setPropertyValue on a property that is defined in the contributing repository, the composite repository creates the item in the contributing then and there. There are two different behaviors depending on whether the CompositeItem is transient or not. If the item is transient, then we wait until the item is persisted before checking to see that all of the appropriate linking properties have been set, so that we may propagate them to the new contributing item. If the item is not transient, we check to see if the correct linking properties are set on the primary item and then add the contributing item to its repository. If there any properties used for linking are missing, then an error is returned.

The check for valid linking properties occurs during the updateItem call, and not during the setPropertyValue call on the contributing item. So if you use lazy item creation and call setPropertyValue on a persistent item, you don’t need to already have valid values set for any linking properties on the primary item at that exact point in time. As long as the values of the linking properties are set before updateItem is called, then the item should be successfully created.

none
If this option is chosen, then no repository items will be created in the underlying repositories under any circumstance. Any contributing items used in the composite repository must already exist in order for valid results to be returned from property value requests.

 
loading table of contents...