Package info.magnolia.templating.elements

Examples of info.magnolia.templating.elements.MarkupHelper


        el.setAttribute("src", ctx + "/.resources/calendar/lang/calendar-" + MgnlContext.getLocale().getLanguage() + ".js");
        result.add(el);
        Text t= new Text("\n");
        result.add(t);
        StringWriter writer = new StringWriter();
        MarkupHelper helper = new MarkupHelper(writer);
        try {
            helper.append(" "+CMS_PAGE_TAG);
            Object nodeObj = StandardExpressionProcessor.processExpression(
                    arguments, "${content}");
            if(!(nodeObj instanceof javax.jcr.Node)){
                throw new TemplateProcessingException("Musst pass a javx.jcr.Node here");
            }
            javax.jcr.Node node = (javax.jcr.Node)nodeObj;
            if(node != null) {
                helper.attribute(CONTENT_ATTRIBUTE, getNodePath(node));
            }
            Object ctxObj = StandardExpressionProcessor.processExpression(
                    arguments, "${renderingContext}");
            if(!(ctxObj instanceof RenderingContext)){
                throw new TemplateProcessingException("Musst pass a RenderingContext here");
            }

            RenderingContext renderingContext = (RenderingContext)ctxObj;
            TemplateDefinition templateDefinition = (TemplateDefinition)renderingContext.getRenderableDefinition();
            String dlg = templateDefinition.getDialog();
            if(dlg!=null){
                helper.attribute("dialog", dlg);
            }
            helper.attribute("preview", String.valueOf(MgnlContext.getAggregationState().isPreviewMode()));

            //here we provide the page editor with the available locales and their respective URI for the current page
//            if (i18nAuthoringSupport.isEnabled() && i18nContentSupport.isEnabled() && i18nContentSupport.getLocales().size()>1){
//
//                Content currentPage = MgnlContext.getAggregationState().getMainContent();
View Full Code Here

TOP

Related Classes of info.magnolia.templating.elements.MarkupHelper

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.