Service/LiveDocx/MailMerge.php
Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to [email protected] so we can send you a copy immediately.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Service
- Subpackage
- LiveDocx
- Version
- $Id: MailMerge.php 24593 2012-01-05 20:35:02Z matthew $
\Zend_Service_LiveDocx_MailMerge
- Parent(s)
- \Zend_Service_LiveDocx
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Since
- LiveDocx 1.0
Constants
Properties

array $_credentials = Array of credentials (username and password) to log into backend server
Inherited from: \Zend_Service_LiveDocx::$$_credentials- Type
- array
- Inherited_from
- \Zend_Service_LiveDocx::$$_credentials
- Since
- LiveDocx 1.2

boolean $_loggedIn = Set to true, when session is logged into backend server
Inherited from: \Zend_Service_LiveDocx::$$_loggedIn- Type
- boolean
- Inherited_from
- \Zend_Service_LiveDocx::$$_loggedIn
- Since
- LiveDocx 1.2

\Zend_Soap_Client $_soapClient = SOAP client used to connect to LiveDocx service
Inherited from: \Zend_Service_LiveDocx::$$_soapClient- Type
- \Zend_Soap_Client
- Inherited_from
- \Zend_Service_LiveDocx::$$_soapClient
- Since
- LiveDocx 1.0

string $_wsdl =
- Type
- string
- Inherited_from
- \Zend_Service_LiveDocx::$$_wsdl
- Since
- LiveDocx 1.0
Methods

__construct(array | \Zend_Config $options = null) : void\throwsConstructor (LiveDocx.MailMerge SOAP Service)
Optionally, pass an array of options (or Zend_Config object).
If an option with the key 'soapClient' is provided, that value will be used to set the internal SOAP client used to connect to the LiveDocx service.
Use 'soapClient' in the case that you have a dedicated or (locally installed) licensed LiveDocx server. For example:
{code} $phpLiveDocx = new Zend_Service_LiveDocx_MailMerge( array ( 'username' => 'myUsername', 'password' => 'myPassword', 'soapClient' => new Zend_Soap_Client('https://api.example.com/path/mailmerge.asmx?WSDL') ) ); {code}
Replace the URI of the WSDL in the constructor of Zend_Soap_Client with that of your dedicated or licensed LiveDocx server.
If you are using the public LiveDocx server, simply pass 'username' and 'password'. For example:
{code} $phpLiveDocx = new Zend_Service_LiveDocx_MailMerge( array ( 'username' => 'myUsername', 'password' => 'myPassword' ) ); {code}
If you prefer to not pass the username and password through the constructor, you can also call the following methods:
{code} $phpLiveDocx = new Zend_Service_LiveDocx_MailMerge();
$phpLiveDocx->setUsername('myUsername') ->setPassword('myPassword'); {/code}
Or, if you want to specify your own SoapClient:
{code} $phpLiveDocx = new Zend_Service_LiveDocx_MailMerge();
$phpLiveDocx->setUsername('myUsername') ->setPassword('myPassword');
$phpLiveDocx->setSoapClient( new Zend_Soap_Client('https://api.example.com/path/mailmerge.asmx?WSDL') ); {/code}
| Name | Type | Description |
|---|---|---|
| $options | array | \Zend_Config |
| Type | Description |
|---|---|
| void\throws | Zend_Service_LiveDocx_Exception |
| Exception | Description |
|---|---|
| \Zend_Service_LiveDocx_Exception |
- Since
- LiveDocx 1.0

__destruct() : booleanClean up and log out of LiveDocx service
Inherited from: \Zend_Service_LiveDocx::__destruct()| Type | Description |
|---|---|
| boolean |
- Since
- LiveDocx 1.0

_backendListArrayToMultiAssocArray(array $list) : arrayConvert LiveDocx service return value from list methods to consistent PHP array
| Name | Type | Description |
|---|---|---|
| $list | array |
| Type | Description |
|---|---|
| array |
- Since
- LiveDocx 1.0

_initSoapClient(string $endpoint) : voidInit Soap client - connect to SOAP service
Inherited from: \Zend_Service_LiveDocx::_initSoapClient()| Name | Type | Description |
|---|---|---|
| $endpoint | string |
| Exception | Description |
|---|---|
| \Zend_Service_LiveDocx_Exception |
- Since
- LiveDocx 1.2

assign(array | string $field, array | string $value = null) : \Zend_Service_LiveDocx_MailMergeAssign values to template fields
| Name | Type | Description |
|---|---|---|
| $field | array | string | |
| $value | array | string |
| Type | Description |
|---|---|
| \Zend_Service_LiveDocx_MailMerge |
| Exception | Description |
|---|---|
| \Zend_Service_LiveDocx_Exception |
- Since
- LiveDocx 1.0

assocArrayToArrayOfArrayOfString(array $assoc) : arrayConvert assoc array to required SOAP type
| Name | Type | Description |
|---|---|---|
| $assoc | array |
| Type | Description |
|---|---|
| array |
- Since
- LiveDocx 1.0

compareVersion(string $version) : intCompare the current API version with another version
Inherited from: \Zend_Service_LiveDocx::compareVersion()| Name | Type | Description |
|---|---|---|
| $version | string | (STRING NOT FLOAT) |
| Type | Description |
|---|---|
| int | -1 (version is less than API version), 0 (versions are equal), or 1 (version is greater than API version) |
- Since
- LiveDocx 1.0

createDocument() : voidMerge assigned data with template to generate document
| Exception | Description |
|---|---|
| \Zend_Service_LiveDocx_Excpetion |
- Since
- LiveDocx 1.0

deleteImage(string $filename) : voidDelete an image file from LiveDocx service
| Name | Type | Description |
|---|---|---|
| $filename | string |
| Exception | Description |
|---|---|
| \Zend_Service_LiveDocx_Exception |
- Since
- LiveDocx 2.0

deleteSharedDocument(string $filename) : voidDelete a shared document from LiveDocx service
| Name | Type | Description |
|---|---|---|
| $filename | string |
- Since
- LiveDocx 1.0

deleteTemplate(string $filename) : voidDelete a template file from LiveDocx service
| Name | Type | Description |
|---|---|---|
| $filename | string |
| Exception | Description |
|---|---|
| \Zend_Service_LiveDocx_Exception |
- Since
- LiveDocx 1.0

downloadImage(string $filename) : voidDownload an image file from LiveDocx service
| Name | Type | Description |
|---|---|---|
| $filename | string |
| Exception | Description |
|---|---|
| \Zend_Service_LiveDocx_Exception |
- Since
- LiveDocx 2.0

downloadTemplate(string $filename) : \binaryDownload template file from LiveDocx service
| Name | Type | Description |
|---|---|---|
| $filename | string |
| Type | Description |
|---|---|
| \binary |
| Exception | Description |
|---|---|
| \Zend_Service_LiveDocx_Exception |
- Since
- LiveDocx 1.0

getAllBitmaps(integer $zoomFactor, string $format) : arrayReturn graphical bitmap data for all pages of created document Return array contains bitmap data (binary) - array key is page number
| Name | Type | Description |
|---|---|---|
| $zoomFactor | integer | |
| $format | string |
| Type | Description |
|---|---|
| array |
- Since
- LiveDocx 1.2

getAllMetafiles() : arrayReturn WMF (aka Windows metafile) data for pages of created document Return array contains WMF data (binary) - array key is page number
| Type | Description |
|---|---|
| array |
- Since
- LiveDocx 1.2

getBitmaps(integer $fromPage, integer $toPage, integer $zoomFactor, string $format) : arrayReturn graphical bitmap data for specified page range of created document Return array contains bitmap data (binary) - array key is page number
| Name | Type | Description |
|---|---|---|
| $fromPage | integer | |
| $toPage | integer | |
| $zoomFactor | integer | |
| $format | string |
| Type | Description |
|---|---|
| array |
- Since
- LiveDocx 1.2

getBlockFieldNames(string $blockName) : arrayReturn all the block fields in the template
| Name | Type | Description |
|---|---|---|
| $blockName | string |
| Type | Description |
|---|---|
| array |
- Since
- LiveDocx 1.0

getBlockNames() : arrayReturn all the block fields in the template
| Type | Description |
|---|---|
| array |
- Since
- LiveDocx 1.0

getDocumentAccessOptions() : arrayReturn supported document access options
| Type | Description |
|---|---|
| array |
- Since
- LiveDocx 1.2 Premium

getDocumentFormats() : arrayReturn supported document formats (lowercase)
| Type | Description |
|---|---|
| array |
- Since
- LiveDocx 1.1

getFieldNames() : arrayReturn all the fields in the template
| Type | Description |
|---|---|
| array |
- Since
- LiveDocx 1.0

getFontNames() : arrayReturn the names of all fonts that are installed on backend server
| Type | Description |
|---|---|
| array |
- Since
- LiveDocx 1.2

getFormat(string $filename) : stringReturn the document format (extension) of a filename
Inherited from: \Zend_Service_LiveDocx::getFormat()| Name | Type | Description |
|---|---|---|
| $filename | string |
| Type | Description |
|---|---|
| string |
- Since
- LiveDocx 1.0

getImageExportFormats() : arrayReturn supported image formats to which can be exported (lowercase)
| Type | Description |
|---|---|
| array |
- Since
- LiveDocx 2.0

getImageImportFormats() : arrayReturn supported image formats from which can be imported (lowercase)
| Type | Description |
|---|---|
| array |
- Since
- LiveDocx 2.0

getMetafiles(integer $fromPage, integer $toPage) : arrayReturn WMF (aka Windows metafile) data for specified page range of created document Return array contains WMF data (binary) - array key is page number
| Name | Type | Description |
|---|---|---|
| $fromPage | integer | |
| $toPage | integer |
| Type | Description |
|---|---|
| array |
- Since
- LiveDocx 1.2

getSoapClient() : \Zend_Soap_Client
| Type | Description |
|---|---|
| \Zend_Soap_Client |
- Since
- LiveDocx 1.2

getTemplateFormats() : arrayReturn supported template formats (lowercase)
| Type | Description |
|---|---|
| array |
- Since
- LiveDocx 1.0

getWsdl() : \Zend_Service_LiveDocx
| Type | Description |
|---|---|
| \Zend_Service_LiveDocx |
- Since
- LiveDocx 1.0

imageExists(string $filename) : booleanCheck whether an image file is available on LiveDocx service
| Name | Type | Description |
|---|---|---|
| $filename | string |
| Type | Description |
|---|---|
| boolean |
- Since
- LiveDocx 2.0

isLoggedIn() : booleanReturn true, if session is currently logged into the backend server
Inherited from: \Zend_Service_LiveDocx::isLoggedIn()| Type | Description |
|---|---|
| boolean |
- Since
- LiveDocx 1.2

listImages() : arrayList all images stored on LiveDocx service
| Type | Description |
|---|---|
| array |
- Since
- LiveDocx 2.0

listSharedDocuments() : arrayList all shared documents stored on LiveDocx service
| Type | Description |
|---|---|
| array |
- Since
- LiveDocx 1.0

listTemplates() : arrayList all templates stored on LiveDocx service
| Type | Description |
|---|---|
| array |
- Since
- LiveDocx 1.0

logIn() : boolean
| Type | Description |
|---|---|
| boolean |
| Exception | Description |
|---|---|
| \Zend_Service_LiveDocx_Exception |
- Since
- LiveDocx 1.2

logOut() : boolean
| Type | Description |
|---|---|
| boolean |
| Exception | Description |
|---|---|
| \Zend_Service_LiveDocx_Exception |
- Since
- LiveDocx 1.2

multiAssocArrayToArrayOfArrayOfString(array $multi) : arrayConvert multi assoc array to required SOAP type
| Name | Type | Description |
|---|---|---|
| $multi | array |
| Type | Description |
|---|---|
| array |
- Since
- LiveDocx 1.0

retrieveDocument(string $format) : \binaryRetrieve document in specified format
| Name | Type | Description |
|---|---|---|
| $format | string |
| Type | Description |
|---|---|
| \binary |
| Exception | Description |
|---|---|
| \Zend_Service_LiveDocx_Exception |
- Since
- LiveDocx 1.0

setBlockFieldValues(string $blockName, array $blockFieldValues) : \Zend_Service_LiveDocx_MailMergeSet block field values
| Name | Type | Description |
|---|---|---|
| $blockName | string | |
| $blockFieldValues | array |
| Type | Description |
|---|---|
| \Zend_Service_LiveDocx_MailMerge |
| Exception | Description |
|---|---|
| \Zend_Service_LiveDocx_Exception |
- Since
- LiveDocx 1.0

setDocumentAccessPermissions(array $permissions, string $password) : \Zend_Service_LiveDocx_MailMergeSet a master password for document and determine which security features are accessible without using the master password.
As default, nothing is allowed. To allow a security setting, explicatively set it using one of he DOCUMENT_ACCESS_PERMISSION_* class constants.
{code} $phpLiveDocx->setDocumentAccessPermissions( array ( Zend_Service_LiveDocx_MailMerge::DOCUMENT_ACCESS_PERMISSION_ALLOW_PRINTING_HIGH_LEVEL, Zend_Service_LiveDocx_MailMerge::DOCUMENT_ACCESS_PERMISSION_ALLOW_EXTRACT_CONTENTS ), 'myDocumentAccessPassword' ); {code}
This method can only be used for PDF documents
| Name | Type | Description |
|---|---|---|
| $permissions | array | |
| $password | string |
| Type | Description |
|---|---|
| \Zend_Service_LiveDocx_MailMerge |
| Exception | Description |
|---|---|
| \Zend_Service_LiveDocx_Exception |
- Since
- LiveDocx 1.2 Premium

setDocumentPassword(string $password) : \Zend_Service_LiveDocx_MailMergeSet a password to open to document
This method can only be used for PDF documents
| Name | Type | Description |
|---|---|---|
| $password | string |
| Type | Description |
|---|---|
| \Zend_Service_LiveDocx_MailMerge |
| Exception | Description |
|---|---|
| \Zend_Service_LiveDocx_Exception |
- Since
- LiveDocx 1.2 Premium

setFieldValue(string $field, array | string $value) : \Zend_Service_LiveDocx_MailMergeSet an array of key and value or array of values
| Name | Type | Description |
|---|---|---|
| $field | string | |
| $value | array | string |
| Type | Description |
|---|---|
| \Zend_Service_LiveDocx_MailMerge |
| Exception | Description |
|---|---|
| \Zend_Service_LiveDocx_Exception |
- Since
- LiveDocx 1.0

setFieldValues(array $values) : \Zend_Service_LiveDocx_MailMergeSet an associative or multi-associative array of keys and values pairs
| Name | Type | Description |
|---|---|---|
| $values | array |
| Type | Description |
|---|---|
| \Zend_Service_LiveDocx_MailMerge |
| Exception | Description |
|---|---|
| \Zend_Service_LiveDocx_Exception |
- Since
- LiveDocx 1.0

setLocalTemplate(string $filename) : \Zend_Service_LiveDocx_MailMergeSet the filename of a LOCAL template (i.e.
a template stored locally on YOUR server)
| Name | Type | Description |
|---|---|---|
| $filename | string |
| Type | Description |
|---|---|
| \Zend_Service_LiveDocx_MailMerge |
| Exception | Description |
|---|---|
| \Zend_Service_LiveDocx_Exception |
- Since
- LiveDocx 1.0

setOptions(array $options) : \Zend_Service_LiveDocxSet options One or more of username, password, soapClient
Inherited from: \Zend_Service_LiveDocx::setOptions()| Name | Type | Description |
|---|---|---|
| $options | array |
| Type | Description |
|---|---|
| \Zend_Service_LiveDocx |
- Since
- LiveDocx 1.2

setPassword( $password) : \Zend_Service_LiveDocx
| Name | Type | Description |
|---|---|---|
| $password |
| Type | Description |
|---|---|
| \Zend_Service_LiveDocx |
- Since
- LiveDocx 1.0

setRemoteTemplate(string $filename) : \Zend_Service_LiveDocx_MailMergeSet the filename of a REMOTE template (i.e.
a template stored remotely on the LIVEDOCX server)
| Name | Type | Description |
|---|---|---|
| $filename | string |
| Type | Description |
|---|---|
| \Zend_Service_LiveDocx_MailMerge |
| Exception | Description |
|---|---|
| \Zend_Service_LiveDocx_Exception |
- Since
- LiveDocx 1.0

setSoapClient(\Zend_Soap_Client $soapClient) : \Zend_Service_LiveDocx
| Name | Type | Description |
|---|---|---|
| $soapClient | \Zend_Soap_Client |
| Type | Description |
|---|---|
| \Zend_Service_LiveDocx |
- Since
- LiveDocx 1.2

setUsername( $username) : \Zend_Service_LiveDocx
| Name | Type | Description |
|---|---|---|
| $username |
| Type | Description |
|---|---|
| \Zend_Service_LiveDocx |
- Since
- LiveDocx 1.0

setWsdl( $wsdl) : \Zend_Service_LiveDocx
| Name | Type | Description |
|---|---|---|
| $wsdl |
| Type | Description |
|---|---|
| \Zend_Service_LiveDocx |
- Since
- LiveDocx 1.0

shareDocument() : stringShare a document - i.e.
the document is available to all over the Internet
| Type | Description |
|---|---|
| string |
- Since
- LiveDocx 1.0

sharedDocumentExists(string $filename) : booleanCheck whether a shared document is available on LiveDocx service
| Name | Type | Description |
|---|---|---|
| $filename | string |
| Type | Description |
|---|---|
| boolean |
- Since
- LiveDocx 1.0

templateExists(string $filename) : booleanCheck whether a template file is available on LiveDocx service
| Name | Type | Description |
|---|---|---|
| $filename | string |
| Type | Description |
|---|---|
| boolean |
- Since
- LiveDocx 1.0

uploadImage(string $filename) : voidUpload an image file to LiveDocx service
| Name | Type | Description |
|---|---|---|
| $filename | string |
| Exception | Description |
|---|---|
| \Zend_Service_LiveDocx_Exception |
- Since
- LiveDocx 2.0

uploadTemplate(string $filename) : voidUpload a template file to LiveDocx service
| Name | Type | Description |
|---|---|---|
| $filename | string |
| Exception | Description |
|---|---|
| \Zend_Service_LiveDocx_Exception |
- Since
- LiveDocx 1.0