API doc - RapturePlatform/Rapture GitHub Wiki

Doc API

The Document api is used for manipulating document objects in Rapture. Documents are normally stored in JSON format.

validateDocRepo

HttpDocApi docApi = new HttpDocApi(loginApi);
boolean retVal = docApi.validateDocRepo(docRepoUri);
retVal = baseAPI.doDoc_ValidateDocRepo(docRepoUri);

Entitlement: /repo/write

Validates repository; requires write permission because it can cause files/tables to be created on first use.

Function Parameters

Parameter Type Description
docRepoUri String

Return value

Type Description
boolean

createDocRepo

HttpDocApi docApi = new HttpDocApi(loginApi);
void retVal = docApi.createDocRepo(docRepoUri, config);
retVal = baseAPI.doDoc_CreateDocRepo(docRepoUri, config);

Entitlement: /repo/write

A DocumentRepository is used to store JSON docs. This method creates and configures the repository for an authority.

Function Parameters

Parameter Type Description
docRepoUri String
config String

Return value

Type Description
void

docRepoExists

HttpDocApi docApi = new HttpDocApi(loginApi);
boolean retVal = docApi.docRepoExists(docRepoUri);
retVal = baseAPI.doDoc_DocRepoExists(docRepoUri);

Entitlement: /repo/list

This API call can be used to determine whether a given repository exists.

Function Parameters

Parameter Type Description
docRepoUri String

Return value

Type Description
boolean

docExists

HttpDocApi docApi = new HttpDocApi(loginApi);
boolean retVal = docApi.docExists(docUri);
retVal = baseAPI.doDoc_DocExists(docUri);

Entitlement: /repo/list

This api call can be used to determine whether a given type exists in a given authority.

Function Parameters

Parameter Type Description
docUri String

Return value

Type Description
boolean

getDocRepoConfig

HttpDocApi docApi = new HttpDocApi(loginApi);
DocumentRepoConfig retVal = docApi.getDocRepoConfig(docRepoUri);
retVal = baseAPI.doDoc_GetDocRepoConfig(docRepoUri);

Entitlement: /repo/read

Retrieves the configuration string for the given document repository.

Function Parameters

Parameter Type Description
docRepoUri String

Return value

Type Description
DocumentRepoConfig
Types used in this function

DocumentRepoConfig

Describes config info for a repository that stores Rapture documents.

Field Type
description String
config String
authority String
idGenUri IdGenURI
strictCheck Boolean
indexes Set
fullTextIndexes Set
updateQueue String
documentRepo RaptureDocConfig

getDocRepoStatus

HttpDocApi docApi = new HttpDocApi(loginApi);
Map<String,String> retVal = docApi.getDocRepoStatus(docRepoUri);
retVal = baseAPI.doDoc_GetDocRepoStatus(docRepoUri);

Entitlement: /repo/read

Gets any available information about a repository.

Function Parameters

Parameter Type Description
docRepoUri String

Return value

Type Description
Map<String,String>

getDocRepoConfigs

HttpDocApi docApi = new HttpDocApi(loginApi);
List<DocumentRepoConfig> retVal = docApi.getDocRepoConfigs();
retVal = baseAPI.doDoc_GetDocRepoConfigs();

Entitlement: /repo/read

Retrieves document repositories

Function Parameters

This function takes no parameters.

Return value

Type Description
List

deleteDocRepo

HttpDocApi docApi = new HttpDocApi(loginApi);
void retVal = docApi.deleteDocRepo(docRepoUri);
retVal = baseAPI.doDoc_DeleteDocRepo(docRepoUri);

Entitlement: /repo/write

This method removes a documentRepository and its data from the Rapture system. There is no undo.

Function Parameters

Parameter Type Description
docRepoUri String

Return value

Type Description
void

archiveRepoDocs

HttpDocApi docApi = new HttpDocApi(loginApi);
void retVal = docApi.archiveRepoDocs(docRepoUri, versionLimit, timeLimit, ensureVersionLimit);
retVal = baseAPI.doDoc_ArchiveRepoDocs(docRepoUri, versionLimit, timeLimit, ensureVersionLimit);

Entitlement: /repo/write

This method archives older versions of a documentRepository.

Function Parameters

Parameter Type Description
docRepoUri String
versionLimit int
timeLimit long
ensureVersionLimit boolean

Return value

Type Description
void

getDocAndMeta

HttpDocApi docApi = new HttpDocApi(loginApi);
DocumentWithMeta retVal = docApi.getDocAndMeta(docUri);
retVal = baseAPI.doDoc_GetDocAndMeta(docUri);

Entitlement: /data/get/$f(docUri)

Retrieves the content and the meta data associated with a document, including version and user information. If the storagedoes not support metadata, this method returns a dummy object.

Function Parameters

Parameter Type Description
docUri String

Return value

Type Description
DocumentWithMeta
Types used in this function

DocumentWithMeta

Contains a Rapture document and its metadata.

Field Type
displayName String
metaData DocumentMetadata
content String

getDocMeta

HttpDocApi docApi = new HttpDocApi(loginApi);
DocumentMetadata retVal = docApi.getDocMeta(docUri);
retVal = baseAPI.doDoc_GetDocMeta(docUri);

Entitlement: /data/list/$f(docUri)

Retrieves only the meta data associated with a document, including version and user information. If the storage does notsupport metadata, this method returns a dummy object.

Function Parameters

Parameter Type Description
docUri String

Return value

Type Description
DocumentMetadata
Types used in this function

DocumentMetadata

Contains the metadata, if any, in a Rapture document.

Field Type
version Integer
writeTime Date
createdTimestamp Long
modifiedTimestamp Long
user String
comment String
deleted Boolean

revertDoc

HttpDocApi docApi = new HttpDocApi(loginApi);
DocumentWithMeta retVal = docApi.revertDoc(docUri);
retVal = baseAPI.doDoc_RevertDoc(docUri);

Entitlement: /data/write/$f(docUri)

Reverts this document back to the previous version by taking the previous version and making a new version.

Function Parameters

Parameter Type Description
docUri String

Return value

Type Description
DocumentWithMeta
Types used in this function

DocumentWithMeta

Contains a Rapture document and its metadata.

Field Type
displayName String
metaData DocumentMetadata
content String

getDoc

HttpDocApi docApi = new HttpDocApi(loginApi);
String retVal = docApi.getDoc(docUri);
retVal = baseAPI.doDoc_GetDoc(docUri);

Entitlement: /data/read/$f(docUri)

Retrieves the content of a document.

Function Parameters

Parameter Type Description
docUri String a string of characters used to identify a document

Return value

Type Description
String

putDoc

HttpDocApi docApi = new HttpDocApi(loginApi);
String retVal = docApi.putDoc(docUri, content);
retVal = baseAPI.doDoc_PutDoc(docUri, content);

since version 1.0.0

Entitlement: /data/write/$f(docUri)

Stores a document in the Rapture system.

Function Parameters

Parameter Type Description
docUri String a string of characters used to identify a document
content String the information to be stored within the document

Return value

Type Description
String

putDocWithVersion

HttpDocApi docApi = new HttpDocApi(loginApi);
boolean retVal = docApi.putDocWithVersion(docUri, content, currentVersion);
retVal = baseAPI.doDoc_PutDocWithVersion(docUri, content, currentVersion);

Entitlement: /data/write/$f(docUri)

Attempts to put the content into the repository, but fails if the repository supports versioning and the current version ofthe document stored does not match the version passed. A version of zero implies that the document should not exist. The purposeof this call is for a client to be able to call getDocAndMeta to retrieve an existing document, modify it, and save the contentback, using the version number in the metadata of the document. If another client has modified the data since it was loaded, thiscall will return false, indicating that the save was not possible.

Function Parameters

Parameter Type Description
docUri String
content String
currentVersion int

Return value

Type Description
boolean

putDocWithEventContext

HttpDocApi docApi = new HttpDocApi(loginApi);
DocWriteHandle retVal = docApi.putDocWithEventContext(docUri, content, eventContext);
retVal = baseAPI.doDoc_PutDocWithEventContext(docUri, content, eventContext);

Entitlement: /data/write/$f(docUri)

Store a document in the Rapture system, passing in an event context to be added to any events spawned off by this put. Parts ofthe uri could be automatically generated

Function Parameters

Parameter Type Description
docUri String
content String
eventContext Map<String,String>

Return value

Type Description
DocWriteHandle A DocWriteHandle object that contains a value on whether the write was successful, the uri of the document that was written, and a handle to the event uri that was fired, if any
Types used in this function

DocWriteHandle

This is a write handle returned after a write (update, delete, insert) operation to a document. It contains information about the document

Field Type
isSuccess Boolean
documentURI RaptureURI
eventHandle RunEventHandle

deleteDoc

HttpDocApi docApi = new HttpDocApi(loginApi);
boolean retVal = docApi.deleteDoc(docUri);
retVal = baseAPI.doDoc_DeleteDoc(docUri);

Entitlement: /data/write/$f(docUri)

Removes a document attribute. Can be used to remove all attributes for a given type as well if the key argument is null.

Function Parameters

Parameter Type Description
docUri String

Return value

Type Description
boolean

renameDoc

HttpDocApi docApi = new HttpDocApi(loginApi);
String retVal = docApi.renameDoc(fromDocUri, toDocUri);
retVal = baseAPI.doDoc_RenameDoc(fromDocUri, toDocUri);

Entitlement: /data/write/$f(fromDocUri)

Renames a document, by getting and putting it on the system without transferring the data back to the client.

Function Parameters

Parameter Type Description
fromDocUri String
toDocUri String

Return value

Type Description
String

getDocs

HttpDocApi docApi = new HttpDocApi(loginApi);
Map<String,String> retVal = docApi.getDocs(docUris);
retVal = baseAPI.doDoc_GetDocs(docUris);

Entitlement: /data/batch

Returns a map of contents where the key is the normalized input Uri and the value is the document retrieved

Function Parameters

Parameter Type Description
docUris List

Return value

Type Description
Map<String,String>

getDocAndMetas

HttpDocApi docApi = new HttpDocApi(loginApi);
List<DocumentWithMeta> retVal = docApi.getDocAndMetas(docUris);
retVal = baseAPI.doDoc_GetDocAndMetas(docUris);

Entitlement: /data/batch

Returns a list of documents and their associated meta data - the meta data includes version and user information

Function Parameters

Parameter Type Description
docUris List

Return value

Type Description
List

docsExist

HttpDocApi docApi = new HttpDocApi(loginApi);
List<boolean> retVal = docApi.docsExist(docUris);
retVal = baseAPI.doDoc_DocsExist(docUris);

Entitlement: /data/batch

Returns a list of true/false statements on whether the listed Uris refer to a valid document. Note: a folder is not considered tobe a document.

Function Parameters

Parameter Type Description
docUris List

Return value

Type Description
List

putDocs

HttpDocApi docApi = new HttpDocApi(loginApi);
List<Object> retVal = docApi.putDocs(docUris, contents);
retVal = baseAPI.doDoc_PutDocs(docUris, contents);

Entitlement: /data/batch

Put a series of documents in a batch form. Refer to putDoc for details.

Function Parameters

Parameter Type Description
docUris List
contents List

Return value

Type Description
List

renameDocs

HttpDocApi docApi = new HttpDocApi(loginApi);
List<String> retVal = docApi.renameDocs(authority, comment, fromDocUris, toDocUris);
retVal = baseAPI.doDoc_RenameDocs(authority, comment, fromDocUris, toDocUris);

Entitlement: /data/batch

Renames a series of documents in batch form. See renameDoc.

Function Parameters

Parameter Type Description
authority String
comment String
fromDocUris List
toDocUris List

Return value

Type Description
List

deleteDocsByUriPrefix

HttpDocApi docApi = new HttpDocApi(loginApi);
List<String> retVal = docApi.deleteDocsByUriPrefix(docUri);
retVal = baseAPI.doDoc_DeleteDocsByUriPrefix(docUri);

Entitlement: /data/write/$f(docUri)

Removes a folder and its contents recursively, including empty subfolders. Validates entitlement on individual docs and folders. Returns a list of the documents and folders removed.

Function Parameters

Parameter Type Description
docUri String

Return value

Type Description
List

listDocsByUriPrefix

HttpDocApi docApi = new HttpDocApi(loginApi);
Map<String,RaptureFolderInfo> retVal = docApi.listDocsByUriPrefix(docUri, depth);
retVal = baseAPI.doDoc_ListDocsByUriPrefix(docUri, depth);

Entitlement: /data/read/$f(docUri)

Returns a list of Uris of all documents and folders below this point, mapping the Uri to a RaptureFolderInfo object

Function Parameters

Parameter Type Description
docUri String
depth int

Return value

Type Description
Map<String,RaptureFolderInfo>

setDocAttribute

HttpDocApi docApi = new HttpDocApi(loginApi);
boolean retVal = docApi.setDocAttribute(attributeUri, value);
retVal = baseAPI.doDoc_SetDocAttribute(attributeUri, value);

Entitlement: /data/write/$f(attributeUri)

Adds a single attribute to an existing document.

Function Parameters

Parameter Type Description
attributeUri String
value String

Return value

Type Description
boolean

setDocAttributes

HttpDocApi docApi = new HttpDocApi(loginApi);
Map<String,boolean> retVal = docApi.setDocAttributes(attributeUri, keys, values);
retVal = baseAPI.doDoc_SetDocAttributes(attributeUri, keys, values);

Entitlement: /data/write/$f(attributeUri)

Adds attributes to an existing document in key/value pairs.

Function Parameters

Parameter Type Description
attributeUri String
keys List
values List

Return value

Type Description
Map<String,boolean>

getDocAttribute

HttpDocApi docApi = new HttpDocApi(loginApi);
XferDocumentAttribute retVal = docApi.getDocAttribute(attributeUri);
retVal = baseAPI.doDoc_GetDocAttribute(attributeUri);

Entitlement: /data/read/$f(attributeUri)

Get a single attribute for the given uri, attributeType, and key e.g. displayName/$attributeType/key

Function Parameters

Parameter Type Description
attributeUri String

Return value

Type Description
XferDocumentAttribute
Types used in this function

XferDocumentAttribute

Holds a key/value pair for an attribute of a document object.

Field Type
attributeType String
key String
value String

getDocAttributes

HttpDocApi docApi = new HttpDocApi(loginApi);
List<XferDocumentAttribute> retVal = docApi.getDocAttributes(attributeUri);
retVal = baseAPI.doDoc_GetDocAttributes(attributeUri);

Entitlement: /data/read/$f(attributeUri)

Gets all known attributes for the given uri e.g. displayName/$attributeType

Function Parameters

Parameter Type Description
attributeUri String

Return value

Type Description
List

deleteDocAttribute

HttpDocApi docApi = new HttpDocApi(loginApi);
boolean retVal = docApi.deleteDocAttribute(attributeUri);
retVal = baseAPI.doDoc_DeleteDocAttribute(attributeUri);

Entitlement: /data/write/$f(attributeUri)

Removes a document attribute. Can be used to remove all attributes for a given type as well if key argument is null.

Function Parameters

Parameter Type Description
attributeUri String

Return value

Type Description
boolean

getDocRepoIdGenUri

HttpDocApi docApi = new HttpDocApi(loginApi);
String retVal = docApi.getDocRepoIdGenUri(docRepoUri);
retVal = baseAPI.doDoc_GetDocRepoIdGenUri(docRepoUri);

Entitlement: /admin/idgen

Returns the Uri that's associated with the idgen that belongs to this document repository. Note that every repository has aidgen Uri, even if no idgen is attached to it.

Function Parameters

Parameter Type Description
docRepoUri String

Return value

Type Description
String

setDocRepoIdGenConfig

HttpDocApi docApi = new HttpDocApi(loginApi);
DocumentRepoConfig retVal = docApi.setDocRepoIdGenConfig(docRepoUri, idGenConfig);
retVal = baseAPI.doDoc_SetDocRepoIdGenConfig(docRepoUri, idGenConfig);

Entitlement: /admin/idgen

This method creates a idgen and attaches it to a document repository. This way, when a document containing an autoid stringis created that autoid will be replaced with a unique id.

Function Parameters

Parameter Type Description
docRepoUri String
idGenConfig String

Return value

Type Description
DocumentRepoConfig
Types used in this function

DocumentRepoConfig

Describes config info for a repository that stores Rapture documents.

Field Type
description String
config String
authority String
idGenUri IdGenURI
strictCheck Boolean
indexes Set
fullTextIndexes Set
updateQueue String
documentRepo RaptureDocConfig

getDocRepoIdGenConfig

HttpDocApi docApi = new HttpDocApi(loginApi);
RaptureIdGenConfig retVal = docApi.getDocRepoIdGenConfig(docRepoUri);
retVal = baseAPI.doDoc_GetDocRepoIdGenConfig(docRepoUri);

Entitlement: /admin/idgen

This method returns any idgen associated with this doc repo, or null if there isn't one.

Function Parameters

Parameter Type Description
docRepoUri String

Return value

Type Description
RaptureIdGenConfig
Types used in this function

RaptureIdGenConfig

Holds the config info for a idgen as described in the idgen API.

Field Type
name String
config String
authority String
⚠️ **GitHub.com Fallback** ⚠️