Search in sources :

Example 16 with MappableTreeNode

use of com.dexels.navajo.script.api.MappableTreeNode in project navajo by Dexels.

the class AccessMap method store.

@Override
public void store() throws MappableException, UserException {
    if (showDetails) {
        try {
            Message user = getMessage(null, "User");
            addProperty(user, "Starttime", getCreated(), Property.DATE_PROPERTY, 10);
            addProperty(user, "Totaltime", Integer.valueOf(getTotaltime()), Property.INTEGER_PROPERTY, 10);
            addProperty(user, "ClientIP", getIpAddress(), Property.STRING_PROPERTY, 50);
            addProperty(user, "ClientHostname", getHost(), Property.STRING_PROPERTY, 50);
            addProperty(user, "User", myAccess.rpcUser, Property.STRING_PROPERTY, 50);
            addProperty(user, "Webservice", myAccess.rpcName, Property.STRING_PROPERTY, 50);
            addProperty(user, "AccessId", myAccess.accessID, Property.STRING_PROPERTY, 50);
            addProperty(user, "Stacktrace", myAccess.getCompiledScript().getStackTrace(), Property.MEMO_PROPERTY, 4096);
            Message currentMapMessage = getMessage(user, "CurrentMap");
            MappableTreeNode currentNode = getCurrentMap();
            if (currentNode != null) {
                showMapDetails(currentMapMessage, currentNode);
            }
            Message requestNavajoMessage = getMessage(user, "RequestNavajo");
            addProperty(requestNavajoMessage, "Document", getRequestNavajo(), Property.MEMO_PROPERTY, -1);
            Message responseNavajoMessage = getMessage(user, "ResponseNavajo");
            addProperty(responseNavajoMessage, "Document", getResponseNavajo(), Property.MEMO_PROPERTY, -1);
            Message outMessagStack = getMessage(user, "OutMessageStack");
            addProperty(outMessagStack, "Stack", getOutMessageStack(), Property.STRING_PROPERTY, -1);
            Message mapStack = getMessage(user, "MapObjectStack");
            addProperty(mapStack, "Stack", getMapStack(), Property.STRING_PROPERTY, -1);
        } catch (Exception ne) {
            logger.error("Error: ", ne);
        }
    }
}
Also used : MappableTreeNode(com.dexels.navajo.script.api.MappableTreeNode) Message(com.dexels.navajo.document.Message) MappingException(com.dexels.navajo.script.api.MappingException) UserException(com.dexels.navajo.script.api.UserException) MappableException(com.dexels.navajo.script.api.MappableException)

Aggregations

MappableTreeNode (com.dexels.navajo.script.api.MappableTreeNode)16 Message (com.dexels.navajo.document.Message)13 ImmutableMessage (com.dexels.immutable.api.ImmutableMessage)12 Navajo (com.dexels.navajo.document.Navajo)12 Selection (com.dexels.navajo.document.Selection)12 ContextExpression (com.dexels.navajo.expression.api.ContextExpression)12 TipiLink (com.dexels.navajo.expression.api.TipiLink)12 Access (com.dexels.navajo.script.api.Access)12 Optional (java.util.Optional)12 Operand (com.dexels.navajo.document.Operand)10 TMLExpressionException (com.dexels.navajo.expression.api.TMLExpressionException)6 ArrayList (java.util.ArrayList)5 List (java.util.List)4 FunctionClassification (com.dexels.navajo.expression.api.FunctionClassification)3 Function (java.util.function.Function)3 NamedExpression (com.dexels.navajo.parser.NamedExpression)2 Reactive (com.dexels.navajo.reactive.api.Reactive)2 Arrays (java.util.Arrays)2 LinkedList (java.util.LinkedList)2 ImmutableFactory (com.dexels.immutable.factory.ImmutableFactory)1