Document Assembly with Zope
I created a zope site with a slew of DTML Document containing clauses for documents. The idea is to list the various DTML Documents in an HTML form from which the user selects particular clauses for inclusion in a dynamically generated document. The DTML Documents are stored in various folders in a tree. This structure is easily viewed with a <dtml-tree> tag. However, I am trying to generate an HTML form with the same structure, but with radio buttons in front of each clause so that one (or none) of the selections can be made by the user. Making the HTML form is a bit tricky, but that isn't the really hard part. First, as users would be allowed to add folders and DTML documents at will (this is a necessity for the project), then a python script can't be used to generate the appropriate document (or can it, because you wouldn't know the complete parameter string). Has anyone tried to do something like this? I considered creating a separate document with a list of the clauses contained in a list parameter. Then the user could just select from the list. This isn't the best solution, because it would presuppose that the user knew what the clause was to begin with (a bad assumption). In fact, the nice thing about the form is that you could have a URL to the particular clause, which the users found very helpful. An alternative is to use a ZCatalog to generate the HTML form. That still leaves the problem of generating the completed document because the python script wouldn't have a non-volitile parameter list. I know that CMF is good for creating a single document. Unfortunately, I haven't found that it is useful for generating a document on the fly from selecting particular clauses from a multitude of clauses. Any ideas? Thanks in advance, Ron
Ronald L. Chichester writes:
... Making the HTML form is a bit tricky, but that isn't the really hard part. First, as users would be allowed to add folders and DTML documents at will (this is a necessity for the project), then a python script can't be used to generate the appropriate document (or can it, because you wouldn't know the complete parameter string). Can you explain a bit better, what you want to achieve with the hierarchy and the python script?
You may also look at "ZTUtils.Tree". Unfortunately, I do not yet know a place where this class is documented. But the ZPT examples contain examples on how to use it... Dieter
Dieter Maurer wrote:
Ronald L. Chichester writes:
... Making the HTML form is a bit tricky, but that isn't the really hard part. First, as users would be allowed to add folders and DTML documents at will (this is a necessity for the project), then a python script can't be used to generate the appropriate document (or can it, because you wouldn't know the complete parameter string). Can you explain a bit better, what you want to achieve with the hierarchy and the python script?
The DTML Documents that contain the clauses of the documents (agreements) are stored in various subfolders by the type of clause (e.g., trademark grant, force majeur, assignment, etc.). Within each of those folders, there are one or more (often 4 or more) clauses from which the user can choose one (or none). The user would be presented with an HTML FORM that would have radio button sets for the group of DTML Documents in each folder. One of the radio button choices is "None," and the other choices are the DTML Documents. This lets the user pick and choose which clauses are to be included in the document that is to be generated. It is an easy matter to use the <dtml-tree> tag to show the various clauses to the user. What I haven't figured out is how to get that information into an HTML form (with radio buttons) and, more importantly, get the selection of clauses into a python script that would actually generate the document. Note, the parameter problem stems from the fact that the users would be allowed to create new Folders and new DTML Documents. Consequently, there would be an arbitrary set of radio buttons, one that could not be foreseen, and thus could not be included into the parameter list that gets sent to the python script from the HTML form. Just generating a list of clauses on the fly really isn't enough. The users insist on having a hyperlink to the individual clauses so that they can review them before making their selection. That is the dillemma. Thanks, Dieter. Any help would be appreciated. Ron
You may also look at "ZTUtils.Tree". Unfortunately, I do not yet know a place where this class is documented. But the ZPT examples contain examples on how to use it...
Dieter
participants (2)
-
Dieter Maurer -
Ronald L. Chichester