public interface IDfValidator
null
if the interface is not
associated with an object instance; otherwise it will return the
IDfPersistentObject interface from which the validator was obtained.Modifier and Type | Method and Description |
---|---|
IDfPersistentObject |
getAssociatedObject()
Returns the IDfPersistentObject interface of the object associated
with the IDfValidator.
|
int |
getMaxErrorBeforeStop()
Returns the upper limit for validation detection.
|
java.lang.String |
getObjectType()
Returns the object type associated with this validator.
|
IDfId |
getPolicyID()
Returns the business policy id associated with this validator.
|
java.lang.String |
getStateName()
Returns the name of the current business policy state associated with
this validator.
|
java.lang.String |
getTimePattern()
Returns the time pattern used for validation.
|
IDfValueAssistance |
getValueAssistance(java.lang.String attrName,
IDfProperties depAttrValues)
Returns the value assistance associated with the specified attribute.
|
IDfProperties |
getValueAssistanceDependencies(java.lang.String attrName)
Return the list of attributes on which the value assistance selection
depends on.
|
java.lang.String |
getWidgetType(int environment,
java.lang.String attrName)
Find the appropriate widget type given a specific
development environment and attribute name.
|
boolean |
hasValueAssistance(java.lang.String attrName)
Indicates whether value assistance is setup for the specified
attribute or not.
|
void |
setMaxErrorBeforeStop(int stopAfterNumOfErrors)
Sets the upper limit for validation detection.
|
void |
setTimePattern(java.lang.String timePattern)
Sets an alternative time pattern used for validation.
|
void |
validateAll(IDfProperties attrValues,
boolean modifiedAttrsOnly)
Performs both attribute level and object level validation.
|
void |
validateAllAttrRules(IDfProperties attrValues,
boolean modifiedAttrsOnly)
Validate the user input
attrValues with all the attribute level
validation rules specified for this object type, policy and state
set in the Data Dictionary. |
void |
validateAllObjRules(IDfProperties attrValues)
Validate the user input attrValues with all the object level
validation rules specified for this object type, policy and state
set in the Data Dictionary.
|
void |
validateAttrRules(java.lang.String attrName,
IDfList values,
IDfProperties depAttrValues)
Validate the specified attribute with the validation rules set in
the Data Dictionary given a list of attribute values, and an IDfProperties
interface containing dependent attributes.
|
void validateAll(IDfProperties attrValues, boolean modifiedAttrsOnly) throws DfException
If attrValues
passed in is null
, the value in the
object instance associated with this IDfValidator is used. (If there is no
object instance associated, an exception will be thrown)
If modifiedAttrsOnly
is set to true
, attribute level
validation will be performed on attributes that are modified but not
yet validated (e.g. by an explicit call to validateAttr
). Attributes
can be modified via calls to append*, insert*, set[Repeating]*, remove* or removeAll.
If modifiedAttrsOnly
is set to false
, attribute level validation will be
performed on all the attributes within this object type.
The following code example demonstrates how to validate all attributes for an object type, specifically those attributes that have been modified:
IDfPersistentObject pObj = null; IDfValidator v = null; try { pObj = sess.getObject(new DfId("0900d5bb8001fd49")); pObj.setInt("int_attr", 6); // Modifying the attr here... v = pObj.getValidator(); v.validateAll(null,true); } catch(DfValidationException ve) { // Validation rules violated... }
attrValues
- specifies the attribute name/attribute values pair
related to the validation. If attrValues
is null
,
the values will be looked up from the object
instance itself, provided the validator is
object specific.modifiedAttrsOnly
- specifies whether to perform attribute
level validation on all the attributes
within this object type, or on the modified
attributes only.DfException
- if validation rules are violated.validateAllAttrRules(com.documentum.fc.common.IDfProperties, boolean)
,
validateAllObjRules(com.documentum.fc.common.IDfProperties)
,
validateAttrRules(java.lang.String, com.documentum.fc.common.IDfList, com.documentum.fc.common.IDfProperties)
void validateAllAttrRules(IDfProperties attrValues, boolean modifiedAttrsOnly) throws DfException
attrValues
with all the attribute level
validation rules specified for this object type, policy and state
set in the Data Dictionary. If attrValues
is
null
, the value in the object instance associated with this
IDfValidator is used. (If there is no object instance associated, an exception will
be thrown)
If modifiedAttrsOnly
is set to true
, attribute level
validation will be performed on attributes that are modified but not
yet validated (e.g. by an explicit call to validateAttr
). Attributes
can be modified via calls to append*, insert*, set[Repeating]*, remove* or removeAll.
If modifiedAttrsOnly
is set to false
, attribute level validation
will be performed on all the attributes within this object type.
The following code example demonstrates how to validate the attribute assigned to the IDfProperties interface list:
IDfPersistentObject pObj = null; IDfValidator v = null; IDfProperties props = new DfProperties(); IDfList values = new DfList(IDfList.DF_STRING); try { pObj = sess.getObject(new DfId("0900d5bb8001fd49")); v = pObj.getValidator(); values.appendString("6"); props.putString("str_attr", values); v.validateAllAttrRules(props, false); } catch(DfValidationException ve) { // Validation rules violated... }
attrValues
- specifies the attribute name/attribute values pair
related to the validation. If attrValues is null
,
the values will be looked up from the object
instance itself, provided the validator is object specific.modifiedAttrsOnly
- specifies whether to perform attribute
level validation on all the attributes
within this object type, or on the modified
attributes only.DfException
- if validation rules are violated.validateAll(com.documentum.fc.common.IDfProperties, boolean)
,
validateAllObjRules(com.documentum.fc.common.IDfProperties)
,
validateAttrRules(java.lang.String, com.documentum.fc.common.IDfList, com.documentum.fc.common.IDfProperties)
void validateAllObjRules(IDfProperties attrValues) throws DfException
attrValues
is
null
, the value in the object instance associated
with this IDfValidator is used. (If there is no object instance associated,
an exception will be thrown)
The following code example demonstrates how to validate the attribute added to the IDfProperties interface list based on object rules defined when the object type was created:
IDfPersistentObject pObj = null; IDfValidator v = null; IDfProperties props = new DfProperties(); IDfList values = new DfList(IDfList.DF_STRING); try { pObj = sess.getObject(new DfId("0900d5bb8001fd49")); v = pObj.getValidator(); values.appendString("6"); props.putString("str_attr", values); v.validateAllObjRules(props); } catch(DfValidationException ve) { // Validation rules violated... }
attrValues
- the attribute name/values pairs used for
this validation. If values are null
,
the value will be looked up from the object
instance itself, provided that the validator is
object specific.DfException
- - if validation rules are violated.validateAll(com.documentum.fc.common.IDfProperties, boolean)
,
validateAllAttrRules(com.documentum.fc.common.IDfProperties, boolean)
,
validateAttrRules(java.lang.String, com.documentum.fc.common.IDfList, com.documentum.fc.common.IDfProperties)
void validateAttrRules(java.lang.String attrName, IDfList values, IDfProperties depAttrValues) throws DfException
If values passed in is null, the values in the object instance associated with this IDfValidator is used. (If there is no object instance associated, an exception will be thrown)
The following code example demonstrates how to validate an attribute given a list of values where there are no dependencies:
IDfPersistentObject pObj = null; IDfValidator v = null; IDfList values = new IDfList(); try { pObj = sess.getObject(new DfId("0900d5bb8001fd49")); v = pObj.getValidator(); values.insertString("6"); v.validateAttrRules("str_attr", valList, null); } catch(DfException dfe) { // Validation rules violated... }
attrName
- the name of the attribute.values
- the list of values to be validated. If values are null
,
the value will be looked up from the object
instance itself, provided that the validator is
object specific.depAttrValues
- the list of attribute name/values pairs that
the evaluation of value assistance is dependent on.
If depAttrValues is null
, but the value assistance
selection does depend on other attribute values,
the attribute values will be looked up from the
object instance itself, provided that the validator
is object specific.DfException
- if validation rules are violated.validateAll(com.documentum.fc.common.IDfProperties, boolean)
,
validateAllAttrRules(com.documentum.fc.common.IDfProperties, boolean)
,
validateAllObjRules(com.documentum.fc.common.IDfProperties)
IDfValueAssistance getValueAssistance(java.lang.String attrName, IDfProperties depAttrValues) throws DfException
The following code example demonstrates how to obtain an IDfValueAssistance interface for one of a sysobject's attributes:
IDfPersistentObject pObj = sess.getObject(new DfId("0900d5bb8001fd49")); IDfValidator v = pObj.getValidator(); IDfValueAssistance va = v.getValueAssistance("attr_list", null);
attrName
- the name of the attribute.depAttrValues
- the list of attribute name/values pairs that
the evaluation of value assistance is dependent on.
If depAttrValues is null
, but the value assistance
selection does depend on other attribute values,
the attribute values will be looked up from the object
instance itself, provided that the validator is object specific.DfException
- if the server returns an error.hasValueAssistance(java.lang.String)
,
getValueAssistanceDependencies(java.lang.String)
java.lang.String getWidgetType(int environment, java.lang.String attrName) throws DfException
The following code example demonstrates how to obtain the CLSID of an ActiveX component given the Microsoft development environment:
IDfPersistentObject pObj = sess.getObject(new DfId("0900d5bb8001fd49")); IDfValidator v = pObj.getValidator(); String retVal = v.getWidgetType(1, "str_attr");
environment
- specifies the development environment for the validation widgets.
Available choices are:
0 Java - obtain the full Java ClassPath 1 Microsoft - obtain the CLSID of the ActiveX control
attrName
- specifies the name of the attribute associated with the widget.environent
is set to 0 or 1, respectively).DfException
- if unable to obtain a widget type.IDfProperties getValueAssistanceDependencies(java.lang.String attrName) throws DfException
The following code example demonstrates how to obtain an IDfProperties interface containing a list of dependent attribute names:
IDfPersistentObject pObj = sess.getObject(new DfId("0900d5bb8001fd49")); IDfValidator v = pObj.getValidator(); IDfProperties props = v.getValueAssistanceDependencies("str_list_dep"); if (props != null) { IDfList depAttrsName = props.getProperties(); for (int i = 0; i < props.getCount(); i++) { System.out.println(depAttrsName.getString(i)); } }
attrName
- the attribute to get the dependencies for.null
will be returned.DfException
- if the server returns an error.hasValueAssistance(java.lang.String)
,
getValueAssistance(java.lang.String, com.documentum.fc.common.IDfProperties)
void setMaxErrorBeforeStop(int stopAfterNumOfErrors)
stopAfterNumOfErrors
- specifies the maximum
number of violated validation rules
validation calls will detect. If
"stopAfterNumOfErrors" is set to zero (the
default), validation will not stop until it
completes all the validation rules.void setTimePattern(java.lang.String timePattern)
timePattern
- specifies a date time pattern the user
would like to use in addition to the client
desktop setting for validation. It should be
a Documentum date/time pattern string. See
the comments for the constructor
DfTime(String, String) for a listing of the legal
patterns.IDfPersistentObject getAssociatedObject()
null
otherwise.boolean hasValueAssistance(java.lang.String attrName) throws DfException
attrName
- specifies the name of the attributetrue
if there is value assistance for the specified attribute,
false
otherwise.DfException
- if the server returns an error.getValueAssistance(java.lang.String, com.documentum.fc.common.IDfProperties)
,
getValueAssistanceDependencies(java.lang.String)
java.lang.String getObjectType()
getPolicyID()
,
getStateName()
IDfId getPolicyID()
getObjectType()
,
getStateName()
java.lang.String getStateName()
getObjectType()
,
getPolicyID()
int getMaxErrorBeforeStop()
java.lang.String getTimePattern()
Copyright 1994-2023 OpenText Corporation. All rights reserved.