public class DocumentFunctions
extends java.lang.Object
Helper functions for converting documents to JSON and JSON to documents. Mostly to relieve complexity in KeepJNXSession
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
FIELD_ASSIGNEDTO |
static java.lang.String |
FIELD_CHAIR |
static java.lang.String |
FIELD_DOLL_INET_CHAIR |
static java.lang.String |
FIELD_DOLL_UPDATEDBY |
static java.lang.String |
FIELD_FROM |
static java.lang.String |
FIELD_FYIASSIGNEDTO |
static java.lang.String |
FIELD_INET_FROM |
static java.lang.String |
FIELD_INET_FYI_NAMES |
static java.lang.String |
FIELD_INET_OPTIONAL_NAMES |
static java.lang.String |
FIELD_INET_REQUIRED_NAMES |
static java.lang.String |
FIELD_INET_SEND_TO |
static java.lang.String |
FIELD_OPTIONAL_ASSIGNEDTO |
static java.lang.String |
FIELD_PRINCIPAL |
static java.lang.String |
FIELD_SEND_TO |
Modifier and Type | Method and Description |
---|---|
static io.vertx.core.json.JsonArray |
convertToList(java.lang.String key,
io.vertx.core.json.JsonObject source)
Validate and/or convert values into list format
|
static boolean |
decryptDocument(KeepJnxSession session,
com.hcl.domino.data.Document doc,
java.lang.String jwtClaim) |
static java.util.Optional<java.lang.Object> |
getCalendarFromJson(io.vertx.core.json.JsonObject jsonSource,
java.lang.String key)
Returns a Optional calendarEntry from a JsonObject, empty if it isn’t Date/Time Needs to be Object, not calendar for additional processing in .orElse
|
static java.util.Optional<com.hcl.domino.data.Document> |
getDocFromCollectionEntry(com.hcl.domino.data.Database db,
com.hcl.domino.data.CollectionEntry entry)
Returns a document, current or soft deleted
|
static io.vertx.core.json.JsonObject |
getDocumentResult(com.hcl.domino.data.Document doc,
DbRequestParameters<io.vertx.core.json.JsonObject> request)
Retrieves and updates and document output result
|
static boolean |
looksLikeIso8601(java.lang.String source)
Checks loosly if a string matches IS8601 datetime format YYYY-MM-DDTHH:mm:ss.sssZ
|
static boolean |
processAdditionalFields(com.hcl.domino.data.Database parentDB,
com.hcl.domino.data.Document doc,
java.util.Map.Entry<java.lang.String,java.lang.Object> entry)
Stores special AdditionalFields Json Object as text item in a Notes Document CounterIntuitive: Returns TRUE if NO processing happened, so the Stream processing can continue
|
static boolean |
processArrayValue(com.hcl.domino.data.Document doc,
java.util.Map.Entry<java.lang.String,java.lang.Object> entry)
Stores Json Array values as multi-value item in a Notes Document CounterIntuitive: Returns TRUE if NO processing happened, so the Stream processing can continue
|
static boolean |
processBooleanValue(com.hcl.domino.data.Document doc,
java.util.Map.Entry<java.lang.String,java.lang.Object> entry)
Stores a boolean value as 0 or 1 integer in item in a Notes Document CounterIntuitive: Returns TRUE if NO processing happened, so the Stream processing can continue
|
static boolean |
processJsonValue(com.hcl.domino.data.Document doc,
java.util.Map.Entry<java.lang.String,java.lang.Object> entry)
Stores Json Object as text item in a Notes Document CounterIntuitive: Returns TRUE if NO processing happened, so the Stream processing can continue
|
static boolean |
removeDeletedItem(com.hcl.domino.data.Document doc,
java.util.Map.Entry<java.lang.String,java.lang.Object> entry)
Removes an item from the document id the value is null.
|
static void |
saveItemToDoc(com.hcl.domino.data.Document doc,
io.vertx.core.json.JsonObject jsonSource,
java.util.Map.Entry<java.lang.String,java.lang.Object> entry)
Saves an item into the Notes document as either string or calendar
|
public static final java.lang.String FIELD_ASSIGNEDTO
public static final java.lang.String FIELD_OPTIONAL_ASSIGNEDTO
public static final java.lang.String FIELD_INET_REQUIRED_NAMES
public static final java.lang.String FIELD_INET_OPTIONAL_NAMES
public static final java.lang.String FIELD_FYIASSIGNEDTO
public static final java.lang.String FIELD_INET_FYI_NAMES
public static final java.lang.String FIELD_CHAIR
public static final java.lang.String FIELD_DOLL_INET_CHAIR
public static final java.lang.String FIELD_PRINCIPAL
public static final java.lang.String FIELD_FROM
public static final java.lang.String FIELD_INET_FROM
public static final java.lang.String FIELD_SEND_TO
public static final java.lang.String FIELD_INET_SEND_TO
public static final java.lang.String FIELD_DOLL_UPDATEDBY
public static io.vertx.core.json.JsonArray convertToList(java.lang.String key, io.vertx.core.json.JsonObject source)
Validate and/or convert values into list format
key
- source
- public static boolean decryptDocument(KeepJnxSession session, com.hcl.domino.data.Document doc, java.lang.String jwtClaim)
session
- doc
- jwtClaim
- public static java.util.Optional<java.lang.Object> getCalendarFromJson(io.vertx.core.json.JsonObject jsonSource, java.lang.String key)
Returns a Optional calendarEntry from a JsonObject, empty if it isn’t Date/Time Needs to be Object, not calendar for additional processing in .orElse
jsonSource
- JsonObject with DateTime ISOkey
- Key to DTpublic static java.util.Optional<com.hcl.domino.data.Document> getDocFromCollectionEntry(com.hcl.domino.data.Database db, com.hcl.domino.data.CollectionEntry entry)
Returns a document, current or soft deleted
db
- Databaseentry
- CollectionEntrypublic static io.vertx.core.json.JsonObject getDocumentResult(com.hcl.domino.data.Document doc, DbRequestParameters<io.vertx.core.json.JsonObject> request)
Retrieves and updates and document output result
doc
- request
- public static boolean looksLikeIso8601(java.lang.String source)
Checks loosly if a string matches IS8601 datetime format YYYY-MM-DDTHH:mm:ss.sssZ
source
- the suspectpublic static boolean processAdditionalFields(com.hcl.domino.data.Database parentDB, com.hcl.domino.data.Document doc, java.util.Map.Entry<java.lang.String,java.lang.Object> entry)
Stores special AdditionalFields Json Object as text item in a Notes Document CounterIntuitive: Returns TRUE if NO processing happened, so the Stream processing can continue
parentDB
- the database the document came fromdoc
- destination to store values inentry
- key/value to process if it is an arraypublic static boolean processArrayValue(com.hcl.domino.data.Document doc, java.util.Map.Entry<java.lang.String,java.lang.Object> entry)
Stores Json Array values as multi-value item in a Notes Document CounterIntuitive: Returns TRUE if NO processing happened, so the Stream processing can continue
doc
- destination to store values inentry
- key/value to process if it is an arraypublic static boolean processBooleanValue(com.hcl.domino.data.Document doc, java.util.Map.Entry<java.lang.String,java.lang.Object> entry)
Stores a boolean value as 0 or 1 integer in item in a Notes Document CounterIntuitive: Returns TRUE if NO processing happened, so the Stream processing can continue
doc
- destination to store values inentry
- key/value to process if it is an arraypublic static boolean processJsonValue(com.hcl.domino.data.Document doc, java.util.Map.Entry<java.lang.String,java.lang.Object> entry)
Stores Json Object as text item in a Notes Document CounterIntuitive: Returns TRUE if NO processing happened, so the Stream processing can continue
doc
- destination to store values inentry
- key/value to process if it is an arraypublic static boolean removeDeletedItem(com.hcl.domino.data.Document doc, java.util.Map.Entry<java.lang.String,java.lang.Object> entry)
Removes an item from the document id the value is null. CounterIntuitive: Returns TRUE if NO REMOVAL happened, so the Stream processing can continue
doc
- the document to store values inentry
- key/value with entry name/valuepublic static void saveItemToDoc(com.hcl.domino.data.Document doc, io.vertx.core.json.JsonObject jsonSource, java.util.Map.Entry<java.lang.String,java.lang.Object> entry)
Saves an item into the Notes document as either string or calendar
doc
- destination to store values injsonSource
- entry
- key/value