[Zope-CMF] Making a CMF Document render DTML

Ausum Studio ausum_studio@hotmail.com
Fri, 20 Sep 2002 23:27:17 -0500


The ability to render a DTML or ZPT call is great. But think of this:  If
you have a complex document containing half its own text and half a table
object full of text (for example), you need to provide a consistent way to
reindex that document in order to not to create a divergence between what
the catalog knows about the doc and the doc itself. (Yes, I asume
SearchableText or any other full-text index does include the rendered chunk
of text.) So an indexing problem comes into place:

If I use another object's content as a chunk of text within my document,
what happens when the author of that object updates it? Should he be granted
to reindex *my* doc even when it is in a private state? In order the let a
thing like that, who should be acquaintance with the relationship between
that object and all those using it, including mine? That very same object,
or another portal_tool containing only the relationships between different
objects across the site? What if 'portal_discussion' upgrades into
'portal_relationships'? (my choice). In any case, how all this would affect
the current workflow implementation?

In the meantime, I must live with the idea that not every doc needs to be
updated that way: "If I wrote a story at my sport's site during the last
Fifa World Cup - for example - , is probable that I must have needed several
tables to illustrate it, and also that all of them have been reused
somewhere else at the same time. But what are the chances that *all* those
tables need to be updated now?"  ;)


Ausum




----- Original Message -----
From: <Jean-Francois.Doyon@CCRS.NRCan.gc.ca>
To: <ausum_studio@hotmail.com>; <zope-cmf@zope.org>
Sent: Friday, September 20, 2002 2:37 PM
Subject: RE: [Zope-CMF] Making a CMF Document render DTML


> Ausum,
>
> Indeed, I just discovered CMF Article recently ... Might be handy in the
> future.
>
> All the options you mentionned had crossed my mind actually :)
>
> But I'm stubborn! I have this OO architecture in there, so I want to use
it.
> I want things to be dynamic, and od things only once, the whole point of
my
> using Zope.
>
> As you suggested the closest thing would've been to add a property that
has
> something like an ObjectID, and use that.  But again, I am restricted as
to
> where in the page that would appear, and that's too restrictive for my
> needs.
>
> Like I said in my message do Dieter, content shoudl be seperate from
> presentation, BUT, that doesn't mean content can't be dynamic either :)
>
> Thanks,
> J.F.
>
> -----Original Message-----
> From: Ausum Studio [mailto:ausum_studio@hotmail.com]
> Sent: Friday, September 20, 2002 3:03 PM
> To: zope-cmf@zope.org
> Subject: Re: [Zope-CMF] Making a CMF Document render DTML
>
>
> I'm concluding that what you need is a workaround to the problem of
> inserting structured subelements  within a document, am I right? Well, ...
> join the club  ;)
>
> I know there's a product called CMFArticle that deals with this, although
it
> uses a folderish object for the purpose, (though I haven't tested it and I
> can tell how well it solves the problem). In fact I agree to the idea that
> all other objects should behave like they can be one within another,
without
> the need to be folderish: A document can contain images, tables,
multimedia
> and/or topics(I'm thinking of the usual 'Related' box), all valid objects
on
> their own; an image can 'contain' captions shared by other elements like
CAD
> drawings or Flash animations. Think of every other possibility and soon
> you'll find out that there's almost no limit for the atomization of the
> content. So that's why current Types are just the starting point as well
as
> a reference.
>
> Here's what I do. I create the subelement  from any of the current Types.
> Let's say 'Quotes'. I create a quote out of a document type and then
create
> a view method to behave like my needs. Because of they are searchable I
have
> a modified 'search' method that opens a new window and gets the quotes
> perfectly rendered one below another (think of an album full of captioned
> photographs in the case of images), and then I just copy and paste it to
the
> IE's WYSIWYG editable body of my current document.(There are already many
> editors who does this.) That doesn't solve the reamining problem that the
> current document doesn't know it 'carries' another object, therefore an
> update to the quote object doesn't update the document it's associated to,
> but at least the job is done really fast.
>
> The closest I've approached to solve this issue is to store a list of
> id/type/path tuples of the objects you want inside, as an extra property.
> That demands that you organize your document skin to support them, and so
> they are opposed to the copy&paste workaround. Of course you could mix
both
> approaches by creating custon tags, regex-processed, but that I haven't
> tried so far.
>
>
> Ausum
>
>
>
> ----- Original Message -----
> From: <Jean-Francois.Doyon@CCRS.NRCan.gc.ca>
> To: <jeffrey@cuemedia.com>
> Cc: <zope-cmf@zope.org>
> Sent: Friday, September 20, 2002 11:18 AM
> Subject: RE: [Zope-CMF] Making a CMF Document render DTML
>
>
> > Jeffrey,
> >
> > Agreed on all counts!
> >
> > I'm just hoping someone has done this before, or can help me figure out
> how
> > to :)  I'm not a big product developper and don't know the Zope code all
> > that well.
> >
> > So I'm perfectly willing to do this work and share it, but I don't know
> > enough to get it done right now :)
> >
> > So I've tracked down the HTML module form the Globals package, that
seems
> > should do what i want.  But not knowing the inner workings, I wonder,
> would
> > I be better off using DocumentTemplate instead? Then there's these
> "client"
> > objects I'm not too sure about ... and so on ...
> >
> > I suppose I could simply wrap a DTML Method into a CMF type, but
> > unfortunately it's too late for me (My content allready exists in CMF
> > Documents), and I'd rather simply change the Document type (CookedBody)
to
> > do what I want. (I know, there's a million reasons I shouldn't do
that!).
> >
> > I suppose I'll eventually figure it out, but I'm going to suffer
terribly
> in
> > the mean time, so I'm hoping someone out there can give me some pointers
> (Or
> > has done this allready).
> >
> > Cheers,
> > J.F.
> >
> > -----Original Message-----
> > From: Jeffrey P Shell [mailto:jeffrey@cuemedia.com]
> > Sent: Friday, September 20, 2002 12:02 PM
> > To: Jean-Francois.Doyon@CCRS.NRCan.gc.ca
> > Cc: chrisw@nipltd.com; zope-cmf@zope.org
> > Subject: Re: [Zope-CMF] Making a CMF Document render DTML
> >
> >
> > I think it's a valid need, one that could be solved a myriad of ways.
> > I don't think DTML (especially since this purpose of DTML is on its way
> > out) based "CMF Documents" should be part of the core product, but it
> > shouldn't be too difficult for you or someone to write a third party
> > product that defines a 'CMF DTML Document' content type, and have that
> > get integrated into the CMF.  The Default Document type is pretty bone
> > simple (and similarly - needlessly complex) - but the key word is
> > 'Default'.  It's meant to be replaceable by something that better suits
> > your needs should you or someone else write the code to do it.
> >
> >
> > On Friday, September 20, 2002, at 09:03  AM,
> > Jean-Francois.Doyon@CCRS.NRCan.gc.ca wrote:
> >
> > > Because having a single template applicable to all documents is too
> > > restrictive.  I want people to be able to contribute documents, and
> > > take
> > > advantage of the workflows, but not all documents will have the exact
> > > same
> > > layout.  In fact there's now way for me to predict what document
> > > authors
> > > might want. BUT I do have a template that does some stuff, like the
> > > consistent look of the site, BUT, I do no want to dictate every detail
> > > of
> > > the layout.  Authors have to be able to decide whether they want an
> > > image
> > > justified left, or right, and so on. Currently this is all done by
> > > putting
> > > HTML inside the CMF Document, which is fine.
> > >
> > > The problem is that, in this particular case, we have tables that
> > > appear all
> > > over the site in various documents (And featured items, and news
> > > items, etc
> > > ...).  Right now these are done as HTML inside a CMF Document.  BUT it
> > > would
> > > make a whole lot more sense to make these tables as re-usable
> > > components
> > > (lists, formatted search results, whatever).  The problem is that I
> > > cannot,
> > > should not, and will not dictate where document authors can/should put
> > > these
> > > tables/lists in their documents.
> >
> > Another solution here would be to make different content types to
> > handle tables, or other items, that present a nice editing interface
> > for what they represent.  Or to use something like CMFArticle (or FDoc,
> > if I can ever make time to put together a release) which are composite
> > document based solutions - where a document is more than just a big
> > block of text and is instead built out of smaller units representing
> > text, images, etc.  But, to get the sort of results you're wanting, you
> > may still need to write a fair amount of custom code to fit into the
> > framework.  But that is the point of a framework - to enable developers
> > to build custom solutions that fit into a larger picture and have many
> > elements of that larger picture taken care of for them (ie - Workflow,
> > etc).
> >
> > > So, the best bet would be to be able to put a DTML tag inside the
body,
> > > where ever the author chooses. I could tell the authors to simply use
> > > <dtml-var "tablegenerator(item2,item5,item22)"> in their HTML code.
> > > (Said
> > > tables are just lists of other Zope objects)
> >
> > "Simply use"???  I think geeks need to strike this phrase from their
> > vocabulary :).  It's like 'simply lo-fi the sampling rate using
> > Latch.ar() with Impulse as a clock.'
> >
> > > Am I really the only one who would find this usefull?  Seems to me I
> > > would
> > > have the best of both worlds, a fully templated DTML aware object.  I
> > > am
> > > fully aware of the theory of seperating content from style and all
> > > that, but
> > > in my world, that's just not practical enough.  Telling authors (we
> > > have
> > > many) that ALL their documents should look the EXACT same (or at least
> > > have
> > > the exact same layout) isn't acceptable. Creating various templates
> > > isn't
> > > practical enough either, I'd have a different template for every
> > > document!
> > >
> > > I can think of a million uses of CMF Documents containing DTML, not
the
> > > least of which is having workflows applicable to DTML rendered
> > > (renderable?)
> > > content.
> > >
> > > Help ? Please ? :)
> >
> > _______________________________________________
> > Zope-CMF maillist  -  Zope-CMF@zope.org
> > http://lists.zope.org/mailman/listinfo/zope-cmf
> >
> > See http://collector.zope.org/CMF for bug reports and feature requests
> >
>
> _______________________________________________
> Zope-CMF maillist  -  Zope-CMF@zope.org
> http://lists.zope.org/mailman/listinfo/zope-cmf
>
> See http://collector.zope.org/CMF for bug reports and feature requests
>