plone / plone.app.blocks

A 'blocks' rendering model for Plone
https://pypi.python.org/pypi/plone.app.blocks
Other
11 stars 4 forks source link

Rnixx issue5 #7

Closed rnixx closed 10 years ago

vangheem commented 11 years ago

I thought part of the reason this serializer was used was so that diazo could re-use this parsing.

If this change causes plone.app.theming to parse the dom an additional time, I'm against this change.

This also plays into the serializer used in plone 5 to facilitate auto csrf protection.

rnixx commented 11 years ago

if you take a closer look how the serializer is created, you'll recognize that there is no difference except the tree is not parsed by lxml's HTMLParser

https://github.com/repoze/repoze.xmliter/blob/master/repoze/xmliter/utils.py#L19

https://github.com/plone/plone.app.blocks/blob/rnixx-issue5/plone/app/blocks/transform.py#L84

the serializer object is now created "by hand"

vangheem commented 11 years ago

Ah yes, right, this still might break diazo.

Looking at https://github.com/repoze/repoze.xmliter/blob/master/repoze/xmliter/utils.py#L11 it seems that is the response is already parsed, it'll re-use it. This might screw up diazo's doctype override capability.

It might be worth testing diazo is all I'm saying..

jensens commented 11 years ago

"Could not find .travis.yml, using standard configuration"?

Isnt the policy to check plone.* code at http://jenkins.plone.org/ ? But here we have Travis?

And if theres a travis run configured, why is the configuration not set?

Questions....

rnixx commented 11 years ago

ok, well, might be that result is already a XMLSerializer, might be checked prior to creating a new one

vangheem commented 11 years ago

So if that XMLSerializer was created the normal way, it'd still break anyways right?

Still, this might break plone.app.theming since the transform is run later.

I think we might have to tackle this issue from another angle.

rnixx commented 11 years ago

i think p.a.theming and p.a.blocks should use the same parsed tree, even the technique used, but should not imply that each result is a full blown html document. thus there should be a utility function similar to the one in repoze.xmliter doing the described stuff and then also be used in theming (if thet is possible without tons of hassle).

anyway, if diazo is installed and we want to skip, diazo rendering x-theme-disabled header is set. similar could be done for blocks, but what if i want to integrate the tiles rendering transformation for HTML snippets this issue is all about?

jensens commented 10 years ago

whats the state of this one?

rnixx commented 10 years ago

imo there's still the need of avoiding the expectation of complete HTML documents for the transforms. my solution at the time of writing was to simply not use p.a.blocks / c.cover

datakurre commented 10 years ago

I close this pull, because this is not solution to the issue. I add a one more comment to the issue about the solutions.