- From: Anselm Baird_Smith <abaird@www43.inria.fr>
- Date: Wed, 27 Nov 1996 11:14:24 +0100 (MET)
- To: "Kai Schmidt" <serkom@schwaben.de>
- Cc: "jigsaw" <www-jigsaw@w3.org>
Kai Schmidt writes:
 > Hi,
 > 
 > could someone get me started on this:
 > 
 > I would like a 'GlobalResource', which I can use to store some global and persistant information 
 > into.   Of cource one should be able to read this info by name from another resource. I tried with 
 > Resource Attributes and am able to create and store infos (in the java code, and in /Admin/Editor). 
 > like:
 > 
 > GlobalResource=Class.forName("w3c.jigsaw.tutorials.GlobalResource");
 > a = new StringAttribute("AGlobalAttribut", "Some Default", Attribute.EDITABLE);
 > MY_INDEX = AttributeRegistry.registerAttribute(GlobalResource, a) ;
 > 
 > but I can only read within the same program with:
 > 
 > getValue("MyOwnAttribut",null);
 > 
 > How can I read from another Resource? Or is there a better way to pass information from one 
 > (postable) resource to the other?
Look in trhe mail archive, I outlined a simple solution to
this. Basically:
class SharedContext {
    static Resource getSomeResource() {
        // Restore the resource out of its store, or whatever
    }
}
And the in your resources, use:
Resource r = SharedContext.getSomeResource();
r.getValue("some-attribute");
Anselm.
Received on Wednesday, 27 November 1996 05:14:29 UTC