(DI-1802) SAP HANA XS application

Overview

XS application consist of exposed oData service and additional XSJS scripts that handle mass insertion and mass deletion of file content. File indexing agents are using XS application to store parsed data for further processing. Upload of content from agents HTTP protocol is used. This document described internal structures and interfaces that can be used by external file indexing agents.

Internal structures

Data model (CDS entities)

Schema

For all subsequent database objects DVD_FILESEARCH schema is used.

Tables

dvd.filesearch::FileIndex.File

File header table where all file definitions are stored.

FieldKeyTypeDescription
idXINTEGERUnique identifier of file automatically assigned during entry creation
guid
NVARCHAR 32Unique identifier of file given by File Indexing agent application
name
NVARCHAR 255Full name of file (including full path in origin)
origin.id
32File origin
fileType
100Type of file


Indexes

Index nameTypeColumn nameReason
dvd.filesearch::FileIndex.File.GUIDIDXIndexguidData is frequently requested by guid identifier


dvd.filesearch::FileIndex.FileData

Data that represent content of defined files. 

FieldKeyTypeDescription
fileIdXINTEGERUnique identifier of file
rowNumXINTEGERRow number of record
timestamp
TIMESTAMPTime stamp of record
content
CLOBString content of record

Indexes

Index nameTypeColumn nameReason
_ESH_FULLTEXT_157295#157299Full-Text IndexcontentMain search functionality is done by this index


dvd.filesearch::FileIndex.FileOrigin

Origin header table where all origin definition are stored.

FieldKeyTypeDescription
idXNVARCHAR 32Unique identifier of file origin (i.e. system name where files are coming from)
name
NVARCHAR 128
Name of origin
host
NVARCHAR 128
Server host


Views

dvd.filesearch::FileIndex.FileView

This view is used for listing results of file contents search.

FieldTableTypeDescription
iddvd.filesearch::FileIndex.FileINTEGERUnique identifier of file
namedvd.filesearch::FileIndex.FileNVARCHAR 255
Full name of file (including full path in origin)
fileTypedvd.filesearch::FileIndex.FileNVARCHAR 100
Type of file
originIddvd.filesearch::FileIndex.FileOriginNVARCHAR 32File origin
originNamedvd.filesearch::FileIndex.FileOriginNVARCHAR 128Name of origin
originHostdvd.filesearch::FileIndex.FileOriginNVARCHAR 128Server host
rowNumdvd.filesearch::FileIndex.FileDataINTEGERRow number of record
timestampdvd.filesearch::FileIndex.FileDataTIMESTAMPTime stamp of record
contentdvd.filesearch::FileIndex.FileDataCLOBString content of record

Sequences

dvd.filesearch::fileId

Number range of field id for table dvd.filesearch::FileIndex.File

ParameterValue
Start with1000
Increment by1
Minimum value1
Maximum value999999999

File indexing service API

File indexing service is implemented using 2 services:

  • XS javascript (XSJS) service
    • Used for creating files, appending rows, etc.
  • XSODATA service
    • Used for full-text search in files
    • Also possible to create files and rows, but for more convenient API xsjs service is more suitable

Service authorizations

Indexing agent application should use database user with assigned role 'dvd.filesearch.roles::agent'.

Technical information

ParamterValue
Application namespacedvd.filesearch.FileIndex
Service path to oData service/dvd/filesearch/FileIndex.xsodata

XSJS service

All request should contain following headers and cookies gathered during initial fetch of X-CSRF-Token token.

HeaderValue
X-CSRF-Token

<Fetched token>

Acceptapplication/json
Content-Typeapplication/json

addFileRows.xsjs

Script path

/dvd/filesearch/addFileRows.xsjs

Request

HTTP method: POST

Request body content example:

Response

Data are successfully added when response contains HTTP code 2* and response body should look as follows:

deleteFileRows.xsjs

Script path

/dvd/filesearch/deleteFileRows.xsjs

Request

HTTP method: POST

Request body content example:

Where guid is identificator of file in which content should be deleted.

Response

Data are successfully deleted when response contains HTTP code 2* and response body should look as follows:

XSODATA service

We are exposing CDS entities to oData using XSODATA definition file. OData are mainly used by SAPUI5 application.

TableoData entityPath
dvd.filesearch::FileIndex.FileOriginFileOrigin/dvd/filesearch/FileIndex.xsodata/FileOrigin
dvd.filesearch::FileIndex.FileFile/dvd/filesearch/FileIndex.xsodata/File
dvd.filesearch::FileIndex.FileDataFileData/dvd/filesearch/FileIndex.xsodata/FileData
dvd.filesearch::FileIndex.FileViewFileView/dvd/filesearch/FileIndex.xsodata/FileView

More information about properties can be found from metadata of service.