Examples of JellyContext


Examples of org.apache.commons.jelly.JellyContext

    /**
     * Simple delete
     */
    public void delete() throws Exception {
  JellyContext context = new JellyContext();
  XMLOutput xmlOutput = XMLOutput.createXMLOutput(System.out);
  context.runScript(new File ("util/ldap-delete.jelly"), xmlOutput);
  xmlOutput.flush();
    }
View Full Code Here

Examples of org.apache.commons.jelly.JellyContext

    /**
     * Simple parsing test
     */
    public void runScript() throws Exception {
  JellyContext context = new JellyContext();
  XMLOutput xmlOutput = XMLOutput.createXMLOutput(System.out);
  context.runScript(new File ("util/test.jelly"), xmlOutput);
  xmlOutput.flush();
    }
View Full Code Here

Examples of org.apache.commons.jelly.JellyContext

      reader = new XmlnsUrisPatcher (parser.getXMLReader());
  }
  InputSource inSrc = new InputSource
      (new FileReader(new File ("util/test.jelly")));

  JellyContext context = new JellyContext();
  ExtXMLParser jellyParser = new ExtXMLParser ();
  jellyParser.setContext(context);
  jellyParser.configure ();
  reader.setContentHandler(new NamespaceAttributesFilter(jellyParser));
  reader.parse (inSrc);
View Full Code Here

Examples of org.apache.commons.jelly.JellyContext

  }
    }

    private JellyContext jellyContext() {
  if (jellyContextCache == null) {
      jellyContextCache = new JellyContext() {
        private Map xmlVals = new HashMap ();
        public Object getVariable(String name) {
      if (getPaProcessData().containsKey (name)) {
          Object v = getPaProcessData().get (name);
          if (v instanceof SAXEventBuffer) {
View Full Code Here

Examples of org.apache.commons.jelly.JellyContext

  throws SAXException {
  if (logger.isDebugEnabled ()) {
      logger.debug ("Evaluating jelly script");
  }
  try {
      JellyContext context = new JellyContext (jellyContext ());
      ExtXMLParser jellyParser = new ExtXMLParser ();
      jellyParser.setContext(context);
      jellyParser.configure ();
      seb.emit (new NamespaceAttributesFilter(jellyParser));
      Script script = jellyParser.getScript ();
View Full Code Here

Examples of org.apache.commons.jelly.JellyContext

    throws ProcessingException,SAXException,IOException {

        super.setup(resolver, objectModel, src, params);

        // Initialize the Jelly context
        this.jellyContext = new JellyContext();
       
        // Update JellyContext with sitemap parameters
        this.updateContext(params);
    }
View Full Code Here

Examples of org.apache.commons.jelly.JellyContext

    throws ProcessingException,SAXException,IOException {

        super.setup(resolver, objectModel, src, params);

        // Initialize the Jelly context
        this.jellyContext = new JellyContext();
       
        // Update JellyContext with sitemap parameters
        this.updateContext(params);
    }
View Full Code Here

Examples of org.apache.commons.jelly.JellyContext

    public TestBeanShellEL(String testName) {
        super(testName);
    }
   
    public void setUp() {
        context = new JellyContext();
        context.setVariable( "foo", "abc" );
        context.setVariable( "bar", new Integer( 123 ) );
        factory = new BeanShellExpressionFactory();
    }
View Full Code Here

Examples of org.apache.commons.jelly.JellyContext

    protected Document runScript(String fileName) throws Exception {
        InputStream in = new FileInputStream(fileName);
        XMLParser parser = new XMLParser();
        Script script = parser.parse(in);
        script = script.compile();
        JellyContext context = parser.getContext();
       
        SAXContentHandler contentHandler = new SAXContentHandler();
        XMLOutput output = new XMLOutput( contentHandler );
       
        contentHandler.startDocument();
View Full Code Here

Examples of org.apache.commons.jelly.JellyContext

        Script script = parser.parse(in);
        script = script.compile();
        log.debug("Found: " + script);
        assertTrue("Parsed a Script", script instanceof Script);
        String[] args = { "one", "two", "three" };
        JellyContext context = new JellyContext();
        context.setVariable("args", args);
        StringWriter buffer = new StringWriter();
        script.run(context, XMLOutput.createXMLOutput(buffer));
        String text = buffer.toString().trim();
        if (log.isDebugEnabled()) {
            log.debug("Evaluated script as...");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.