Additional information about change contexts

The modified resources in a change context can be accessed by using proxies obtained from its provider.

See CqUserDb.MODIFIED_RESOURCES_LIST in the Javadoc information for the cq package.

Operations that modify a nonversioned resource cause the resource to be copied from its location in the repository to a change context, where it is modified. Which change context maintains the copy is determined by the proxy used to make the modification. The modified copy of the resource hides the corresponding resource in the repository until the change context is delivered or deleted or until the modified copy is removed from the change context.

An editing session in progress can be abandoned by using the doClearContext() method.

A change context resource is created by the server the first time it is requested to modify a CqContextResource.

A change context holds current, newly-created, and modified resources until committed.

There can be only one change context per user database, but independent edits can happen in the same change context.

Delivery of modified resources from the change context to the database is controlled by the deliveryOrder parameter on doWriteProperties and other do methods commonly used on context resources. The deliveryOrder parameter controls what gets delivered and when.

The doDeliver method attempts to deliver this resource to the database. The argument to this method is a Feedback object and is a specification for the properties of this resource that are to be included in the proxy returned by this operation.

For example:
record = (CqRecord) record.doWriteProperties(ALL_FIELDS, HOLD); 
record = (CqRecord) record.doDeliver(ALL_FIELDS); 

The doWriteProperties method writes dirty properties to the change context-copy of a resource and, optionally, requests that modified resources in the change context be delivered to or resources be deleted from the database.

The arguments of the doWriteProperties are:
  • feedback - An instance of Feedback requesting properties for this resource and for the resources delivered by this operation. May be null if no feedback is desired.
  • deliveryOrder - If CqProvider.HOLD, the modified resource, is left in a writable state in the change context, the modified resource in the change context must be delivered before the modifications become visible to other providers. If not CqProvider.HOLD, the modified and moribund resources specified by this parameter, will be delivered to or deleted from the database in the order indicated. To deliver all modified and moribund resources in an arbitrary order, use CqProvider.DELIVER_ALL. To deliver just this modified resource, use CqProvider.DELIVER. The deliveryOrder argument must not be null.