phpDocumentor servooclient
[ class tree: servooclient ] [ index: servooclient ] [ all elements ]

Class: ServOO_Client

Source Location: /lodel/scripts/servooclient.php

Class ServOO_Client

Class Overview

Client class for communicating with ServOO server.

This class is a wrapper around the class ServOO_SOAP_Server on the server-side. convert* methods convert the input files into the specified format and perform high level processing on the return file like unpacking ZIP archive or processing the XHTML file. Consider first using convertToAssoc since it is the highest-level method provided by this library. If finer control is required, lower-level methods are available. Listed by decreasing order of processing: convertToXHTML, convertUnpack, convertToFile, convertToString.

Located in /lodel/scripts/servooclient.php [line 51]



		
				Author(s):
		
  • Ghislain Picard, Gautier Poupeau, Luc Santeramo
Information Tags:
Copyright:  Copyright (c) 2004, Ghislain Picard, Gautier Poupeau, Luc Santeramo
Copyright:  Copyright (c) 2005, Ghislain Picard, Marin Dacos, Luc Santeramo, Gautier Poupeau, Jean Lamy

Properties

Methods

[ Top ]
Descendants
Child Class Description
ServOO Client class for communicating with ServOO server.

[ Top ]
Property Summary
mixed   $error   true if an error occured.
mixed   $error_message   message of the last error.
mixed   $http_request   array containing the http_request params.
mixed   $_images  
mixed   $_soapclient  

[ Top ]
Method Summary
ServOO_Client   ServOO_Client()   ServOO_Client constructor.
void   call()  
array   convertToAssoc()   Convert the file $infilename from $informat into $outformat, extract the stylized blocks of the xhtml file into an association array. This is the highest level function unless finer controls are required.
bool   convertToFile()   Convert the file $infilename from $informat into $outformat and save the resulting file on the disk as $outfilename
bool   convertToString()   convert the file $infilename from $informat into $outformat.
array   convertToXHTML()   Convert the file $infilename from $informat into $outformat and extract the xhtml file and the images from the ZIP archive returned by the ServOO.
array   convertUnpack()   Convert the file $infilename from $informat into $outformat and extract the files from the ZIP archive returned by the ServOO. You must ensure that ServOO return ZIP archive for the selected $outformat (raise an error if not a ZIP archive).
array   images()   get the images contained in the XHTML file.
void   setauth()   Set the basic authentification parameters
void   setproxy()   Set the proxy parameters
string   validateXML()   Validate an XML file for a XML Schema
string   version()   Get the version of the ServOO.

[ Top ]
Properties
mixed   $error [line 56]

true if an error occured.


[ Top ]
mixed   $error_message [line 61]

message of the last error.


[ Top ]
mixed   $http_request [line 67]

array containing the http_request params.

API Tags:
Access:  private


[ Top ]
mixed   $_images [line 78]
API Tags:
Access:  private


[ Top ]
mixed   $_soapclient [line 73]
API Tags:
Access:  private


[ Top ]
Methods
Constructor ServOO_Client  [line 86]

  ServOO_Client ServOO_Client( string $url  )

ServOO_Client constructor.

Parameters:
string   $url:  Location of the ServOO server.


[ Top ]
call  [line 481]

  void call( $operation, [ $params = array()]  )

Parameters:
   $operation: 
   $params: 

API Tags:
Access:  private


[ Top ]
convertToAssoc  [line 397]

  array convertToAssoc( string $infilename, string $informat, string $outformat, string $tmpdir, [string $imagesdir = ""], [array $options = array()], [array $zipoptions = array()], [function $callbackimages = ""], [mixed $user_vars = ""]  )

Convert the file $infilename from $informat into $outformat, extract the stylized blocks of the xhtml file into an association array. This is the highest level function unless finer controls are required.

The images file are extracted from the archive and the <img src=""> are updated accordinatly.

Parameters:
string   $infilename:  input filename
string   $informat:  MIME format or filename extension of the input file
string   $outformat:  MIME format, filename extension, or especial type of the output file
string   $tmpdir:  temporary directory for extracting the archive.
string   $imagesdir:  directory where to transfer the image if no callback function is given.
array   $options:  options to send to ServOO. Available options depend on outformat.
array   $zipoptions:  See ServOO_Client::convertUnpack() for details.
function   $callbackimages:  callback function taking threes arguments ( the original filename, the index in the zip archive and the user defined variable $user_vars) and must return the new full filename where the image shall be extracted or an empty string if the images should not be extracted. If no callback is provided the images filename a automatically assigned and stored in the $tmpdir directory.
mixed   $user_vars:  variable transmitted to the callback.

API Tags:
Return:  associative array containing the style and the block. False on error message if any error
Access:  public


[ Top ]
convertToFile  [line 164]

  bool convertToFile( string $infilename, string $informat, string $outformat, string $outfilename, [array $options = array()]  )

Convert the file $infilename from $informat into $outformat and save the resulting file on the disk as $outfilename

Parameters:
string   $infilename:  input filename
string   $outfilename:  output filename
string   $informat:  MIME format or filename extension of the input file
string   $outformat:  MIME format, filename extension, or especial type of the output file
array   $options:  options to send to ServOO. Available options depend on outformat.

API Tags:
Return:  true on success


[ Top ]
convertToString  [line 124]

  bool convertToString( string $infilename, string $informat, string $outformat, &$outstring, [array $options = array()]  )

convert the file $infilename from $informat into $outformat.

Parameters:
string   $infilename:  input filename
string   $informat:  MIME format or filename extension of the input file
string   $outformat:  MIME format, filename extension, or especial type of the output file
array   $options:  options to send to ServOO. Available options depend on outformat.
   &$outstring: 

API Tags:
Return:  true on success


[ Top ]
convertToXHTML  [line 271]

  array convertToXHTML( string $infilename, string $informat, string $outformat, string $tmpdir, [string $imagesdir = ""], [array $options = array()], [array $zipoptions = array()], [function $callbackimages = ""], [mixed $user_vars = ""]  )

Convert the file $infilename from $informat into $outformat and extract the xhtml file and the images from the ZIP archive returned by the ServOO.

You must ensure that ServOO return ZIP archive containing a xhtml file and images for the selected $outformat.The images are transfered as defined by a callback function and the XHTML is updated to account for this change (change the href location).

Parameters:
string   $infilename:  input filename
string   $informat:  MIME format or filename extension of the input file
string   $outformat:  MIME format, filename extension, or especial type of the output file
string   $tmpdir:  temporary directory for extracting the archive.
string   $imagesdir:  directory where to transfer the image if no callback function is given.
array   $options:  options to send to ServOO. Available options depend on outformat.
array   $zipoptions:  See ServOO_Client::convertUnpack() for details.
function   $callbackimages:  callback function taking threes arguments ( the original filename, the index in the zip archive and the user defined variable $user_vars) and must return the new full filename where the image shall be extracted or an empty string if the images should not be extracted. If no callback is provided the images filename a automatically assigned and stored in the $tmpdir directory.
mixed   $user_vars:  variable transmitted to the callback.

API Tags:
Return:  list of file fullname. False on error message if any error
Access:  public


[ Top ]
convertUnpack  [line 206]

  array convertUnpack( string $infilename, string $informat, string $outformat, string $outdir, [array $options = array()], [array $zipoptions = array()], string $outfilename  )

Convert the file $infilename from $informat into $outformat and extract the files from the ZIP archive returned by the ServOO. You must ensure that ServOO return ZIP archive for the selected $outformat (raise an error if not a ZIP archive).

Parameters:
string   $infilename:  input filename
string   $outfilename:  output filename
string   $informat:  MIME format or filename extension of the input file
string   $outformat:  MIME format, filename extension, or especial type of the output file
string   $outdir:  directory where files in the archive are extracted.
array   $options:  options to send to ServOO. Available options depend on outformat.
array   $zipoptions:  options to pass to PclZip lib. Two additional options are provided: denyextensions and allowextensions to select the files to extract. These options must be perl regexp. If allowextensions is not set the default value is xhtml|jpg|png|gif for security reason. Set allowextensions to "" or any other value if you don't want the default. The regexp search is done case-insensitive (/i modifier)

API Tags:
Return:  list of file fullname. False on error message if any error


[ Top ]
images  [line 519]

  array images( )

get the images contained in the XHTML file.


API Tags:
Return:  array with images filename


[ Top ]
setauth  [line 111]

  void setauth( string $user, string $pass  )

Set the basic authentification parameters

Parameters:
string   $user:  username
string   $pass:  password


[ Top ]
setproxy  [line 101]

  void setproxy( string $user, string $pass  )

Set the proxy parameters

Parameters:
string   $user:  username
string   $pass:  password


[ Top ]
validateXML  [line 455]

  string validateXML( string $xml, string $xmlschema, [strign $validator = "MSV"]  )

Validate an XML file for a XML Schema

Parameters:
string   $xml:  XML filename
string   $xmlschema:  XML/Schema filename
strign   $validator:  available validators are in ServOO_SOAP_Server class

API Tags:
Return:  return nothing if the document is valid. Otherwise, the string return by the validator or if any Error the message returned by the SOAP server


[ Top ]
version  [line 433]

  string version( )

Get the version of the ServOO.


API Tags:
Return:  version


[ Top ]

Documentation generated on Wed, 29 Aug 2007 14:30:00 +0200 by phpDocumentor 1.4.0a2