It looks like it is failing on a call to a jdom Document or Element but I have
jdom in the lib directory with maverick and everything else. Element and
Document are definitely classes in the jar file. I am really stuck. It is
failing on line 140. I would really appreciate some more ideas. What am I
missing?
Thanks,
Angela
/* */ package org.infohazard.maverick.flow;
/* */
/* */ import java.util.HashMap;
/* */ import java.util.Iterator;
/* */ import java.util.List;
/* */ import java.util.Map;
/* */ import javax.servlet.ServletConfig;
/* */ import org.apache.commons.logging.Log;
/* */ import org.apache.commons.logging.LogFactory;
/* */ import org.infohazard.maverick.transform.DocumentTransformFactory;
/* */ import org.infohazard.maverick.transform.XSLTransformFactory;
/* */ import org.infohazard.maverick.util.XML;
/* */ import org.infohazard.maverick.view.DocumentViewFactory;
/* */ import org.infohazard.maverick.view.NullViewFactory;
/* */ import org.infohazard.maverick.view.RedirectViewFactory;
/* */ import org.infohazard.maverick.view.TrivialViewFactory;
/* */ import org.jdom.Document;
/* */ import org.jdom.Element;
/* */
/* */ public class Loader
/* */ {
/* */ protected static final String TAG_MODULES = "modules";
/* */ protected static final String TAG_VIEWFACTORY = "view-factory";
/* */ protected static final String TAG_CONTROLLERFACTORY =
"controller-factory";
/* */ protected static final String TAG_TRANSFORMFACTORY =
"transform-factory";
/* */ protected static final String TAG_SHUNTFACTORY = "shunt-factory";
/* */ protected static final String ATTR_PROVIDER = "provider";
/* */ protected static final String TAG_COMMANDS = "commands";
/* */ protected static final String TAG_COMMAND = "command";
/* */ protected static final String ATTR_COMMAND_NAME = "name";
/* */ protected static final String TAG_VIEWS = "views";
/* */ protected static final String PARAM_DEFAULT_VIEW_TYPE =
"default-view-type";
/* */ protected static final String PARAM_DEFAULT_TRANSFORM_TYPE =
"default-transform-type";
/* 57 */ private static Log log = LogFactory.getLog(Loader.class);
/* */
/* 60 */ protected Map commands = new HashMap();
/* */ protected ServletConfig servletCfg;
/* */ protected MasterFactory masterFact;
/* */ protected ViewRegistry viewReg;
/* */ protected CommandFactory commandFact;
/* */
/* */ public Loader(Document doc, ServletConfig dispatcherConfig)
/* */ throws ConfigException
/* */ {
/* 82 */ this.servletCfg = dispatcherConfig;
/* 83 */ this.masterFact = new MasterFactory(dispatcherConfig);
/* */
/* 87 */ this.viewReg = new ViewRegistrySimple(this.masterFact);
/* 88 */ this.commandFact = new CommandFactory(this.viewReg);
/* */
/* 90 */ setupCoreModules();
/* */
/* 92 */ loadDocument(doc);
/* */ }
/* */
/* */ public Map getCommands()
/* */ {
/* 101 */ return this.commands;
/* */ }
/* */
/* */ protected void setupCoreModules()
/* */ throws ConfigException
/* */ {
/* 111 */ TransformFactory docTrans = new DocumentTransformFactory();
/* 112 */ docTrans.init(null, this.servletCfg);
/* 113 */ this.masterFact.defineTransformFactory("document", docTrans);
/* */
/* 115 */ TransformFactory xsltTrans = new XSLTransformFactory();
/* 116 */ xsltTrans.init(null, this.servletCfg);
/* 117 */ this.masterFact.defineTransformFactory("xslt", xsltTrans);
/* */
/* 120 */ ViewFactory document = new DocumentViewFactory();
/* 121 */ document.init(null, this.servletCfg);
/* 122 */ this.masterFact.defineViewFactory("document", document);
/* */
/* 124 */ ViewFactory redirect = new RedirectViewFactory();
/* 125 */ redirect.init(null, this.servletCfg);
/* 126 */ this.masterFact.defineViewFactory("redirect", redirect);
/* */
/* 128 */ ViewFactory trivial = new TrivialViewFactory();
/* 129 */ trivial.init(null, this.servletCfg);
/* 130 */ this.masterFact.defineViewFactory("trivial", trivial);
/* */
/* 132 */ ViewFactory nullViewFact = new NullViewFactory();
/* 133 */ nullViewFact.init(null, this.servletCfg);
/* 134 */ this.masterFact.defineViewFactory("null", nullViewFact);
/* */ }
/* */
/* */ protected void loadDocument(Document doc)
/* */ throws ConfigException
/* */ {
/* 144 */ Element root = doc.getRootElement();
/* */
/* 147 */ String defaultTransformType = XML.getValue(root,
"default-transform-type");
/* 148 */ if (defaultTransformType != null) {
/* 149 */ this.masterFact.setDefaultTransformType(defaultTransformType);
/* */ }
/* */
/* 152 */ String defaultViewType = XML.getValue(root, "default-view-type");
/* 153 */ if (defaultViewType != null) {
/* 154 */ this.masterFact.setDefaultViewType(defaultViewType);
/* */ }
/* */
/* 158 */ Iterator allModulesIt = root.getChildren("modules").iterator();
/* 159 */ while (allModulesIt.hasNext())
/* */ {
/* 161 */ Element modules = (Element)allModulesIt.next();
/* 162 */ loadModules(modules);
/* */ }
/* */
/* 166 */ Iterator allViewsIt = root.getChildren("views").iterator();
/* 167 */ while (allViewsIt.hasNext())
/* */ {
/* 169 */ Element viewsNode = (Element)allViewsIt.next();
/* 170 */ this.viewReg.defineGlobalViews(viewsNode);
/* */ }
/* */
/* 174 */ Iterator allCommandsIt = root.getChildren("commands").iterator();
/* 175 */ while (allCommandsIt.hasNext())
/* */ {
/* 177 */ Element commandsNode = (Element)allCommandsIt.next();
/* */
/* 179 */ Iterator commandIt =
commandsNode.getChildren("command").iterator();
/* 180 */ while (commandIt.hasNext())
/* */ {
/* 182 */ Element commandNode = (Element)commandIt.next();
/* */
/* 184 */ String commandName = commandNode.getAttributeValue("name");
/* */
/* 186 */ log.info("Creating command: " + commandName);
/* */
/* 188 */ Command cmd = this.commandFact.createCommand(commandNode);
/* */
/* 190 */ this.commands.put(commandName, cmd);
/* */ }
/* */ }
/* */ }
/* */
/* */ protected void loadModules(Element modulesNode)
/* */ throws ConfigException
/* */ {
/* 202 */ ClassLoader classLoader =
Thread.currentThread().getContextClassLoader();
/* 203 */ if (classLoader == null)
/* */ {
/* 205 */ classLoader = DefaultControllerFactory.class.getClassLoader();
/* */ }
/* */
/* 209 */
this.masterFact.defineTransformFactories(modulesNode.getChildren("transform-factory"));
/* 210 */
this.masterFact.defineViewFactories(modulesNode.getChildren("view-factory"));
/* */
/* 212 */ Element shuntFactoryNode = modulesNode.getChild("shunt-factory");
/* 213 */ if (shuntFactoryNode != null)
/* */ {
/* 215 */ String providerName =
shuntFactoryNode.getAttributeValue("provider");
/* */
/* 217 */ if (providerName == null) {
/* 218 */ throw new ConfigException("Not a valid shunt factory node: "
+ XML.toString(shuntFactoryNode));
/* */ }
/* */
/* */ ShuntFactory instance;
/* */ try
/* */ {
/* 225 */ Class providerClass = classLoader.loadClass(providerName);
/* 226 */ instance = (ShuntFactory)providerClass.newInstance();
/* */ }
/* */ catch (Exception ex)
/* */ {
/* 230 */ throw new ConfigException("Unable to define shunt factory " +
providerName, ex);
/* */ }
/* */
/* 234 */ log.info("Using shunt factory " + providerName);
/* */
/* 236 */ instance.init(shuntFactoryNode, this.servletCfg);
/* */
/* 239 */ this.viewReg = new ViewRegistryShunted(this.masterFact,
instance);
/* 240 */ this.commandFact.setViewRegistry(this.viewReg);
/* */ }
/* 242 */ Element controllerFactoryNode =
modulesNode.getChild("controller-factory");
/* 243 */ if (controllerFactoryNode == null)
/* */ return;
/* 245 */ String providerName =
controllerFactoryNode.getAttributeValue("provider");
/* */
/* 247 */ if (providerName == null) {
/* 248 */ throw new ConfigException("Not a valid controller factory node:
" + XML.toString(controllerFactoryNode));
/* */ }
/* */
/* */ ControllerFactory instance;
/* */ try
/* */ {
/* 255 */ Class providerClass = classLoader.loadClass(providerName);
/* 256 */ instance = (ControllerFactory)providerClass.newInstance();
/* */ }
/* */ catch (Exception ex)
/* */ {
/* 260 */ throw new ConfigException("Unable to define controller factory
" + providerName, ex);
/* */ }
/* */
/* 264 */ log.info("Using controller factory " + providerName);
/* */
/* 267 */ instance.init(controllerFactoryNode, this.servletCfg);
/* */
/* 269 */ this.commandFact.setControllerFactory(instance);
/* */ }
/* */ }
/* Location: C:\workspace\contract\lib\maverick-2.2.4.jar
* Qualified Name: org.infohazard.maverick.flow.Loader
* Java Class Version: 5 (49.0)
* JD-Core Version: 0.5.3------------------------------------------------------------------------------
_______________________________________________
%(real_name)s mailing list
%(real_name)s...@%(host_name)s
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
Archives are available at
http://www.mail-archive.com/mav-user%40lists.sourceforge.net/