package org.nuiton.wikitty.publication.engine;


import java.io.Reader;
import java.util.HashMap;
import javax.script.AbstractScriptEngine;
import javax.script.Bindings;
import javax.script.ScriptContext;
import javax.script.ScriptEngineFactory;
import javax.script.ScriptException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
 * Support la syntaxe a la jsp et pour les wikitty permet d'acceder au champs
 * directement par w.<nom_du_champs> (TODO comment faire ? :))
 *
 *
 * @author poussin
 * @version $Revision$
 *
 * Last update: $Date$
 * by : $Author$
 */
public class WPScriptEngine extends AbstractScriptEngine {

    /** to use log facility, just put in your code: log.info(\"...\"); */
    static private Log log = LogFactory.getLog(WPScriptEngine.class);

    @Override
    public Object eval(String script, ScriptContext context) throws ScriptException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public Object eval(Reader reader, ScriptContext context) throws ScriptException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public Bindings createBindings() {
        return new WPBindings();
    }

    @Override
    public ScriptEngineFactory getFactory() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    static public class WPBindings extends HashMap<String, Object> implements Bindings {

    }
}
