API doc - RapturePlatform/Rapture GitHub Wiki
The Document api is used for manipulating document objects in Rapture. Documents are normally stored in JSON format.
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.
Parameter | Type | Description |
---|---|---|
docRepoUri | String |
Type | Description |
---|---|
boolean |
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.
Parameter | Type | Description |
---|---|---|
docRepoUri | String | |
config | String |
Type | Description |
---|---|
void |
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.
Parameter | Type | Description |
---|---|---|
docRepoUri | String |
Type | Description |
---|---|
boolean |
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.
Parameter | Type | Description |
---|---|---|
docUri | String |
Type | Description |
---|---|
boolean |
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.
Parameter | Type | Description |
---|---|---|
docRepoUri | String |
Type | Description |
---|---|
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 |
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.
Parameter | Type | Description |
---|---|---|
docRepoUri | String |
Type | Description |
---|---|
Map<String,String> |
HttpDocApi docApi = new HttpDocApi(loginApi);
List<DocumentRepoConfig> retVal = docApi.getDocRepoConfigs();
retVal = baseAPI.doDoc_GetDocRepoConfigs();
Entitlement: /repo/read
Retrieves document repositories
This function takes no parameters.
Type | Description |
---|---|
List |
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.
Parameter | Type | Description |
---|---|---|
docRepoUri | String |
Type | Description |
---|---|
void |
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.
Parameter | Type | Description |
---|---|---|
docRepoUri | String | |
versionLimit | int | |
timeLimit | long | |
ensureVersionLimit | boolean |
Type | Description |
---|---|
void |
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.
Parameter | Type | Description |
---|---|---|
docUri | String |
Type | Description |
---|---|
DocumentWithMeta |
Contains a Rapture document and its metadata.
Field | Type |
---|---|
displayName | String |
metaData | DocumentMetadata |
content | String |
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.
Parameter | Type | Description |
---|---|---|
docUri | String |
Type | Description |
---|---|
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 |
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.
Parameter | Type | Description |
---|---|---|
docUri | String |
Type | Description |
---|---|
DocumentWithMeta |
Contains a Rapture document and its metadata.
Field | Type |
---|---|
displayName | String |
metaData | DocumentMetadata |
content | String |
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.
Parameter | Type | Description |
---|---|---|
docUri | String | a string of characters used to identify a document |
Type | Description |
---|---|
String |
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.
Parameter | Type | Description |
---|---|---|
docUri | String | a string of characters used to identify a document |
content | String | the information to be stored within the document |
Type | Description |
---|---|
String |
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.
Parameter | Type | Description |
---|---|---|
docUri | String | |
content | String | |
currentVersion | int |
Type | Description |
---|---|
boolean |
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
Parameter | Type | Description |
---|---|---|
docUri | String | |
content | String | |
eventContext | Map<String,String> |
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 |
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 |
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.
Parameter | Type | Description |
---|---|---|
docUri | String |
Type | Description |
---|---|
boolean |
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.
Parameter | Type | Description |
---|---|---|
fromDocUri | String | |
toDocUri | String |
Type | Description |
---|---|
String |
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
Parameter | Type | Description |
---|---|---|
docUris | List |
Type | Description |
---|---|
Map<String,String> |
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
Parameter | Type | Description |
---|---|---|
docUris | List |
Type | Description |
---|---|
List |
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.
Parameter | Type | Description |
---|---|---|
docUris | List |
Type | Description |
---|---|
List |
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.
Parameter | Type | Description |
---|---|---|
docUris | List | |
contents | List |
Type | Description |
---|---|
List |
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.
Parameter | Type | Description |
---|---|---|
authority | String | |
comment | String | |
fromDocUris | List | |
toDocUris | List |
Type | Description |
---|---|
List |
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.
Parameter | Type | Description |
---|---|---|
docUri | String |
Type | Description |
---|---|
List |
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
Parameter | Type | Description |
---|---|---|
docUri | String | |
depth | int |
Type | Description |
---|---|
Map<String,RaptureFolderInfo> |
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.
Parameter | Type | Description |
---|---|---|
attributeUri | String | |
value | String |
Type | Description |
---|---|
boolean |
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.
Parameter | Type | Description |
---|---|---|
attributeUri | String | |
keys | List | |
values | List |
Type | Description |
---|---|
Map<String,boolean> |
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
Parameter | Type | Description |
---|---|---|
attributeUri | String |
Type | Description |
---|---|
XferDocumentAttribute |
Holds a key/value pair for an attribute of a document object.
Field | Type |
---|---|
attributeType | String |
key | String |
value | String |
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
Parameter | Type | Description |
---|---|---|
attributeUri | String |
Type | Description |
---|---|
List |
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.
Parameter | Type | Description |
---|---|---|
attributeUri | String |
Type | Description |
---|---|
boolean |
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.
Parameter | Type | Description |
---|---|---|
docRepoUri | String |
Type | Description |
---|---|
String |
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.
Parameter | Type | Description |
---|---|---|
docRepoUri | String | |
idGenConfig | String |
Type | Description |
---|---|
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 |
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.
Parameter | Type | Description |
---|---|---|
docRepoUri | String |
Type | Description |
---|---|
RaptureIdGenConfig |
Holds the config info for a idgen as described in the idgen API.
Field | Type |
---|---|
name | String |
config | String |
authority | String |