cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ovi...@apache.org
Subject cvs commit: xml-cocoon2/src/scratchpad/schecoon/src/org/apache/cocoon/components/treeprocessor/sitemap ScriptNodeBuilder.java
Date Wed, 13 Mar 2002 19:06:45 GMT
ovidiu      02/03/13 11:06:45

  Added:       src/scratchpad/schecoon/src/org/apache/cocoon/components/treeprocessor/sitemap
                        ScriptNodeBuilder.java
  Log:
  Builder for creating a ScriptNode for <map:script>.
  
  Revision  Changes    Path
  1.1                  xml-cocoon2/src/scratchpad/schecoon/src/org/apache/cocoon/components/treeprocessor/sitemap/ScriptNodeBuilder.java
  
  Index: ScriptNodeBuilder.java
  ===================================================================
  package org.apache.cocoon.components.treeprocessor.sitemap;
  
  import org.apache.avalon.framework.component.ComponentManager;
  import org.apache.avalon.framework.component.ComponentSelector;
  import org.apache.avalon.framework.component.Composable;
  import org.apache.avalon.framework.configuration.Configuration;
  import org.apache.avalon.framework.configuration.ConfigurationException;
  import org.apache.avalon.excalibur.component.ExcaliburComponentSelector;
  
  import org.apache.cocoon.components.treeprocessor.AbstractProcessingNodeBuilder;
  import org.apache.cocoon.components.treeprocessor.CategoryNode;
  import org.apache.cocoon.components.treeprocessor.CategoryNodeBuilder;
  import org.apache.cocoon.components.treeprocessor.MapStackResolver;
  import org.apache.cocoon.components.treeprocessor.LinkedProcessingNodeBuilder;
  import org.apache.cocoon.components.treeprocessor.ProcessingNode;
  
  import org.apache.cocoon.components.flow.Interpreter;
  
  public class ScriptNodeBuilder extends AbstractProcessingNodeBuilder
    implements Composable
  {
    protected ScriptNode node;
    protected ComponentManager manager;
  
    public void compose(ComponentManager manager)
    {
      this.manager = manager;
    }
  
    public ProcessingNode buildNode(Configuration config)
      throws Exception
    {
      String source = config.getAttribute("src");
      String language = config.getAttribute("language", "JavaScript");
  
      System.out.println("script node = " + source
                         + ", language = " + language);
  
      // Get the type and class for this matcher
      ComponentSelector selector = (ComponentSelector)this.manager.lookup(Interpreter.ROLE);
      System.out.println("selector = " + selector);
      System.out.println("component = " + selector.select(language));
      
      this.node = new ScriptNode();
  //     this.treeBuilder.setupNode(this.node, config);
  
      return this.node;
    }
  }
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message