Hi List,
I have made a Framework that encapsulates a number of tools that are useful in my applications. _javascript_ Things like a popUp Calendar Date selector, prototype and scriptaculous, overlib, RichText HTML Editor, etc. Some of those tools have their own css and images referenced inside the css file and of course _javascript_ files. In order to use those tools I use the following approach: For CSS files I declare a String var like this:
private final String calendarSkinCSS = application().frameworksBaseURL() + "/" + frameworkName() + ".framework/WebServerResources/TORA_Tools_Resources/_javascript_/jscalendar/skins/aqua/theme.css";
In my HTML file I declare the component this way <webobject name = "CalendarSkinCSS" />
And in my WOD file this
CalendarSkinCSS: WOGenericElement { elementName = "link"; rel = "stylesheet"; type = "text/css"; href = calendarSkinCSS; }
That way I get this html code
<link href="" type="text/css" rel="stylesheet">
For _javascript_ files is something similar
String declaration example
private final String calendarJSURL = application().frameworksBaseURL() + "/" + frameworkName() + ".framework/WebServerResources/TORA_Tools_Resources/_javascript_/jscalendar/calendar.js"; HTML file
<webobject name = "calendarJSURL" />
WOD file
calendarJSURL: WOJavaScript { scriptSource = calendarJSURL; }
I get this:
<script src="" language="_javascript_">
As you can see this is a simple approach that resolves the use of css and _javascript_ files, but now I am testing the deployment of my apps in Tomcat, so this approach does not work (well It would work if I had apache running with my WebServer resources in it and my app running in Tomcat on the same machine ). Is there a better approach that you gays know that would facilitate the use of the framework in a Servlet deployment environment? I have made some tests and the framework is copied inside the application.war file so if I change the way I generate the URL's to a more "WebObjects way" I think there will not be problems in the Servlet Deployment environment. Does Project Wonder has Components and Utilities that could help me?
Any Help will be appreciate.
Miguel Torres.
|