Quote from: PaulGregory at Nov 07, 2006, 02:18 PM
Anyway. For those that are new to MODx and enjoying this thread, OpenGeek has been busy rethinking the MODx core for the past year or two. I believe he’s rethought (recoded) the whole thing several times. He’s largely working independently from the rest of the team, and key parts of this are new to us, which is why even 0.9.5 RC1 still has Snippets under Resources rather than starting to introduce new terminology like Elements.
I think this is the single biggest semantic gap for us to bridge between the MODx of today, and the one I’m describing. And though it is an important one, I think if this switch of meanings surrounding Resources is the biggest change in terminology, it won’t be that bad.
Quote from: PaulGregory at Nov 07, 2006, 02:18 PM
Somehow I often end up the lone voice of dissent amongst the praise, so I’m going to take this opportunity to agree that Resources/Elements broadly makes sense and all efforts made are commendable.
:o
Quote from: PaulGregory at Nov 07, 2006, 02:18 PM
So. As Resource will have types (document, weblink), it would seem that the idea we previously called DocumentType must now be ResourceSubType, and although I have yet to fathom exactly how my outline fits with OpenGeek’s new elements it still seems vaguely doable. What do you think, Jason?
Document Types (i.e. Document, Web Link) become Resource Class, because you implement a class to describe the behavior of that type of resource. If all you are doing though is creating Documents with different sets of meta data Elements attached, then you can attach those to the base element or any other Element common to your Resource Type, or even define specific Elements to apply to a Template only within a specific section (i.e. Context).
This is contrasted with content type handling, which might also be a little different than it is now. Currently, I have reimplemented this in the Elements layer. Let me explain. Each element defines what kind of content it returns, but Resources do not. This allows the use of a single resource to respond with various content types, say by attaching a snippet which dynamically sets the content type to be returned, which might be useful for some context-sensitive content delivery scenarios. But ultimately, the content type of a resource is defined by the content type of the base element attached to it. So if you attach an base element that returns HTML, your resource is an HTML content type.
Quote from: PaulGregory at Nov 07, 2006, 02:18 PM
Also, Jason, can you confirm how modules fit into this? Currently, a module is a PHP page that is added to the Manager menu. Is that then an element in itself, or do modules need to be rewritten to fit a typical front-end Resource + Elements model?
In my mind, no need for Modules at all. They are the same as script elements in this new architecture since Manager pages can be built in the same way as the front-end. So yes, they would likely need to be rewritten, but considering they become as easy to build and customize as the site itself and I think the required effort is worth it.
Quote from: PaulGregory at Nov 07, 2006, 02:18 PM
Does this have any impact on the way snippets like Ditto list content based on a "tags" TV? Does a better method open up with this new routine?
You add power in the fact that you can define hierarchical tag structures by relating elements together, and you can then do things like attach tags to Elements of a Resource, which brings the categorization capabilities to the same level as the reusable content Elements themselves. I think other improvements related to contexts and caching will have more impact on the performance and capabilities of snippets like Ditto and Wayfinder, which list resources in various ways.
Quote from: PaulGregory at Nov 07, 2006, 02:18 PM
What does this let us do that we can’t now do? (I’m sure there are an unlimited number of things, but some examples would be nice).
Some examples of what the new architecture allows, some practical, some more abstract:
* Define Elements representing Dublin Core Metadata attributes for all your Resources
* Treat the default Resource content as just another Element with default values and such.
* Create Resource classes that handle XML web service requests or Ajax requests specifically and manage those within MODx.
* Create Resource and/or Element classes that get their content from a file instead of the content database.
* Create a Script Element class extension that parses MODx tags in the PHP source before evaluation (dynamic PHP code, similar to dynamic CSS)
* Allow all MODx Resource and Element behavior to be overridden or extended without touching a single core file.
* Chain together a set of Elements that define workflow patterns and/or security permissions and attach them to a Resource or another Element.
* Chain together a set of Script elements that are conditionally performed based on the execution of it’s dependents.
I’ll come up with some more when I have a little more time.