Name Last Update
..
Core Loading commit data...
Document Loading commit data...
PropertySheet Loading commit data...
Tool Loading commit data...
dtml Loading commit data...
scripts Loading commit data...
tests Loading commit data...
transforms Loading commit data...
www Loading commit data...
FormPrintout.py Loading commit data...
GPL.txt Loading commit data...
MAINTAINERS.txt Loading commit data...
OOoTemplate.py Loading commit data...
OOoUtils.py Loading commit data...
Permissions.py Loading commit data...
VERSION.txt Loading commit data...
__init__.py Loading commit data...
readme.txt Loading commit data...
OOo Template

  An Zope object class to generate OOo documents dynamically.

  OOo Template derives from Zope Page Templates. Simply define the content.xml
  part of an OOo document in the edit tab. Then create a new File and upload
  an existing OOo document (ex. default_ooo_template). Then set the stylesheet
  property to the id of the uploaded OOo document (ex. default_ooo_template in this case).

  Rendering consists in replacing content.xml of the original OOo document
  with the content.xml generated by the OOo Template.

  Special tags for including content:

    - <office:include>
        Allow you to include another document in the current template (as an OLE attachment)
        You must specify at least the path (can be either a single name or a path name using "/").
        The type of document must be specified in the embedded document itself as
        a MIME type. Size parameters are defined, as in any ODF file,
        within the <draw:frame> tag which encloses the <office:include> tag.

        TODO: make sure it is useful or useless to pass x, y params (as before)

       Example:
        <draw:frame draw:style-name='gr1' svg:height='18.686cm' svg:width='27.367cm' draw:layer='layout' 
                    svg:x='0cm' svg:y='0cm'
                    tal:attributes="svg:height height | string:18.686cm;
                                    svg:width width | string:27.367cm">
          <office:include path="ERP5Site_viewOwnerBarChart" xlink:type='simple' 
                          xlink:actuate='onLoad' xlink:show='embed'/>
        </draw:frame>

    - <office:include_img>
        Not unlike <office:include>, allows you to include a picture document, refer to
        the <office:include> part for details.
        The optional "type" attribute specifies the picture format ; you can either
        pass a full value ("image/jpeg") or the short version ("jpeg").
        You can also pass position parameters with "x" and "y" attributes.
        The maxwidth and maxheight parameters are useful to set constraints.
        The aspect ratio information try to be kept (if you set only one size
        or if a constraint is applied).

       Example:
           <office:include_img x="5cm" y="1cm" path="foo" />

  Tips:

    - it is possible to embed images by calling oo_builder.addImage(image)
      where oo_builder is a handle to OOo Template internals and
      addImage a method to embed an image in the resulting document.

      Example:

      <draw:image draw:style-name="fr1" draw:name="Image1" text:anchor-type="as-char"
              draw:z-index="0" xlink:href="#Pictures/0001.png"
              xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"
              tal:attributes="xlink:href python:request.oo_builder.addImage(image.index_html(None,None,display='medium'))"/>

  Known Issues:

    - content type must be set to text/html

    - remove any dtd declaration such as:

    <!DOCTYPE office:document-content PUBLIC "-//OpenOffice.org//DTD OfficeDocument
1.0//EN" "office.dtd">