com.itmill.toolkit.terminal.web
Class ServletThemeSource

java.lang.Object
  extended by com.itmill.toolkit.terminal.web.ServletThemeSource
All Implemented Interfaces:
ThemeSource

public class ServletThemeSource
extends 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:
4.1.4
Author:
IT Mill Ltd.

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.itmill.toolkit.terminal.web.ThemeSource
ThemeSource.ThemeException, ThemeSource.XSLStream
 
Constructor Summary
ServletThemeSource(ServletContext context, ApplicationServlet webAdapterServlet, String path)
          Creates a new instance of ThemeRepository by reading the themes from a local directory.
 
Method Summary
 long getModificationTime()
          Returns the modification time of the description file.
 String getName()
          Gets the name of the ThemeSource.
 InputStream getResource(String resourceId)
          Gets the input stream for the resource with the specified resource id.
 Theme getThemeByName(String name)
          Gets the Theme instance by name.
 Collection getThemes()
          Gets the list of themes in the theme source.
 Collection getXSLStreams(Theme theme, WebBrowser type)
          Gets the 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

ServletThemeSource

public ServletThemeSource(ServletContext context,
                          ApplicationServlet webAdapterServlet,
                          String path)
                   throws IOException,
                          ThemeSource.ThemeException
Creates a new instance of ThemeRepository by reading the themes from a local directory.

Parameters:
file - the Path to the JAR archive .
path - the Path inside the archive to be processed.
Throws:
IOException - if the writing failed due to input/output error.
ThemeException - If the resource is not found or there was some problem finding the resource.
ThemeSource.ThemeException
Method Detail

getXSLStreams

public Collection getXSLStreams(Theme theme,
                                WebBrowser type)
                         throws ThemeSource.ThemeException
Gets the XSL stream for the specified theme and web-browser type.

Specified by:
getXSLStreams in interface ThemeSource
Parameters:
theme - the Theme, which XSL should be returned.
type - the type of the current client.
Returns:
Collection of ThemeSource.XSLStream objects.
Throws:
ThemeSource.ThemeException - If the resource is not found or there was some problem finding the resource.
See Also:
ThemeSource.getXSLStreams(Theme, WebBrowser)

getModificationTime

public long getModificationTime()
Returns the modification time of the description file.

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

getResource

public InputStream getResource(String resourceId)
                        throws ThemeSource.ThemeException
Gets the input stream for the resource with the specified resource id.

Specified by:
getResource in interface ThemeSource
Parameters:
resourceId - the resource id.
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 Collection getThemes()
Gets the list of themes in the theme source.

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

getName

public String getName()
Gets the name of the ThemeSource.

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

getThemeByName

public Theme getThemeByName(String name)
Gets the Theme instance by name.

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


Copyright © 2000-2008 IT Mill Ltd. All Rights Reserved.