Class IxbusDocumentMapper
java.lang.Object
org.exoplatform.addons.ixbus.util.IxbusDocumentMapper
Maps the folders returned by the ixbus parapheur API to
DocumentEntity. A folder the API returns without one of the
optional fields is mapped without it, and a folder that cannot be mapped at
all is skipped, so one malformed folder never empties a whole list.-
Method Summary
Modifier and TypeMethodDescriptionstatic List<DocumentEntity> toDocumentEntities(org.json.JSONArray folders, String serverUrl, Predicate<org.json.JSONObject> filter) Maps every folder of the payload accepted by the filter, most recent first (the API returns them oldest first).static DocumentEntitytoDocumentEntity(org.json.JSONObject folder, String serverUrl) Maps one folder.
-
Method Details
-
toDocumentEntities
public static List<DocumentEntity> toDocumentEntities(org.json.JSONArray folders, String serverUrl, Predicate<org.json.JSONObject> filter) Maps every folder of the payload accepted by the filter, most recent first (the API returns them oldest first).- Parameters:
folders- the API payloadserverUrl- the ixbus server url, used to build each folder's linkfilter- which folders to keep, read on the raw JSON object- Returns:
- the mapped folders, never null
-
toDocumentEntity
Maps one folder. Onlyidentifiantis required.- Parameters:
folder- the folder as returned by the APIserverUrl- the ixbus server url- Returns:
- the mapped folder
-