Hi, OK, part of my zope pages are inserted from another site (like frames, but without frames). What must make my product is taking these external pages, treating the HTML code and print it with some new features. When the user clicks a link of this inserted page, I want to intercept the request, treat the URL to go and searsh the HTML code to insert it in my page. Is it possible to do it??? How??? Thank you for your attention. Pierre. P.S.: If you speak french, please do it in your answer!
Pierre Rougier wrote:
Hi, OK, part of my zope pages are inserted from another site (like frames, but without frames). What must make my product is taking these external pages, treating the HTML code and print it with some new features. When the user clicks a link of this inserted page, I want to intercept the request, treat the URL to go and searsh the HTML code to insert it in my page. Is it possible to do it??? How???
Thank you for your attention.
Pierre.
P.S.: If you speak french, please do it in your answer!
_______________________________________________ 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 )
Facile !... (façon de parler...) Deux solutions à deux problèmes différents : 1- Pour rediriger une page vers une autre, utiliser la syntaxe suivante : <dtml-call "REQUEST.redirect (<url>)"> Dans ce cas, on n'a pas accès au contenu html de la page. 2 - Pour avoir accès au contenu HTML d'une page extérieure au site, il faut utiliser la méthode externe suivante (trouvée dans un HowTo du site Zope, que je sois pardonné pour l'emprunt sans mention de l'auteur....) : import httplib def GetURL(site, filename): from httplib import HTTP http = HTTP(site) http.putrequest('GET', filename) http.putheader('Accept', 'text/html') # we can handle text/html http.putheader('Accept', 'text/plain') # we can handle text/plain http.endheaders() httpcode, httpmsg, headers = http.getreply() # get response headers if httpcode != 200: raise "Could not get document" # HTTP error doc = http.getfile() data = doc.read() # read file doc.close() return data Ensuite, après avoir inséré l'External Method dans la hierarchie de Zope, pour récupérer le texte html d'une URL distante, utiliser la syntaxe suivante : <dtml-let mapage="GetURL ('www.toto.com', '/index.html')"> // Traitements... </dtml-let> 3- Pour accéder au contenu d'une page interne au site, utiliser une référence du style : <dtml-let mapage="_['page_a_traiter']"> </dtml-let> Et voilà !... Pierre-Julien GRIZEL
Pierre-Julien Grizel wrote:
1- Pour rediriger une page vers une autre, utiliser la syntaxe suivante : <dtml-call "REQUEST.redirect (<url>)"> Dans ce cas, on n'a pas accès au contenu html de la page.
2 - Pour avoir accès au contenu HTML d'une page extérieure au site, il faut utiliser la méthode externe suivante (trouvée dans un HowTo du site Zope, que je sois pardonné pour l'emprunt sans mention de l'auteur....) : . . .
There is an easier way using another Zope How-To tip: Use Zope's Client.call function. http://www.zope.org/Members/lstaffor/ZClientMethod ------------------------------------------------------ Andres Corrada-Emmanuel Email: andres@corrada.com ------------------------------------------------------
On Fri, 31 Mar 2000, you wrote:
Hi, OK, part of my zope pages are inserted from another site (like frames, but without frames). What must make my product is taking these external pages, treating the HTML code and print it with some new features. I have done something similar called munging where urls of other sites are modified to go thru your site such that you can keep track of user activity. In your case since you actually want to modify contents you may have to use an external method and use the http module interface to get the page modify it within python ie add dtml ,get the page into zope, dynamically create another object and reference it or redirect to it within your dtml so that zope can process it. ofcourse have done nothing of this sort myself but just an idea When the user clicks a link of this inserted page, I want to intercept the request, treat the URL to go and searsh the HTML code to insert it in my page. Is it possible to do it??? How???
Thank you for your attention.
Pierre.
P.S.: If you speak french, please do it in your answer!
_______________________________________________ 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 ) -- ########################## necessity is the mother of invention ##########################
I have done something similar. I have some sutff built that is not ready for distribution but can talk to you about it off list if you really want it... Basically what I did was use an external method to get the page, go through and take all the links (terrible .asp things) and make them into .html links on my server.... when that page is loaded it goes and gets the equevilent .asp page... Why do all of this... well search engines won't index .asp pages so it's a way to get things indexed that can't be otherwise..... Josh At 12:34 PM -0500 4/3/00, sathya wrote:
On Fri, 31 Mar 2000, you wrote:
Hi, OK, part of my zope pages are inserted from another site (like frames, but without frames). What must make my product is taking these external pages, treating the HTML code and print it with some new features. I have done something similar called munging where urls of other sites are modified to go thru your site such that you can keep track of user activity. In your case since you actually want to modify contents you may have to use an external method and use the http module interface to get the page modify it within python ie add dtml ,get the page into zope, dynamically create another object and reference it or redirect to it within your dtml so that zope can process it. ofcourse have done nothing of this sort myself but just an idea When the user clicks a link of this inserted page, I want to intercept the request, treat the URL to go and searsh the HTML code to insert it in my page. Is it possible to do it??? How???
------------------------------------------------- Joshua Brauer Computer Support Scientist Department of Biochemistry and Molecular Biology Colorado State University Fort Collins, CO 80523 (970) 491-1080 ------------------------------------------------- Fax or Voice mail toll free 888-392-4832, ext. 291-345-5142 ------------------------------------------------- Direct Fax (419) 793-4120 -------------------------------------------------
participants (5)
-
Andres Corrada -
Joshua Brauer -
Pierre Rougier -
Pierre-Julien Grizel -
sathya