Search in sources :

Example 1 with WaitTimeTrigger

use of com.twinsoft.convertigo.engine.parsers.triggers.WaitTimeTrigger in project convertigo by convertigo.

the class HtmlTransaction method applyUserEvents.

protected void applyUserEvents() throws EngineException {
    HtmlConnector connector = (HtmlConnector) parent;
    if (!runningThread.bContinue)
        return;
    try {
        Document dom = null;
        for (int i = 0; i < wcFields.size(); i++) {
            AbstractEvent event = (AbstractEvent) wcFields.get(i);
            connector.dispatchEvent(event, context, new WaitTimeTrigger(0, false));
        }
        String comment = (wcEvent instanceof AbstractEvent) ? ((AbstractEvent) wcEvent).getXPath() : "on browser";
        Engine.logBeans.trace("(HtmlTransaction) Dispatch Event: " + comment);
        boolean dispatch = connector.dispatchEvent(wcEvent, context, wcTrigger);
        dom = connector.getHtmlParser().getDom(context);
        Engine.logBeans.trace("(HtmlTransaction) Event: " + comment + (dispatch ? "" : " not") + " dispatched");
        setCurrentXmlDocument(dom);
        if (Engine.logBeans.isTraceEnabled())
            Engine.logBeans.trace("(HtmlTransaction) Parse result dom:\n" + XMLUtils.prettyPrintDOM(dom));
    } catch (Exception e) {
        throw new EngineException("An unexpected exception occured while trying to get the document via HTTP.", e);
    } finally {
        bDispatching = false;
    }
    if (!runningThread.bContinue)
        return;
}
Also used : WaitTimeTrigger(com.twinsoft.convertigo.engine.parsers.triggers.WaitTimeTrigger) HtmlConnector(com.twinsoft.convertigo.beans.connectors.HtmlConnector) EngineException(com.twinsoft.convertigo.engine.EngineException) AbstractEvent(com.twinsoft.convertigo.engine.parsers.events.AbstractEvent) Document(org.w3c.dom.Document) EngineException(com.twinsoft.convertigo.engine.EngineException) EvaluatorException(org.mozilla.javascript.EvaluatorException) JavaScriptException(org.mozilla.javascript.JavaScriptException) IOException(java.io.IOException) ObjectWithSameNameException(com.twinsoft.convertigo.engine.ObjectWithSameNameException)

Example 2 with WaitTimeTrigger

use of com.twinsoft.convertigo.engine.parsers.triggers.WaitTimeTrigger in project convertigo by convertigo.

the class HttpTriggerWaitTimeEditorComposite method initialize.

private void initialize() {
    WaitTimeTrigger trigger = (parent.getTrigger() instanceof WaitTimeTrigger) ? (WaitTimeTrigger) parent.getTrigger() : null;
    GridData gridData2 = new GridData();
    gridData2.horizontalAlignment = GridData.FILL;
    gridData2.grabExcessHorizontalSpace = true;
    gridData2.verticalAlignment = GridData.CENTER;
    GridLayout gridLayout = new GridLayout();
    gridLayout.numColumns = 2;
    this.setLayout(gridLayout);
    Label label = new Label(this, SWT.CHECK);
    label.setText("Check this to force detection of any DOM changes\nwhile waiting. (Can cause heavy CPU load)");
    check = new Button(this, SWT.CHECK);
    check.setSelection((trigger != null) ? trigger.isDoDirty() : false);
}
Also used : WaitTimeTrigger(com.twinsoft.convertigo.engine.parsers.triggers.WaitTimeTrigger) GridLayout(org.eclipse.swt.layout.GridLayout) Button(org.eclipse.swt.widgets.Button) GridData(org.eclipse.swt.layout.GridData) Label(org.eclipse.swt.widgets.Label)

Aggregations

WaitTimeTrigger (com.twinsoft.convertigo.engine.parsers.triggers.WaitTimeTrigger)2 HtmlConnector (com.twinsoft.convertigo.beans.connectors.HtmlConnector)1 EngineException (com.twinsoft.convertigo.engine.EngineException)1 ObjectWithSameNameException (com.twinsoft.convertigo.engine.ObjectWithSameNameException)1 AbstractEvent (com.twinsoft.convertigo.engine.parsers.events.AbstractEvent)1 IOException (java.io.IOException)1 GridData (org.eclipse.swt.layout.GridData)1 GridLayout (org.eclipse.swt.layout.GridLayout)1 Button (org.eclipse.swt.widgets.Button)1 Label (org.eclipse.swt.widgets.Label)1 EvaluatorException (org.mozilla.javascript.EvaluatorException)1 JavaScriptException (org.mozilla.javascript.JavaScriptException)1 Document (org.w3c.dom.Document)1