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/java/org/apache/cocoon/components/treeprocessor/sitemap ScriptNode.java
Date Tue, 24 Sep 2002 08:30:33 GMT
ovidiu      2002/09/24 01:30:33

  Modified:    src/java/org/apache/cocoon/components/treeprocessor/sitemap
                        ScriptNode.java
  Log:
  Modified to work with the new data model for the control flow.
  
  Revision  Changes    Path
  1.3       +5 -38     xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap/ScriptNode.java
  
  Index: ScriptNode.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap/ScriptNode.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ScriptNode.java	8 Sep 2002 00:32:13 -0000	1.2
  +++ ScriptNode.java	24 Sep 2002 08:30:33 -0000	1.3
  @@ -60,23 +60,18 @@
   import org.apache.cocoon.environment.Environment;
   
   /**
  - * Handler for <map:script> elements in the sitemap.
  + * Handler for <map:script> elements in the sitemap. It registers the 
    *
    * @author <a href="mailto:ovidiu@apache.org">Ovidiu Predescu</a>
    * @since March 13, 2002
    */
   public class ScriptNode extends AbstractProcessingNode
  -  implements Composable, Contextualizable
   {
  -  ComponentManager manager;
     String source;
  -  String language;
  -  Context context;
   
  -  public ScriptNode(String source, String language)
  +  public ScriptNode(String source)
     {
       this.source = source;
  -    this.language = language;
     }
     
     /**
  @@ -95,37 +90,9 @@
       return true;
     }
   
  -  public void contextualize(org.apache.avalon.framework.context.Context context)
  -    throws ContextException
  +  public void registerScriptWithInterpreter(Interpreter interpreter)
     {
  -    this.context = (Context)context.get(Constants.CONTEXT_ENVIRONMENT_CONTEXT);
  -  }
  -
  -  /**
  -   *
  -   * Load the script specified by this node.
  -   *
  -   * @param manager a <code>ComponentManager</code> value
  -   */
  -  public void compose(ComponentManager manager)
  -    throws ComponentException
  -  {
  -    this.manager = manager;
  -
  -    try {
  -      ComponentSelector selector
  -        = (ComponentSelector)manager.lookup(Interpreter.ROLE);
  -      // Obtain the Interpreter instance for this language
  -      Interpreter interpreter = (Interpreter)selector.select(language);
  -      if (interpreter instanceof AbstractInterpreter)
  -        ((AbstractInterpreter)interpreter).register(source);
  -      // else FIXME: what to do if interpreter doesn't inherit from
  -      // AbstractInterpreter
  -    }
  -    catch (Exception ex) {
  -      throw new ComponentException("ScriptNode: Couldn't read the source file "
  -                                   + source + " in language " + language
  -                                   + ":" + ex);
  -    }
  +    if (interpreter instanceof AbstractInterpreter)
  +      ((AbstractInterpreter)interpreter).register(source);
     }
   }
  
  
  

----------------------------------------------------------------------
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