In terms of storing this, I think we have three options as well:
a) Store in some persistent ZODB tool
b) Store all templates in a single resource directory (++typeviews++
or something)
c) Store templates for a particular type in a type-specific resource
directory (++typeviews++typename or something)
I'm leaning towards c here.
In the TTW plone world diazo will the primary way a new plone user will templating and arranging html, we could let them use diazo. Even TAL is familiar to us, it will be something new to them.
An alternative is something like collective.listingviews where you give them a UI to expose the values they need along with unique css classes. Then let them use diazo to turn them into the design they want.
What I was thinking would be nice is some form of ttw python code more similar to a BrowserView than the old pythonmethods. For example, if there was business logic you'd want to do that in python rather than a template. One example might be to calculate a an automatic ID for a content item or perhaps a custom validator.
An alternative is something like collective.listingviews where you give them a UI to expose the values they need along with unique css classes. Then let them use diazo to turn them into the design they want.I haven't tried c.listingviews, but I do subscribe to these types of solution.What I was thinking would be nice is some form of ttw python code more similar to a BrowserView than the old pythonmethods. For example, if there was business logic you'd want to do that in python rather than a template. One example might be to calculate a an automatic ID for a content item or perhaps a custom validator.
I'm worried about writing Python through the web, and there are a host of problems with trying to execute TTW python scripts.
I wonder if we can get away with this:- you can write ZPT through the web, including to register new ZPT-only views and tiles- you can write Diazo rules through the web- you can apply tiles and utility views and behaviours written in Python to your themes/views/tiles/typesMartin
--
1) Tidy up the control panel front page. I think it should be a
generic "types" control panel, incorporating the relatively sparse
features of the current "Types" control panel and making it possible
to add/edit Dexterity types.
2) The "Add type" screen could be more user friendly, with better
help text at least.
3) When adding a type, we should immediately go to the edit view of that type.
4) The two "export" actions are great, but it's probably quite hard
to understand what they do. We should make them more user friendly.
5) When editing a type, again it's a bit hard to know what to do (The
"behaviours", for example, is fairly obtruse if you don't know what a
behaviour is). There are also some styling issues that makes the whole
page a bit jumbled.
6) The field editor I think is quite nice, actually, but the
"Settings..." trigger is failing for me right now, with a jQuery error
(Plone 4.3).
7) We need a way to make custom views
I think this is the main sticking point right now for making the TTW
type story useful.
I think we could use the ACE editor (from the new p.a.theming editor)
to make this possible. I think we have a couple of options here:
a) Register a local view multi adapter that invokes some semantics to
render a template
b) Have a behaviour on TTW types that invokes some semantics to
render a template
I prefer option b, I think - local component registrations have a
tendency to get out of sync and are quite opaque.
In terms of templates, again I think we have three options
a) Use a ZopePageTemplate stored in the ZODB somewhere
b) Use Blocks-like HTML snippets with tile declarations to define
field placeholders
c) Use HTML snippets with some other, less generic custom format to
define field placeholders (i.e. data- attributes specifying field
names)
I'm leaning towards option b here too. What do others thing?
*think
Thinking about it a bit more, ZPT may be the safer and more flexible option. What I'm thinking, is that when you click "customise view" we generate something that looks like the default view (i.e. lists field labels and values), but in fact is the basic TAL to generate that without any loops, i.e. it has a div for each field with the relevant TAL.
In terms of storing this, I think we have three options as well:
a) Store in some persistent ZODB tool
b) Store all templates in a single resource directory (++typeviews++
or something)
c) Store templates for a particular type in a type-specific resource
directory (++typeviews++typename or something)
I'm leaning towards c here.
Another option would be to use portal_view_customizations for this.
8) We need a better export/import round tripping story
It should be possible to do two things:
- Export a zip file with one or more types (i.e. so you can
distribute sets) that can be easily imported through the control panel
- Export a zip file with a skeleton Python package containing a type,
for when you want to move to full filesystem distribution
I'd welcome some feedback on the items above. It's probably going to
be what I sprint on in Arnhem. ;)
Thanks for your thoughts on how to improve the Dexterity type editor, Martin. They actually are very much in line with my own brainstorming about what needs to happen. I'm going to respond to specific items below, and also add a few other things I think are important.
On 9/15/12 3:01 PM, Martin Aspeli wrote:
Yes, I think it should list all the types, whether Dexterity-based or not. Clicking into a type takes you to a 'General' tab that lets you edit the type's title and description as well as configuring where the type can be added (anywhere, within any instance of another type, in specific folders) and by whom, and most of the other settings from the current types control panel.
1) Tidy up the control panel front page. I think it should be a
generic "types" control panel, incorporating the relatively sparse
features of the current "Types" control panel and making it possible
to add/edit Dexterity types.
The workflow stuff should probably get moved to a separate tab which lets you select a workflow like the current Types control panel does, possibly with a graphical representation if Nathan figures out how to make that work. And the ability to jump over to the workflow editor which I assume would be its own control panel.
If you're looking at a Dexterity content type you see Schema and Behaviors tabs. If we add a new Views tab, we can possibly make that work for either Dexterity or Archetypes if we implement it right.
2) The "Add type" screen could be more user friendly, with betterYep.help text at least.
Yep.
3) When adding a type, we should immediately go to the edit view of that type.
Yeah. I think we should have one 'export' button which takes you to a separate page that shows you an overview of what is going to be exported, tells you what to do with it, and then has the big export button at the bottom.
4) The two "export" actions are great, but it's probably quite hard
to understand what they do. We should make them more user friendly.
The behaviors page definitely needs some work. In addition to an overview of what's going on, we need better descriptions of what behaviors do, and a better way to filter down if you're looking for a particular behavior.5) When editing a type, again it's a bit hard to know what to do (The
"behaviours", for example, is fairly obtruse if you don't know what a
behaviour is). There are also some styling issues that makes the whole
page a bit jumbled.
Probably it's using some selectors without proper quotes around the stuff in square brackets.6) The field editor I think is quite nice, actually, but the
"Settings..." trigger is failing for me right now, with a jQuery error
(Plone 4.3).
One of the biggest things we could do to improve the usability of the field editing is when you're adding a new field, make the field-specific options show up as soon as you choose what type of field you want.
I also want to figure out how to let the user select between widgets for a field, or at least configure attributes of the default widget.
Yeah, this is the biggest sticking point at the moment, I think. Did you see the mockups I made for this early this year? I also started a branch of plone.app.dexterity to implement it, although I didn't get terribly far.7) We need a way to make custom views
I think this is the main sticking point right now for making the TTW
type story useful.
I'm sort of inclined to go with (a), because five.customerize already handles the tricky bits, and I'm not quite sure how the traversal would work for (a) if you want to have more than one custom view with different names.I think we could use the ACE editor (from the new p.a.theming editor)
to make this possible. I think we have a couple of options here:
a) Register a local view multi adapter that invokes some semantics to
render a template
b) Have a behaviour on TTW types that invokes some semantics to
render a template
I prefer option b, I think - local component registrations have a
tendency to get out of sync and are quite opaque.
I think it would be nice to have 2 different things:In terms of templates, again I think we have three options
a) Use a ZopePageTemplate stored in the ZODB somewhere
b) Use Blocks-like HTML snippets with tile declarations to define
field placeholders
c) Use HTML snippets with some other, less generic custom format to
define field placeholders (i.e. data- attributes specifying field
names)
I'm leaning towards option b here too. What do others thing?
*think
Thinking about it a bit more, ZPT may be the safer and more flexible option. What I'm thinking, is that when you click "customise view" we generate something that looks like the default view (i.e. lists field labels and values), but in fact is the basic TAL to generate that without any loops, i.e. it has a div for each field with the relevant TAL.
1. ZPT, with auto-generation of a basic template with all the fields, like you described. This is good for when the user knows TAL and needs something pretty custom. And this is definitely the one to do first.
2. Something with a more graphical UI that lets you arrange which fields are shown in what order, and whether or not to show their labels, or just the field content. This is inching in the direction of deco, but I think it could still be pretty useful to non-programmer types even if it doesn't allow for full flexibility of positioning and the flexibility of configurable tiles. (As a related aside, if we went with tiles, I'd be a little worried about the performance of rendering the view of a type with a hundred fields.)
Let's stop inventing new places for things to be stored. Templates in a folder somewhere is good. :)In terms of storing this, I think we have three options as well:
a) Store in some persistent ZODB tool
b) Store all templates in a single resource directory (++typeviews++
or something)
c) Store templates for a particular type in a type-specific resource
directory (++typeviews++typename or something)
I'm leaning towards c here.
Another option would be to use portal_view_customizations for this.
We have the export, but not the import. Can you import if you already have instances of the type?8) We need a better export/import round tripping story
It should be possible to do two things:
- Export a zip file with one or more types (i.e. so you can
distribute sets) that can be easily imported through the control panel
Yeah, that'd be killer if people didn't have to set up ZopeSkel.- Export a zip file with a skeleton Python package containing a type,
for when you want to move to full filesystem distribution
Some other things:I'd welcome some feedback on the items above. It's probably going to
be what I sprint on in Arnhem. ;)
9) More field types. It'd be fantastic to be able to add a relation to another type, or a data grid with several columns. Even basic things like a URL and an Email field would be useful, especially since we don't have a way to configure validators TTW yet.
10) Configure fields as searchable (both in SearchableText, and with their own indexes -- the latter is a critical step toward building out collections or using addons like eea.facetednavigation).
11) Assign field read/write permissions.
12) Fix schema invalidation - Right now the TTW type editor doesn't work if you're using it on a deployment with multiple instances. That's because there's no invalidation getting sent from the instance where the change was made to tell the other instances that they need to re-sync their dynamic schemas.
13) A TTW builder of metadata schemas that can be assigned to multiple content types. I prototyped this at https://github.com/davisagli/collective.pigeonhole although currently it only adds fields to Archetypes content, because that's what the client needed. (Dylan, this is going to look a lot like collective.facets—which is because I forgot the latter exists until I was already done with the prototype—only it's built around plone.schemaeditor for configuring the schema. Let's talk at the conf about how we can merge our efforts.)
8) We need a better export/import round tripping story
It should be possible to do two things:
- Export a zip file with one or more types (i.e. so you can
distribute sets) that can be easily imported through the control panel
- Export a zip file with a skeleton Python package containing a type,
for when you want to move to full filesystem distribution
I'd welcome some feedback on the items above. It's probably going to
be what I sprint on in Arnhem. ;)
i'm coming to these issues from the consuming user end, so i'll characterize what i'd HOPED to find. also, my thoughts have more to do with features external to zope/plone and their internal implementation. let me jump in at #8:
On Saturday, September 15, 2012 6:18:11 AM UTC-7, Martin Aspeli wrote:
8) We need a better export/import round tripping story
It should be possible to do two things:
- Export a zip file with one or more types (i.e. so you can
distribute sets) that can be easily imported through the control panel
- Export a zip file with a skeleton Python package containing a type,
for when you want to move to full filesystem distribution
I'd welcome some feedback on the items above. It's probably going to
be what I sprint on in Arnhem. ;)
first, i'd expected that the TTW facility would be able to spec some but not all features i'd like in my new types, that a ~zopeskel version would get written into some .../src/new.product directory with all the required profile, etc. directory sub-structure, and with "put your code here" delimiters identifying places i could add the extra bits. couldn't an improved "Export" button do that sort of meld of zopeskel.dexterity with the current model/template files?
second, i usually begin my design work in UML, using a tool like ArgoUML, and so i was pretty happy with the Archetypes profile that you could use to export AT-style types. couldn't it be possible to write a new profile for ArgoUML to produce Dexterity types?
Thanks for your thoughts on how to improve the Dexterity type editor, Martin. They actually are very much in line with my own brainstorming about what needs to happen. I'm going to respond to specific items below, and also add a few other things I think are important.
On 9/15/12 3:01 PM, Martin Aspeli wrote:
1) Tidy up the control panel front page. I think it should be a
generic "types" control panel, incorporating the relatively sparse
features of the current "Types" control panel and making it possible
to add/edit Dexterity types.
Yes, I think it should list all the types, whether Dexterity-based or not. Clicking into a type takes you to a 'General' tab that lets you edit the type's title and description as well as configuring where the type can be added (anywhere, within any instance of another type, in specific folders) and by whom, and most of the other settings from the current types control panel.
The workflow stuff should probably get moved to a separate tab which lets you select a workflow like the current Types control panel does, possibly with a graphical representation if Nathan figures out how to make that work. And the ability to jump over to the workflow editor which I assume would be its own control panel.
If you're looking at a Dexterity content type you see Schema and Behaviors tabs. If we add a new Views tab, we can possibly make that work for either Dexterity or Archetypes if we implement it right.
2) The "Add type" screen could be more user friendly, with better
help text at least.
Yep.
Yep.3) When adding a type, we should immediately go to the edit view of that type.
Yeah. I think we should have one 'export' button which takes you to a separate page that shows you an overview of what is going to be exported, tells you what to do with it, and then has the big export button at the bottom.4) The two "export" actions are great, but it's probably quite hard
to understand what they do. We should make them more user friendly.
5) When editing a type, again it's a bit hard to know what to do (The
"behaviours", for example, is fairly obtruse if you don't know what a
behaviour is). There are also some styling issues that makes the whole
page a bit jumbled.
The behaviors page definitely needs some work. In addition to an overview of what's going on, we need better descriptions of what behaviors do, and a better way to filter down if you're looking for a particular behavior.
Even with better descriptions it would still be confusing that both the schema editor and a tick box on behaviors result in fields in the final type.Is there are way to make a schema injecting behavior show it's fields in the editor as read only so you can preview the full schema?
I think it would be nice to have 2 different things:
1. ZPT, with auto-generation of a basic template with all the fields, like you described. This is good for when the user knows TAL and needs something pretty custom. And this is definitely the one to do first.
2. Something with a more graphical UI that lets you arrange which fields are shown in what order, and whether or not to show their labels, or just the field content. This is inching in the direction of deco, but I think it could still be pretty useful to non-programmer types even if it doesn't allow for full flexibility of positioning and the flexibility of configurable tiles. (As a related aside, if we went with tiles, I'd be a little worried about the performance of rendering the view of a type with a hundred fields.)I'm still uncomfortable with having more than one way to do something. It's an approach that resulted in Plone being hard to explain and hard to document.Each new different way requires more learning burden to understand the limitations of one over the other.For example if we are going to present TAL templates to edit a type view why not let the user use templates to modify anything else on the page like other Cms's do. I'm not suggesting we do this just that it would make the system much easier to understand.I think we have the opportunity with ttw development to start new. It doesn't have to mirror how we build Plone the application. It also doesn't have to be just a starter to get you into file system development. I think we should be approaching this as a single cohesive UI that will let you build how classes of sites with needing to create a package deploy it.
That way ploud becomes easier than Wordpress.For example I was looking at requirements the other day for a booking system for interpreters and clients. They wanted it built into a Cms. It has business logic of rounds of offers for jobs and logic about determining pricing. Thinking how we simplify building ttw a concrete example like this might help guide this UI. Documentation driven development approach please.