Package com.volantis.mcs.protocols

Examples of com.volantis.mcs.protocols.Script$ScriptCreator


        assertEquals("Buffer should be unchanged",
                     "",
                     DOMUtilities.toString(
                             buffer.getRoot(), protocol.getCharacterEncoder()));

        Script script = DOMScript.createScript(
                new LiteralScriptAssetReference("task"));
        protocol.addOnEventElement(buffer, attributes, "testEvent", script);
        String expected = transformMarkup(
                "<onevent type=\"testEvent\">task</onevent>",
                protocol);
View Full Code Here


                = attributes.getEventAttributes (true);

            ScriptAssetReference userScript = eventAttributes.getEvent (eventIndex);

            if (userScript != null) {
                Script scriptObject = Script.createScript(userScript);
                if (logger.isDebugEnabled ()) {
                    logger.debug ("User script for " + attributeName
                                  + " is " + scriptObject);
                }
                if (scriptObject != null) {
                    script = scriptObject.stringValue();
                }
            }

            if (internalScript != null) {
                if (logger.isDebugEnabled ()) {
View Full Code Here

    //javadoc inherited
    protected void addEnterEvents(
            DOMOutputBuffer dom,
            CanvasAttributes attributes) throws ProtocolException {

        Script forwardTask = getTaskForEvent(attributes, "onenterforward",
                                             EventConstants.ON_ENTER_FORWARD);
        Script backwardTask = getTaskForEvent(attributes, "onenterbackward",
                                              EventConstants.ON_ENTER_BACKWARD);

        // It is assumed that if the forward and backward tasks are the same,
        // then the 'script' is the same. Ideally we should be checking that
        // this event is associated with the same asset.
View Full Code Here

    protected void addOnEventElement(DOMOutputBuffer dom,
                                     MCSAttributes attributes,
                                     String eventName, int eventIndex)
        throws ProtocolException {

        Script task = getTaskForEvent(attributes, eventName, eventIndex);
        addOnEventElement(dom, attributes, eventName, task);
    }
View Full Code Here

     * Get the task script from an event attribute.
     */
    protected Script getTaskForEvent(MCSAttributes attributes,
                                     String eventName, int eventIndex)
        throws ProtocolException {
        Script script = null;

        // Get the event attributes which have been specified if any.
        EventAttributes events = attributes.getEventAttributes(false);
        if (events == null) {
            if (logger.isDebugEnabled()) {
View Full Code Here

        // Open the element to use for the action.
        Element actionElement = openAction(dom, attributes, true);

        // Add the task from the onclick script.
        Script task = getTaskForEvent(attributes, "onclick",
                                      EventConstants.ON_CLICK);
        if (task != null) {
            // Append the script into the output buffer.
            task.appendTo(dom);
        }

        // Close the action element.
        dom.closeElement(actionElement);
    }
View Full Code Here

            throws ProtocolException {

        String script = null;

        if (userScript != null) {
            Script scriptObject = Script.createScript(userScript);
            if (logger.isDebugEnabled ()) {
                logger.debug ("User script for " + attributeName
                              + " is " + scriptObject);
            }
            if (scriptObject != null) {
                script = scriptObject.stringValue();
            }
        }

        if (internalScript != null) {
            if (logger.isDebugEnabled ()) {
View Full Code Here

TOP

Related Classes of com.volantis.mcs.protocols.Script$ScriptCreator

Copyright © 2018 www.massapicom. 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.