Package de.innovationgate.wgpublisher.webtml.utils

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


        TMLContext cx = WGAGlobal.fetchInitialContext(Context.getCurrentContext());
        cx.changesessionpassword(domain, newPassword);
    }
   
    public void waitForUpdates(WGDatabase db, int timeoutSeconds) throws TMLScriptException {
        TMLContext cx = WGAGlobal.fetchInitialContext(Context.getCurrentContext());
        cx.waitforauthupdates(db, timeoutSeconds);
    }
View Full Code Here


                createDebugNode(parentDebugNode);
                status.iterationDebugNode = debugNode.addElement("starttag");
            }

            // First get tml context to allow script execution (maybe already needed in id-calculation)
            TMLContext parentContext = this.getParentTagContext();
            TMLContext baseContext = null;
           
            // We have no parent tag, so we are absolute root: Construct main context
            if (parentContext == null) {
                baseContext = new TMLContext((WGContent) this.pageContext.getRequest().getAttribute(WGACore.ATTRIB_MAINCONTEXT), this);
                TMLContext.clearThreadMainContext();
                baseContext.makeThreadMainContext();
            }
            else {
                baseContext = new TMLContext(parentContext, status);
            }

            this.setTMLContext(baseContext);
           
            // Register status with id
            String id = this.getId();
            if (id != null) {
                status.id = id;
                Map tagIds = status.getTagIds();
                tagIds.put(id, status);
            }

            TMLContext tmlContext = null;

            // Set tag contexts
            status.childTMLContext = baseContext;

            if (this.getContext() != null) {
                tmlContext = baseContext.context(this.getContext(), false);
                if (tmlContext != null) {
                    this.setTMLContext(tmlContext);
                    this.setChildTagContext(tmlContext);
                }
                else {
                    status.subContextError = true;
                   

                    // Tag should not be canceled if the context validity
                    // is checked via iscontextvalid
                    boolean cancelTag = true;
                    if (this instanceof ConditionBase) {
                        ConditionBase conditionTag = (ConditionBase) this;
                        if (conditionTag.getIscontextvalid() != null) {
                            cancelTag = false;
                        }
                    }
                    if (cancelTag == true) {
                        String msg = "Failed context change: " + getContext();
                        if (baseContext.getlasterror() != null) {
                            msg += ". Reason: " + baseContext.getlasterror();
                        }
                        this.addWarning(msg, true);
                        setCancelTag(true);
                        return Tag.SKIP_BODY;
                    }
                   
                }
            }

            if (this.getPrivatecontext() != null) {
                tmlContext = baseContext.context(this.getPrivatecontext());
                if (baseContext.getlasterror() == null) {
                    this.setTMLContext(tmlContext);
                }
                else {
                    this.addWarning(tmlContext.getlasterror(), false);
                }
            }
           
            // Set boolean flags
            this.setEvalBody(true);
View Full Code Here

    public String getTagName() {
        String className = getClass().getName();
        return className.substring(className.lastIndexOf(".") + 1).toLowerCase();
    }
    public void buildHTMLHead(boolean metaOutput, String scripts) throws WGAPIException {
        TMLContext context = this.getTMLContext();
      WGContent content = context.content();
     
      if( content != null ){   
        // Eventually put out meta tags
        this.appendResult("<meta name=\"generator\" content=\"").appendResult(WGACore.getReleaseString()).appendResult("\">\n");   
        if (metaOutput == true ) {
View Full Code Here

    else {
        status.lastDisplayedRow = status.resultSize;
    }
   
    // Set system variables - compatibility to TML1
    TMLContext context = this.getTMLContext();
    try {
            context.setvar("c_from", new Integer(status.offset + 1).toString(), false);
            context.setvar("c_to", new Integer(status.lastDisplayedRow).toString());
            context.setvar("c_total", new Integer(realResultSize).toString());
        }
        catch (WGAPIException e) {
            this.addWarning("Unable to set system vars 'c_from', 'c_to', 'c_total': " + e.getMessage(), false);
            this.getCore().getLog().error("Unable to set system vars 'c_from', 'c_to', 'c_total'", e);
        }
View Full Code Here

               
                Object valueToReturn = null;
                while(_it.hasNext()) {
                    Object currentValue = _it.next();
                   
                    TMLContext filterContext = _dummyContext;
                    Map<String, Object> additionalObjects = new HashMap<String, Object>();
                    if (currentValue instanceof WGContent) {
                        filterContext = getTMLContext().context((WGContent) currentValue);
                    }
                    else {
View Full Code Here

            // Virtual links adressing content are treated internally, so the resulting link will match the current content URL policy
            if (WGContent.VIRTUALLINKTYPE_CONTENT.equals(context.content().getVirtualLinkType()) ||
                    WGContent.VIRTUALLINKTYPE_UNIQUENAME.equals(context.content().getVirtualLinkType())) {
                List elements = WGUtils.deserializeCollection(context.content().getVirtualLink(), "/");
                String docID = (String) elements.get(elements.size() - 1);
                TMLContext targetContext = context.context("docid:" + docID, false);
                if (targetContext != null) {
                    completeUrl = targetContext.contenturl(mediaKey, layoutKey);
                }
                else {
                    completeUrl = WGPDispatcher.buildVirtualLink(context.content(), context.getrequest(), mediaKey, layoutKey);
                }
            }
View Full Code Here

        throw new TMLException("Unknown navigator type: " + type, true);
    }
   
    String exclude = getExclude();
    if (exclude != null) {
        TMLContext excludeContext = getTMLContext().context(exclude, false);
        if (excludeContext != null) {
            status.contentList.remove(excludeContext.content());
        }
        else {
            addWarning("Unresolvable exclude context: " + exclude, false);
        }
    }
View Full Code Here

    public String webtmlFetchLabel(WGAResourceBundleManager manager, TMLContext context, String container, String file, String key) throws WGAPIException {
       
        try {
            // If we are included and the main context is multilang we should try to take the language choice from there
            TMLContext mainContext = context.getmaincontext();
            if (LanguageBehaviourTools.isMultiLanguageContext(mainContext)) {
                Locale mainLangLocale = WGLanguage.languageNameToLocale((String) mainContext.meta(WGContent.META_LANGUAGE));
                String label = LanguageBehaviourTools.fetchLabelForLanguage(manager, container, file, key, mainLangLocale);
                if (label != null) {
                    return label;
                }
            }
View Full Code Here

TOP

Related Classes of de.innovationgate.wgpublisher.webtml.utils.TMLContext

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.