org.millstone.webadapter
Class JarThemeSource

java.lang.Object
  |
  +--org.millstone.webadapter.JarThemeSource
All Implemented Interfaces:
ThemeSource

public class JarThemeSource
extends java.lang.Object
implements ThemeSource

Theme source for reading themes from a JAR archive. At this time only jar files are supported and an archive may not contain any recursive archives.

Since:
3.0
Version:
3.0.3
Author:
IT Mill Ltd.

Nested Class Summary
 
Nested classes inherited from class org.millstone.webadapter.ThemeSource
ThemeSource.ThemeException
 
Constructor Summary
JarThemeSource(java.io.File file, WebAdapterServlet webAdapterServlet, java.lang.String path)
          Creates a new instance of ThemeRepository by reading the themes from a local directory.
 
Method Summary
 long getModificationTime()
          Return modication time of the jar file.
 java.lang.String getName()
          Get the name of the ThemeSource.
 java.io.InputStream getResource(java.lang.String resourceId)
          Get input stream for the resource with the specified resource id.
 Theme getThemeByName(java.lang.String name)
          Return Theme instance by name.
 java.util.Collection getThemes()
          Get list of themes in the theme source.
 java.util.Collection getXSLStreams(Theme theme, WebBrowser type)
          Get XSL stream for the specified theme and web-browser type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JarThemeSource

public JarThemeSource(java.io.File file,
                      WebAdapterServlet webAdapterServlet,
                      java.lang.String path)
               throws ThemeSource.ThemeException,
                      java.io.FileNotFoundException,
                      java.io.IOException
Creates a new instance of ThemeRepository by reading the themes from a local directory.

Parameters:
file - Path to the JAR archive .
path - Path inside the archive to be processed.
Throws:
java.io.FileNotFoundException - if no theme files are found
ThemeSource.ThemeException
java.io.IOException
Method Detail

getXSLStreams

public java.util.Collection getXSLStreams(Theme theme,
                                          WebBrowser type)
                                   throws ThemeSource.ThemeException
Description copied from interface: ThemeSource
Get XSL stream for the specified theme and web-browser type. Returns the XSL templates, which are used to process the UIDL data. The type parameter is used to limit the templates, which are returned based on the theme fileset requirements.

Specified by:
getXSLStreams in interface ThemeSource
Parameters:
theme - Theme, which XSL should be returned
type - The type of the current client.
Returns:
Colection containing the XSL streams.
ThemeSource.ThemeException
See Also:
ThemeSource.getXSLStreams(Theme, WebBrowser)

getModificationTime

public long getModificationTime()
Return modication time of the jar file.

Specified by:
getModificationTime in interface ThemeSource
Returns:
Last modification time of the theme source.
See Also:
ThemeSource.getModificationTime()

getResource

public java.io.InputStream getResource(java.lang.String resourceId)
                                throws ThemeSource.ThemeException
Description copied from interface: ThemeSource
Get input stream for the resource with the specified resource id.

Specified by:
getResource in interface ThemeSource
Returns:
Stream where the resource can be read.
Throws:
ThemeSource.ThemeException - If the resource is not found or there was some problem finding the resource.
See Also:
ThemeSource.getResource(String)

getThemes

public java.util.Collection getThemes()
Description copied from interface: ThemeSource
Get list of themes in the theme source.

Specified by:
getThemes in interface ThemeSource
Returns:
List of themes included in the theme source.
See Also:
ThemeSource.getThemes()

getName

public java.lang.String getName()
Description copied from interface: ThemeSource
Get the name of the ThemeSource.

Specified by:
getName in interface ThemeSource
Returns:
Name of the theme source.
See Also:
ThemeSource.getName()

getThemeByName

public Theme getThemeByName(java.lang.String name)
Description copied from interface: ThemeSource
Return Theme instance by name.

Specified by:
getThemeByName in interface ThemeSource
Parameters:
name - Theme name.
Returns:
Theme instance matching the name, or null if not found.
See Also:
ThemeSource.getThemeByName(String)


Copyright © 2000,2001,2002 IT Mill Ltd. All Rights Reserved.