Programming__WebObjects-Web Applications-Development-Custom Resource Manager
Version 2.1 by smmccraw on 2007/07/08 09:45
Petite Abeille
Here is a little example on how to write your own WOResourceManager:
The main methods to implement are urlForResourceNamed() and bytesForResourceNamed().
- urlForResourceNamed simply build an URL for a resource from wherever you would like (eg a jar file). Unfortunately, urlForResourceNamed uses pathForResourceNamed so you will need to rewrite that also:
- bytesForResourceNamedsimplyretrievearesourcefromwhereveryouwouldlike(egajarfile):
- Last but not least, you need to take care of those funky WOURLValuedElementData so dataForResourceNamed will work:
- Finally, you need to register your resource manager with WOApplication:
Handling of languages and frameworks are left as an exercise to the reader.
Category:WebObjects