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="/WebObjects/Frameworks/TORATools_1_11.framework/ WebServerResources/TORA_Tools_Resources/JavaScript/jscalendar/skins/ aqua/theme.css" 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="/WebObjects/Frameworks/TORATools_1_11.framework/ WebServerResources/TORA_Tools_Resources/JavaScript/jscalendar/ calendar.js" 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.







 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to