uPortal 2.4.1
API Documentation

org.jasig.portal
Class StylesheetSet

java.lang.Object
  extended byorg.jasig.portal.utils.SAX2FilterImpl
      extended byorg.jasig.portal.StylesheetSet
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler, org.xml.sax.ext.LexicalHandler, org.xml.sax.XMLFilter, org.xml.sax.XMLReader

public class StylesheetSet
extends SAX2FilterImpl

A tool for managing a collection of stylesheets. StylesheetSet allows you to instansiate a list of stylesheets in memory and select one according to the request/title/media parameters.

Version:
$Revision: 1.36.2.1 $
Author:
Peter Kharchenko

Constructor Summary
StylesheetSet()
           
StylesheetSet(org.xml.sax.ContentHandler dt)
          Create a SAX filter that will pick up stylesheet bindings in a document that's processed through this filter.
StylesheetSet(java.lang.String uri)
          Creates a new StylesheetSet instance given a .ssl file URI.
 
Method Summary
 void addStyleSheet(StylesheetDescription sd)
          Add a stylesheet to the list.
 javax.xml.transform.Source getStylesheet()
          Obtains a default stylesheet.
 javax.xml.transform.Source getStylesheet(javax.servlet.http.HttpServletRequest req)
          Obtain a stylesheet source.
 javax.xml.transform.Source getStylesheet(java.lang.String title)
          Obtain a stylesheet transform source
 javax.xml.transform.Source getStylesheet(java.lang.String title, BrowserInfo bi)
          Obtain a stylesheet
 javax.xml.transform.Source getStylesheet(java.lang.String title, javax.servlet.http.HttpServletRequest req)
          Obtain a stylesheet source.
 javax.xml.transform.Source getStylesheet(java.lang.String title, java.lang.String media)
          Obtain a stylesheet.
 javax.xml.transform.Source getStylesheetByMedia(java.lang.String media)
          Obtain a stylesheet for a given media.
 java.lang.String getStylesheetURI(BrowserInfo bi)
          Obtain a matching stylesheet URI
 java.lang.String getStylesheetURI(javax.servlet.http.HttpServletRequest req)
          Obtain a matching stylesheet.
 java.lang.String getStylesheetURI(java.lang.String media)
          Returns the URI of the stylesheet matching the media
 java.lang.String getStylesheetURI(java.lang.String title, BrowserInfo bi)
          Describe getStylesheetURI method here.
 java.lang.String getStylesheetURI(java.lang.String title, javax.servlet.http.HttpServletRequest req)
          Obtain stylesheet URI
 java.lang.String getStylesheetURI(java.lang.String title, java.lang.String media)
          Obtain a stylesheet URI
 void processingInstruction(java.lang.String target, java.lang.String data)
          Fills StylesheetSet by accepting SAX events
 void setMediaProps(java.lang.String uri)
          Set the location of the media properties object.
 
Methods inherited from class org.jasig.portal.utils.SAX2FilterImpl
characters, comment, endCDATA, endDocument, endDTD, endElement, endEntity, endPrefixMapping, error, fatalError, getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getFeature, getParent, getProperty, ignorableWhitespace, notationDecl, parse, parse, resolveEntity, setAllHandlers, setContentHandler, setDocumentLocator, setDTDHandler, setEntityResolver, setErrorHandler, setFeature, setLexicalHandler, setParent, setProperty, skippedEntity, startCDATA, startDocument, startDTD, startElement, startEntity, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StylesheetSet

public StylesheetSet()

StylesheetSet

public StylesheetSet(org.xml.sax.ContentHandler dt)
Create a SAX filter that will pick up stylesheet bindings in a document that's processed through this filter.

Parameters:
dt - a ContentHandler of the downstream SAX listener..

StylesheetSet

public StylesheetSet(java.lang.String uri)
              throws PortalException
Creates a new StylesheetSet instance given a .ssl file URI.

Parameters:
uri - a String value
Throws:
PortalException - if an error occurs
Method Detail

getStylesheet

public javax.xml.transform.Source getStylesheet(java.lang.String title)
Obtain a stylesheet transform source

Parameters:
title - a String value
Returns:
a Source for a given stylesheet

getStylesheet

public javax.xml.transform.Source getStylesheet()
Obtains a default stylesheet.

Returns:
a Source for a default stylesheet.

getStylesheet

public javax.xml.transform.Source getStylesheet(java.lang.String title,
                                                java.lang.String media)
Obtain a stylesheet.

Parameters:
title - stylesheet title
media - stylesheet media
Returns:
a Source for the stylesheet.

getStylesheet

public javax.xml.transform.Source getStylesheet(java.lang.String title,
                                                BrowserInfo bi)
                                         throws PortalException
Obtain a stylesheet

Parameters:
title - stylesheet title
bi - current BrowserInfo value
Returns:
a Source for the stylesheet
Throws:
PortalException - if an error occurs

getStylesheetURI

public java.lang.String getStylesheetURI(java.lang.String media)
                                  throws GeneralRenderingException
Returns the URI of the stylesheet matching the media

Parameters:
media -
Returns:
the stylesheet URI
Throws:
GeneralRenderingException

getStylesheetURI

public java.lang.String getStylesheetURI(javax.servlet.http.HttpServletRequest req)
                                  throws PortalException
Obtain a matching stylesheet.

Parameters:
req - current request value.
Returns:
a String stylesheet URI
Throws:
PortalException - if an error occurs

getStylesheetURI

public java.lang.String getStylesheetURI(BrowserInfo bi)
                                  throws PortalException
Obtain a matching stylesheet URI

Parameters:
bi - a BrowserInfo value
Returns:
a String styleshet
Throws:
PortalException - if an error occurs

getStylesheetURI

public java.lang.String getStylesheetURI(java.lang.String title,
                                         javax.servlet.http.HttpServletRequest req)
                                  throws PortalException
Obtain stylesheet URI

Parameters:
title - stylesheet title
req - a HttpServletRequest value
Returns:
a String stylesheet URI
Throws:
PortalException - if an error occurs

getStylesheetURI

public java.lang.String getStylesheetURI(java.lang.String title,
                                         BrowserInfo bi)
                                  throws PortalException
Describe getStylesheetURI method here.

Parameters:
title - a stylesheet title
bi - a BrowserInfo value
Returns:
a String stylesheet URI
Throws:
PortalException - if an error occurs

getStylesheetURI

public java.lang.String getStylesheetURI(java.lang.String title,
                                         java.lang.String media)
                                  throws GeneralRenderingException
Obtain a stylesheet URI

Parameters:
title - stylesheet title
media - media value
Returns:
a String stylesheet URI
Throws:
GeneralRenderingException - if an error occurs

getStylesheet

public javax.xml.transform.Source getStylesheet(java.lang.String title,
                                                javax.servlet.http.HttpServletRequest req)
                                         throws PortalException
Obtain a stylesheet source.

Parameters:
title - stylesheet title
req - current request
Returns:
a Source for the stylesheet.
Throws:
PortalException - if an error occurs

getStylesheet

public javax.xml.transform.Source getStylesheet(javax.servlet.http.HttpServletRequest req)
                                         throws PortalException
Obtain a stylesheet source.

Parameters:
req - an HttpServletRequest value
Returns:
a Source for the stylesheet
Throws:
PortalException - if an error occurs

getStylesheetByMedia

public javax.xml.transform.Source getStylesheetByMedia(java.lang.String media)
                                                throws GeneralRenderingException
Obtain a stylesheet for a given media.

Parameters:
media - desired media
Returns:
a Source for the stylesheet.
Throws:
GeneralRenderingException - if an error occurs

addStyleSheet

public void addStyleSheet(StylesheetDescription sd)
Add a stylesheet to the list.

Parameters:
sd - a StylesheetDescription value

processingInstruction

public void processingInstruction(java.lang.String target,
                                  java.lang.String data)
                           throws org.xml.sax.SAXException
Fills StylesheetSet by accepting SAX events

Specified by:
processingInstruction in interface org.xml.sax.ContentHandler
Overrides:
processingInstruction in class SAX2FilterImpl
Parameters:
target -
data -
Throws:
org.xml.sax.SAXException
See Also:
ContentHandler.processingInstruction(java.lang.String, java.lang.String)

setMediaProps

public void setMediaProps(java.lang.String uri)
                   throws PortalException
Set the location of the media properties object.

Parameters:
uri - a String value
Throws:
PortalException - if an error occurs

uPortal 2.4.1
API Documentation