Package org.jasig.portal.serialize

Examples of org.jasig.portal.serialize.BaseMarkupSerializer


            else {
                final IUserPreferencesManager userPreferencesManager = this.portcs.getUserPreferencesManager();
                final ThemeStylesheetDescription tsd = userPreferencesManager.getThemeStylesheetDescription();
                final String serializerName = tsd.getSerializerName();
               
                final BaseMarkupSerializer serOut = MEDIAMANAGER.getSerializerByName(serializerName, printWriter);
                channel.renderXML(serOut);
            }
        }
    }
View Full Code Here


        // if channel's render method was to be called, we would've returned by now
        if (contentHandler != null) {
            localRenderXML(contentHandler);
        }
        else {
            BaseMarkupSerializer serOut = null;
            try {
                final IUserPreferencesManager userPreferencesManager = this.portcs.getUserPreferencesManager();
                final ThemeStylesheetDescription tsd = userPreferencesManager.getThemeStylesheetDescription();
                serOut = MEDIAMANAGER.getSerializerByName(tsd.getSerializerName(), printWriter);
            }
View Full Code Here

                // set the response mime type
                res.setContentType(tsd.getMimeType() + "; charset=" + CHARACTER_SET);
                // obtain the writer - res.getWriter() must occur after res.setContentType()
                Writer out = new BufferedWriter(res.getWriter(), 1024);
                // get a serializer appropriate for the target media
                BaseMarkupSerializer markupSerializer =
                    MEDIA_MANAGER.getSerializerByName(tsd.getSerializerName(),
                        new ChannelTitleIncorporationWiterFilter(out, channelManager, ulm));
                // set up the serializer
                markupSerializer.asContentHandler();
                // see if we can use character caching
                boolean ccaching = (CHARACTER_CACHE_ENABLED && (markupSerializer instanceof CachingSerializer));
                channelManager.setCharacterCaching(ccaching);
                // pass along the serializer name
                channelManager.setSerializerName(tsd.getSerializerName());
View Full Code Here

        cr.startRendering ();

        // set the output mime type
        res.setContentType(mediaM.getReturnMimeType(req));
        // set up the serializer
        BaseMarkupSerializer ser = mediaM.getSerializer(mediaM.getMedia(req), res.getWriter());
        ser.asContentHandler();
        // get the framing stylesheet
        String xslURI = ResourceLoader.getResourceAsURLString(this.getClass(), set.getStylesheetURI(req));
        try {
            TransformerHandler th=XSLT.getTransformerHandler(xslURI);
            th.setResult(new SAXResult(ser));
View Full Code Here

      workerThread.start();
      long startTime = System.currentTimeMillis();
      // set the mime type
      res.setContentType(mediaM.getReturnMimeType(req));
      // set up the serializer
      BaseMarkupSerializer ser = mediaM.getSerializer(mediaM.getMedia(req), res.getWriter());
      ser.asContentHandler();
      // get the framing stylesheet
      String xslURI = null;
      try
      {
        xslURI = set.getStylesheetURI(req);
View Full Code Here

        cr.startRendering ();

        // set the output mime type
        res.setContentType(mediaM.getReturnMimeType(req));
        // set up the serializer
        BaseMarkupSerializer ser = mediaM.getSerializer(mediaM.getMedia(req), res.getWriter());
        ser.asContentHandler();
        // get the framing stylesheet
        String xslURI = ResourceLoader.getResourceAsURLString(this.getClass(), set.getStylesheetURI(req));
        try {
            TransformerHandler th=XSLT.getTransformerHandler(xslURI);
            th.setResult(new SAXResult(ser));
View Full Code Here

                                    .renderCharacters(out);
                        } else {
                            ThemeStylesheetDescription tsd = this.portcs
                                    .getUserPreferencesManager()
                                    .getThemeStylesheetDescription();
                            BaseMarkupSerializer serOut = MEDIAMANAGER
                                    .getSerializerByName(tsd
                                            .getSerializerName(), out);
                            this.the_channel.renderXML(serOut);
                        }
                        return;
                    } catch (Exception e) {
                        // if any of the above didn't work, fall back to the
                        // error channel
                        resetCError(ErrorCode.SET_RUNTIME_DATA_EXCEPTION, e,
                                channelSubscribeId, this.the_channel,
                                "Channel failed a refresh attempt.");
                    }
                } else if (chFate.equals("restart")) {
                    log
                            .debug("CError:renderCharacters() : going for reinstantiation");

                    ChannelManager cm = this.portcs.getChannelManager();

                    ChannelRuntimeData crd = (ChannelRuntimeData) this.runtimeData
                            .clone();
                    crd.clear();
                    try {
                        this.the_channel = cm
                        .instantiateChannel(channelSubscribeId);
                        if (this.the_channel == null) {
                            resetCError(ErrorCode.GENERAL_ERROR, null,
                                    channelSubscribeId, null,
                                    "Channel failed to reinstantiate!");
                        } else {
                            try {
                                if (this.the_channel instanceof IPrivilegedChannel) {
                                    ((IPrivilegedChannel) this.the_channel)
                                            .setPortalControlStructures(this.portcs);
                                }
                                this.the_channel.setRuntimeData(crd);
                                if (this.the_channel instanceof ICharacterChannel) {
                                    ((ICharacterChannel) this.the_channel)
                                            .renderCharacters(out);
                                } else {
                                    ThemeStylesheetDescription tsd = this.portcs
                                            .getUserPreferencesManager()
                                            .getThemeStylesheetDescription();
                                    BaseMarkupSerializer serOut = MEDIAMANAGER
                                            .getSerializerByName(tsd
                                                    .getSerializerName(), out);
                                    this.the_channel.renderXML(serOut);
                                }
                                return;
                            } catch (Exception e) {
                                // if any of the above didn't work, fall back to
                                // the error channel
                                resetCError(ErrorCode.SET_RUNTIME_DATA_EXCEPTION,
                                        e, channelSubscribeId,
                                        this.the_channel,
                                        "Channel failed a reload attempt.");
                                cm.setChannelInstance(
                                         channelSubscribeId, this);
                                log.error( "CError::renderCharacters() : an error occurred " +
                                        "during channel reinitialization.", e);
                            }
                        }
                    } catch (Exception e) {
                        resetCError(ErrorCode.GENERAL_ERROR, e,
                                channelSubscribeId, null,
                                "Channel failed to reinstantiate!");
                        log.error("CError::renderCharacters() : an error occurred during " +
                                "channel reinstantiation. ", e);
                    }
                } else if (chFate.equals("toggle_stack_trace")) {
                    this.showStackTrace = !this.showStackTrace;
                }
            }
        }
        // if channel's render XML method was to be called, we would've returned
        // by now
        BaseMarkupSerializer serOut = null;
        try {
            ThemeStylesheetDescription tsd = this.portcs
                    .getUserPreferencesManager()
                    .getThemeStylesheetDescription();
            serOut = MEDIAMANAGER.getSerializerByName(tsd.getSerializerName(), out);
View Full Code Here

      workerThread.start();
      long startTime = System.currentTimeMillis();
      // set the mime type
      res.setContentType(mediaM.getReturnMimeType(req));
      // set up the serializer
      BaseMarkupSerializer ser = mediaM.getSerializer(mediaM.getMedia(req), res.getWriter());
      ser.asContentHandler();
      // get the framing stylesheet
      String xslURI = null;
      try
      {
        xslURI = set.getStylesheetURI(req);
View Full Code Here

                    res.setContentType(tsd.getMimeType() + "; charset=" +
                        CHARACTER_SET);
                    // obtain the writer - res.getWriter() must occur after res.setContentType()
                    PrintWriter out = res.getWriter();
                    // get a serializer appropriate for the target media
                    BaseMarkupSerializer markupSerializer = MEDIAMANAGER.getSerializerByName(tsd.getSerializerName(), out);
                    // set up the serializer
                    markupSerializer.asContentHandler();
                    // see if we can use character caching
                    boolean ccaching=(CHARACTER_CACHE_ENABLED && (markupSerializer instanceof CachingSerializer));
                    channelManager.setCharacterCaching(ccaching);
                    // initialize ChannelIncorporationFilter
                    // ChannelIncorporationFilter cif = new ChannelIncorporationFilter(markupSerializer, channelManager); // this should be slightly faster then the ccaching version, may be worth adding support later
View Full Code Here

TOP

Related Classes of org.jasig.portal.serialize.BaseMarkupSerializer

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.