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!
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
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.
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!
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.