DOCUMENTS 5 - PortalScripting API
|
The Document class has been added to the DOCUMENTS PortalScripting API to gain full access to the documents stored on registers of a DOCUMENTS file by scripting means. More...
Public Member Functions | |
boolean | deleteDocument () |
Delete the Document object. More... | |
boolean | doOCR () |
Execute OCR for the current document. More... | |
String | downloadDocument (String filePath="", String version="") |
Download the Document to the server's filesystem for further use. More... | |
String | getAsPDF () |
Create a PDF file containing the current Document's contents and return the path in the file system. More... | |
String | getAttribute (String attribute) |
Get the String value of an attribute of the Document. More... | |
String | getLastError () |
Function to get the description of the last error that occurred. More... | |
String | getOID (boolean oidLow=false) |
Returns the object-id. More... | |
Register | getRegister () |
Returns the Register the Document belongs to. More... | |
String | hash (String hashfunction, String version="") |
Generate the hash value for the Document using the given hash function. More... | |
boolean | moveToRegister (Register regObj) |
Move the Document to another document Register of the file. More... | |
boolean | reindexBlob () |
Reindex the blob located in an active file. More... | |
boolean | setAttribute (String attribute, String value) |
Set the String value of an attribute of the Document to the desired value. More... | |
boolean | setDocumentName (String nameWithExt) |
Set the name of the current document. More... | |
boolean | uploadDocument (String sourceFilePath, boolean versioning=true) |
Upload a file stored on the server's filesystem for replacing or versioning this Document. More... | |
Public Attributes | |
String | bytes |
The file size of the Document object. More... | |
String | comment |
The comment of the Document object. More... | |
boolean | encrypted |
Info, if the blob is encrypted in the repository. More... | |
String | extension |
The extension of the Document object. More... | |
String | fullname |
The complete filename (name plus extension) of the Document object. More... | |
String | id |
The id of the Document object. More... | |
String | name |
The name (without extension) of the Document object. More... | |
String | size |
The file size of the Document object. More... | |
The Document class has been added to the DOCUMENTS PortalScripting API to gain full access to the documents stored on registers of a DOCUMENTS file by scripting means.
boolean Document::deleteDocument | ( | ) |
Delete the Document object.
With the necessary rights you can delete a document of the file. Do this only on scratch copies (startEdit, commit)
true
if successful, false
in case of any error boolean Document::doOCR | ( | ) |
Execute OCR for the current document.
true
if successful, false
in case of any error String Document::downloadDocument | ( | String | filePath = "" , |
String | version = "" |
||
) |
Download the Document to the server's filesystem for further use.
filePath | Optional string specifying where the downloaded Document to be stored. Note: A file path containing special characters can be modified due to the encoding problem. The modified file path will be returned. |
version | Optional string value specifying which version of this Document to be downloaded (e.g. "2.0"). The default value is the active version. Note: This parameter is ignored for an archive document. |
filePath
) version
)String Document::getAsPDF | ( | ) |
Create a PDF file containing the current Document's contents and return the path in the file system.
The different document types of your documents require the appropriate PDF filter programs to be installed and configured in DOCUMENTS.
String
with file path of the PDF, an empty string in case of any error. String Document::getAttribute | ( | String | attribute | ) |
Get the String value of an attribute of the Document.
attribute | String containing the name of the desired attribute |
String Document::getLastError | ( | ) |
Function to get the description of the last error that occurred.
String Document::getOID | ( | boolean | oidLow = false | ) |
Returns the object-id.
oidLow | Optional flag: If true only the id of the Document object (m_oid ) will be returned. If false the id of the Document object will be returned together with the id of the corresponding class in the form class-id:m_oid . The default value is false . |
String
with the object-id oidLow
) Register Document::getRegister | ( | ) |
Returns the Register the Document belongs to.
null
if missing String Document::hash | ( | String | hashfunction, |
String | version = "" |
||
) |
Generate the hash value for the Document using the given hash function.
These hash functions are supported:
sha1
sha224
sha256
sha384
sha512
md4
md5
whirlpool
ripemd160
hashfunction | String containing the name of the hash function. |
version | Optional string value specifying which version of this Document to be hashed (e.g. "2.0"). The default value is the active version. Note: This parameter is ignored for an archive document. |
boolean Document::moveToRegister | ( | Register | regObj | ) |
Move the Document to another document Register of the file.
With the necessary rights you can move the Document to another document Register of the file.
true
if successful, false
in case of any error boolean Document::reindexBlob | ( | ) |
Reindex the blob located in an active file.
This method is only allowed if at the filetype the option 'automatic document indexing'
is enabled.
true
if successful, false
in case of any error boolean Document::setAttribute | ( | String | attribute, |
String | value | ||
) |
Set the String value of an attribute of the Document to the desired value.
attribute | String containing the name of the desired attribute |
value | String containing the desired value of the attribute |
true
if successful, false
in case of any error boolean Document::setDocumentName | ( | String | nameWithExt | ) |
Set the name of the current document.
This method is only allowed for documents at a scratch copy (startEdit
, commit
).
nameWithExt | String containing the document name with extension. |
true
if successful, false
in case of any error boolean Document::uploadDocument | ( | String | sourceFilePath, |
boolean | versioning = true |
||
) |
Upload a file stored on the server's filesystem for replacing or versioning this Document.
sourceFilePath | String containing the path of the desired file to be uploaded. Note: Backslashes contained in the filepath must be quoted with a leading backslash, since the backslash is a special char in ECMAScript! |
versioning | Optional flag: true for versioning the Document and false for replacing it. |
true
if successful, false
in case of any error String Document::bytes |
String Document::comment |
boolean Document::encrypted |
Info, if the blob is encrypted in the repository.
String Document::extension |
String Document::fullname |
String Document::id |
String Document::name |