Examples of TMLAction


Examples of de.innovationgate.wgpublisher.webtml.utils.TMLAction

       
       
        String actionCallFunction = null;
                if (isAjaxCall()) {
                    // create ajax call
                    TMLAction action = getTMLContext().getActionByID(clickaction, getDesignDBKey());
                    if (action == null) {
                        addWarning("Action of id '" + clickaction + "' is not defined", true);
                        return;
                       
                    }
View Full Code Here

Examples of de.innovationgate.wgpublisher.webtml.utils.TMLAction

        else {
            actionID = "scriptlets:" + command;
        }
       
        // Call scriptlet
        TMLAction action = context.getActionByID(actionID, null);
        if (action != null) {
            return String.valueOf(context.callCustomAction(action, params));
        }
        else {
            return "";
View Full Code Here

Examples of de.innovationgate.wgpublisher.webtml.utils.TMLAction

        // Look for directly set script name
        String scriptName = (String) cx.getThreadLocal(TL_SCRIPTNAME);
       
        // Look for TMLAction definition
        if (scriptName == null) {
            TMLAction action = (TMLAction) cx.getThreadLocal(TL_ACTIONDEFINITION);
            if (action != null) {
                scriptName =  action.getDescription();
            }
        }
       
        // Undeterminable: An anonymous script
        if (scriptName == null) {
View Full Code Here

Examples of de.innovationgate.wgpublisher.webtml.utils.TMLAction

        // Get the current action, to be able to expand local name and search
        // the action to perform in it's database
        TMLAction.Locator actionLocator = determineActionLocator(cx, thisObj, context, actionID);

        TMLAction action = context.getActionByID(actionLocator.getId(), actionLocator.getDbkey());
        if (action == null) {
            throw new EvaluatorException("Could not retrieve action for ID '" + actionID + "'");
        }

        TMLScriptRootScope rootScope = fetchRootScope(cx);
View Full Code Here

Examples of de.innovationgate.wgpublisher.webtml.utils.TMLAction

        TMLAction.Locator actionLocator = null;

        // Retrieve objects that may override the locator information from the current context
        TMLAction.Locator currentLocator = currentActionLocator(cx, thisObj);
        TMLAction currentAction = currentAction(cx, thisObj);

        // A custom action locator was registered
        if (currentLocator != null) {
            actionLocator = new TMLAction.Locator(currentLocator.getDbkey(), context.resolveDesignReference(actionID, currentLocator.getId()));
        }
       
        // An action definition was registered
        else if (currentAction != null) {
            actionLocator = new TMLAction.Locator(currentAction.getModuleDatabase(), context.resolveDesignReference(actionID, currentAction.getModuleName()));
        }

        // Use TMLContext base reference information, try to extract dbkey information
        else  {
            actionLocator = new TMLAction.Locator(null, context.resolveDesignReference(actionID));
View Full Code Here

Examples of de.innovationgate.wgpublisher.webtml.utils.TMLAction

        return actionLocator;
    }

    static TMLAction currentAction(Context cx, Scriptable thisObj) {
        // Retrieve action definition of the currently executed script code
        TMLAction currentAction = (TMLAction) cx.getThreadLocal(RhinoExpressionEngine.TL_ACTIONDEFINITION);

        // When inside the code of a TMLScript object, get locator information
        // from stored action definition inside object
        if (thisObj != null && thisObj.has(RhinoExpressionEngine.PARAM_ACTIONDEFINITION, thisObj)) {
            currentAction = (TMLAction) thisObj.get(RhinoExpressionEngine.PARAM_ACTIONDEFINITION, thisObj);
View Full Code Here

Examples of de.innovationgate.wgpublisher.webtml.utils.TMLAction

        // Get the function def (might need to expand local name by the name of
        // the current action)
        TMLAction.Locator actionLocator = determineActionLocator(cx, currentObject, context, actionID);

        TMLAction action;
        try {
            action = context.getModuleActionByID(actionLocator.getId(), actionLocator.getDbkey());
        }
        catch (TMLActionException e) {
            throw new EvaluatorException("Could not retrieve TMLScript module '" + args[0] + "': " + e.getMessage());
        }
        if (action == null) {
            throw new EvaluatorException("Could not retrieve TMLScript module '" + args[0] + "'");
        }

        // Fetch runtime and return function object
        RhinoExpressionEngineImpl runtime = fetchRuntime(cx);
       
        // Use Context Redirector as scope, so the objects implicit context always directs to the current script's context
        ContextRedirector redirector = new ContextRedirector();
       
        // Preserve thread locals
        ThreadLocalPreserver preserver = new ThreadLocalPreserver((RhinoContext) cx);
        preserver.preserve(RhinoExpressionEngine.TL_ACTIONDEFINITION, action);
        preserver.preserve(RhinoExpressionEngine.TL_SCRIPTNAME, "TMLScript-Object " + action.getModuleDatabase() + "/" + action.getModuleName());;
        try {
            Function func = runtime.getCompiledFunction(action.getCode(), (RhinoContext) cx, redirector);
            func.put(RhinoExpressionEngine.PARAM_ACTIONDEFINITION, func, action);
            return func;
        }
        finally {
            preserver.restore();
View Full Code Here

Examples of de.innovationgate.wgpublisher.webtml.utils.TMLAction

        Scriptable obj = func.construct(cx, thisObj, new Object[] {});
        Scriptable topLevelScope = ScriptableObject.getTopLevelScope(thisObj);

        // Put the action definition to the object, so it "knows" where it's
        // definition came from
        TMLAction action = (TMLAction) func.get(RhinoExpressionEngine.PARAM_ACTIONDEFINITION, func);
        if (action != null) {
            obj.put(RhinoExpressionEngine.PARAM_ACTIONDEFINITION, obj, action);
        }

        // Execute constructor
View Full Code Here

Examples of de.innovationgate.wgpublisher.webtml.utils.TMLAction

    private void createChangeActionJS(String name, FormInputRegistrator form, String event) throws WGAPIException {
        String changeaction = this.getChangeaction();
    if (!WGUtils.isEmpty(changeaction)) {
            if (isAjaxCall()) {
                // create ajax call
                TMLAction action = getTMLContext().getActionByID(changeaction, getDesignDBKey());
                if (action != null) {
                    this.appendResult(event + "=\"" + getAjaxJSFunction(action, Collections.singletonList(name)) + "\"");
                }
                else {
                    addWarning("Action of id '" + changeaction + "' is not defined");
View Full Code Here

Examples of de.innovationgate.wgpublisher.webtml.utils.TMLAction

        String actionID = (String) parsedArgs.get("id");
        List actionArgs = new ArrayList(parsedArgs.getOverflowArgs());


        // Locate action
        TMLAction action;
        if (design._currentObject != null) {
            TMLAction.Locator locator = WGAGlobal.determineActionLocator(cx, design._currentObject, context, actionID);
            action = context.getActionByID(locator.getId(), locator.getDbkey());
        }
        else {
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.