Service/LiveDocx/MailMerge.php

Show: PublicProtectedPrivateinherited
Table of Contents
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 license@zend.com 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

Package: Zend\Service\LiveDocx
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

>VConstant  WSDL = 'https://api.livedocx.com/2.0/mailmerge.asmx?WSDL'
>VConstant  VERSION = '2.0'
inherited
LiveDocx service version
Inherited from: \Zend_Service_LiveDocx::VERSION
Inherited_from
\Zend_Service_LiveDocx::VERSION  
Since
LiveDocx 1.0  

Properties

>VPropertyprotectedarray $_blockFieldValues
Block field values
Details
Type
array
Since
LiveDocx 1.0  
>VPropertyprotectedarray $_credentials
inherited
Array of credentials (username and password) to log into backend server
Inherited from: \Zend_Service_LiveDocx::$$_credentials
Details
Type
array
Inherited_from
\Zend_Service_LiveDocx::$$_credentials  
Since
LiveDocx 1.2  
>VPropertyprotectedarray $_fieldValues
Field values
Details
Type
array
Since
LiveDocx 1.0  
>VPropertyprotectedboolean $_loggedIn
inherited
Set to true, when session is logged into backend server
Inherited from: \Zend_Service_LiveDocx::$$_loggedIn
Details
Type
boolean
Inherited_from
\Zend_Service_LiveDocx::$$_loggedIn  
Since
LiveDocx 1.2  
>VPropertyprotected\Zend_Soap_Client $_soapClient
inherited
SOAP client used to connect to LiveDocx service
Inherited from: \Zend_Service_LiveDocx::$$_soapClient
Details
Type
\Zend_Soap_Client
Inherited_from
\Zend_Service_LiveDocx::$$_soapClient  
Since
LiveDocx 1.0  
>VPropertyprotectedstring $_wsdl
inherited
WSDL of LiveDocx web service
Inherited from: \Zend_Service_LiveDocx::$$_wsdl
Details
Type
string
Inherited_from
\Zend_Service_LiveDocx::$$_wsdl  
Since
LiveDocx 1.0  

Methods

methodpublic__construct(array | \Zend_Config $options = null) : void\throws

Constructor (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}

Parameters
NameTypeDescription
$optionsarray | \Zend_Config
Returns
TypeDescription
void\throwsZend_Service_LiveDocx_Exception
Throws
ExceptionDescription
\Zend_Service_LiveDocx_Exception
Details
Since
LiveDocx 1.0  
methodpublic__destruct() : boolean
inherited

Clean up and log out of LiveDocx service

Inherited from: \Zend_Service_LiveDocx::__destruct()
Returns
TypeDescription
boolean
Details
Since
LiveDocx 1.0  
methodprotected_backendListArrayToMultiAssocArray(array $list) : array

Convert LiveDocx service return value from list methods to consistent PHP array

Parameters
NameTypeDescription
$listarray
Returns
TypeDescription
array
Details
Since
LiveDocx 1.0  
methodprotected_initSoapClient(string $endpoint) : void
inherited

Init Soap client - connect to SOAP service

Inherited from: \Zend_Service_LiveDocx::_initSoapClient()
Parameters
NameTypeDescription
$endpointstring
Throws
ExceptionDescription
\Zend_Service_LiveDocx_Exception
Details
Since
LiveDocx 1.2  
methodpublicassign(array | string $field, array | string $value = null) : \Zend_Service_LiveDocx_MailMerge

Assign values to template fields

Parameters
NameTypeDescription
$fieldarray | string
$valuearray | string
Returns
TypeDescription
\Zend_Service_LiveDocx_MailMerge
Throws
ExceptionDescription
\Zend_Service_LiveDocx_Exception
Details
Since
LiveDocx 1.0  
methodpublicassocArrayToArrayOfArrayOfString(array $assoc) : array
static

Convert assoc array to required SOAP type

Parameters
NameTypeDescription
$assocarray
Returns
TypeDescription
array
Details
Since
LiveDocx 1.0  
methodpubliccompareVersion(string $version) : int
inherited

Compare the current API version with another version

Inherited from: \Zend_Service_LiveDocx::compareVersion()
Parameters
NameTypeDescription
$versionstring

(STRING NOT FLOAT)

Returns
TypeDescription
int-1 (version is less than API version), 0 (versions are equal), or 1 (version is greater than API version)
Details
Since
LiveDocx 1.0  
methodpubliccreateDocument() : void

Merge assigned data with template to generate document

Throws
ExceptionDescription
\Zend_Service_LiveDocx_Excpetion
Details
Since
LiveDocx 1.0  
methodpublicdeleteImage(string $filename) : void

Delete an image file from LiveDocx service

Parameters
NameTypeDescription
$filenamestring
Throws
ExceptionDescription
\Zend_Service_LiveDocx_Exception
Details
Since
LiveDocx 2.0  
methodpublicdeleteSharedDocument(string $filename) : void

Delete a shared document from LiveDocx service

Parameters
NameTypeDescription
$filenamestring
Details
Since
LiveDocx 1.0  
methodpublicdeleteTemplate(string $filename) : void

Delete a template file from LiveDocx service

Parameters
NameTypeDescription
$filenamestring
Throws
ExceptionDescription
\Zend_Service_LiveDocx_Exception
Details
Since
LiveDocx 1.0  
methodpublicdownloadImage(string $filename) : void

Download an image file from LiveDocx service

Parameters
NameTypeDescription
$filenamestring
Throws
ExceptionDescription
\Zend_Service_LiveDocx_Exception
Details
Since
LiveDocx 2.0  
methodpublicdownloadSharedDocument( $filename) : void

Parameters
NameTypeDescription
$filename
methodpublicdownloadTemplate(string $filename) : \binary

Download template file from LiveDocx service

Parameters
NameTypeDescription
$filenamestring
Returns
TypeDescription
\binary
Throws
ExceptionDescription
\Zend_Service_LiveDocx_Exception
Details
Since
LiveDocx 1.0  
methodpublicgetAllBitmaps(integer $zoomFactor, string $format) : array

Return graphical bitmap data for all pages of created document Return array contains bitmap data (binary) - array key is page number

Parameters
NameTypeDescription
$zoomFactorinteger
$formatstring
Returns
TypeDescription
array
Details
Since
LiveDocx 1.2  
methodpublicgetAllMetafiles() : array

Return WMF (aka Windows metafile) data for pages of created document Return array contains WMF data (binary) - array key is page number

Returns
TypeDescription
array
Details
Since
LiveDocx 1.2  
methodpublicgetBitmaps(integer $fromPage, integer $toPage, integer $zoomFactor, string $format) : array

Return graphical bitmap data for specified page range of created document Return array contains bitmap data (binary) - array key is page number

Parameters
NameTypeDescription
$fromPageinteger
$toPageinteger
$zoomFactorinteger
$formatstring
Returns
TypeDescription
array
Details
Since
LiveDocx 1.2  
methodpublicgetBlockFieldNames(string $blockName) : array

Return all the block fields in the template

Parameters
NameTypeDescription
$blockNamestring
Returns
TypeDescription
array
Details
Since
LiveDocx 1.0  
methodpublicgetBlockNames() : array

Return all the block fields in the template

Returns
TypeDescription
array
Details
Since
LiveDocx 1.0  
methodpublicgetDocumentAccessOptions() : array

Return supported document access options

Returns
TypeDescription
array
Details
Since
LiveDocx 1.2 Premium  
methodpublicgetDocumentFormats() : array

Return supported document formats (lowercase)

Returns
TypeDescription
array
Details
Since
LiveDocx 1.1  
methodpublicgetFieldNames() : array

Return all the fields in the template

Returns
TypeDescription
array
Details
Since
LiveDocx 1.0  
methodpublicgetFontNames() : array

Return the names of all fonts that are installed on backend server

Returns
TypeDescription
array
Details
Since
LiveDocx 1.2  
methodpublicgetFormat(string $filename) : string
inherited

Return the document format (extension) of a filename

Inherited from: \Zend_Service_LiveDocx::getFormat()
Parameters
NameTypeDescription
$filenamestring
Returns
TypeDescription
string
Details
Since
LiveDocx 1.0  
methodpublicgetImageExportFormats() : array

Return supported image formats to which can be exported (lowercase)

Returns
TypeDescription
array
Details
Since
LiveDocx 2.0  
methodpublicgetImageFormats() : void

methodpublicgetImageImportFormats() : array

Return supported image formats from which can be imported (lowercase)

Returns
TypeDescription
array
Details
Since
LiveDocx 2.0  
methodpublicgetMetafiles(integer $fromPage, integer $toPage) : array

Return WMF (aka Windows metafile) data for specified page range of created document Return array contains WMF data (binary) - array key is page number

Parameters
NameTypeDescription
$fromPageinteger
$toPageinteger
Returns
TypeDescription
array
Details
Since
LiveDocx 1.2  
methodpublicgetPassword() : string | null
inherited

Return current password

Inherited from: \Zend_Service_LiveDocx::getPassword()
Returns
TypeDescription
string | null
Details
Since
LiveDocx 1.0  
methodpublicgetSoapClient() : \Zend_Soap_Client
inherited

Get SOAP client

Inherited from: \Zend_Service_LiveDocx::getSoapClient()
Returns
TypeDescription
\Zend_Soap_Client
Details
Since
LiveDocx 1.2  
methodpublicgetTemplateFormats() : array

Return supported template formats (lowercase)

Returns
TypeDescription
array
Details
Since
LiveDocx 1.0  
methodpublicgetUsername() : string | null
inherited

Return current username

Inherited from: \Zend_Service_LiveDocx::getUsername()
Returns
TypeDescription
string | null
Details
Since
LiveDocx 1.0  
methodpublicgetVersion() : string
inherited

Return the current API version

Inherited from: \Zend_Service_LiveDocx::getVersion()
Returns
TypeDescription
string
Details
Since
LiveDocx 1.0  
methodpublicgetWsdl() : \Zend_Service_LiveDocx
inherited

Return WSDL of LiveDocx web service

Inherited from: \Zend_Service_LiveDocx::getWsdl()
Returns
TypeDescription
\Zend_Service_LiveDocx
Details
Since
LiveDocx 1.0  
methodpublicimageExists(string $filename) : boolean

Check whether an image file is available on LiveDocx service

Parameters
NameTypeDescription
$filenamestring
Returns
TypeDescription
boolean
Details
Since
LiveDocx 2.0  
methodpublicisLoggedIn() : boolean
inherited

Return true, if session is currently logged into the backend server

Inherited from: \Zend_Service_LiveDocx::isLoggedIn()
Returns
TypeDescription
boolean
Details
Since
LiveDocx 1.2  
methodpubliclistImages() : array

List all images stored on LiveDocx service

Returns
TypeDescription
array
Details
Since
LiveDocx 2.0  
methodpubliclistSharedDocuments() : array

List all shared documents stored on LiveDocx service

Returns
TypeDescription
array
Details
Since
LiveDocx 1.0  
methodpubliclistTemplates() : array

List all templates stored on LiveDocx service

Returns
TypeDescription
array
Details
Since
LiveDocx 1.0  
methodpubliclogIn() : boolean
inherited

Log in to LiveDocx service

Inherited from: \Zend_Service_LiveDocx::logIn()
Returns
TypeDescription
boolean
Throws
ExceptionDescription
\Zend_Service_LiveDocx_Exception
Details
Since
LiveDocx 1.2  
methodpubliclogOut() : boolean
inherited

Log out of the LiveDocx service

Inherited from: \Zend_Service_LiveDocx::logOut()
Returns
TypeDescription
boolean
Throws
ExceptionDescription
\Zend_Service_LiveDocx_Exception
Details
Since
LiveDocx 1.2  
methodpublicmultiAssocArrayToArrayOfArrayOfString(array $multi) : array
static

Convert multi assoc array to required SOAP type

Parameters
NameTypeDescription
$multiarray
Returns
TypeDescription
array
Details
Since
LiveDocx 1.0  
methodpublicretrieveDocument(string $format) : \binary

Retrieve document in specified format

Parameters
NameTypeDescription
$formatstring
Returns
TypeDescription
\binary
Throws
ExceptionDescription
\Zend_Service_LiveDocx_Exception
Details
Since
LiveDocx 1.0  
methodpublicsetBlockFieldValues(string $blockName, array $blockFieldValues) : \Zend_Service_LiveDocx_MailMerge

Set block field values

Parameters
NameTypeDescription
$blockNamestring
$blockFieldValuesarray
Returns
TypeDescription
\Zend_Service_LiveDocx_MailMerge
Throws
ExceptionDescription
\Zend_Service_LiveDocx_Exception
Details
Since
LiveDocx 1.0  
methodpublicsetDocumentAccessPermissions(array $permissions, string $password) : \Zend_Service_LiveDocx_MailMerge

Set 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

Parameters
NameTypeDescription
$permissionsarray
$passwordstring
Returns
TypeDescription
\Zend_Service_LiveDocx_MailMerge
Throws
ExceptionDescription
\Zend_Service_LiveDocx_Exception
Details
Since
LiveDocx 1.2 Premium  
methodpublicsetDocumentPassword(string $password) : \Zend_Service_LiveDocx_MailMerge

Set a password to open to document

This method can only be used for PDF documents

Parameters
NameTypeDescription
$passwordstring
Returns
TypeDescription
\Zend_Service_LiveDocx_MailMerge
Throws
ExceptionDescription
\Zend_Service_LiveDocx_Exception
Details
Since
LiveDocx 1.2 Premium  
methodpublicsetFieldValue(string $field, array | string $value) : \Zend_Service_LiveDocx_MailMerge

Set an array of key and value or array of values

Parameters
NameTypeDescription
$fieldstring
$valuearray | string
Returns
TypeDescription
\Zend_Service_LiveDocx_MailMerge
Throws
ExceptionDescription
\Zend_Service_LiveDocx_Exception
Details
Since
LiveDocx 1.0  
methodpublicsetFieldValues(array $values) : \Zend_Service_LiveDocx_MailMerge

Set an associative or multi-associative array of keys and values pairs

Parameters
NameTypeDescription
$valuesarray
Returns
TypeDescription
\Zend_Service_LiveDocx_MailMerge
Throws
ExceptionDescription
\Zend_Service_LiveDocx_Exception
Details
Since
LiveDocx 1.0  
methodpublicsetLocalTemplate(string $filename) : \Zend_Service_LiveDocx_MailMerge

Set the filename of a LOCAL template (i.e.

a template stored locally on YOUR server)

Parameters
NameTypeDescription
$filenamestring
Returns
TypeDescription
\Zend_Service_LiveDocx_MailMerge
Throws
ExceptionDescription
\Zend_Service_LiveDocx_Exception
Details
Since
LiveDocx 1.0  
methodpublicsetOptions(array $options) : \Zend_Service_LiveDocx
inherited

Set options One or more of username, password, soapClient

Inherited from: \Zend_Service_LiveDocx::setOptions()
Parameters
NameTypeDescription
$optionsarray
Returns
TypeDescription
\Zend_Service_LiveDocx
Details
Since
LiveDocx 1.2  
methodpublicsetPassword( $password) : \Zend_Service_LiveDocx
inherited

Set password

Inherited from: \Zend_Service_LiveDocx::setPassword()
Parameters
NameTypeDescription
$password
Returns
TypeDescription
\Zend_Service_LiveDocx
Details
Since
LiveDocx 1.0  
methodpublicsetRemoteTemplate(string $filename) : \Zend_Service_LiveDocx_MailMerge

Set the filename of a REMOTE template (i.e.

a template stored remotely on the LIVEDOCX server)

Parameters
NameTypeDescription
$filenamestring
Returns
TypeDescription
\Zend_Service_LiveDocx_MailMerge
Throws
ExceptionDescription
\Zend_Service_LiveDocx_Exception
Details
Since
LiveDocx 1.0  
methodpublicsetSoapClient(\Zend_Soap_Client $soapClient) : \Zend_Service_LiveDocx
inherited

Set SOAP client

Inherited from: \Zend_Service_LiveDocx::setSoapClient()
Parameters
NameTypeDescription
$soapClient\Zend_Soap_Client
Returns
TypeDescription
\Zend_Service_LiveDocx
Details
Since
LiveDocx 1.2  
methodpublicsetUsername( $username) : \Zend_Service_LiveDocx
inherited

Set username

Inherited from: \Zend_Service_LiveDocx::setUsername()
Parameters
NameTypeDescription
$username
Returns
TypeDescription
\Zend_Service_LiveDocx
Details
Since
LiveDocx 1.0  
methodpublicsetWsdl( $wsdl) : \Zend_Service_LiveDocx
inherited

Set WSDL of LiveDocx web service

Inherited from: \Zend_Service_LiveDocx::setWsdl()
Parameters
NameTypeDescription
$wsdl
Returns
TypeDescription
\Zend_Service_LiveDocx
Details
Since
LiveDocx 1.0  
methodpublicshareDocument() : string

Share a document - i.e.

the document is available to all over the Internet

Returns
TypeDescription
string
Details
Since
LiveDocx 1.0  
methodpublicsharedDocumentExists(string $filename) : boolean

Check whether a shared document is available on LiveDocx service

Parameters
NameTypeDescription
$filenamestring
Returns
TypeDescription
boolean
Details
Since
LiveDocx 1.0  
methodpublictemplateExists(string $filename) : boolean

Check whether a template file is available on LiveDocx service

Parameters
NameTypeDescription
$filenamestring
Returns
TypeDescription
boolean
Details
Since
LiveDocx 1.0  
methodpublicuploadImage(string $filename) : void

Upload an image file to LiveDocx service

Parameters
NameTypeDescription
$filenamestring
Throws
ExceptionDescription
\Zend_Service_LiveDocx_Exception
Details
Since
LiveDocx 2.0  
methodpublicuploadTemplate(string $filename) : void

Upload a template file to LiveDocx service

Parameters
NameTypeDescription
$filenamestring
Throws
ExceptionDescription
\Zend_Service_LiveDocx_Exception
Details
Since
LiveDocx 1.0  
Documentation was generated by phpDocumentor 2.0.0a12.