cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Reinhard Poetz" <reinh...@apache.org>
Subject RE: Getting the componentmanager (was Re: access defaultsmetamodule variables from java code)
Date Fri, 31 Oct 2003 09:19:36 GMT

From: Jorg Heymans 

> InputModule d = (InputModule)manager.lookup( 
> "org.apache.cocoon.components.modules.input.InputModuleSelector");
> -> this one bums out with a null exception object

try this:

try {
 this.selector = (ComponentSelector)this.manager.lookup(InputModule.ROLE
+ "Selector");
} catch(ComponentException ce) {
 throw new PatternException("Cannot access input modules selector", ce);
}

// Get the module
InputModule module;
try {
 module = (InputModule)this.selector.select(moduleName);
} catch(ComponentException ce) {
 throw new PatternException("Cannot get InputModule named '" +
moduleName +
  "' in expression '" + this.originalExpr + "'", ce);
}

(for further details have a look at the class 
org.apache.cocoon.components.treeprocessor.variables.PreparedVariableRes
olver)

HTH

--
Reinhard


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message