Re: Newbie Question: Graphics in Component
Re: Newbie Question: Graphics in Component
- Subject: Re: Newbie Question: Graphics in Component
- From: Owen McKerrow <email@hidden>
- Date: Tue, 21 Oct 2003 11:58:27 +1000
Hi Bob,
> As I'm now trying to come up to speed in WO here and as I'm working in
> Project Builder, I've added new 'Groups' to the Web Server Resources
> group such as 'graphics', 'css' & 'audio'. I've then added the
> appropriate file type to these 'Groups'. However, when I go out to
> the actual master directory in the Finder - looks like everything has
> been all tossed into one directory! Guess it really doesn't matter as
> long as Project Builder doesn't care - but was surprised to see this.
> First question is: Is this normal?
Yup, sucks, but that's normal.
>
> The second and more important question is, I've cut & pasted a
> pre-existing web page in order to start wiring an existing website in
> WO, and am now trying to figure out how to do my relevant links. I
> added a graphic to the page via WebObjects Builder to see what kind of
> source code it's expecting, and it used the format ../filename.gif.
> Changed all of my relevant links to use this format and voila', I now
> see graphics in WebObjects Builder. Only problem is, now when I run
> the application from within PB and the first page displays, I don't
> see ANY of the graphics!!!! Feeling rather dense here, so would
> appreciate if anyone might provide some clarification. Been through
> the Web Applications manual, but don't recall seeing anything about
> the general way to work with straight HTML type pages and their
> related HTML based components.
Image's are a bit of a pain if you aren't actually adding them as
resource to your project. Well at least I find them so.
Now when you do a normal build, the WOApp expects to find all of its
images in
/Library/WebServer/Documents/cgi-bin/WebObjects/
but because your HTML that's generated by WO Builder starts with ../
for your static image, it expects to find the images in
/Library/WebServer/Documents/cgi-bin/
So the solution ?
1) Make a space on a live server for the images and put in the full
URL in e.g. http://www.yoursite.com/WebObjects/projectname/imagename.gif
2) Make a folder in /Library/WebServer/Documents/cgi-bin/ called
something like WOImages
Then make a folder of the same name at the root of your project. Place
a copy of the images in both directories. This way the images will
appear in WOBuilder as well as when you run the project.
Mind you if you have included them in your project ( which from the
sounds of it you have ), you don't set the src binding but set
framework to "app" and then the filename to the. Also make sure that
the images are included as part of your WebServer Target NOT your
Project Target name ( i.e. the little box next to the file is ticked
when you are looking at the WebServer target ).
Hope that helps
Owen
> Thanks for any clue ins...Bob
>
> Bob McCormick
> XebraTech
> (805) 302-3359
> _______________________________________________
> webobjects-dev mailing list | email@hidden
> Help/Unsubscribe/Archives:
> http://www.lists.apple.com/mailman/listinfo/webobjects-dev
> Do not post admin requests to the list. They will be ignored.
>
>
"As of tomorrow, employees will only be able to access the building
using individual security cards. Pictures will be taken next Wednesday
employees will receive their cards in two weeks."
- "Dilbert Quotes" Winner, Fred Dales, Microsoft Corp
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.