Actually, the code I gave was pulled directly out of one of my actions.
Don't forget that to get the 'manager' object your component should implement
composable (you should read up on the
Avalon framework if this is new to you).
Here is some code for a dummy action that should get you started. No guarantees it is
perfect though.
public class DummyAction extends AbstractAction implements Composable {
private ComponentManager manager;
/**
* Composable
*/
public void compose(ComponentManager manager) {
this.manager = manager;
}
/**
*
*/
public DummyAction() {
super();
}
public Map act(Redirector redirector, SourceResolver resolver, Map
objectModel, String source, Parameters
params) throws Exception {
ContextManager cm = null;
cm = (ContextManager) this.manager.lookup(ContextManager.ROLE);
SessionContext context = cm.getContext("authentication");
// If no context then user has not logged on
if (context == null) {
return null;
}
DocumentFragment df = context.getXML("/authentication");
// User has logged on
NodeList nl = df.getChildNodes();
... You code goes here
}
}
--
Paul Bowler
Aventix Associates Ltd
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]