public class TheBarbican
extends java.lang.Object
Module that ensures read & write access to documents is managed by the KeepConfig Configuration has convenience functions to check on forms, aliases and fields TODO: Extract API
Constructor and Description |
---|
TheBarbican(KeepDbInfo dbInfo)
Default constructor, the Barbican always works in the context of a database, so we init it with the configuration info of that database
|
Modifier and Type | Method and Description |
---|---|
boolean |
barbicanAllowsThisDocument(KeepJnxSession s,
com.hcl.domino.data.Database parentDB,
com.hcl.domino.data.Document doc,
java.lang.String formModeName,
java.lang.String realFormName)
Check if we can process these documents
|
boolean |
deleteKeepApplicationByApiKey(KeepJnxSession s,
java.lang.String appId)
Deletes an KeepApplication document
|
boolean |
deleteNote(KeepJnxSession s,
com.hcl.domino.data.Database parentDB,
java.lang.String dbFormName,
java.lang.String dbModeName,
com.hcl.domino.data.Document note) |
io.vertx.core.json.JsonObject |
filterDocument(KeepJnxSession s,
java.lang.String modeName,
com.hcl.domino.data.Document note) |
io.vertx.core.json.JsonObject |
filterDocumentSilent(KeepJnxSession s,
java.lang.String modeName,
com.hcl.domino.data.Document note)
Like filterDocument, but no error bubbles up
|
java.lang.String |
getRealFormName(com.hcl.domino.data.Database db,
com.hcl.domino.data.Document note,
java.lang.String overrideFormName) |
java.lang.String |
getRealFormName(com.hcl.domino.data.Database db,
java.lang.String formName) |
boolean |
hasForm(java.lang.String formName)
Returns if a specific form with any mode exist in the configuration Takes aliases into account
|
boolean |
hasFormAndMode(java.lang.String formName,
java.lang.String modeName)
Returns if a specific form and mode exist in the configuration Takes aliases into account
|
KeepApplicationConfigInfo |
retrieveKeepApplicationByApiKey(KeepJnxSession s,
java.lang.String appId) |
io.vertx.core.json.JsonObject |
updateDocument(KeepJnxSession s,
com.hcl.domino.data.Database parentDB,
java.lang.String modeName,
com.hcl.domino.data.Document note,
io.vertx.core.json.JsonObject payload,
java.lang.String parentUnid) |
TheBarbican |
updateNoteFromPayloadWithMode(KeepJnxSession s,
com.hcl.domino.data.Database parentDB,
io.vertx.core.json.JsonObject payload,
com.hcl.domino.data.Document note,
FormAccessModeInfo mode,
java.lang.String apiName,
java.lang.String parentUnid) |
TheBarbican |
validateFormAccessFormula(KeepJnxSession s,
com.hcl.domino.data.Database parentDB,
java.lang.String formula,
com.hcl.domino.data.Document note,
java.lang.String apiName)
Validate the user has access to perform an action using a FormAccessMode, according to the DQL access formula in the KeepConfig
|
public TheBarbican(@Nonnull KeepDbInfo dbInfo)
Default constructor, the Barbican always works in the context of a database, so we init it with the configuration info of that database
dbInfo
- public boolean deleteKeepApplicationByApiKey(KeepJnxSession s, java.lang.String appId)
Deletes an KeepApplication document
s
- appId
- public boolean deleteNote(KeepJnxSession s, com.hcl.domino.data.Database parentDB, java.lang.String dbFormName, java.lang.String dbModeName, com.hcl.domino.data.Document note) throws KeepException
s
- dbModeName
- dbFormName
- note
- KeepException
public io.vertx.core.json.JsonObject filterDocument(KeepJnxSession s, java.lang.String modeName, com.hcl.domino.data.Document note) throws KeepException
s
- modeName
- Mode - to be usednote
- KeepException
public io.vertx.core.json.JsonObject filterDocumentSilent(KeepJnxSession s, java.lang.String modeName, com.hcl.domino.data.Document note)
Like filterDocument, but no error bubbles up
s
- sessionmodeName
- note
- public boolean hasForm(java.lang.String formName)
Returns if a specific form with any mode exist in the configuration Takes aliases into account
formName
- public boolean hasFormAndMode(java.lang.String formName, java.lang.String modeName)
Returns if a specific form and mode exist in the configuration Takes aliases into account
formName
- modeName
- public KeepApplicationConfigInfo retrieveKeepApplicationByApiKey(KeepJnxSession s, java.lang.String appId) throws KeepException
s
- appId
- KeepException
public io.vertx.core.json.JsonObject updateDocument(KeepJnxSession s, com.hcl.domino.data.Database parentDB, java.lang.String modeName, com.hcl.domino.data.Document note, io.vertx.core.json.JsonObject payload, java.lang.String parentUnid) throws java.lang.Exception
s
- parentDB
- modeName
- note
- payload
- parentUnid
- java.lang.Exception
java.lang.Throwable
public TheBarbican updateNoteFromPayloadWithMode(KeepJnxSession s, com.hcl.domino.data.Database parentDB, io.vertx.core.json.JsonObject payload, com.hcl.domino.data.Document note, FormAccessModeInfo mode, java.lang.String apiName, java.lang.String parentUnid) throws java.lang.Exception
s
- parentDB
- payload
- note
- mode
- apiName
- parentUnid
- java.lang.Exception
public TheBarbican validateFormAccessFormula(KeepJnxSession s, com.hcl.domino.data.Database parentDB, java.lang.String formula, com.hcl.domino.data.Document note, java.lang.String apiName) throws KeepException
Validate the user has access to perform an action using a FormAccessMode, according to the DQL access formula in the KeepConfig
s
- parentDB
- formula
- note
- apiName
- KeepException
- error, e.g. not enough access or failure parsing formulapublic boolean barbicanAllowsThisDocument(KeepJnxSession s, com.hcl.domino.data.Database parentDB, com.hcl.domino.data.Document doc, java.lang.String formModeName, java.lang.String realFormName) throws KeepExceptionInsufficientAccess
Check if we can process these documents
s
- The Keep SessionparentDB
- containing the document to validatedoc
- to validateformModeName
- to verifyrealFormName
- formName, if passedKeepExceptionInsufficientAccess
public java.lang.String getRealFormName(@Nonnull com.hcl.domino.data.Database db, java.lang.String formName)
db
- Database containing the formformName
- Form name or aliaspublic java.lang.String getRealFormName(@Nonnull com.hcl.domino.data.Database db, @Nonnull com.hcl.domino.data.Document note, java.lang.String overrideFormName)
db
- Database containing the formnote
- Note to checkoverrideFormName
- Form name to use instead