RE: Css generation question
RE: Css generation question
- Subject: RE: Css generation question
- From: Marius Strumyla <email@hidden>
- Date: Tue, 22 Jun 2004 13:44:24 -0400
I just hardcoded the path. Works for me.
In your case it would be smth like this.
MyStyleSheet.css:
table {
background-image:
url("/WebObjects/Frameworks/MyFramework.framework/WebServerResources/brushed
-aluminum-04.gif");
}
hope this helps
--
marius
-----Original Message-----
From: email@hidden
[mailto:email@hidden]On Behalf Of Jerry Porter
Sent: Tuesday, June 22, 2004 1:09 PM
To: webobjects-dev
Subject: Css generation question
Hello folks,
The setup:
I have been playing with CSS and I have it working quite well with my
application.
I have a css file stored in a framework in a WebServerResources
directory and use aWOResourceUrl in a component wrapper to return the
url and use it in a link like:
HTML:
<link rel="stylesheet" type="text/css" href="<webobject
name=styleSheet></webobject>">
WOD:
styleSheet: WOResourceURL {
filename = "MyStyleSheet.css";
framework = "MyFramework";
}
Works fine no problems:
Now the problem.
I want to use background images like:
table {
border: 1;
background: #eeeeee;
color: #000000;
padding: 0;
margin: 0"
border: 0;
background-image: url("brushed-aluminum-04.gif");
}
The above image is a resource that is in a WebObjects framework or
application.
The problem is that the location of the image resource cannot be
specified relative to the deployment location of the webobjects
application in the css file, similar to hooking up a WOImage using the
framework binding to divine the location of the resource.
What I did was create a series of components (CssComponent, CssElement)
that reads a plist in a Resources directory. This file represents my
intended css. I add a couple of "hints" in the plist to divine the
location of my resources (with the help or WOResourceManager), it then
generates an inline string that is embed in my pages like:
<html>
<head>
<title>Css Test</title>
<style type="text/css">
table {
border: 1;
background: #eeeeee;
color: #000000;
padding: 0;
margin: 0"
border: 0;
background-image:
url("/cgi-bin/WebObjects/CssTest.woa/wr?
wodata=file:/local/jerryp/Install/Applications/CssTest.woa%2
FContents/WebServerResources/brushed-aluminum-04.gif");
}
</style>
</head>
<body>
..... Stuff goes here .....
</body>
</html>
This too is ok, except I don't want embed the inline string, I still
want to generate something that I can reference like:
<link rel="stylesheet" type="text/css" href="<webobject
name=styleSheet></webobject>">
The idea is I don't want the css cluttering up my rendered document.
Now the question:
Is there a way I can get a url to my component after it generates the
css and reference it in a link tag?
thanks in advance
Jerry E. Porter
Software Engineer
Wireless Matrix Corporation
102, 1530 - 27th Ave. NE
Calgary, Alberta, Canada
T2E 7S6
Main: 1-403-250-3949
Fax: 1-403-250-8163
email@hidden
http://www.wirelessmatrixcorp.com
_______________________________________________
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.
The information transmitted in this E-mail is intended only for the person
to which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons other
than the intended recipient is prohibited. If you received this in error,
please contact the sender and delete the material from any computer.
_______________________________________________
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.