API fields - RapturePlatform/Rapture GitHub Wiki

Fields API

Fields are well known concepts in Rapture that are parts of documents. By defining a field and its relationship to the data within a type, information can be retrieved from a document without transferring the complete document back to a client. The methods in this API are used to both define fields and retrieve information from a document.

listFieldsByUriPrefix

HttpFieldsApi fieldsApi = new HttpFieldsApi(loginApi);
Map<String,RaptureFolderInfo> retVal = fieldsApi.listFieldsByUriPrefix(authority, depth);
retVal = baseAPI.doFields_ListFieldsByUriPrefix(authority, depth);

Entitlement: /admin/field

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
authority String
depth int

Return value

Type Description
Map<String,RaptureFolderInfo>

getField

HttpFieldsApi fieldsApi = new HttpFieldsApi(loginApi);
RaptureField retVal = fieldsApi.getField(fieldUri);
retVal = baseAPI.doFields_GetField(fieldUri);

Entitlement: /admin/field

Retrieves the field definition.

Function Parameters

Parameter Type Description
fieldUri String

Return value

Type Description
RaptureField
Types used in this function

RaptureField

  • A RaptureField is the definition of a concept in Rapture, referenced within a type or a series of types.*
Field Type
authority String
category String
name String
longName String
description String
units String
groupingFn RaptureGroupingFn
bands List
fieldPaths Set

putField

HttpFieldsApi fieldsApi = new HttpFieldsApi(loginApi);
void retVal = fieldsApi.putField(field);
retVal = baseAPI.doFields_PutField(field);

Entitlement: /admin/field

Create or replace the field definition

Function Parameters

Parameter Type Description
field RaptureField

Return value

Type Description
void
Types used in this function

RaptureField

  • A RaptureField is the definition of a concept in Rapture, referenced within a type or a series of types.*
Field Type
authority String
category String
name String
longName String
description String
units String
groupingFn RaptureGroupingFn
bands List
fieldPaths Set

fieldExists

HttpFieldsApi fieldsApi = new HttpFieldsApi(loginApi);
boolean retVal = fieldsApi.fieldExists(fieldUri);
retVal = baseAPI.doFields_FieldExists(fieldUri);

Entitlement: /admin/field

Check whether a field definition with the given uri exists

Function Parameters

Parameter Type Description
fieldUri String

Return value

Type Description
boolean

deleteField

HttpFieldsApi fieldsApi = new HttpFieldsApi(loginApi);
void retVal = fieldsApi.deleteField(fieldUri);
retVal = baseAPI.doFields_DeleteField(fieldUri);

Entitlement: /admin/field

Delete a field definition

Function Parameters

Parameter Type Description
fieldUri String

Return value

Type Description
void

getDocumentFields

HttpFieldsApi fieldsApi = new HttpFieldsApi(loginApi);
List<String> retVal = fieldsApi.getDocumentFields(docURI, fields);
retVal = baseAPI.doFields_GetDocumentFields(docURI, fields);

Entitlement: /user/field/$f(docURI)

Returns a list of values referenced by the fields. Note that there is not a simple 1:1 mapping between the returned list and the list of fields supplied as a parameter.

Function Parameters

Parameter Type Description
docURI String
fields List

Return value

Type Description
List

putDocumentAndGetDocumentFields

HttpFieldsApi fieldsApi = new HttpFieldsApi(loginApi);
List<String> retVal = fieldsApi.putDocumentAndGetDocumentFields(docURI, content, fields);
retVal = baseAPI.doFields_PutDocumentAndGetDocumentFields(docURI, content, fields);

Entitlement: /user/field/$f(docURI)

Behaves similarly to getFieldsFromDocument, except that the supplied content is first added to the document cache, overwriting any previous values.

Function Parameters

Parameter Type Description
docURI String
content String
fields List

Return value

Type Description
List
⚠️ **GitHub.com Fallback** ⚠️