getRenderedItem

Help
2011-12-15
2013-04-25
  • Philip Kilner

    Philip Kilner - 2011-12-15

    Hi All,

    I have a Plomino document with quite a bit of conditional logic in it, which I need to be able to take a "snapshot" of. Ideally, I'd like to programatically create a Plone page to hold these snapshots.

    Can I use "getRenderedItem" to access the rendered view of the document? I'm struggling to get this syntax right for this!

    PhilK

     
  • Eric Brehault

    Eric Brehault - 2011-12-19

    Hello,

    getRenderedItem only renders an item using a field

    What you need in your case is to render the entire document.
    To do that, you can use openWithForm:
    form = plominoDocument.getForm()
    # you can also use another form, specifically designed for snapshot rendering:
    # form = plominoDocument.getParentDatabase().getForm('myform')
    snapshot_html = plominoDocument.openWithForm(form)

    then you can store the html in richtext field in a snapshot doc

    Eric

     
  • Jean Jordaan

    Jean Jordaan - 2011-12-22

    If you have your permissions configured appropriately, you can even store the HTML in a Plone page somewhere outside your Plomino database (it sounded like this might be something you want to do). Note that in this case you'll be using the Plone API, not Plomino any more.

     
  • Philip Kilner

    Philip Kilner - 2012-01-17

    Hi,

    Just to close the loop on this, creating snapshot HTML and saving it as a standard Plone page worked really well.

    I needed to save a static copy of a document with a lot of conditional display logic in it, and I needed to be able to render the document as a PDF with zopyx.smartprintng.lite - woked like a charm!

    Thanks guys!

    PhilK

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks