Skip to main content

ZOPYX SmartPrintNG Server

Project description

zopyx.smartprintng.server

A repoze.bfg based server implementation for the SmartPrintNG framework.

The SmartPrintNG server is part of the SmartPrintNG web-to-print solution of ZOPYX.

Requirements

  • Python 2.6 (no Python 3 support)

Installation

  • create an virtualenv environment (Python 2,4, 2.5 or 2.6) - either within your current (empty) directory or by letting virtualenv create one for you:

    virtualenv --no-site-packages .

    or:

    virtualenv --no-site-packages smartprintng
  • install repoze.bfg (by installing repoze.bfg.xmlrpc having repoze.bfg as a dependency)

    bin/easy_install -i http://dist.repoze.org/bfgsite/simple repoze.bfg.xmlrpc
  • install the SmartPrintNG server:

    bin/easy_install zopyx.smartprintng.server
  • create a server.ini configuration file (and change according to your needs):

    [DEFAULT]
    debug = true
    
    [app:main]
    use = egg:zopyx.smartprintng.server#app
    reload_templates = true
    debug_authorization = false
    debug_notfound = false
    
    [server:main]
    use = egg:Paste#http
    host = 127.0.0.1
    port = 6543
  • start the server:

    bin/paster serve server.ini

XMLRPC API

The SmartPrintNG server exposes several methods through XMLRPC:

def convertZIP(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(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 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

Support

Support for SmartPrintNG server is currently only available on a project basis.

Contact

ZOPYX Ltd. & Co. KG
c/o Andreas Jung,
Charlottenstr. 37/1
D-72070 Tuebingen, Germany
E-mail: info at zopyx dot com

Changelog

0.5.1 (2009/08/01)

  • added convertZIPandRedirect() method

  • added deliver() method

  • moved base.ServerCore to models.py

  • delivered files must be younger than ‘delivery_max_age’ seconds

  • cleanup code

  • internal refactoring

  • more tests

0.5.0 (2009/07/23)

  • now requires Python 2.6

0.4.3 (2009/07/22)

  • removed most of the ZCML configuration

  • tests, tests, tests

0.4.2 (2009/07/19)

  • switching back to zope.sendmail

  • implemented asynchronous mail delivery on top of zope.sendmail

0.4.1 (2009/07/19)

  • using repoze.sendmail

0.4.0 (2009/07/19)

  • added convertZIPEmail() API

0.3.4 (2009/07/13)

  • updated documentation

0.3.3 (2009/07/12)

  • fix for missing BASE tag within HTML files

0.3.2 (2009/07/12)

  • better logging

0.3.1 (2009/07/08)

  • disabled check for maximum size of the request within parse_xmlrpc_request() since 8MB is too small for us

0.3.0 (2009/07/06)

  • switched to repoze.bfg

0.2.0 (2009/07/06)

  • improved handling of temporary directories

0.1.2 (2009/07/05)

  • improved handling of temporary directories

0.1.1 (2009/07/05)

  • improved logging and error handling

0.1 (2009/07/05)

  • Initial release

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zopyx.smartprintng.server-0.5.1.tar.gz (58.5 kB view details)

Uploaded Source

File details

Details for the file zopyx.smartprintng.server-0.5.1.tar.gz.

File metadata

File hashes

Hashes for zopyx.smartprintng.server-0.5.1.tar.gz
Algorithm Hash digest
SHA256 033a994d9d8763057ea6faa7d19c90df0813f5a5a67d796d8f8b05e0d69c056b
MD5 1d027d0801329e4e2a56f980e5cc5ad9
BLAKE2b-256 663a96e3aebdd7b2b98477b9b80587752364bad8beb96034dda2cd65faa662a3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page