Examples of TMLContext


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

    }

    public static String label(Context cx, Scriptable thisObj, java.lang.Object[] args, Function funObj) throws JavaScriptException, WGAPIException {
       
        Design design = unwrapThisObj(thisObj);
        TMLContext context = WGAGlobal.fetchInitialContext(cx);
        Arguments parsedArgs = WGAGlobal._localLabelVarargs.parse(args);
       
        return context.label(design._designContext.getDesignDB(), (String) parsedArgs.get("container"), (String) parsedArgs.get("file"), (String) parsedArgs.get("key"), (List) parsedArgs.get("params"));
       
    }
View Full Code Here

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

       
    }
   
    public static WGAResourceBundle getLabelBundle(Context cx, Scriptable thisObj, java.lang.Object[] args, Function funObj) throws JavaScriptException, WGAPIException, IOException {
       
        TMLContext tmlContext = WGAGlobal.fetchInitialContext(cx);
        Design design = (Design) thisObj;
       
        Arguments varArgs = _getLabelBundleVarargs.parse(args);
        WGAResourceBundleManager manager = tmlContext.getwgacore().getResourceBundleManager(design._designContext.getDesignDB());
       
        String container = (String) varArgs.get("container");
        if (container == null) {
            container = WGAResourceBundleManager.CONTAINER_DEFAULT;
        }
View Full Code Here

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

    }
   
    public static void registerGlobal(Context cx, Scriptable thisObj, java.lang.Object[] args, Function funObj) {
       
        VarArgParser.Arguments parsedArgs = _registerGlobalVarargs.parse(args);
        TMLContext context = WGAGlobal.fetchInitialContext(cx);
       
        String name = (String) parsedArgs.get("name");
        Object ref = parsedArgs.get("ref");
       
        // Register name against package or class name
        if (ref instanceof String) {
            context.getwgacore().getTmlscriptGlobalRegistry().registerGlobal(new TMLScriptGlobal(name, TMLScriptGlobal.TYPE_PACKAGE_OR_CLASS, ref));
        }
        else {
            context.getwgacore().getTmlscriptGlobalRegistry().registerGlobal(new TMLScriptGlobal(name, TMLScriptGlobal.TYPE_OBJECT, ref));
        }
       
       
    }
View Full Code Here

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

   
    public static void registerDbGlobal(Context cx, Scriptable thisObj, java.lang.Object[] args, Function funObj) {
       
        Design design = unwrapThisObj(thisObj);
        VarArgParser.Arguments parsedArgs = _registerGlobalVarargs.parse(args);
        TMLContext context = WGAGlobal.fetchInitialContext(cx);
       
        String name = (String) parsedArgs.get("name");
        Object ref = parsedArgs.get("ref");
       
       
        // Register name against package or class name
       
        if (ref instanceof String) {
            context.getwgacore().getTmlscriptGlobalRegistry().registerDBGlobal(new TMLScriptGlobal(name, TMLScriptGlobal.TYPE_PACKAGE_OR_CLASS, ref), design._designContext.getDesignDB());
        }
        else {
            context.getwgacore().getTmlscriptGlobalRegistry().registerDBGlobal(new TMLScriptGlobal(name, TMLScriptGlobal.TYPE_OBJECT, ref), design._designContext.getDesignDB());
        }
       
       
    }
View Full Code Here

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

        return (Design) thisObj;
    }
   
    public static Plugin plugin(Context cx, Scriptable thisObj, java.lang.Object[] args, Function funObj) throws JavaScriptException, WGException {
       
        TMLContext context = WGAGlobal.fetchInitialContext(cx);
        Design design = unwrapThisObj(thisObj);
        WGDatabase designDb = design._designContext.getDesignDB();
       
        // Look if the design db is a plugin itself
        if (designDb.getDbReference().startsWith(PluginConfig.PLUGIN_DBKEY_PREFIX)) {
            return new Plugin(designDb);
        }
       
        // Follow to the design provider
        WGDesignProvider provider = designDb.getDesignProvider();
        if (!(provider instanceof PluginDesignProvider)) {
            return null;
        }
       
        PluginDesignProvider pluginProvider = (PluginDesignProvider) provider;
        String dbKey = pluginProvider.getDesignDBKey();
       
       
        WGDatabase db = context.db(dbKey);
        if (db == null) {
            return null;
        }
       
        return new Plugin(db);
View Full Code Here

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

        }
       
        VarArgParser.Arguments parsedArgs = WGAGlobal._callActionVarargs.parse(args);

        // Determine action id and action context
        TMLContext context = (TMLContext) parsedArgs.get("context");
        if (context == null) {
            context = WGAGlobal.fetchInitialContext(cx);
        }

        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 {
            action = context.getActionByID(actionID, design._designContext.getDesignDB().getDbReference());
        }
       
        if (action == null) {
            throw new EvaluatorException("Could not retrieve action for ID '" + actionID + "'");
        }

        // Call action
        Object actionResult;
        try {
            TMLScriptRootScope rootScope = WGAGlobal.fetchRootScope(cx);
            actionResult = context.callCustomAction(action, actionArgs, rootScope.getData().getUnwrappedGlobalScopeObjects());
        }
        catch (WGAPIException e) {
            throw Context.throwAsScriptRuntimeEx(e);
        }
View Full Code Here

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

            return WGAGlobal.loadObjectDefinition(cx, runtime.getSharedScope().getWgaGlobal(), args, funObj);
        }

        VarArgParser.Arguments parsedArgs = WGAGlobal._loadObjectDefVarags.parse(args);

        TMLContext context = WGAGlobal.fetchInitialContext(cx);
        String actionID = (String) parsedArgs.get("id");
        NativeObject currentObject = (NativeObject) parsedArgs.get("currentObject");

        // Get the function def (might need to expand local name by the name of
        // the current action)
        // Locate object definition
        TMLAction action = null;
        try {
            if (design._currentObject != null) {
                TMLAction.Locator locator = WGAGlobal.determineActionLocator(cx, design._currentObject, context, actionID);
                action = context.getModuleActionByID(locator.getId(), locator.getDbkey());
            }
            else {
                action = context.getModuleActionByID(actionID, design._designContext.getDesignDB().getDbReference());
            }
        }
        catch (TMLActionException e) {
            throw new EvaluatorException("Could not retrieve TMLScript module '" + args[0] + "': " + e.getMessage());
        }
View Full Code Here

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

@CodeCompletion()
public class Auth {
   
    public boolean login(String user, String password, String domain) throws LoginException, WGAPIException {
        TMLContext cx = WGAGlobal.fetchInitialContext(Context.getCurrentContext());
        return cx.getwgacore().login(user, password, domain, cx.getrequest(), cx.getresponse());
    }
View Full Code Here

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

        TMLContext cx = WGAGlobal.fetchInitialContext(Context.getCurrentContext());
        return cx.getwgacore().login(user, password, domain, cx.getrequest(), cx.getresponse());
    }
   
    public boolean logout(String domain) throws WGAPIException {
        TMLContext cx = WGAGlobal.fetchInitialContext(Context.getCurrentContext());
        return cx.getwgacore().logout(domain, cx.getrequest().getSession());
    }
View Full Code Here

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

        TMLContext cx = WGAGlobal.fetchInitialContext(Context.getCurrentContext());
        return cx.getwgacore().logout(domain, cx.getrequest().getSession());
    }
   
    public void changeSessionPassword(String domain, String newPassword) {
        TMLContext cx = WGAGlobal.fetchInitialContext(Context.getCurrentContext());
        cx.changesessionpassword(domain, newPassword);
    }
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.