Re: embedded objects
Re: embedded objects
- Subject: Re: embedded objects
- From: Chuck Hill <email@hidden>
- Date: Sun, 04 May 2003 11:20:52 -0700
Dick,
I often work with such HTML. This is one of the reasons that I advocate
staying away from Direct Connect. Especially on a Mac where Apache is
already installed. Sure, its easy to start with, but then you have to
fiddle with this and that and everything changes when you deploy.
If you are using a webserver (and NOT direct connect!), and it appears that
you are, you can "forget" about WO entirely when considering such paths and
just ask yourself, "What would work in static HTML that is not a relative
path?".
So, in your example this URL
http://localhost/~rpeskin/u2_beautifulday.mid
is, assuming the app is running under the same domain, equivalent to
/~rpeskin/u2_beautifulday.mid
and *that* is the URL you should be using.
This:
/Volumes/Users/rpeskin/Sites/u2_beautifulday.mid
won't work as /Volume/Users is *not* under the web server's doc root. At
least I hope it isn't! :-)
Just remember to start all paths with '/' and to make them relative to the
web server's doc root.
Chuck
At 01:55 PM 04/05/2003 -0400, Richard L. Peskin wrote:
>>>>
Chuck --
On Saturday, May 3, 2003, at 08:19 PM, Chuck Hill wrote:
The problem is the path to the midi file: u2_beautifulday.mid
When this was a static page, this file was in the same directory as the
html file so the relative path was fine. Now that this is in a WO page,
the path is relative to the dynamic WO URL. It is going to be resolved to
something like this:
http//domain.com/cgi-bin/WebObjects/AppName.woa/1/wo/68F3uq7ZwjIJNKWjPMKrwM/
u2_beautifulday.mid
Yes, I forgot the file is a context relative to the session ID.
The easiest solution is to change the path to be relative to the webserver
doc root, something like this:
src="/multimedia/midi/u2_beautifulday.mid"
That didn't work for me. For example, my doc root is
/Library/WebServer/Documents. Putting the .mid file in the above documents
directory (or a subdirectory) and using either path relative to Documents
or even an absolute path, still results in the file not being found.
You could also make it a resource in your project and use WOEmbeddedObject
and the resource manager to get to it. But that seems like a lot of work
for little benefit in this case.
There may be little choice. It appears that the only option (not involving
WOEmbeddedObject) is to use a fully qualified URL. For example:
---------------
<embed src="http://localhost/~rpeskin/u2_beautifulday.mid" width="144"
height="60" autostart="true" loop="true" volume=200>
</embed>
<center><b>Siberian Husky sled dogs are my real interest.</b>
<p><IMG SRC="http://localhost/~rpeskin/sledteam2.gif" BORDER=2 height=508
width=400></center>
The current time is <B><I><FONT COLOR="#008000"><WEBOBJECT
NAME=String1></WEBOBJECT></FONT></I></B><P>This page has been viewed
<B><I><WEBOBJECT NAME=String2></WEBOBJECT></I></B> times.</P><WEBOBJECT
NAME=Hyperlink1>Refresh Time</WEBOBJECT></BODY>
-------------------
Works correctly. However:
------------------
<embed src="/Volumes/Users/rpeskin/Sites/u2_beautifulday.mid" width="144"
height="60" autostart="true" loop="true" volume=200>
</embed>
<center><b>Siberian Husky sled dogs are my real interest.</b>
<p><IMG SRC="/Volumes/Users/rpeskin/Sites/sledteam2.gif" BORDER=2
height=508 width=400></center>
The current time is <B><I><FONT COLOR="#008000"><WEBOBJECT
NAME=String1></WEBOBJECT></FONT></I></B><P>This page has been viewed
<B><I><WEBOBJECT NAME=String2></WEBOBJECT></I></B> times.</P><WEBOBJECT
NAME=Hyperlink1>Refresh Time</WEBOBJECT></BODY>
---------------
Does not work correctly; neither the gif image nor the midi file are
recognized.
(Above results are using WO 5.2.1, Java 1.41 and the development
environment with a fixed port.)
While the above example is contrived, it does point out that the use of
"pre-existing" html code in Main.wo > Main.html can be problematic. In any
event, I haven't found the documentation that describes just what is
acceptable in the way of "external" file paths. (The issues are of interest
when one needs to preserve some of the "traditional" html when converting a
site to WebObjects. A lot of the "traditional" html was built with tools
like Dreamweaver and is a pain to recreate in WO.)
--dick peskin
Chuck
At 07:21 PM 02/05/2003 -0400, Richard L. Peskin wrote:
In the code snippet below I am inserting a couple of WOComponents into
a static html page. (Other static page items not listed.) The whole
page works correctly except that the midi file never plays although the
QT control is shown on the page. Should I expect the midi file to play
or do I need to use WOEmbeddedObject components?
(This exercise arises out of the attempt to integrate WOComponents into
an existing page.)
---------------
<embed src="u2_beautifulday.mid" width="144" height="60"
autostart="true" loop="true" volume=200>
</embed>
<WEBOBJECT NAME=String1></WEBOBJECT></FONT></I></B><P>This page has
been viewed <B><I><WEBOBJECT NAME=String2></WEBOBJECT></I></B>
times.</P><WEBOBJECT NAME=Hyperlink1>Refresh Time</WEBOBJECT>
--------------------
--dick peskin
Richard L. Peskin, RLP Consulting, Londonderry, VT
http://www.rlpcon.com
http://www.caip.rutgers.edu/~peskin
_______________________________________________
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.
--
Chuck Hill email@hidden
Global Village Consulting Inc. http://www.global-village.net
Richard L. Peskin, RLP Consulting, Londonderry, VT
http://www.rlpcon.com
http://www.caip.rutgers.edu/~peskin
<<<<
--
Chuck Hill email@hidden
Global Village Consulting Inc. http://www.global-village.net
_______________________________________________
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.