Search in sources :

Example 1 with ScriptBuffer

use of org.directwebremoting.ScriptBuffer in project ma-core-public by infiniteautomation.

the class EnginePrivate method remoteHandleException.

/**
 * Call the dwr.engine._remoteHandleException() in the browser
 * @param conduit The browser pipe to write to
 * @param batchId The identifier of the batch that we are handling a response for
 * @param callId The id of the call we are replying to
 * @param ex The exception to throw on the remote end
 * @throws IOException If writing fails.
 */
public static void remoteHandleException(ScriptConduit conduit, String batchId, String callId, Throwable ex) throws IOException {
    try {
        ScriptBuffer script = new ScriptBuffer();
        script.appendScript("dwr.engine._remoteHandleException(\'").appendScript(batchId).appendScript("\',\'").appendScript(callId).appendScript("\',").appendData(ex).appendScript(");");
        conduit.addScript(script);
    } catch (MarshallException mex) {
        ScriptBuffer script = new ScriptBuffer();
        script.appendScript("dwr.engine._remoteHandleException(\'").appendScript(batchId).appendScript("\',\'").appendScript(callId).appendScript("\',").appendData(mex).appendScript(");");
        addScriptWithoutException(conduit, script);
    }
}
Also used : ScriptBuffer(org.directwebremoting.ScriptBuffer)

Example 2 with ScriptBuffer

use of org.directwebremoting.ScriptBuffer in project ma-core-public by infiniteautomation.

the class ScriptProxy method addFunctionCall.

/**
 * Call a named function with no parameters.
 * @param funcName The name of the function to call
 */
public void addFunctionCall(String funcName) {
    ScriptBuffer script = new ScriptBuffer();
    script.appendScript(funcName).appendScript("();");
    addScript(script);
}
Also used : ScriptBuffer(org.directwebremoting.ScriptBuffer)

Example 3 with ScriptBuffer

use of org.directwebremoting.ScriptBuffer in project ma-core-public by infiniteautomation.

the class Engine method setPollUsingComet.

/**
 * Does DWR us comet polling? (Default: true)
 * @param pollComet True/False to use Comet where supported
 * @see <a href="http://getahead.org/dwr/browser/engine/options">Options documentation</a>
 */
public void setPollUsingComet(boolean pollComet) {
    ScriptBuffer script = new ScriptBuffer();
    script.appendScript("dwr.engine.setPollUsingComet(").appendData(pollComet).appendScript(");");
    addScript(script);
}
Also used : ScriptBuffer(org.directwebremoting.ScriptBuffer)

Example 4 with ScriptBuffer

use of org.directwebremoting.ScriptBuffer in project ma-core-public by infiniteautomation.

the class Engine method setRpcType.

/**
 * Set the preferred remoting type.
 * @param newType One of dwr.engine.XMLHttpRequest or dwr.engine.IFrame or dwr.engine.ScriptTag
 * @see <a href="http://getahead.org/dwr/browser/engine/options">Options documentation</a>
 */
public void setRpcType(int newType) {
    ScriptBuffer script = new ScriptBuffer();
    script.appendScript("dwr.engine.setRpcType(").appendData(newType).appendScript(");");
    addScript(script);
}
Also used : ScriptBuffer(org.directwebremoting.ScriptBuffer)

Example 5 with ScriptBuffer

use of org.directwebremoting.ScriptBuffer in project ma-core-public by infiniteautomation.

the class Engine method setActiveReverseAjax.

/**
 * Does DWR poll the server for updates? (Default: false)
 * @param activeReverseAjax True/False to turn RA on/off
 * @see <a href="http://getahead.org/dwr/browser/engine/options">Options documentation</a>
 */
public void setActiveReverseAjax(boolean activeReverseAjax) {
    ScriptBuffer script = new ScriptBuffer();
    script.appendScript("dwr.engine.setActiveReverseAjax(").appendData(activeReverseAjax).appendScript(");");
    addScript(script);
}
Also used : ScriptBuffer(org.directwebremoting.ScriptBuffer)

Aggregations

ScriptBuffer (org.directwebremoting.ScriptBuffer)20 IOException (java.io.IOException)1 ServletContext (javax.servlet.ServletContext)1 JspException (javax.servlet.jsp.JspException)1 JspWriter (javax.servlet.jsp.JspWriter)1 Container (org.directwebremoting.Container)1 ScriptSession (org.directwebremoting.ScriptSession)1 WebContextBuilder (org.directwebremoting.WebContextFactory.WebContextBuilder)1 ConverterManager (org.directwebremoting.extend.ConverterManager)1 MarshallException (org.directwebremoting.extend.MarshallException)1