The Produce & Publish 2.1 Documentation

Requirements

«  Changelog   ::   Contents   ::   Changelog  »

The Produce & Publish Server provides the conversion functionality to all components of the Produce & Publish platform. The server is implemented on top of the Pyramid webframework (http://docs.pylonsproject.org/projects/pyramid/dev/). The server provides a simple XML-RPC API over standard HTTP protocol.

Requirements

Installation

Upgrading

For upgrading an existing SmartPrintNG server you should try the following inside your virtualenv environment:

bin/easy_install -U zopyx.smartprintng.server
bin/easy_install -U zopyx.convert2

XMLRPC API

The SmartPrintNG server exposes several methods through XMLRPC:

def convertZIP(auth_token, zip_archive, converter_name):
    """ 'zip_archive' is ZIP archive (encoded as base-64 byte string).
        The archive must contain exactly *one* HTML file to be converted
        including all related resources like stylesheets and images.
        All files must be stored flat within the archive (no subfolders).
        All references to externals resources like the 'src' attribute
        of the IMG tag or references to the stylesheet(s) must use
        relative paths. The method returns the converted output file
        also as base64-encoded ZIP archive.
    """

def convertZIPEmail(auth_token, context, zip_archive, converter_name='pdf-prince',
                    sender=None, recipient=None, subject=None, body=None):
    """ Similar to convertZIP() except that this method will send the
        converted output document to a recipient by email. 'subject' and
        'body' parameters *must* be utf-8 encoded.
    """

def availableConverters():
    """ Returns a list of available converter names on the
        SmartPrintNG backend.
    """

def authenticate(username, password):
    """ Log into the server. Returns an auth_token. authenticate()
        must be called before calling any of the methods above.
    """

def ping():
    """ says 'pong' - or something similar """

Email configuration

For using the email support through the convertZIPEmail() the email server must be configured through a dedicated configuration file. An email.ini may look like this:

[mail]
hostname = smtp.gmail.com
username = some_username
password = some_password
force_tls = False
no_tls = False

You have to pass the name of the email configuration file to paster when starting then server:

bin/paster serve server.ini mail_config=/path/to/email.ini

«  Changelog   ::   Contents   ::   Changelog  »