Git Product home page Git Product logo

redomino.appytransforms's Introduction

redomino.appytransforms

It registers a new portal transforms that let you dynamically generate odt or ods files for a given template.

This product is based on http://appyframework.org/pod.html

Since it aims to generate native LibreOffice/OpenOffice formats, it is not necessary running libre office in server mode.

This plugin is meant for developers, it could be used for generating dynamic odt/ods files, write a custom PloneFormGen adapter, etc.

Usage

Example:

>>> from zope.component import getUtility
>>> from Products.PortalTransforms.interfaces import IPortalTransformsTool
>>> file_contents = open('your odt file with variables').read()     # see redomino/appytransforms/tests/input.odt
>>> portal_transforms = getUtility(IPortalTransformsTool)
>>> converter = portal_transforms.convertTo(target_mimetype='application/vnd.oasis.opendocument.text.transformed',
>>>                                        orig=file_contents,
>>>                                        mimetype='application/vnd.oasis.opendocument.text',
>>>                                        mapper=dict(plone_version='4.3.2-sunny-day-beta'),
>>>                                       )
>>> transformed_odt_contents = converter.getData()

appy.pod's tips and limitations

Tips and appy.pod's limitations.

Odt files:

  • use the "Edit" -> "Changes" -> "Record" in order to display vars
  • conditional text fields seems to be not supported (as far as I can see), use comments with do text if expr instead
  • libreoffice does not support comments on single words (see http://ask.libreoffice.org/en/question/5256/comments-in-writer/), so it seems that you'll have to the only way to
  • repeating list items, it does not works as expected

Ods files:

  • don't use the "Edit" -> "Changes" -> "Record" on ods files!
  • repeat rows adding a comment on the first cell with "do row for person in persons" and put dynamic content putting into the cell value ="person['age']"
  • if you want to pass a single variable and displaying it into a single cell use the followind syntax into the cell value ="variable_name" (not as a comment)

appy's documentation is awful: if you are in trouble trying to get working ODT/ODS templates check out the tests doc https://github.com/redomino/redomino.appytransforms/tree/master/redomino/appytransforms/tests

Tests

Test status:

https://secure.travis-ci.org/redomino/redomino.appytransforms.png

How to launch tests:

$ ./bin/test -m redomino.appytransforms

Authors

redomino.appytransforms's People

Watchers

Fabrizio Reale avatar Davide Moro avatar Andrea D'Este avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.