Interface ValueContextForUpdate
- All Superinterfaces:
ValueContext
Path interpretation
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).
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
Defines the policy for validating this content. -
Method Summary
Modifier and TypeMethodDescriptionReturns the validation report of this content.Returns the validation report of this content.void
setPrivilegeForNode
(Path aNodePath) Disables all permission checks for the specified node during the current operation.void
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.Methods inherited from interface com.orchestranetworks.instance.ValueContext
getAdaptationInstance, getAdaptationTable, getHome, getNode, getNode, getValue, getValue, getValue
-
Method Details
-
setValue
void setValue(Object aValue, Path aPath) throws UnavailableContentError, PathAccessException, IllegalArgumentException Sets the value of the specified node. The value's Java type must be consistent with the data model node type.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)
andProcedureContext.setAllPrivileges(boolean)
for more information.Access and mapping rules
The access and mapping rules between XML Schema and Java are described in the chapter Mapping to Java.
- Throws:
UnavailableContentError
- If content has become unavailable due to a data model error.PathAccessException
- If the specified node does not exist.IllegalArgumentException
- If:- the specified node cannot be written;
- the specified value is not consistent with the data model node type;
- the specified node is under an aggregated list;
- the specified node is under a terminal node and the value to set is
the value
AdaptationValue.INHERIT_VALUE
.
-
setValue
void setValue(Object aValue, SchemaNode aNode) throws UnavailableContentError, PathAccessException, IllegalArgumentException Sets the value of the specified node.- Throws:
UnavailableContentError
PathAccessException
IllegalArgumentException
- Since:
- 6.0.0
- See Also:
-
setValueFromXsString
void setValueFromXsString(String aString, Path aPath) throws UnavailableContentError, PathAccessException Sets the string value specified. The string must comply with the standard representation of the associated type, as specified by XML Schema.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)
andProcedureContext.setAllPrivileges(boolean)
for more information.Access and mapping rules
The access and mapping rules between XML Schema and Java are described in the chapter Mapping to Java.
- Throws:
UnavailableContentError
PathAccessException
- See Also:
-
setValueFromXsString
void setValueFromXsString(String aString, SchemaNode aNode) throws UnavailableContentError, PathAccessException Sets the string value specified.- Throws:
UnavailableContentError
PathAccessException
- Since:
- 6.0.0
- See Also:
-
setPrivilegeForNode
Disables all permission checks for the specified node during the current operation.Privilege scope
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:
- an import user service launched by this user could still set a value for this node.
- a procedure executed with this user session and with
setAllPrivileges(false)
could still set a value for this node. - a SOAP data service call with this user session could still set a value for this node.
- any trigger with no privilege granted could still set a value for this node when multiple triggers are specified by the data model. Indeed, all triggers implied in the operation are affected by the privilege.
- Throws:
PathAccessException
- If the specified node does not exist.IllegalArgumentException
- If the specified node is not terminal ornull
.- Since:
- 5.8.0
-
setValueEnablingPrivilegeForNode
void setValueEnablingPrivilegeForNode(Object aValue, Path aNodePath) throws UnavailableContentError, PathAccessException, IllegalArgumentException Utility method to set a value for the specified node while disabling all permission checks for this node.This is the same as calling
setPrivilegeForNode(Path)
andsetValue(Object, Path)
successively. As a consequence, the privilege is granted beyond the invocation of this method, as specified bysetPrivilegeForNode(Path)
.- Throws:
UnavailableContentError
- If content has become unavailable due to a data model error.PathAccessException
- If the specified node does not exist.IllegalArgumentException
- If:- the specified node cannot be written;
- the specified value is not consistent with the data model node type;
- the specified node is under an aggregated list;
- the specified node is under a terminal node and the value to set is
the
AdaptationValue.INHERIT_VALUE
.
- Since:
- 5.9.0
- See Also:
-
getValidationReport
ValidationReport getValidationReport()Returns the validation report of this content.This method is equivalent to:
ValueContextForUpdate#getValidationReport(ValidationPolicy.ALL);
- Since:
- 6.0.0
- See Also:
-
getValidationReport
Returns the validation report of this content.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 therecord-level checks in the table controls
are taken into account.Important:
-
Values of nodes that define an auto-increment
(specified in the data model using
the
osd:autoIncrement
element) or a function (specified in the data model using anosd:function
element) are not set if this content is a newtable record
. That is, constraints defined by these nodes are not checked if this content is a newtable record
. - The validation message threshold defined in the EBX® main configuration file is ignored. That is, the validation of this content is not interrupted when the threshold is reached by a constraint and a severity.
-
A
validation item
with aseverity 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.
- Since:
- 6.0.0
- See Also:
-
Values of nodes that define an auto-increment
(specified in the data model using
the
-