I've not played with linkers before, but I can see that your suggestion should
work and would be cleaner than what I have. I'd effectively have to translate
my existing codeserver changes from java to javascript, but that shouldn't be
difficult (even for a javascript novice :)
Thanks,
Paul
On 11/06/12 12:01, Thomas Broyer wrote:
How about customizing the CrossSiteIframeLinker instead?
Customizing either the computeUrlForResource or loadExternalStylesheets to no longer be relative to
the "module base url" (but rather to, say, the "host page base url").
Or if you need it to be relative to the "module base url", add a linker to emit
the appropriate CSS files in the module output dir (where the Super Dev Mode's will find
them).
On Monday, June 11, 2012 12:16:19 PM UTC+2, Paul Robinson wrote:
The new superDevMode is *very* impressive. Well done!
I don't know how unusual my use-case is, but I require custom handling of
some CSS files to make things work properly. For example, I allow customers to
skin my app, and that requires CSS in a database. So there's a CSS file
referenced in a gwt.xml file that does not exist as a regular file on disk.
Consequently, the code server cannot possibly handle it correctly.
I also use ant to write a build number into the name of some CSS files in
gwt.xml files. The CSS files are stored without the build number, and so I have
an http filter that removes the build number from the file name. This means
that users' browsers are forced to update their CSS whenever I release a new
build.
Modifying com.google.gwt.dev.codeserver.WebServer to do what I want was
pretty easy, but I'd prefer not to change it at all. Ideally, it would be
easier to customise its behaviour via subclassing.
In particular, I would like the following changes:
(a) WebServer.doGet(...) to be protected, not private
(b) WebServer.sendOutputFile(String, HttpServletResponse) to be protected,
not private
(c) The signature of WebServer.sendOutputFile(String, HttpServletResponse)
to be modified so that the HttpServletRequest is passed in (so that I can work
out who the http referer was, and pass on the request for the
database-generated CSS to my tomcat server)
(d) CodeServer constructs WebServer directly. That means I would have to copy
& paste CodeServer and make the replacement create my WebServer subclass.
Alternatively, it would be easier if CodeServer.main(String[]) were to construct an
instance, and then use protected instance methods to do all the work, including
parsing the options and creating the WebServer instance. That way, I could subclass
CodeServer as well.
Is this possible?
Thanks,
Paul
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors