Examples of ScriptEngine


Examples of org.webharvest.runtime.scripting.ScriptEngine

            language = language.toLowerCase();
        }

        String returnExpression = scriptDef.getReturnExpression();

        ScriptEngine scriptEngine = language == null ? scraper.getScriptEngine() : scraper.getScriptEngine(language);
        scriptEngine.eval( scriptText.toString() );

        if (returnExpression != null) {
            String returnExpressionEvaluated = BaseTemplater.execute( scriptDef.getReturnExpression(), scraper.getScriptEngine());
            Object returnValue = scriptEngine.eval(returnExpressionEvaluated);
            return CommonUtil.createVariable(returnValue);
        } else {
            return new EmptyVariable();
        }
       
View Full Code Here

Examples of org.webharvest.runtime.scripting.ScriptEngine

    }

    public Variable execute(Scraper scraper, ScraperContext context) {
        String workingDir = scraper.getWorkingDir();

        ScriptEngine scriptEngine = scraper.getScriptEngine();
        String action = BaseTemplater.execute( fileDef.getAction(), scriptEngine);
        String filePath = BaseTemplater.execute( fileDef.getPath(), scriptEngine);
        String type = BaseTemplater.execute( fileDef.getType(), scriptEngine);
        String charset = BaseTemplater.execute( fileDef.getCharset(), scriptEngine);
        if (charset == null) {
View Full Code Here

Examples of org.webharvest.runtime.scripting.ScriptEngine

        Variable body = getBodyTextContent(htmlToXmlDef, scraper, context);

        HtmlCleaner cleaner = new HtmlCleaner();
        CleanerProperties properties = cleaner.getProperties();

        final ScriptEngine scriptEngine = scraper.getScriptEngine();

        final String advancedXmlEscape = BaseTemplater.execute( htmlToXmlDef.getAdvancedXmlEscape(), scriptEngine);
        if ( advancedXmlEscape != null) {
            properties.setAdvancedXmlEscape(CommonUtil.isBooleanTrue(advancedXmlEscape) );
        }
View Full Code Here

Examples of org.webharvest.runtime.scripting.ScriptEngine

    }

    public Variable execute(Scraper scraper, ScraperContext context) {
      scraper.setRunningHttpProcessor(this);

        ScriptEngine scriptEngine = scraper.getScriptEngine();
        String url = BaseTemplater.execute( httpDef.getUrl(), scriptEngine);
        String method = BaseTemplater.execute( httpDef.getMethod(), scriptEngine);
        String multipart = BaseTemplater.execute( httpDef.getMultipart(), scriptEngine);
        boolean isMultipart = CommonUtil.getBooleanValue(multipart, false);
        String specifiedCharset = BaseTemplater.execute( httpDef.getCharset(), scriptEngine);
View Full Code Here

Examples of org.webharvest.runtime.scripting.ScriptEngine

        String language = BaseTemplater.execute( templateDef.getLanguage(), scraper.getScriptEngine());
        if (language != null) {
            language = language.toLowerCase();
        }
        ScriptEngine scriptEngine = language == null ? scraper.getScriptEngine() : scraper.getScriptEngine(language);

        String result = BaseTemplater.execute(body.toString(), scriptEngine);
       
        return new NodeVariable(result);
    }
View Full Code Here

Examples of org.webharvest.runtime.scripting.ScriptEngine

        super(whileDef);
        this.whileDef = whileDef;
    }

    public Variable execute(Scraper scraper, ScraperContext context) {
        ScriptEngine scriptEngine = scraper.getScriptEngine();
        String index = BaseTemplater.execute( whileDef.getIndex(), scriptEngine);
        String maxLoopsString = BaseTemplater.execute( whileDef.getMaxLoops(), scriptEngine);
        boolean isEmpty = CommonUtil.getBooleanValue( BaseTemplater.execute(whileDef.getEmpty(), scriptEngine), false );

        double maxLoops = Constants.DEFAULT_MAX_LOOPS;
View Full Code Here

Examples of org.webharvest.runtime.scripting.ScriptEngine

        super(loopDef);
        this.loopDef = loopDef;
    }

    public Variable execute(Scraper scraper, ScraperContext context) {
        ScriptEngine scriptEngine = scraper.getScriptEngine();
        String item = BaseTemplater.execute( loopDef.getItem(), scriptEngine);
        String index = BaseTemplater.execute( loopDef.getIndex(), scriptEngine);
        String maxLoopsString = BaseTemplater.execute( loopDef.getMaxloops(), scriptEngine);
        String filter = BaseTemplater.execute( loopDef.getFilter(), scriptEngine);
        boolean isEmpty = CommonUtil.getBooleanValue( BaseTemplater.execute(loopDef.getEmpty(), scriptEngine), false );
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.