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 | Method and Description |
---|---|
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 |
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.
|
getAdaptationInstance, getAdaptationTable, getHome, getNode, getNode, getValue, getValue, getValue
void 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 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.
UnavailableContentError
PathAccessException
SchemaNode.parseXsString(String)
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
.