public class FormAccessModeInfo
extends java.lang.Object
Class to hold information about Form mode. This is a state in the workflow at which a form exists, e.g. “Draft”, “Approval”. At different modes a Form will be accessible to different people and different pre- and post-scripts can be run. onLoad runs prior to returning the result for a GET request. onSave runs prior to saving to the database, after applying values from the HTTP request. onSave can do validation or data manipulation. The language used for the manipulation will be defined at the KeepDbInfo object.
Modifier and Type | Class and Description |
---|---|
static class |
FormAccessModeInfo.FormAccessModeRules |
Constructor and Description |
---|
FormAccessModeInfo()
Standard constructor
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getDeleteAccessFormula()
String formula to define delete access.
|
java.lang.String |
getModeName()
Gets the name associated with this mode
|
java.lang.String |
getOnLoad()
String of formula to be run prior to returning the result for a GET request
|
java.lang.String |
getOnSave()
String of formula to be run after applying request values from a POST / PATCH request and prior to saving to the database
|
java.util.Set<java.lang.String> |
getReadAccessFields()
Subset of fields to return in any GET request
|
java.lang.String |
getReadAccessFormula()
String formula to define read access.
|
java.util.List<FormAccessModeInfo.FormAccessModeRules> |
getValidationRules()
Set of validation rules, with each rule having a formula to process and an error message to return.
|
java.util.Set<java.lang.String> |
getWriteAccessFields()
Subset of fields to accept in any POST / PATCH request
|
java.lang.String |
getWriteAccessFormula()
String formula to define write access.
|
boolean |
hasReadAccessField(java.lang.String key)
Check if a field has read access If NO fields are there it is true
|
boolean |
isAllowAnyField() |
boolean |
isComputeWithForm()
Applies the underlying Domino Form’s Input Translation and Input Validation formulas prior to save
|
boolean |
isStrictInput()
Gets whether an error should be thrown if the fields expected for a POST / PATCH are missing.
|
void |
setAllowAnyField(boolean allowAnyField) |
void |
setComputeWithForm(boolean computeWithForm)
Sets whether or not to apply the underlying Domino Form’s Input Translation and Input Validation formulas prior to save
|
void |
setDeleteAccessFormula(java.lang.String deleteAccessFormula)
Sets formula to define delete access, e.g.
|
void |
setModeName(java.lang.String modeName)
Sets the name to associate this mode to
|
void |
setOnLoad(java.lang.String onLoad)
Sets the formula to run prior to returning result for a GET request
|
void |
setOnSave(java.lang.String onSave)
Sets the formula to be run after applying request values from a POST / PATCH request and prior to saving to the database
|
FormAccessModeInfo |
setReadAccessFields(java.util.Collection<java.lang.String> readAccessFields)
Sets the fields to return in any GET request
|
FormAccessModeInfo |
setReadAccessFormula(java.lang.String readAccessFormula)
Sets formula to define write access, e.g.
|
FormAccessModeInfo |
setStrictInput(boolean strictInput)
Sets whether an error should be thrown if the fields expected for a POST / PATCH are missing.
|
FormAccessModeInfo |
setValidationRules(java.util.Collection<FormAccessModeInfo.FormAccessModeRules> validationRules)
Sets the validation rules to process in a POST / PATCH request
|
FormAccessModeInfo |
setWriteAccessFields(java.util.Collection<java.lang.String> writeAccessFields)
Sets the fields to accept in any POST / PATCH request
|
FormAccessModeInfo |
setWriteAccessFormula(java.lang.String writeAccessFormula)
Sets formula to define write access, e.g.
|
io.vertx.core.json.JsonObject |
toJson() |
public java.lang.String getDeleteAccessFormula()
String formula to define delete access.
public java.lang.String getModeName()
Gets the name associated with this mode
public java.lang.String getOnLoad()
String of formula to be run prior to returning the result for a GET request
public java.lang.String getOnSave()
String of formula to be run after applying request values from a POST / PATCH request and prior to saving to the database
public java.util.Set<java.lang.String> getReadAccessFields()
Subset of fields to return in any GET request
public java.lang.String getReadAccessFormula()
String formula to define read access.
public java.util.List<FormAccessModeInfo.FormAccessModeRules> getValidationRules()
Set of validation rules, with each rule having a formula to process and an error message to return. Formulas are in DQL format
public java.util.Set<java.lang.String> getWriteAccessFields()
Subset of fields to accept in any POST / PATCH request
public java.lang.String getWriteAccessFormula()
String formula to define write access.
public boolean hasReadAccessField(java.lang.String key)
Check if a field has read access If NO fields are there it is true
key
- public boolean isAllowAnyField()
public boolean isComputeWithForm()
Applies the underlying Domino Form’s Input Translation and Input Validation formulas prior to save
public boolean isStrictInput()
Gets whether an error should be thrown if the fields expected for a POST / PATCH are missing. If false, any additional fields supplied are just dropped.
public void setAllowAnyField(boolean allowAnyField)
allowAnyField
- the allowAnyField to setpublic void setComputeWithForm(boolean computeWithForm)
Sets whether or not to apply the underlying Domino Form’s Input Translation and Input Validation formulas prior to save
computeWithForm
- whether to run {code computeWithForm} method on the document before savepublic void setDeleteAccessFormula(java.lang.String deleteAccessFormula)
Sets formula to define delete access, e.g.
@IsMember("[Finance]";@UserRoles);
Result: Mode is only accessible to users allocated the Finance role.!@IsNotMember("[R&D]":"[Admin]";@UserRoles);
Result: Mode is only accessible to users in either R&D or Admin roles.@IsMember("Marketing Group"; @UserNamesList);
Result: Mode is only accessible to users or groups in the "Marketing Group" group@IsMember("*\/OU=HR\/O=MyCorp"; @UserNamesList);
Result: Mode is only accessible to users with the Organization Unit "HR" and Orgnization "MyCorp" in their username
deleteAccessFormula
- public void setModeName(@Nonnull java.lang.String modeName)
Sets the name to associate this mode to
modeName
- name of the modepublic void setOnLoad(java.lang.String onLoad)
Sets the formula to run prior to returning result for a GET request
onLoad
- formula to runpublic void setOnSave(java.lang.String onSave)
Sets the formula to be run after applying request values from a POST / PATCH request and prior to saving to the database
onSave
- formula to reunpublic FormAccessModeInfo setReadAccessFields(java.util.Collection<java.lang.String> readAccessFields)
Sets the fields to return in any GET request
readAccessFields
- list of fields to returnpublic FormAccessModeInfo setReadAccessFormula(java.lang.String readAccessFormula)
Sets formula to define write access, e.g.
@IsMember("[Finance]";@UserRoles);
Result: Mode is only accessible to users allocated the Finance role.!@IsNotMember("[R&D]":"[Admin]";@UserRoles);
Result: Mode is only accessible to users in either R&D or Admin roles.@IsMember("Marketing Group"; @UserNamesList);
Result: Mode is only accessible to users or groups in the "Marketing Group" group@IsMember("*\/OU=HR\/O=MyCorp"; @UserNamesList);
Result: Mode is only accessible to users with the Organization Unit "HR" and Orgnization "MyCorp" in their username
readAccessFormula
- public FormAccessModeInfo setStrictInput(boolean strictInput)
Sets whether an error should be thrown if the fields expected for a POST / PATCH are missing. If false, any additional fields supplied are just dropped.
strictInput
- method for validating JSON inputpublic FormAccessModeInfo setValidationRules(java.util.Collection<FormAccessModeInfo.FormAccessModeRules> validationRules)
Sets the validation rules to process in a POST / PATCH request
validationRules
- list of fields to acceptpublic FormAccessModeInfo setWriteAccessFields(java.util.Collection<java.lang.String> writeAccessFields)
Sets the fields to accept in any POST / PATCH request
writeAccessFields
- list of fields to acceptpublic FormAccessModeInfo setWriteAccessFormula(java.lang.String writeAccessFormula)
Sets formula to define write access, e.g.
@IsMember("[Finance]";@UserRoles);
Result: Mode is only accessible to users allocated the Finance role.!@IsNotMember("[R&D]":"[Admin]";@UserRoles);
Result: Mode is only accessible to users in either R&D or Admin roles.@IsMember("Marketing Group"; @UserNamesList);
Result: Mode is only accessible to users or groups in the "Marketing Group" group@IsMember("*\/OU=HR\/O=MyCorp"; @UserNamesList);
Result: Mode is only accessible to users with the Organization Unit "HR" and Orgnization "MyCorp" in their username
writeAccessFormula
- public io.vertx.core.json.JsonObject toJson()