This
section describes functions that operate on document values
that are available in expressions.
getDocLengthRetrieves
the file size of a document.
Syntax getDocLength(com.adobe.idp.Document)
Parameterscom.adobe.idp.Document is
a reference to a serialized document.
ReturnsA Long that
contains the file size of the document in bytes. Returns 0 if
the parameter does not evaluate to a document.
ExampleA
variable named vardocument references a PDF file
that was serialized after being submitted as a work item form. The
following example returns 455343, the size of the
referenced document in bytes:
getDocLength(/process_data/@vardocument)
getDocAttributeRetrieves
the value of the specified document attribute.
Syntax getDocAttribute(com.adobe.idp.Document, String)
Parameterscom.adobe.idp.Document is
a reference to a serialized document. String is
a string that holds the name of the document attribute to retrieve.
For information about available attributes, see Document attributes for attachments and notes.
ReturnsThe
value of the attribute specified by String. The
attribute determines the type of value returned. Returns an empty
string if the com.adobe.idp.Document parameter
does not evaluate to a com.adobe.idp.Document value.
Returns null if String does not
hold a valid attribute name.
ExampleA document variable
named varattachment references a PDF file that
was attached to a task. The following example returns an integer that
represents the access permissions of the attachment:
getDocAttribute(/process_data/@varattachment,"wspermission")
setDocAttributeSets
the value of a document attribute.
Syntax setDocAttribute(com.adobe.idp.Document, String, String)
Parameterscom.adobe.idp.Document is
a reference to a serialized document. The first String parameter
is a string that holds the name of the document attribute to set.
The second String parameter is a string that holds
the value to set the document attribute to. For information about
available attributes, see Document attributes for attachments and notes.
ReturnsA
reference to the input com.adobe.idp.Document value
with the attribute specified by the first String parameter
set to the value specified by the second String parameter.
Returns
a reference to an empty com.adobe.idp.Document value with the specified
attribute set to the specified value if the first parameter does
not evaluate to a document.
Returns a reference to the unchanged
com.adobe.idp.Document value if the second or third parameters do
not evaluate to a String.
ExampleThe
following example returns the description of a document that the document variable
named vardoc1 references:
setDocAttribute(/process_data/@vardoc1,"wsdescription",
"An example description.")
getDocContentTypeRetrieves
the content type of a document. The content type identifies the
type of the document, similar to the mime-type property
of documents that are sent over the web. For example, a PDF document
has a document type of application/pdf.
The document type of a document can have no value or can have
any value that is set with the setDocContent function,
when the document was attached to a task. For more information,
see setDocContentType.
Syntax getDocContentType(com.adobe.idp.Document)
Parameterscom.adobe.idp.Document is
a serialized document that is referenced by a document variable.
ReturnsA String that
contains the content type. Returns an empty String if
the parameter does not evaluate to a document.
setDocContentTypeSets
the content type of a document. The content type identifies the
type of the document, similar to the mime-type property
of documents that are sent over the web. For example, a PDF document
has a document type of application/pdf.
Syntax setDocContentType(com.adobe.idp.Document, String)
Parameterscom.adobe.idp.Document is
a serialized document that is referenced by a document variable.
String is
a string that contains the content type that you want to set for
the document.
ReturnsA
reference to a copy of the com.adobe.idp.Document value
that was used as a parameter. Returns a new, empty document with
the specified content type if the first parameter does not evaluate
to a com.adobe.idp.Document.
getDocContentBase64Retrieves the content of a document as a Base64-encoded
string.
Syntax getDocContentBase64(aDocument)
ParametersaDocument is
a serialized document value. You can reference the document value
using an XPath expression.
ReturnsA
string value that represents the document. If the parameter does
not evaluate to a document value, an empty string is returned.
ExampleA
text file is stored in a document variable named documentVar.
The content of the text file is the single word content.
The following expression returns the string value Y29udGVudA==:
getDocConententBase64(/process_data/@documentVar)
getDocFromBase64Converts a Base64-encoded string to a document.
Syntax getDocFromBase64(aString)
ParametersaString is
a string value that contains Base64-encoded text. You can reference the
string value using an XPath expression.
ReturnsA
document value that represents a document, and the content of the
document is the decoded text that aString contained.
ExampleA
string variable named stringVar contains the Base64-encoded
text Y29udGVudA==. The following expression returns
a document that contains the text content:
getDocFromBase64(/process_data/@stringVar)
|
|
|