Fetch Document from SMS

This functionality retrieves a document from the SMS Server. There are different methods - one method retrieves the complete document in a file whose path is specified by the User, another method retrieves the complete document in a buffer and yet another method retrieves a specified Page of the document in a buffer.

 

Usage in Visual C++/Visual Basic Application

Usage in Java Application

Error

 

Usage in Visual C++/Visual Basic Application

Prototype

int WINAPI NGISGetDocInFile( LPTSTR cabinetName, LPISINDEX isIndex,

        LPTSTR userIndex, LPTSTR fileName,

                      LPTSTR siteName

      )

 

Input Parameters description

Name

Description

Valid Values

Type Of Parameter

cabinetName

Name of the Image Cabinet to which the User wants to connect.

Not Null

Input Parameter

isIndex

A pointer to a variable of type ISINDEX. The structure ISINDEX contains information (namely, Index of the Volume in which the document is added and the Index of the document in that Volume) about the document that is to be fetched.

 

Input Parameter

UserIndex

This parameter is reserved and it can be used with the default value.

null

Input Parameter

fileName

Full Path of the file in which the document data will be fetched.

Not null

Input Parameter

siteName

Name of the Site from where the document is fetched.

N/A

Output Parameter

 

Output Parameters

This method returns an integer that will be 1 in case of success else an error code will be returned.

 

Prototype

int WINAPI NGISGetDocInFile_MT ( CSocket * m_pSock, LPTSTR siteAddress, short portId,

                                                                 LPTSTR cabinetName, short siteId, short m_sVolumeId,

 int m_nDocIndex, LPTSTR userIndex,

 LPTSTR fileName, LPTSTR siteName

                            )

 

Input Parameters description

Name

Description

Valid Values

Type Of Parameter

m_pSock

A pointer to a variable of type Csocket, which that encapsulates a Socket Object to the JTS.

A valid socket connection to JTS

Input Parameter

siteAddress

IP Address on which the JTS Server is running.

IP Address where JTS running

Input Parameter

portId

Port on which JTS Server is running.

short>0

Input Parameter

cabinetName

Name of the Image Cabinet to which the User wants to connect.

Not Null

Input Parameter

siteId

Index of the Site from where the document is to be fetched. This is significant in case of replication of Volume at different Sites. User can give   the SiteId of the local Site where Volume of a Remote Site is replicated in order for fast retrieval.

short > 0

Input Parameter

m_sVolumeId

Index of Volume in which document is present in  the SMS Server.

short>0

Input Parameter

m_nDocIndex

Index of the document in Volume.

int>0

Input Parameter

UserIndex

This parameter is reserved and it can be used with the default value.

Null

Input Parameter

fileName

Full path of file in which Image Server will retrieve full data of the document.

Not null

Input Parameter

siteName

Name of the Site from where  the document is fetched.

N/A

Output Parameter

 

Output Parameters

This method returns an integer which will be 1 in case of success else an error code will be returned.

 

Prototype

int WINAPI NGISGetPage ( LPTSTR cabinetName, LPISINDEX isIndex, LPTSTR UserIndex,

                                                 short pageNo, TCHAR ** buf

      )

 

Input Parameters description

Name

Description

Valid Values

Type Of Parameter

cabinetName

Name of the Image Cabinet to which the User wants to connect.

Not Null

Input Parameter

isIndex

A pointer to a variable of type ISINDEX. The structure ISINDEX contains information (namely, Index of the Volume in which the document is added and the Index of the document in that Volume) about the document that is to be fetched.

 

Input Parameter

UserIndex

This parameter is reserved and it can be used with the default value.

null

Input Parameter

pageNo

Page Number of the document that is to be fetched from  the SMS Server.

int >0

Input Parameter

buf

Output Parameter buffer in which page data is returned.

N/A

Output Parameter

 

Output Parameters

This method returns an integer that will be 1 in case of success else an error code will be returned.

 

Prototype

int WINAPI NGISGetPageInFile_MT ( CSocket * m_pSock, LPTSTR siteAddress, short portId,

                                LPTSTR cabinetName, short siteId, short m_sVolumeId,

                                int m_nDocIndex, LPTSTR UserIndex, short pageNo,

                                LPTSTR fileName

                              )

 

Input Parameters description

Name

Description

Valid Values

Type Of Parameter

m_pSock

A pointer to a variable of type CSocket that encapsulates a Socket Object to the JTS.

A valid socket connection to JTS

Input Parameter

siteAddress

IP Address on which the JTS Server is running.

IP address where JTS running

Input Parameter

portId

Port on which the JTS Server is running.

short>0

Input Parameter

cabinetName

Name of the Image Cabinet to which the User wants to connect.

Not Null

Input Parameter

siteId

Index of the Site from where the document is to be fetched. This is significant in case of replication of Volume at different Sites. User can give   the SiteId of the local Site where Volume of a Remote Site is replicated in order for fast retrieval.

short > 0

Input Parameter

m_sVolumeId

Index of Volume in which document is present in the SMS Server.

short>0

Input Parameter

m_nDocIndex

Index of the document in Volume.

int>0

Input Parameter

UserIndex

This parameter is reserved and it can be used with the default value.

null

Input Parameter

pageNo

Page Number of the document that needs to be fetched from the SMS Server.

short  >0

Input Parameter

fileName

Full path of file in which Image Server will retrieve page data of document.

Not null

Input Parameter

 

Output Parameters

This method returns an integer that will be 1 in case of success else an error code will be returned.

 

 

Usage in Java Application

 

Prototype

public int JPISGetDocInFile( String cabinetName, JPISIsIndex isIndex,

                                           String docFileName, JPDBString siteName

                                                )

 

Input Parameters description

Name

Description

Valid Values

Type Of Parameter

cabinetName

Name of the Image Cabinet to which the User wants to connect.

Not null

Input Parameter

isIndex

An object of type JPISIsIndexthat contains information (namely, Index of the Volume in which the document is added and the Index of the document in that Volume) about the document to be fetched.

 

Input Parameter

UserIndex

This parameter is for internal use and not in use now

Null

Input Parameter

docFileName

Full Path of the file in which the document data will be fetched.

Not null

Input Parameter

siteName

Name of the Site from where the document is fetched.

N/A

Output Parameter

 

Output Parameters

This method returns an integer that will be 1 in case of success else an error code will be returned.

 

Prototype

public int JPISGetPage (  String cabinetName, JPISIsIndex isIndex, String UserIndex ,

             int pageNumber, ByteArrayOutputStream buf

          )

 

Input Parameters description

Name

Description

Valid Values

Type Of Parameter

cabinetName

Name of the Image Cabinet to which the User wants to connect.

Not Null

Input Parameter

isIndex

An object of type JPISIsIndexthat contains information (namely, Index of the Volume in which the document is added and the Index of the document in that Volume) about the document to be fetched.

 

Input Parameter

UserIndex

This parameter is reserved and it can be used with the default value.

null

Input Parameter

pageNumber

Page Number of the document that is to be fetched from the SMS Server.

int > 0

Input Parameter

buf

Output Parameter buffer in which page data is returned.

N/A

Output Parameter

 

Output Parameters

This method returns an integer which will be 1 in case of success else an error code will be returned.

 

Prototype

public int JPISGetPage_MT ( JtsConnection jtsCon, String jtsAddress, short portId,

    String cabinetName, short siteId, short volumeId,

    int docIndex, String UserIndex, int   pageNumber,

    ByteArrayOutputStream buf

  )

 

Input Parameters description

Name

Description

Valid Values

Type Of Parameter

JtsCon

This object holds a connection to the JTS Server. However, it can be sent as null, as a new socket connection to JTS using second two parameters (jtsAddress and portId) is created inside the function when the parameter is sent as null.

Object of class JtsConnection having a connection to JTS

Input Parameter

JtsAddress

IP Address on which the JTS Server is running.

IP address where JTS running

Input Parameter

portId

Port on which JTS is running.

short>0

Input Parameter

cabinetName

Name of the Image Cabinet to which the User wants to connect.

Not Null

Input Parameter

siteId

Index of the Site from where the document is to be fetched. This is significant in case of replication of Volume at different Sites. User can give   the SiteId of the local Site where Volume of a Remote Site is replicated in order for fast retrieval.

short > 0

Input Parameter

volumeId

Index of Volume in which document is added to the SMS
Server
.

short>0

Input Parameter

docIndex

Index of the document in the Volume of SMS Server.

int>0

Input Parameter

UserIndex

This parameter is reserved and it can be used with the default value.

null

Input Parameter

pageNumber

Page Number of the document that needs to be fetched from the SMS Server.

int > 0

Input Parameter

buf

Output Parameter buffer in which page data is returned.

N/A

Output Parameter

 

Output Parameters

This method returns an integer that will be 1 in case of success else an error code will be returned.

 

Prototype

public int JPISGetDocInFile_MT (  JtsConnection jtsCon, String jtsAddress, short portId,

            String cabinetName, short siteId, short volumeId,

                          int docIndex, String UserIndex, OutputStream buf,

                          JPDBString oSiteName

          )

 

Input Parameters description

Name

Description

Valid Values

Type Of Parameter

JtsCon

This object holds a connection to the JTS. However, it can be sent as null, as a new socket connection to JTS using second two parameters (jtsAddress and portId) is created inside the function when the parameter is sent as null.

Object of class JtsConnection having a connection to JTS

Input Parameter

JtsAddress

IP Address on which the JTS server is running.

IP Address where JTS running

Input Parameter

PortId

Port on which port JTS is running.

short>0

Input Parameter

cabinetName

Name of the Image Cabinet to which the User wants to connect.

Not Null

Input Parameter

SiteId

Index of the Site from where the document is to be fetched. This is significant in case of replication of Volume at different Sites. User can give   the SiteId of the local Site where Volume of a Remote Site is replicated in order for fast retrieval.

short > 0

Input Parameter

VolumeId

Index of the Volume in which document is added to the SMS Server.

short>0

Input Parameter

DocIndex

Index of the document in Volume.

int>0

Input Parameter

UserIndex

This parameter is reserved and it can be used with the default value.

null

Input Parameter

Buf

This is output stream in which document data is returned.

N/A

Output Parameter

oSiteName

Name of the Site from where document is fetched.

N/A

Output Parameter

 

Output Parameters

This method returns an integer which will be 1 in case of success else an error code will be returned.

 

Prototype

public int JPISGetDocInFile_MT ( JtsConnection jtsCon, String jtsAddress, short portId,

                                                       String cabinetName, short siteId, short volumeId,

                                                       int docIndex, String UserIndex, String docFileName,

                                                       JPDBString oSiteName

  )

 

Input Parameters description

Name

Description

Valid Values

Type Of Parameter

jtsCon

This object holds a connection to the JTS. However, it can be sent as null, as a new socket connection to JTS using second two parameters (jtsAddress and portId) is created inside the function when the parameter is sent as null.

Object of class JtsConnection having a connection to JTS

Input Parameters

jtsAddress

IP Address on which the JTS server is running.

IP Address where JTS running

Input Parameters

portId

Port on which port JTS is running.

short>0

Input Parameters

cabinetName

Name of the Image Cabinet to which the User wants to connect.

Not Null

Input Parameters

siteId

Index of the Site from where the document is to be fetched. This is significant in case of replication of Volume at different Sites. User can give   the SiteId of the local Site where Volume of a Remote Site is replicated in order for fast retrieval.

short > 0

Input Parameters

volumeId

Index of Volume in which document is added into the SMS.

short>0

Input Parameters

docIndex

Index of the document in Volume.

int>0

Input Parameters

UserIndex

This parameter is reserved and it can be used with the default value.

null

Input Parameters

docFileName

Full path of file in which Image Server will bring full data of document.

Not null

Input Parameters

oSiteName

Name of the site from where document is fetched.

N/A

Output Parameters

 

Output Parameters

This method returns an integer that will be 1 in case of success else an error code will be returned.