Examples of StringElement


Examples of org.apache.ecs.StringElement

            {
                message.addElement(msg);
            }
            else
            {
                message = new StringElement(msg);
            }
        }
    }
View Full Code Here

Examples of org.apache.ecs.StringElement

        String templateName = data.getTemplateInfo().getNavigationTemplate();
        FreeMarkerService fm = (FreeMarkerService)
            TurbineServices.getInstance()
                .getService(FreeMarkerService.SERVICE_NAME);

        StringElement output = new StringElement();
        output.setFilterState(false);
        output.addElement(
            fm.handleRequest(context, "navigations/" + templateName, true));
        return output;
    }
View Full Code Here

Examples of org.apache.ecs.StringElement

    {
        Context context = TurbineVelocity.getContext( data );

        String templateName = data.getTemplateInfo().getNavigationTemplate();

        StringElement output = new StringElement();
        output.setFilterState(false);

        // Usually adds the leading slash, but make it sure.
        if ((templateName.length() > 0) &&
            (templateName.charAt(0) != '/'))
        {
            templateName = '/' + templateName;
        }
        output.addElement( TurbineVelocity
            .handleRequest(context,"navigations" + templateName) );
        return output;
    }
View Full Code Here

Examples of org.apache.ecs.StringElement

    {
        WebContext context = getContext( data );

        String templateName = data.getTemplateInfo().getNavigationTemplate();

        StringElement output = new StringElement();
        output.setFilterState(false);
        output.addElement(
            buildWMTemplate(context,"navigations/" + templateName));
        return output;
    }
View Full Code Here

Examples of org.apache.ecs.StringElement

        throws Exception
    {
        FreeMarkerService fm = (FreeMarkerService)
            TurbineServices.getInstance()
                .getService(FreeMarkerService.SERVICE_NAME);
        StringElement output = new StringElement();
        output.setFilterState(false);
        output.addElement(fm.handleRequest(context,templateFile, cache));
        return output;
    }
View Full Code Here

Examples of org.apache.ecs.StringElement

     * @return A ConcreteElement.
     * @exception Exception, a generic exception.
     */
    public ConcreteElement buildTemplate( RunData data ) throws Exception
    {
        StringElement output = null;
        String screenData = null;
        Context context = TurbineVelocity.getContext(data);

        // This will already be properly set and will not be null
        // because of TemplateSessionValidator.
        String templateName = TurbineTemplate.getScreenTemplateName(
            data.getTemplateInfo().getScreenTemplate() );

        // Template service adds the leading slash, but make it sure.
        if ((templateName.length() > 0) &&
            (templateName.charAt(0) != '/'))
        {
            templateName = '/' + templateName;
        }

        try
        {
            // if a layout has been defined return the results, otherwise
            // send the results directly to the output stream.
            if (getLayout(data) == null)
            {
                TurbineVelocity.handleRequest(context,
                    "screens" + templateName,
                    data.getResponse().getOutputStream());
            }
            else
            {
                screenData = TurbineVelocity
                    .handleRequest(context,"screens" + templateName);
            }
        }
        catch (Exception e)
        {
            // If there is an error, build a $processingException and
            // attempt to call the error.vm template in the screens
            // directory.
            context.put ( "processingException", e.toString() );
            context.put ( "stackTrace", StringUtils.stackTrace(e) );
            templateName = TurbineResources.getString(
                "template.error", "/error.vm");
            if ((templateName.length() > 0) &&
                (templateName.charAt(0) != '/'))
            {
                templateName = '/' + templateName;
            }
            screenData = TurbineVelocity.handleRequest(
                context, "screens" + templateName);
        }

        // package the response in an ECS element
        if (screenData != null)
        {
            output = new StringElement();
            output.setFilterState(false);
            output.addElement(screenData);
        }
        return output;
    }
View Full Code Here

Examples of org.apache.ecs.StringElement

            (templateName.charAt(0) != '/'))
        {
            templateName = '/' + templateName;
        }

        StringElement output = new StringElement();
        output.setFilterState(false);

        String screenData = null;
        try
        {
            screenData = buildWMTemplate(context, "screens" + templateName);
        }
        catch (Exception e)
        {
            // If there is an error, build a $processingException and
            // attempt to call the error.wm template in the screens
            // directory.
            context.put( "processingException", e.toString() );
            context.put( "stackTrace", StringUtils.stackTrace(e) );
            templateName = TurbineResources.getString(
                "template.error", "/error.wm");
            if ((templateName.length() > 0) &&
                (templateName.charAt(0) != '/'))
            {
                templateName = '/' + templateName;
            }
            screenData = buildWMTemplate(
                context, "screens" + templateName);
        }
        output.addElement(screenData);
        return output;
    }
View Full Code Here

Examples of org.apache.ecs.StringElement

        FreeMarkerService fm = (FreeMarkerService)
            TurbineServices.getInstance()
            .getService(FreeMarkerService.SERVICE_NAME);

        StringElement output = new StringElement();
        output.setFilterState(false);
        output.addElement(
            fm.handleRequest(context, "screens" + templateName, true));
        return output;
    }
View Full Code Here

Examples of org.apache.ecs.StringElement

     *
     * @param msg a string.
     */
    public void setMessage(String msg)
    {
        this.message = new StringElement(msg);
    }
View Full Code Here

Examples of org.apache.ecs.StringElement

     *
     * @param msg a string.
     */
    public void addMessage(String msg)
    {
        addMessage(new StringElement(msg));
    }
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.