Package com.volantis.mcs.context

Examples of com.volantis.mcs.context.MarinerPageContext


   
    // Javadoc inherited
    public XDIMEResult doElementStart(XDIMEContextInternal context,
            XDIMEAttributes attributes) throws XDIMEException {

        MarinerPageContext pageContext = getPageContext(context);
       
        // creating anonymous region instance
        // and pushing it into buffer
        anonymousRegionInstance = createAnonymousRegion(pageContext);   
        pageContext.pushContainerInstance(anonymousRegionInstance);
        OutputBuffer outputBuffer =
          anonymousRegionInstance.getCurrentBuffer();
        pageContext.pushOutputBuffer(outputBuffer);
       
        return super.doElementStart(context, attributes);
    }   
View Full Code Here


    // Javadoc inherited
    public XDIMEResult doElementEnd(XDIMEContextInternal context)
            throws XDIMEException {

        MarinerPageContext pageContext = getPageContext(context);

        // do this first so that current pane is not surpressed.
        XDIMEResult result = super.doElementEnd(context);
       
        // Pop the anonymous region buffer that was pushed on at the
        // end of the doElementStart() method.
        pageContext.popContainerInstance(anonymousRegionInstance);     

        OutputBuffer anonymousBuffer =
                anonymousRegionInstance.getCurrentBuffer();
        pageContext.popOutputBuffer(anonymousBuffer);
       
        DeviceLayoutContext layoutToPop = pageContext.getDeviceLayoutContext();       
       
        pageContext.popDeviceLayoutContext();               

        ContainerInstance containingInstance =
            pageContext.getCurrentContainerInstance();

        // buffer from annonymous region must be merged
        // with current buffer from instance
        containingInstance.getCurrentBuffer().transferContentsFrom(
            this.anonymousRegionInstance.getCurrentBuffer());
View Full Code Here

     *                       pipeline configuration
     * @return a default XMLReader
     */
    public static XMLReader getXMLReader(MarinerRequestContext requestContext) {

        MarinerPageContext pageContext =
            ContextInternals.getMarinerPageContext(requestContext);

        // retrive the PipelineInitialization instance that the volantis
        // bean manages.
        PipelineInitialization pipelineInitialization =
            pageContext.getVolantisBean().getPipelineInitialization();

        // get hold of the Adapter process factory
        XMLPipelineFactory factory =
            pipelineInitialization.getPipelineFactory();

View Full Code Here

                             ErrorHandler errorHandler,
                             InputSource inputSource)
        throws SAXException, IOException {
        XMLReader reader = getXMLReader(requestContext, errorHandler);
       
         MarinerPageContext pageContext =
            ContextInternals.getMarinerPageContext(requestContext);
            
         XMLPipelineContext pipelineContext = getPipelineContext(requestContext);
         // set the Base URI in the pipeline's context
         try {
             URL baseURI = pageContext.getAbsoluteURL(
                pageContext.getRequestURL(false));
             if (logger.isDebugEnabled()) {
                 logger.debug("Setting Base URI " + baseURI);
             }
             pipelineContext.pushBaseURI(baseURI.toExternalForm());
         } catch (MalformedURLException e) {
View Full Code Here

            attributes, XDIMESchemata.XHTML2_NAMESPACE, ATTR_NAME_CONTENT);
        if (content != null && content.length() > 0) {
            bodyContentBuffer.writeText(content);
            outputBufferPushed = false;
        } else {
            final MarinerPageContext pageContext =
                ContextInternals.getMarinerPageContext(
                    context.getInitialRequestContext());
            // add the output buffer to the page context's output buffer stack
            pageContext.pushOutputBuffer(bodyContentBuffer);
            outputBufferPushed = true;
        }
    }
View Full Code Here

    public void endProcess(final XDIMEContextInternal context,
                           final MetaInformationElement metaElement)
            throws XDIMEException {

        if (outputBufferPushed) {
            final MarinerPageContext pageContext =
                ContextInternals.getMarinerPageContext(
                    context.getInitialRequestContext());
            pageContext.popOutputBuffer(bodyContentBuffer);
        }
    }
View Full Code Here

    // Javadoc inherited from super class.
  public Writer getContentWriter (MarinerRequestContext context,
                                  PAPIAttributes papiAttributes)
    throws PAPIException {

    MarinerPageContext pageContext
        = ContextInternals.getMarinerPageContext (context);
    VolantisProtocol protocol = pageContext.getProtocol ();           
    Writer writer = protocol.getNativeWriter();

    return writer;
  }
View Full Code Here

                    "context multiple times");
        }

        this.requestContext = requestContext;

        MarinerPageContext pageContext =
                ContextInternals.getMarinerPageContext(requestContext);

        // Create the base URL tracker and store it in the page context.
        BaseURLTracker baseURLTracker =
                new BaseURLTracker(pageContext.getRequestURL(false));
        pageContext.setBaseURLProvider(baseURLTracker);

        // Create the project tracker.
        ProjectManager projectManager = pageContext.getProjectManager();
        ProjectStack projectStack = pageContext.getProjectStack();
        projectTracker = new ProjectTracker(baseURLTracker, projectManager,
                projectStack);

        defaultHandler.setInitialRequestContext(requestContext);
    }
View Full Code Here

  // Javadoc inherited from super class.
  public int elementStart (MarinerRequestContext context,
                           PAPIAttributes papiAttributes)
    throws PAPIException {

    MarinerPageContext pageContext
      = ContextInternals.getMarinerPageContext (context);

    PickleBlockAttributes attributes = (PickleBlockAttributes) papiAttributes;
   
    // Try and find the pane with the specified name, if it could not be
    // found then return and skip the element body.
    String paneName = attributes.getPane ();
    if (paneName != null) {
      FormatReference formatRef = FormatReferenceParser.parsePane(paneName, pageContext);
      Pane pane = pageContext.getPane(formatRef.getStem());
      NDimensionalIndex paneIndex = formatRef.getIndex();
     
      if (pane == null) {
          skipped = true;
          return SKIP_ELEMENT_BODY;
      }

        paneInstance = (AbstractPaneInstance)
                pageContext.getFormatInstance(pane, paneIndex);
        if (paneInstance.ignore()) {
            skipped = true;
            return SKIP_ELEMENT_BODY;
        }

      pageContext.pushContainerInstance (paneInstance);
    }

    // The super class will handle initialising the protocol attributes and
    // calling the protocol.
    return super.elementStart (context, papiAttributes);
View Full Code Here

    PickleBlockAttributes attributes = (PickleBlockAttributes) papiAttributes;
   
    // The super class will call the protocol.
    super.elementEnd (context, papiAttributes);

    MarinerPageContext pageContext
      = ContextInternals.getMarinerPageContext (context);

    if (paneInstance != null) {
      pageContext.popContainerInstance (paneInstance);
    }

    return CONTINUE_PROCESSING;
  }
View Full Code Here

TOP

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

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.