Package com.volantis.mcs.context

Examples of com.volantis.mcs.context.EnvironmentContext


        // The processed page will be written to the response, so
        // we don't need to do anything further.
        XMLReader reader = MarlinSAXHelper.getXMLReader(mcsContext, null);

        EnvironmentContext environmentContext =
                ContextInternals.getEnvironmentContext(mcsContext);

        // The getXMLReader() call above will set up the pipelineContext in
        // the environmentContext.  See MarlinSAXHelper.setPipelineContext()
        XMLPipelineContext pipelineContext =
                environmentContext.getPipelineContext();

        // Set the Base URI in the pipeline's context
        URL baseURI = this.getServletContext().getResource("/");
        if (logger.isDebugEnabled()) {
            logger.debug("Setting Base URI " + baseURI.toExternalForm());
View Full Code Here


            // The processed page will be written to the response, so
            // we don't need to do anything further.
            XMLReader reader =
                    MarlinSAXHelper.getXMLReader( requestContext, null );

            EnvironmentContext environmentContext =
                    ContextInternals.getEnvironmentContext( requestContext );

            // The getXMLReader() call above will set up the pipelineContext in
            // the environmentContext.  See MarlinSAXHelper.setPipelineContext()
            XMLPipelineContext pipelineContext =
                    environmentContext.getPipelineContext();
            // set the Base URI in the pipeline's context
            try {
                URL baseURI = new URL( baseUrl );
                if( logger.isDebugEnabled() ) {
                    logger.debug( "Setting Base URI "
View Full Code Here

        if (context != null) {
            sessionContext = context.getCurrentSessionContext();
            expressionContext = context.getExpressionContext();
        }
        try {
            EnvironmentContext environmentContext
                    = new InternalEnvironmentContext(this, sessionContext);
            environmentContext.setExpressionContext(expressionContext);

            initialise(config, request, response, environmentContext);
        } catch (RepositoryException e) {
            throw new MarinerContextException(e);
        }
View Full Code Here

                                        ServletRequest request,
                                        ServletResponse response)
            throws IOException,
            MarinerContextException {

        EnvironmentContext environmentContext
                = new ServletEnvironmentContext(this);

        initialise(config, config.getServletContext(),
                (HttpServletRequest) request, (HttpServletResponse) response,
                environmentContext);
View Full Code Here

                                        ServletResponse response,
                                        EnvironmentContext envContext)
            throws IOException,
            MarinerContextException {

        EnvironmentContext newContext = new ServletEnvironmentContext(this);
        if (envContext != null) {
            newContext.setExpressionContext(envContext.getExpressionContext());
        }

        initialise(null, context, (HttpServletRequest) request,
                (HttpServletResponse) response, newContext);
    }
View Full Code Here

            RepositoryException,
            MarinerContextException {

        // Retrieve the environment context so that it may be shared with the
        // new nested context.
        EnvironmentContext envContext =
                ContextInternals.getEnvironmentContext(this);
        return new MarinerServletRequestContext(servletContext,
                request, response,
                envContext);
    }
View Full Code Here

            // todo: The following baseURI initialisation code should be
            // unnecessary if the system id is properly set on the InputSource.
            // However, this needs to be tested properly before changing it as
            // there were some problems with the pipeline.
            EnvironmentContext environmentContext =
                ContextInternals.getEnvironmentContext(servletRequestContext);

            // The getXMLReader() call above will set up the pipelineContext in
            // the environmentContext.  See MarlinSAXHelper.setPipelineContext()
             XMLPipelineContext pipelineContext = environmentContext.getPipelineContext();
             // set the Base URI in the pipeline's context
             try {
                 URL baseURI = filterConfig.getServletContext().getResource("/");
                 String baseURIAsString = baseURI.toExternalForm();
                 if (logger.isDebugEnabled()) {
View Full Code Here

        requestContext = new MockMarinerServletRequestContext(servletRequest, new MockHTTPServletResponse());

        Project project = new RuntimeProjectMock("projectMock", expectations);
//        requestContext.pushProject(project);

        EnvironmentContext environmentContext = new ServletEnvironmentContext(
                requestContext);
        ContextInternals.setEnvironmentContext(requestContext,
                environmentContext);

        ExpressionFactory expressionFactory = ExpressionFactory.getDefaultInstance();

        ExpressionContext expressionContext =
                expressionFactory.createExpressionContext(
                        null,
                        NamespaceFactory.getDefaultInstance()
                        .createPrefixTracker());

        expressionContext.setProperty(MarinerRequestContext.class,
                                      requestContext, false);

        final CurrentProjectProviderMock projectProviderMock =
                new CurrentProjectProviderMock("projectProviderMock",
                        expectations);
        projectProviderMock.expects.getCurrentProject().returns(project).any();

        // Add a project provider in for resolving relative policy expressions
        // without a project into absolute IDs containing a project.
        expressionContext.setProperty(CurrentProjectProvider.class,
                projectProviderMock, false);

        environmentContext.setExpressionContext(expressionContext);
        return requestContext;
    }
View Full Code Here

     * of the incoming request
     */
    private void storeVisitedIdsInPipelineContext(
            final MarinerServletRequestContext requestContext) {

        final EnvironmentContext environmentContext =
            ContextInternals.getEnvironmentContext(requestContext);
        final XMLPipelineContext pipelineContext =
            environmentContext.getPipelineContext();

        // store the ID's of the visited MCS instances adding the ID of the
        // current instance.
        String instances = requestContext.getHttpRequest().getHeader(
            URLConfigurationFactory.VISITED_MCS_INSTANCES_HEADER_NAME);
View Full Code Here

        pageContext.setPolicyReferenceResolver(referenceResolverMock);

        referenceResolverMock.expects.resolveQuotedTextExpression(null)
                .returns(null).any();

        EnvironmentContext envContext = new TestEnvironmentContext();
        ContextInternals.setEnvironmentContext(requestContext, envContext);

        ContextInternals.setMarinerPageContext(requestContext, pageContext);
        ContextInternals.setApplicationContext(requestContext, appContext);
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.