Re: do we need plone.app.customerize ? was: [Plone-Users] Insufficient privileges on folder _contents

Jamie Lentin <jm-Pj/[email protected]>
Newsgroups gmane.comp.web.zope.plone.devel
Message-ID <[email protected]>
On 2013-12-11 21:43, Dylan Jay wrote:
> On 12 Dec 2013 02:28, "Jamie Lentin" <jm-Pj/[email protected]> wrote:
>  >
>  > On 2013-12-10 6:27, Dylan Jay wrote:
>  > > On 10 Dec 2013, at 4:44 pm, Nathan Van Gheem <[email protected]>
>  > > wrote:
>  > >
>  > >>
>  > >>
>  > >>
>  > >> On Mon, Dec 9, 2013 at 11:40 PM, Dylan Jay <djay-n0pU0XVUApFWk0Htik3J/[email protected]>
> wrote:
>  > >> On 10 Dec 2013, at 4:34 pm, Nathan Van Gheem
> <[email protected]>
>  > >> wrote:
>  > >>
>  > >> > Playing with the idea of TTW jbot:
> https://github.com/collective/collective.jbot [1]
>  > >> >
>  > >> > This approach isn't "safe." It actually creates temp files for
> each template customization so templates aren't run in restricted
> python.
>  > >> >
>  > >> > I think this could hit most people's use-cases though.
>  > >>
>  > >> There already exists a package to do this which includes
> something
>  > >> like jbot.
>  > >>
>  > >> https://pypi.python.org/pypi/plone.app.themingplugins [2]
>  > >> AFAIK, this does not work TTW. It's only for themes that are
> also
>  > >> python packages.
>  > >
>  > > Sorry you are right.
>  > > I do think plone.app.theming is the right place for doing new or
>  > > replacing existing views however.
>  > >
>  > > I know it's a long thread but I think it's well worth reading the
>  > > discussion of some ideas on how to achieve this between optilude
> and
>  > > me.
>  > >
>  > >
> http://markmail.org/message/q52lv4pyh4zn3cdd#query:+page:1+mid:6oqjgbip6pfh2c7m+state:results
> [3]
>  > >
>  > > This simple summary is that you can create something like tiles
>  > > (either via TAL and/or by using some kind of builder UI) which
> you can
>  > > than pull into your diazo theme under certain conditions and
> transform
>  > > the html if you need to. So any given page of a site could then
> be
>  > > made up of theme + content page + one or more tiles (which aren't
>  > > visible when viewing the unthemed content page).
>  > > For example to add last updated time to the bottom of every page.
>  > > - Instead of hacking the page template or main templated, you
> would
>  > > instead create a last updated tile and then write a diazo rule to
>  > > merges that into the final rendered page.
>  >
>  > +1 - I've tried restricting myself to doing a site theme within a
> zip
>  > file before, and being able to include per-type themes in the zip
> file
>  > would have been incredibly handy, verging on essential. So
> something
>  > like:-
>  >
>  > site.theme/views/Folder/my_magical_listing.pt [4]
>  >
>  > Registering a @@my_magical_listing for Folder portal types. They're
> part
>  > of the theme, so definitely a job for plone.app.theming. As you say
> no
>  > need to be able to override views, since you can do any overriding
>  > within Diazo. It's mostly about making sure the data is there for
> Diazo
>  > to chew on.
> 
>> 
>  > I thought plone.app.themingplugins was going to save me but
> apparently
>  > only works with a theme on the filesystem (not necessarily it's own
>  > package IIRC). If it works for zip files then I guess it'd also be
> TTW
>  > using the ACE editor. Not convinced a builder UI is worth it,
> versus
>  > copy-and-pastable examples on developer.plone.org [5] /
> stackoverflow you
>  > can then tweak.
> 
> Collective.listingviews does the "data diazo can chew on" builder part
> now ttw except that you can't include it in the theme zip. Instead
> you'd upload it as a generic setup zip (or just reconfigure it).
> 
> It doesn't however let you create full templates. If you haven't tried
> it I'd be interested if you find it powerful enough or would still
> prefer full templates?

I did try it at the time and decided against it. I can't remember my 
precise reasoning, but I think not being able to configure it as part of 
the theme was a big part of it. Possibly it didn't have the navigation 
portlet behaviour of showing sibling pages when on a non-folderish page? 
I'm not starting scandalous rumours though, I could easily be wrong :)

The important bit for be is being file-configurable, rather than lots of 
error-prone clicking to reproduce something. e.g. As part of the same 
site I could say "To create Plone type needed for the banner images, 
make a new type and copy and paste this XML". It doesn't have to be TAL, 
however using TAL saves inventing another file format. Having an editor 
for a TAL subset also sounds reasonably do-able.

> Copy paste and tweak from stackoverflow is certainly a plus for
> templates. With the listingview builder i was trying to avoid issue of
> non python developers debugging non working code plus also I restrict
> the code you can write to the HTML generated is standard. That way the
> diazo rules are the same so you can at least cut and paste and tweak
> them.
>  Either was I think its a good idea to move something like
> listingviews and/or templates into the theming zip.

Definitely.

>  > >> However I think that encouraging overriding inbuilt templates
> isn't a
>  > >> good idea. Mostly what people want to do is change just one or
> two
>  > >> parts of the template. Overriding the template this is
> reasonably easy
>  > >> but creates a big mess when you try and upgrade your site since
>  > >> plone's innards could have changed including templates.
>  > >> I think a simple quick way for users to create new views would
> be
>  > >> safer.
>  > >>
>  > >> >
>  > >> > Thoughts?
>  > >> >
>  > >> >
>  > >> > -Nathan
>  > >> >
>  > >> >
>  > >> > On Thu, Dec 5, 2013 at 12:41 PM, David Glick (Plone)
> <david.glick-z4DKO/[email protected]> wrote:
>  > >> > On 12/5/13, 6:24 AM, Nathan Van Gheem wrote:
>  > >> > I think many problems can probably be solved with diazo these
> days and yes, customerize doesn't not consistently work.
>  > >> >
>  > >> > That being said, we do need a customization story for
> non-devs.
>  > >> >
>  > >> > How feasible would it be to make a TTW jbot?
>  > >> >
>  > >> > Shouldn't be too hard. z3c.jbot already has the right hooks to
> look for a template's source "somewhere else" when a template is
> rendered. We would just need to add to the possible "somewhere else"
> locations, by configuring it with a set of ZODB paths to search for
> templates.
>  > >> >
>  > >> > This only takes care of overriding existing templates though.
> In a world without portal_skins and Acquisition, to add new templates
> we would need a way to register new views TTW (stored in the
> persistent component registry). There's no technical reason that can't
> be done, but no one has built it yet.
>  > >> >
>  > >> > And even for the use case of overriding templates, security is
> a caveat. Part of the problem with portal_view_customizations is that
> it takes a template which was running as filesystem code (i.e.
> unrestricted) and, once customized, runs it as restricted Python. That
> tends to lead to authorization errors once things are customized if
> the template was/is using things that aren't allowed in restricted
> code. For some sites (i.e. most standalone sites) it would be fine to
> allow unrestricted execution of TTW-edited code as long as only
> Managers are allowed to edit that code. But for shared hosting
> (multiple Plone sites for different clients in one Zope instance)
> that's not very safe. I'm not sure how to solve this for those sites,
> short of maybe doing automated testing of all templates to make sure
> they still execute successfully as restricted Python.
>  > >> >
>  > >> >
>  > >> >
>  > >> > --
>  > >> > Nathan Van Gheem
>  > >> > Solutions Architect
>  > >> > Wildcard Corp
>  > >> >
> ------------------------------------------------------------------------------
>  > >> > Sponsored by Intel(R) XDK
>  > >> > Develop, test and display web and hybrid apps with a single
> code base.
>  > >> > Download it for free now!
>  > >> >
> http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk_______________________________________________
> [6]
>  > >> > Plone-developers mailing list
>  > >> > Plone-developers-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
>  > >> > https://lists.sourceforge.net/lists/listinfo/plone-developers
> [7]
>  > >>
>  > >>
>  > >>
>  > >>
>  > >> --
>  > >> Nathan Van Gheem
>  > >> Solutions Architect
>  > >> Wildcard Corp
>  > >
>  > >
>  > >
> ------------------------------------------------------------------------------
>  > > Sponsored by Intel(R) XDK
>  > > Develop, test and display web and hybrid apps with a single code
> base.
>  > > Download it for free now!
>  > >
> http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk
> [8]
>  > > _______________________________________________
>  > > Plone-developers mailing list
>  > > Plone-developers-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
>  > > https://lists.sourceforge.net/lists/listinfo/plone-developers [7]
>  >
>  >
> ------------------------------------------------------------------------------
>  > Rapidly troubleshoot problems before they affect your business.
> Most IT
>  > organizations don't have a clear picture of how application
> performance
>  > affects their revenue. With AppDynamics, you get 100% visibility
> into your
>  > Java,.NET, & PHP application. Start your 15-day FREE TRIAL of
> AppDynamics Pro!
>  >
> http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
> [9]
>  > _______________________________________________
>  > Plone-developers mailing list
>  > Plone-developers-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
>  > https://lists.sourceforge.net/lists/listinfo/plone-developers [7]
> 
> 
> Links:
> ------
> [1] https://github.com/collective/collective.jbot
> [2] https://pypi.python.org/pypi/plone.app.themingplugins
> [3]
> http://markmail.org/message/q52lv4pyh4zn3cdd#query:+page:1+mid:6oqjgbip6pfh2c7m+state:results
> [4] http://my_magical_listing.pt
> [5] http://developer.plone.org
> [6]
> http://pubads.g.doubleclick.net/gampad/clk?id=111408631&amp;iu=/4140/ostg.clktrk_______________________________________________
> [7] https://lists.sourceforge.net/lists/listinfo/plone-developers
> [8]
> http://pubads.g.doubleclick.net/gampad/clk?id=111408631&amp;iu=/4140/ostg.clktrk
> [9]
> http://pubads.g.doubleclick.net/gampad/clk?id=84349831&amp;iu=/4140/ostg.clktrk

------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.