Based on previous e-mails here, I have read that Zope does not support server-side includes. Is there a way to get around this in reference to an img src, as in the following: <img src="myprogram?-action=gif&yadda yadda yadda> Basically what I have here is a page that includes other documents (maps, graphs, etc.) via server-side-includes. If there isn't any way around this, then I may have to forgo Zope for now...too much of my system depends on this sort of thing. Thansk in Advance, Jessica
Zope in a sense replaces server-side includes with <dtml-var>. What you need to do is upload the images to Zope in whatever folder is appropriate. To do this, select "Image" from the create item menu found at the bottom of your Zope "Contents" screen. Select the images you would like to upload, and submit. The images will then be in your object hierarchy. You can reference them using either (1) Manual <img src="..."> (2) Using dtml-var (the Zope way of doing things) Say, for example, you uploaded an image called foo_jpg (Zope does not allow dots in object names). You could reference it from any object in the same folder as the image or nested folders using dtml-var <dtml-var foo_jpg> Zope will automatically insert the height and width attributes and so forth. To remove the border, you would use... <dtml-var "foo.jpg.tags(border=0)"> (I think)... There are some interesting HOWTO's on this topic at zope.org. jessica lee tishmack wrote:
Based on previous e-mails here, I have read that Zope does not support server-side includes. Is there a way to get around this in reference to an img src, as in the following:
<img src="myprogram?-action=gif&yadda yadda yadda>
Basically what I have here is a page that includes other documents (maps, graphs, etc.) via server-side-includes. If there isn't any way around this, then I may have to forgo Zope for now...too much of my system depends on this sort of thing.
Thansk in Advance, Jessica
_______________________________________________ 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 )
-- Ken Kinder 303.381.7631
Say, for example, you uploaded an image called foo_jpg (Zope does not allow dots in object names). You could reference it from any object in the same folder as the image or nested folders using dtml-var
<dtml-var foo_jpg>
Thank you for your input..I think I need to explain myself a little better, however. I have no trouble with a static image...the trouble I am having is with images created on the fly. For example, I have a cgi program (which I would like to continue residing in my linux structure.....static pages I would like to be in my Zope structure). This program will generate a graph based on the time units, and whatever particular data sets I pass as parameters to the program. So, the image can't be stored on Zope, since the image may be different each time it is brought up...for example, I have the ability to pass the word "today" as a parameter...this means that everyday, the graph generated will be different. Is there a way for Zope to respond to a cgi program that's being called as "img src" value? Thanks, Jessica
So, you have a CGI script that dynamically creates an image as its output. You'll either need to re-implement this using Python and make a ZOPE product, wrap it using a Zope product (which seems the least elegant), or just keep it out of Zope (probably the desirable). I assume you're running apache and using Zope.cgi, so your Zope path is http://yourhostname/Zope Now, your CGI scripts are under: http://yourhostname/cgi-bin You'll just want to reference the images just like you would in normal HTML. Zope will not mess with an img tag, so if it points to a working CGI script, you're ok. Does that answer your question? jessica lee tishmack wrote:
Say, for example, you uploaded an image called foo_jpg (Zope does not allow dots in object names). You could reference it from any object in the same folder as the image or nested folders using dtml-var
<dtml-var foo_jpg>
Thank you for your input..I think I need to explain myself a little better, however. I have no trouble with a static image...the trouble I am having is with images created on the fly.
For example, I have a cgi program (which I would like to continue residing in my linux structure.....static pages I would like to be in my Zope structure). This program will generate a graph based on the time units, and whatever particular data sets I pass as parameters to the program. So, the image can't be stored on Zope, since the image may be different each time it is brought up...for example, I have the ability to pass the word "today" as a parameter...this means that everyday, the graph generated will be different. Is there a way for Zope to respond to a cgi program that's being called as "img src" value?
Thanks, Jessica
_______________________________________________ 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 )
-- Ken Kinder 303.381.7631
Is there a way to do this using Zope-zserver, and not Zope-pcgi? When I started this, I was just using the Zserver....but now that I need to include calls to cgi programs for the sake of a couple images, I am thinking I will needs Zope-pcgi.. If this is the case, I will need to uninstall the Zope-Zserver (if I try to have both, there is a conflict) and install Zope-pcgi. Does this mean I will have to import all the files, directories, etc. back into Zope, and then reconfigure all of the files (replace all SSI lines with dtml lines, etc)? Thanks, Jessica
So, you have a CGI script that dynamically creates an image as its output. You'll either need to re-implement this using Python and make a ZOPE product, wrap it using a Zope product (which seems the least elegant), or just keep it out of Zope (probably the desirable). I assume you're running apache and using Zope.cgi, so your Zope path is
Now, your CGI scripts are under:
You'll just want to reference the images just like you would in normal HTML. Zope will not mess with an img tag, so if it points to a working CGI script, you're ok.
Does that answer your question?
There could be a way with zserver but I don't know it. My advice is to use PCGI for performance and salability anyway, though. ZServer is quicker to setup, but in a production environment, apache is still higher performance. Although, having CGI scripts are never good for performance. ;) PCGI is fine though. You can generally have both pcgi and zserver installed without a conflict; there's just no point to it. There very well could be a way to "wrap" CGI scripts in zserver, but it would still be better done in a true apache environment, where it belongs. To be 100% ZOPE you would re-implement everything in Zope/Python/DTML though. I've seen a lot of company areas where zope stuff points to CGI stuff and visa versa, so your situation seems to frequently be solved that way. jessica lee tishmack wrote:
Is there a way to do this using Zope-zserver, and not Zope-pcgi? When I started this, I was just using the Zserver....but now that I need to include calls to cgi programs for the sake of a couple images, I am thinking I will needs Zope-pcgi..
If this is the case, I will need to uninstall the Zope-Zserver (if I try to have both, there is a conflict) and install Zope-pcgi. Does this mean I will have to import all the files, directories, etc. back into Zope, and then reconfigure all of the files (replace all SSI lines with dtml lines, etc)?
Thanks, Jessica
So, you have a CGI script that dynamically creates an image as its output. You'll either need to re-implement this using Python and make a ZOPE product, wrap it using a Zope product (which seems the least elegant), or just keep it out of Zope (probably the desirable). I assume you're running apache and using Zope.cgi, so your Zope path is
Now, your CGI scripts are under:
You'll just want to reference the images just like you would in normal HTML. Zope will not mess with an img tag, so if it points to a working CGI script, you're ok.
Does that answer your question?
_______________________________________________ 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 )
-- Ken Kinder 303.381.7631
On Mon, 27 Mar 2000, jessica lee tishmack wrote:
Is there a way to do this using Zope-zserver, and not Zope-pcgi? When I started this, I was just using the Zserver....but now that I need to include calls to cgi programs for the sake of a couple images, I am thinking I will needs Zope-pcgi..
You only need Zope-pcgi if the cgi calls need to come off of the same IP as the rest of your zope. If your Zope site is, say, www.mysite.com, then you could put your image cgi stuff into an Apahce responding to the an IP under the name of, say, images.mysite.com. This would be your maximum performance route: direct calls to Zserver for the Zope stuff, and direct calls to Apache for the cgi images. You only need the separate IP, by the way, if both need to be listening on port 80 (say because people from behind a firewall need to access your site). If you can deal with either one listening on another port, then Zope at least can deal with that (I imagine Apache can too, but I've never tried it.)
If this is the case, I will need to uninstall the Zope-Zserver (if I try to have both, there is a conflict) and install Zope-pcgi. Does this mean
What have you run into that makes you think there is a conflict? When you run Zope using pcgi, you are still running Zserver. It's just listening to pcgi calls instead of port 80 (or whatever) calls. It is certainly possible to run Zserver such that it will respond both to direct calls and to pcgi calls. This is the way it is set up by default, at least under Unix if you compile Zope using w_pcgi: Zserver listens on port 8080 for http traffic, and also communicates with Apache using pcgi. Reinstalling to add pcgi support is like upgrading to a new version of Zope: copy your var directory (actually just Data.fs should be enough) to a safe place, do the install, and then copy your saved var overtop of the new one built by the install. You'll also need to reinstall any Products that you downloaded and installed. --RDM
You only need Zope-pcgi if the cgi calls need to come off of the same IP as the rest of your zope. If your Zope site is, say, www.mysite.com, then you could put your image cgi stuff into an Apahce responding to the an IP under the name of, say, images.mysite.com.
Thanks so much everyone for all the help...actually, I ended up still being able to use Zserver (without pcgi)...I left the cgi programs on my separate non-Zope site...and then for the image source, I just used a link to the site, with all the corresponding parameters to generate the picture...like so: <img src="http://www.mynonzopesite.com/cgiprogram?parameters"> This worked! So, I was able to keep the regular Zserver, and still do calls (at least for an image generation) to a cgi program residing on a completely different site...looks like I will stick with Zope now, since I am able to do this. :-)
What have you run into that makes you think there is a conflict?
When I would do "rpm -Uvh Zope-pcgi-2.1.4-1.i386.rpm" I would get the following message: "error: failed dependencies: Zope-zserver conflicts with Zope-pcgi-2.1.4-1 Zope-pcgi conflicts with Zope-zserver-2.1.2-3" But I no longer need pcgi, so I guess this isn't a problem for me anymore. Thanks Again, Jessica
On Wed, 29 Mar 2000, you wrote:
"error: failed dependencies: Zope-zserver conflicts with Zope-pcgi-2.1.4-1 Zope-pcgi conflicts with Zope-zserver-2.1.2-3"
Yes, thats because Jeff Rush is meticulous :-). He has different versions of startup scripts depending on what packages you download. So theres a check for this You will have to erase the zserver rpm before installing the pcgi
Thanks Again, Jessica
_______________________________________________ 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 ##########################
"error: failed dependencies: Zope-zserver conflicts with Zope-pcgi-2.1.4-1 Zope-pcgi conflicts with Zope-zserver-2.1.2-3"
Yes, thats because Jeff Rush is meticulous :-). He has different versions of startup scripts depending on what packages you download. So theres a check for this You will have to erase the zserver rpm before installing the pcgi
I did this, and I still get the same error...so, then I deleted the Zope-2.1.2-3.i386.rpm file as well, and still get the same error....hmmm. I hope this means I don't have to delete all Zope items, install pcgi, and then start over. What do most folks do who realize they want to use pcgi, after starting with zserver? Thanks, Jessica
On Thu, 6 Apr 2000, jessica lee tishmack wrote:
then start over. What do most folks do who realize they want to use pcgi, after starting with zserver?
I just recompiled (actually, I was going the other way), but, then, I work from the source distrabution, not the RPMs. Keep in mind that you can just copy your Data.fs in order to copy your whole existing site. So in your case, I'd just copy it somewhere, do the rpm -e for the current RMPs, the rpm -i for the new ones, and then copy the Data.fs back in. If you installed any products, you'll have to reinstall those, too; but all your own content is stored in the object database, Data.fs. Note that this same procedure applies to doing a Zope version upgrade. --RDM
Thank you for your input..I think I need to explain myself a little better, however. I have no trouble with a static image...the trouble I am having is with images created on the fly.
This should be fairly easy to do by creating an external method that calls your program, then calling the external method using dtml. -jfarr ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Hi! I'm a signature virus. Copy me into your .sig to join the fun! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Say, for example, you uploaded an image called foo_jpg (Zope does not allow dots in object names). You could reference it from any object in the same folder as the image or nested folders using dtml-var
Just to nitpick, that isn't true. Zope object ids can contain periods, but it makes it a pain to refer to those objects in Python expressions. -jfarr
On Wed, 22 Mar 2000, you wrote:
Based on previous e-mails here, I have read that Zope does not support server-side includes. Is there a way to get around this in reference to an img src, as in the following:
<img src="myprogram?-action=gif&yadda yadda yadda>
Basically what I have here is a page that includes other documents (maps, graphs, etc.) via server-side-includes. If there isn't any way around this, then I may have to forgo Zope for now...too much of my system depends on this sort of thing.
I hope you have got your answer , any way my 2 cents ssi pales in comparision to dtml. dtml makes template programming a breeze. You will have to learn the syntax and ssi statements have their equivalents in dtml and more. But zope is best for dynamic stuff. For static pages I would stick with the http server. For your problem I see coding some dtml to replace the ssi and refer to the external cgi just as usual for creating the image dynamically. ########################## necessity is the mother of invention ##########################
You can embed SSI within Zope. I'm currently writing a How-To on it. Depending on how complex your inclusion is, you may be able to get away with using Apache rewrite rules. If you want to embed the SSIs within your Zope pages, you can resort to using SiteAccess and a call to Client.call. Take a look at the thread "How to serve PHP within Zope" for a more detailed explanation of what I mean. I should have the How-To finished soon. If you are in a rush, I can send you a draft. ------------------------------------------------------ Andres Corrada-Emmanuel Email: andres@corrada.com Owner http://www.corrada.com/mamey Mamey Phone: (413) 587-9595 ------------------------------------------------------
participants (6)
-
Andres Corrada -
jessica lee tishmack -
Jonothan Farr -
Ken Kinder -
R. David Murray -
sathya