ZMenu 0.0.2 product
Yellow ppl, ZMenu is a complete navigational system that uses a tree like display. It allows you to dinamicly add a navigational link menus system to your site. This ZClass based product is still in a development stage and I'dd like to have some feedback about it... so email me about any problems or sugestions. You can download it here (there is also a pic): http://www.zope.org/Members/hramos/products/ZMenu ===== Hugo Ramos - hugo@zopers.org ZopersORG - http://www.zopers.org ===== Do not meddle in the affairs of programmers, for they are easy to annoy, and have all the source code!!!
I'm sorry to ask such a newbie question.. This is probably a very common use for Zope, and I'm sorry to ask what is probably obvious to everybody here... I need to take rows in an SQL database table, and create one or several nested folders of web pages out of them.. Each record would become a web page, and the content of several of the fields in the record would be flowed through a template to make the various parts of the web page.. Thank you. Chris Beaumont chris@msri.org
On Wed, 23 Aug 2000, Chris Beaumont wrote:
I need to take rows in an SQL database table, and create one or several nested folders of web pages out of them..
I'd suggest checking out the ZSQL Methods manual, and then asking any questions that you still have (and there probably will be some!) --RDM
"R. David Murray" wrote:
On Wed, 23 Aug 2000, Chris Beaumont wrote:
I need to take rows in an SQL database table, and create one or several nested folders of web pages out of them..
I'd suggest checking out the ZSQL Methods manual, and then asking any questions that you still have (and there probably will be some!)
Or check out ZPatterns if you're braev ;-) Chris
David, Thank you, I've been successful in setting up basic SQL methods, data input forms and query forms, the problem Ive been having is in trying to break each table record (one row in a table, say) out into a separate DTML document.. with fields in the record forming the parts of the document.. (I'm making a web heirarchy of events which each have to have their own page with various kinds of constantly changing information about the event on them.. These pages have to live at relatively stable URLs.. (of course, it doesnt matter if they are physical documents to a search engine..) So far what Ive seen in the ZSQL Methods guide are lots of hints on how to use SQL methods to build tables from my data, and how to build interfaces to use a given SQL query to filter those tables by content.. Which is great if you want lots of lists.. What I want to build are lists *and their linked documents* the records' fields flowing into the meta tags and body text of many individual objects. When a record is deleted from the source SQL table, I want to be able to have that deletion propagate to the child document.. Is a valid approach to iterate through all of the rows of the table, taking one field of the individual record and using that to deliniate the "ID" of the generated document, then writing the others out as HTML through dtml-var tags? I know this seems like a stupid question, but it seems as if this is such a common need that I cant help but feel that one of the available products would address it. If one doesnt exist then yes, I'll have to figure it out myself.. I've seen similar things done in some Zope products.. so I know it can be done... What I was hoping for is for some suggestions on the best way to go about it that didnt require me figuring it out from scratch.... Thank you "R. David Murray" wrote:
On Wed, 23 Aug 2000, Chris Beaumont wrote:
I need to take rows in an SQL database table, and create one or several nested folders of web pages out of them..
I'd suggest checking out the ZSQL Methods manual, and then asking any questions that you still have (and there probably will be some!)
On Thu, 24 Aug 2000, Chris Beaumont wrote:
Thank you, I've been successful in setting up basic SQL methods, data input forms and query forms, the problem Ive been having is in trying to break each table record (one row in a table, say) out into a separate DTML document.. with fields in the record forming the parts of the document.. (I'm making a web heirarchy of events which each have to have their own page with various kinds of constantly changing information about the event on them.. These pages have to live at relatively stable URLs.. (of course, it doesnt matter if they are physical documents to a search engine..) [...] What I want to build are lists *and their linked documents* the records' fields flowing into the meta tags and body text of many individual objects. When a record is deleted from the source SQL table, I want to be able to have that deletion propagate to the child document..
Maybe I'm misunderstanding your question, or maybe I'm misuderstanding ZSQL methods <grin>, because it does seem pretty straightforward to me. I haven't done what I'm about to describe, though, so I could be way off base. It seems to me that what you want to do is have a ZSQL method that takes an argument from the URL (they can do that), where the argument is the 'id' of the record. Then your method uses that argument to retrieve *just* that row from your database. Then you have your html template filled in using the column variables from that record. No need to have actual document objects sitting around, just the template. If you delete a record the corresponding page is therefore gone. And you get stable URLs, if the ids don't change: http://www.yoursite.com/yourmethod/recordid --RDM
"R. David Murray" wrote:
On Thu, 24 Aug 2000, Chris Beaumont wrote:
Thank you, I've been successful in setting up basic SQL methods, data input forms and query forms, the problem Ive been having is in trying to break each table record (one row in a table, say) out into a separate DTML document.. with fields in the record forming the parts of the document.. (I'm making a web heirarchy of events which each have to have their own page with various kinds of constantly changing information about the event on them.. These pages have to live at relatively stable URLs.. (of course, it doesnt matter if they are physical documents to a search engine..) [...] What I want to build are lists *and their linked documents* the records' fields flowing into the meta tags and body text of many individual objects. When a record is deleted from the source SQL table, I want to be able to have that deletion propagate to the child document..
Maybe I'm misunderstanding your question, or maybe I'm misuderstanding ZSQL methods <grin>, because it does seem pretty straightforward to me. I haven't done what I'm about to describe, though, so I could be way off base.
It seems to me that what you want to do is have a ZSQL method that takes an argument from the URL (they can do that), where the argument is the 'id' of the record. Then your method uses that argument to retrieve *just* that row from your database. Then you have your html template filled in using the column variables from that record. No need to have actual document objects sitting around, just the template. If you delete a record the corresponding page is therefore gone. And you get stable URLs, if the ids don't change:
Thats a really cool idea. if you combine that with a python brain you can get customized display.
R. David Murray wrote:
This is really easy to do. Now, what do I have to do if I want to use URLs like this: http://www.yoursite.com/events/recordid/index.html http://www.yoursite.com/events/recordid/pics.html http://www.yoursite.com/events/recordid/[...]/edit The real data is stored in a RDBMS, only the user interface templates are in the ZODB. Currently I use the obvious: http://www.yoursite.com/events_display_info/recordid http://www.yoursite.com/events_display_pics/recordid etc. Is it possible to use methods which get the recordid and a possible /edit extension from the URL and create the requested objects on the fly? There was a discussion about this topic a few months ago but I don't remember the exact circumstances so it's difficult to search for in the mailing list archive. Cheers, Nils -- nika@acm.org | nika@kassube.de (preferred) 4kassube@informatik.uni-hamburg.de | nika@on-luebeck.de
Chris Beaumont wrote:
David,
Thank you, I've been successful in setting up basic SQL methods, data input forms and query forms, the problem Ive been having is in trying to break each table record (one row in a table, say) out into a separate DTML document.. with fields in the record forming the parts of the document.. (I'm making a web heirarchy of events which each have to have their own page with various kinds of constantly changing information about the event on them.. These pages have to live at relatively stable URLs.. (of course, it doesnt matter if they are physical documents to a search engine..)
Some considerations. 1. Duplicating data is bad. 2. Let the RDMBS do as much of the processing as possible. A possible solution (TMTOWTDI): create a dtml method 'create event'. its basically an encapsulation to simulate triggers. in this method make your call to the insertion of the data into the sql db. after that call you can create a ZClass or DTML document with the property that stores the primary key of the data record in the DB (if you do it as a dtml doc, you either want to clone, or pass its body, check out the ZQR). this is your basic association of your objects and the sql data. in a dtml method that lives above your objects have a body that basically calls a retrieval sql on the db which takes an arg for the id. The body of your dtml doc/ZClass(index_html) calls this method for presentation of its data passing its property as an arg. you can arrange your objects in whatever heirarchy you want as they will acquire the dtml method and the sql methods for presentation (or put it in the zclass). For deletion create a similiar trigger encapsulation method, delete row, delete object. caveat. DON't use this to display lots of events on a page (hideous performance). you're much better off going to the db directly and grabbing all the results you need perhaps with python brain for extra presentation info. Cheers Kapil
So far what Ive seen in the ZSQL Methods guide are lots of hints on how to use SQL methods to build tables from my data, and how to build interfaces to use a given SQL query to filter those tables by content.. Which is great if you want lots of lists..
What I want to build are lists *and their linked documents* the records' fields flowing into the meta tags and body text of many individual objects. When a record is deleted from the source SQL table, I want to be able to have that deletion propagate to the child document..
Is a valid approach to iterate through all of the rows of the table, taking one field of the individual record and using that to deliniate the "ID" of the generated document, then writing the others out as HTML through dtml-var tags?
I know this seems like a stupid question, but it seems as if this is such a common need that I cant help but feel that one of the available products would address it. If one doesnt exist then yes, I'll have to figure it out myself.. I've seen similar things done in some Zope products.. so I know it can be done... What I was hoping for is for some suggestions on the best way to go about it that didnt require me figuring it out from scratch....
Thank you
"R. David Murray" wrote:
On Wed, 23 Aug 2000, Chris Beaumont wrote:
I need to take rows in an SQL database table, and create one or several nested folders of web pages out of them..
I'd suggest checking out the ZSQL Methods manual, and then asking any questions that you still have (and there probably will be some!)
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Hi Hugo ! Hugo Ramos wrote:
ZMenu is a complete navigational system that uses a tree like display. It allows you to dinamicly add a navigational link menus system to your site.
I have added part of your Product into the ZDP-Tools by adding a DTML method to my DocumentFolder ZClass, and it works out of the box;-). Have a look at: http://zdp.zope.org/projects/eurozope/ZMenus_Tree_Navigation or from the top: http://zdp.zope.org/ZMenus_Tree_Navigation This shows the hierarchy of the ZDP site. It still needs to be integrated, but it already is some kind of a SiteMap. It is also some kind of Pike lookalike, that I may use for my Weblog thingie I have been thinking about.:
This ZClass based product is still in a development stage and I'dd like to have some feedback about it... so email me about any problems or sugestions.
Your product assumes that the users manually add links to other content on the site, but the funny thing is that this can be automatized. Why add links when the content is already there ?
You can download it here (there is also a pic): http://www.zope.org/Members/hramos/products/ZMenu
This is the only method I have adopted from your Product: <dtml-var standard_html_header> <dtml-tree id branches_expr="objectValues(['Book','Chapter','Comment', 'CommentFolder','DiscussionFolder','DocumentFolder','Draft','DraftSubmissionFolder', 'Event','EventFolder','FAQAnswer','FAQFolder','FAQQuestion','FAQSection','Foil', 'FoilFolder','Member','MemberFolder','News','NewsFolder','Paragraph','Part','Phase', 'Portal','PortalFolder','Process','ProductDocumentationFolder','Project','ProjectFolder', 'Search','SearchEngine','SearchFolder','Snippet','SnippetFolder','Subject','Task', 'TaskFolder','Topic','TopicFolder','WebSiteLink','WebSiteLinkFolder','ZClassDocumentation'])" sort=title> <dtml-if tree-item-expanded> <dtml-if "NeedsReaders!=0"> <b><i><a href="<dtml-var "absolute_url()">"><dtml-var nickname></a></i></b> <dtml-else> <b><i>(<dtml-var nickname>)</i></b> </dtml-if> <dtml-else> <dtml-if "NeedsReaders!=0"> <b><i><a href="<dtml-var "absolute_url()">"><dtml-var nickname></a></i></b> <dtml-else> <b><i>(<dtml-var nickname>)</i></b> </dtml-if> </dtml-if> </dtml-tree> <dtml-var standard_html_footer> Best regards, Maik Röder -- "The computing future is based on "cyberbodies" - self-contained, neatly-ordered, beautifully-laid-out collections of information, like immaculate giant gardens." The second coming - A manifesto. David Gelernter http://www.edge.org/3rd_culture/gelernter/gelernter_p1.html
participants (7)
-
Chris Beaumont -
Chris Withers -
Hugo Ramos -
Kapil Thangavelu -
Maik Roeder -
Nils Kassube -
R. David Murray