On Dec 7, 11:03 am, "Ian Charnas" <
ian.char...@gmail.com> wrote:
> I want to take more of a 'quacks like a duck' approach. I want plugin
> integration to be accomplished mostly through entrypoints. Plugins
> can add stuff to the admin interface via entrypoints... they can
> modify the url processing method via entrypoints... and so on. When
> an entrypoint's output will end up on the web interface, I prefer the
> plugin outputs actual html and not some data structure. This avoids
> all those ugly hacks you see in other systems when developers try to
> trick the system into displaying what they want. Style will be kept
> uniform through intelligent use of css.
The reasons for having Tortuga plug-ins go away if they look and act
too much like TurboGears apps or WSGI modules. What makes something a
CMS plug-in as opposed to something, well, not a plug-in is that it
uses the API (that will be) provided and provides functionality that
is relevant to extending CMS functionality. The main thing that I see
writing Tortuga plug-ins for is describing document sets that contain
complex or dynamic data types.
There's a sense in which *any* web app can be construed as a document
set, but pragmatically there may be limits to the situations in which
that is the most productive approach. I don't know what the limits
are, but it's possible. ;-)
> I don't write interfaces and parent classes and such unless they're
> actually *really* necessary, because unnecessary abstraction causes
> bloat and ugly hacks when programmers try to get around the interfaces
> to accomplish their tasks.
The real challenge will be making the interface that is both simple
enough and functional enough to get used. From the TurboGears list,
it's 5 lines of code to embed a WSGI app like Tortuga into a TG app.
Making it look pretty and providing access to the data across those
boundaries is a little more challenging, which is why I'm excited
about this capability in Tortuga. It's one thing to graft an app into
the site tree. It's another thing altogether to have a consistent way
to share both presentation and content.
> I *do* like to write examples though. Lots and lots of examples. So
> developers will get a good foundation on how to write plugins through
> the examples, and then they can browse through the "api", which will
> consist of config, rendering, database, and what the entrypoints are
> and how they work.
For those of us who want to start coding yesterday, I think that the
developers preview already provides important insight into what a CMS
plug-in should do, which is:
1) Provide the stuff that you would type in if you followed the
example. **or**
2) Perform document 'translations', i.e. provide infrastructure for
complex content types to be derived from simple inputs.
In other words, I think that 2 useful likely entry points can be
implied from the example. #1 is pretty straight forward, but #2 is
really exciting. At it's core, building a Tortuga site is going to be
very much likely building a TurboGears site. The content and
presentation of a Tortuga document map to the model and view of the
MVC pattern as implemented in TG2, even using the same APIs (Alchemy
and Genshi). The exciting plug-ins will be those that extend user
defined content types in the way that Tortuga core provides i18n and
workflow.
Simple things that someone like I can do (being longer on
implementation than coding) would be building a pilot site with TG2.
When Tortuga is ready, we've already seen how the template and model
code will be imported.
Much more challenging will be writing the transformational kind of
code that extends the functionality of user content. While the i18n
and workflows provide examples of what we can expect to do with plug-
ins, implementation will be vastly simpler when those classes have
been generalized, i.e. it's probably OK and fun to speculate about
possible applications, but it won't be productive to write code yet.
Which I think brings us back to the original question. If someone
wants to have content ready for Tortuga when it's ready then they can
recycle Alchemy Objects and Genshi Templates from a TG2 app, gaining
some professional features when they do so. If it turns out that the
part of the site already developed won't benefit from Tortuga, but
future development would, then Tortuga can be built as a WSGI app and
called from TG2 or visa versa.
Chris