Package org.jasig.portal.serialize

Examples of org.jasig.portal.serialize.OutputFormat


                log.error("unable to obtain proper markup serializer : ", e);
            }

            if (serOut == null) {
                // default to XML serializer
                final OutputFormat frmt = new OutputFormat("XML", "UTF-8", true);
                serOut = new XMLSerializer(printWriter, frmt);
            }

            localRenderXML(serOut);
        }
View Full Code Here


          StructureStylesheetUserPreferences ssup = userPrefs.getStructureStylesheetUserPreferences();
          StructureAttributesIncorporationFilter saif = new StructureAttributesIncorporationFilter(th, ssup);

          // Put a duplicating filter before th
          StringWriter sw = null;
          OutputFormat outputFormat = null;
          if (printXMLToLog) {
            sw = new StringWriter();
            outputFormat = new OutputFormat();
            outputFormat.setIndenting(true);
            XMLSerializer debugSerializer = new XMLSerializer(sw, outputFormat);
            SAX2DuplicatingFilterImpl dupFilter = new SAX2DuplicatingFilterImpl(th, debugSerializer);
            dupFilter.setParent(saif);
          }
View Full Code Here

          StructureStylesheetUserPreferences ssup = userPrefs.getStructureStylesheetUserPreferences();
          StructureAttributesIncorporationFilter saif = new StructureAttributesIncorporationFilter(th, ssup);

          // Put a duplicating filter before th
          StringWriter sw = null;
          OutputFormat outputFormat = null;
          if (printXMLToLog) {
            sw = new StringWriter();
            outputFormat = new OutputFormat();
            outputFormat.setIndenting(true);
            XMLSerializer debugSerializer = new XMLSerializer(sw, outputFormat);
            SAX2DuplicatingFilterImpl dupFilter = new SAX2DuplicatingFilterImpl(th, debugSerializer);
            dupFilter.setParent(saif);
          }
View Full Code Here

                            userPreferences.getStructureStylesheetUserPreferences());

                    // This is a debug statement that will print out XML incoming to the
                    // structure transformation to a log file serializer to a printstream
                    StringWriter dbwr1 = null;
                    OutputFormat outputFormat = null;
                    if (logXMLBeforeStructureTransformation && log.isDebugEnabled()) {
                        dbwr1 = new StringWriter();
                        outputFormat = new OutputFormat();
                        outputFormat.setIndenting(true);
                        XMLSerializer dbser1 = new XMLSerializer(dbwr1, outputFormat);
                        SAX2DuplicatingFilterImpl dupl1 = new SAX2DuplicatingFilterImpl(ssth, dbser1);
                        dupl1.setParent(saif);
                    }
View Full Code Here

   * This method is useful for debugging.
   * @param node the Node to print; must be of type Document or Element
   * @return a nicely formatted String suitable for printing
   */
  public static String serializeNode(Node node) {
    OutputFormat format = new OutputFormat();
    format.setOmitXMLDeclaration(true);
    format.setIndenting(true);
    return serializeNode(node,format);
  }
View Full Code Here

   * @param out
   * @return the serializer
   */
  public BaseMarkupSerializer getSerializerByName (String serializerName, java.io.Writer out) {
    if (serializerName != null && serializerName.equals("WML")) {
      OutputFormat frmt = new OutputFormat("wml", "UTF-8", true);
      frmt.setDoctype(WMLPublicId, WMLSystemId);
      return  new XMLSerializer(out, frmt);
    } /* else if (serializerName != null && serializerName.equals("PalmHTML")) {
      OutputFormat frmt = new OutputFormat("HTML", "UTF-8", true);
      return  new PalmHTMLSerializer(out, frmt);
      } */ else if (serializerName != null && serializerName.equals("XML")) {
      OutputFormat frmt = new OutputFormat("XML", "UTF-8", true);
      return  new XMLSerializer(out, frmt);
    } else if (serializerName != null && serializerName.equals("XHTML")) {
      OutputFormat frmt = new OutputFormat("XHTML", "UTF-8", true);
      frmt.setPreserveSpace(true);
      frmt.setIndenting(outputIndenting);
      frmt.setDoctype(XHTMLPublicId, XHTMLSystemId);
      frmt.setOmitDocumentType(omitDoctype);
      return  new CachingXHTMLSerializer(out, frmt);
    } else {
      // default case is HTML, such as that for netscape and explorer
      OutputFormat frmt = new OutputFormat("HTML", "UTF-8", true);
      frmt.setPreserveSpace(true);
      frmt.setIndenting(outputIndenting);
      frmt.setDoctype(HTMLPublicId, HTMLSystemId);
      frmt.setOmitDocumentType(omitDoctype);
      return  new CachingHTMLSerializer(out, frmt);
    }
  }
View Full Code Here

   * @param out
   * @return the serializer
   */
  public BaseMarkupSerializer getSerializerByName (String serializerName, java.io.Writer out) {
    if (serializerName != null && serializerName.equals("WML")) {
      OutputFormat frmt = new OutputFormat("wml", "UTF-8", true);
      frmt.setDoctype("-//WAPFORUM//DTD WML 1.1//EN", "http://www.wapforum.org/DTD/wml_1.1.xml");
      return  new XMLSerializer(out, frmt);
    } /* else if (serializerName != null && serializerName.equals("PalmHTML")) {
      OutputFormat frmt = new OutputFormat("HTML", "UTF-8", true);
      return  new PalmHTMLSerializer(out, frmt);
      } */ else if (serializerName != null && serializerName.equals("XML")) {
      OutputFormat frmt = new OutputFormat("XML", "UTF-8", true);
      return  new XMLSerializer(out, frmt);
    } else if (serializerName != null && serializerName.equals("XHTML")) {
      OutputFormat frmt = new OutputFormat("XHTML", "UTF-8", true);
      frmt.setPreserveSpace(true);
      frmt.setIndenting(outputIndenting);
      frmt.setDoctype("-//W3C//DTD XHTML 1.0 Transitional//EN", "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd");
      frmt.setOmitDocumentType(omitDoctype);
      return  new CachingXHTMLSerializer(out, frmt);
    } else {
      // default case is HTML, such as that for netscape and explorer
      OutputFormat frmt = new OutputFormat("HTML", "UTF-8", true);
      frmt.setPreserveSpace(true);
      frmt.setIndenting(outputIndenting);
      frmt.setDoctype("-//W3C//DTD HTML 4.01 Transitional//EN", "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd");
      frmt.setOmitDocumentType(omitDoctype);
      return  new CachingHTMLSerializer(out, frmt);
    }
  }
View Full Code Here

                    "unable to obtain proper markup serializer : ", e);
        }

        if (serOut == null) {
            // default to XML serializer
            OutputFormat frmt = new OutputFormat("XML", "UTF-8", true);
            serOut = new XMLSerializer(out, frmt);
        }

        localRenderXML(serOut);
    }
View Full Code Here

          StructureStylesheetUserPreferences ssup = userPrefs.getStructureStylesheetUserPreferences();
          StructureAttributesIncorporationFilter saif = new StructureAttributesIncorporationFilter(th, ssup);

          // Put a duplicating filter before th
          StringWriter sw = null;
          OutputFormat outputFormat = null;
          if (printXMLToLog) {
            sw = new StringWriter();
            outputFormat = new OutputFormat();
            outputFormat.setIndenting(true);
            XMLSerializer debugSerializer = new XMLSerializer(sw, outputFormat);
            SAX2DuplicatingFilterImpl dupFilter = new SAX2DuplicatingFilterImpl(th, debugSerializer);
            dupFilter.setParent(saif);
          }
View Full Code Here

          StructureStylesheetUserPreferences ssup = userPrefs.getStructureStylesheetUserPreferences();
          StructureAttributesIncorporationFilter saif = new StructureAttributesIncorporationFilter(th, ssup);

          // Put a duplicating filter before th
          StringWriter sw = null;
          OutputFormat outputFormat = null;
          if (printXMLToLog) {
            sw = new StringWriter();
            outputFormat = new OutputFormat();
            outputFormat.setIndenting(true);
            XMLSerializer debugSerializer = new XMLSerializer(sw, outputFormat);
            SAX2DuplicatingFilterImpl dupFilter = new SAX2DuplicatingFilterImpl(th, debugSerializer);
            dupFilter.setParent(saif);
          }
View Full Code Here

TOP

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

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.