Package com.volantis.mcs.context

Examples of com.volantis.mcs.context.EnvironmentContext


            XDIMEContextInternal context) {

        super(type, strategy,
                dataHandlingStrategy, context);

        final EnvironmentContext environmentContext =
            ContextInternals.getEnvironmentContext(
                context.getInitialRequestContext());
        final ResponseCachingDirectives cachingDirectives =
            environmentContext.getCachingDirectives();
        if (cachingDirectives != null) {
            cachingDirectives.disable();
        }
    }
View Full Code Here


        int lastDot = path.lastIndexOf('.');
        String resultMimeType = null;

        if (lastDot != -1) {
            MarinerPageContext pageContext = getPageContext(context);
            EnvironmentContext envContext = pageContext.getEnvironmentContext();
            resultMimeType = envContext.getMimeType(path);
        }
        return resultMimeType;
    }
View Full Code Here

            Value defaultValue) {

        ExpressionFactory factory = expressionContext.getFactory();                                 
        Value value = defaultValue;

        EnvironmentContext environmentContext =
            ContextInternals.getEnvironmentContext(requestContext);

        // See if the header can be found
        String header = environmentContext.getHeader(name);

        if (header != null) {
            value = factory.createStringValue(header);
        }
View Full Code Here

            Value defaultValue) {
        ExpressionFactory factory = expressionContext.getFactory();
        Value value = defaultValue;

        EnvironmentContext environmentContext =
            ContextInternals.getEnvironmentContext(requestContext);


        // See if the header can be found
        Enumeration enumeration = environmentContext.getHeaders(name);

        // The number of headers isn't known until the enumeration has
        // been traversed so build up a dynamic array of the header
        // values
        List headers;
View Full Code Here

    protected Object getCurrentValue(ExpressionContext context) {

        MarinerRequestContext requestContext = (MarinerRequestContext)
                context.getProperty(MarinerRequestContext.class);

        EnvironmentContext environmentContext =
                ContextInternals.getEnvironmentContext(requestContext);

        Enumeration enumeration = environmentContext.getHeaders(name);

        // The number of headers isn't known until the enumeration has
        // been traversed so build up a dynamic array of the header
        // values
        List headers = new ArrayList();
View Full Code Here

    protected Object getCurrentValue(ExpressionContext context) {

        MarinerRequestContext requestContext = (MarinerRequestContext)
                context.getProperty(MarinerRequestContext.class);

        EnvironmentContext environmentContext =
                ContextInternals.getEnvironmentContext(requestContext);

        return environmentContext.getHeader(name);
    }
View Full Code Here

     * Set the an attribute on the request to show whether the page can should
     * be cached
     * @param canCache - true iff the css reference is internal only
     */
    private void setPageCacheAttribute(boolean canCache) {
        EnvironmentContext environmentContext =
                getMarinerPageContext().getEnvironmentContext();

        if (canCache) {
            environmentContext.setAttribute(
                    CacheScopeConstant.CACHE_SCOPE_ATTRIBUTE,
                    CacheScopeConstant.CAN_CACHE_PAGE);
        } else {
            environmentContext.setAttribute(
                    CacheScopeConstant.CACHE_SCOPE_ATTRIBUTE,
                    CacheScopeConstant.CAN_NOT_CACHE_PAGE);
        }
    }
View Full Code Here

        if (attributes != null) {
            String resolvedLink = getLinkFromReference(attributes.getAction());
            AbstractForm form = attributes.getFormData();
            if (form != null ) {
                // Get the context path URL which is environment dependent.
                EnvironmentContext envContext = context.getEnvironmentContext();
                MarinerURL contextPathURL = null;
                if (envContext != null) {
                    contextPathURL = envContext.getContextPathURL();
                }

                if (logger.isDebugEnabled()) {
                    logger.debug("Context path is "
                                 + contextPathURL.getExternalForm());
View Full Code Here

        // Get the context path URL which is environment dependent.
        // For some tests in oldtests enviromentContext is null so only for these old tests
        // are added checking conditions
        String contextPath = null;
        EnvironmentContext envContext = context.getEnvironmentContext();
        if(envContext == null) {
            logger.warn("EnvironmentContext object is NULL");
            return;
        }
        MarinerURL contextPathURL = envContext.getContextPathURL();
        if (contextPathURL != null) {
            contextPath = contextPathURL.getExternalForm();
        } else {
            logger.warn("EnvironmentContext#getContextPathURL object is NULL");           
            return;
View Full Code Here

TOP

Related Classes of com.volantis.mcs.context.EnvironmentContext

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.