public interface ValueContextForUpdate extends ValueContext
This interface has the following specificity regarding the way paths are interpreted
in path-based methods (ValueContext.getValue(Path), ValueContext.getNode(Path),
setValue(Object, Path), etc.): if the specified path is absolute and this context is a record, it
starts at the record root (not the dataset root).
| Modifier and Type | Interface and Description |
|---|---|
static class |
ValueContextForUpdate.ValidationPolicy
Defines the policy for validating this content.
|
| Modifier and Type | Method and Description |
|---|---|
ValidationReport |
getValidationReport()
Returns the validation report of this content.
|
ValidationReport |
getValidationReport(ValueContextForUpdate.ValidationPolicy aPolicy)
Returns the validation report of this content.
|
void |
setPrivilegeForNode(Path aNodePath)
Disables all permission checks for the specified node
during the current operation.
|
void |
setValue(Object aValue,
Path aPath)
Sets the value of the specified node.
|
void |
setValue(Object aValue,
SchemaNode aNode)
Sets the value of the specified node.
|
void |
setValueEnablingPrivilegeForNode(Object aValue,
Path aNodePath)
Utility method to set a value for the specified node while disabling all permission checks
for this node.
|
void |
setValueFromXsString(String aString,
Path aPath)
Sets the string value specified.
|
void |
setValueFromXsString(String aString,
SchemaNode aNode)
Sets the string value specified.
|
getAdaptationInstance, getAdaptationTable, getHome, getNode, getNode, getValue, getValue, getValuevoid setValue(Object aValue, Path aPath) throws UnavailableContentError, PathAccessException, IllegalArgumentException
For a terminal node, the value AdaptationValue.INHERIT_VALUE
can be set to specify that a node inherits its value from the parent dataset
(this is the default value for any newly created dataset).
The container will validate the value against the data model type and constraints when the transaction is committed.
Permissions on the specified node will be evaluated before committing the changes,
except when some extra privileges are granted in the containing trigger or procedure context.
See setPrivilegeForNode(Path) and
ProcedureContext.setAllPrivileges(boolean) for more information.
The access and mapping rules between XML Schema and Java are described in the chapter Mapping to Java.
UnavailableContentError - If content has become unavailable due to a data model error.PathAccessException - If the specified node does not exist.IllegalArgumentException - If:
AdaptationValue.INHERIT_VALUE.void setValue(Object aValue, SchemaNode aNode) throws UnavailableContentError, PathAccessException, IllegalArgumentException
UnavailableContentErrorPathAccessExceptionIllegalArgumentExceptionsetValue(Object, Path)void setValueFromXsString(String aString, Path aPath) throws UnavailableContentError, PathAccessException
This method first converts the specified string, then invokes setValue(Object, Path).
Permissions on the specified node will be evaluated before committing the changes,
except when some extra privileges are granted in the containing trigger or procedure context.
See setPrivilegeForNode(Path) and
ProcedureContext.setAllPrivileges(boolean) for more information.
The access and mapping rules between XML Schema and Java are described in the chapter Mapping to Java.
UnavailableContentErrorPathAccessExceptionSchemaNode.parseXsString(String)void setValueFromXsString(String aString, SchemaNode aNode) throws UnavailableContentError, PathAccessException
UnavailableContentErrorPathAccessExceptionsetValueFromXsString(java.lang.String, com.orchestranetworks.schema.Path)void setPrivilegeForNode(Path aNodePath) throws PathAccessException, IllegalArgumentException
The privilege is granted for the whole update or create operation of the current record or dataset, but does not apply to the UI. This implies that permission checks for the specified node will be skipped until the operation is over. This privilege can be granted by a trigger, or in a procedure.
For instance, given a user with read-only permission on the specified node:
setAllPrivileges(false)
could still set a value for this node.PathAccessException - If the specified node does not exist.IllegalArgumentException - If the specified node is not terminal or null.void setValueEnablingPrivilegeForNode(Object aValue, Path aNodePath) throws UnavailableContentError, PathAccessException, IllegalArgumentException
This is the same as calling setPrivilegeForNode(Path) and setValue(Object, Path)
successively. As a consequence, the privilege is granted beyond the invocation
of this method, as specified by setPrivilegeForNode(Path).
UnavailableContentError - If content has become unavailable due to a data model error.PathAccessException - If the specified node does not exist.IllegalArgumentException - If:
AdaptationValue.INHERIT_VALUE.ValidationReport getValidationReport()
This method is equivalent to:
ValueContextForUpdate#getValidationReport(ValidationPolicy.ALL);
getValidationReport(ValidationPolicy)ValidationReport getValidationReport(ValueContextForUpdate.ValidationPolicy aPolicy)
If this is a dataset,
the validation takes into account the constraints defined by
the underlying data model and only on the fields that are outside a
table. That is, tables are not validated when validating a dataset.
If this is a table record, all the constraints
defined under the table and the record-level checks in
the table controls are taken into account.
Important:
osd:autoIncrement element)
or a function (specified in the data model using an
osd:function element)
are not set if this content is a new table record.
That is, constraints defined by these nodes are not checked
if this content is a new table record.
validation item with a severity fatal
is added to the returned validation report if an unexpected error occurs
during the validation of this content.
The report returned by this method is not affected by modifications performed after this method is called. The rules for ensuring that data in EBX® remains valid, despite potential concurrent updates, are explained in the section Consistency and validation.
Adaptation.getValidationReport()