com.itmill.toolkit.terminal.web
Interface ThemeSource

All Known Implementing Classes:
CollectionThemeSource, DirectoryThemeSource, JarThemeSource, ServletThemeSource

public interface ThemeSource

Interface implemented by theme sources.

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

Nested Class Summary
static class ThemeSource.ThemeException
          ThemeException is thrown by classes implementing the ThemeSource interface if some error occurs during processing.
static class ThemeSource.XSLStream
          Wrapper class for XSL InputStreams.
 
Method Summary
 long getModificationTime()
          Gets the last modification time, used to reload theme on changes.
 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)
          Returns 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.
 

Method Detail

getName

String getName()
Gets the name of the ThemeSource.

Returns:
the Name of the theme source.

getXSLStreams

Collection getXSLStreams(Theme theme,
                         WebBrowser type)
                         throws ThemeSource.ThemeException
Gets the 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.

Note : This implicitly operates in xslt mode.

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:
Theme

getModificationTime

long getModificationTime()
Gets the last modification time, used to reload theme on changes.

Returns:
the Last modification time of the theme source.

getResource

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

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.

getThemes

Collection getThemes()
Gets the list of themes in the theme source.

Returns:
the List of themes included in the theme source.

getThemeByName

Theme getThemeByName(String name)
Returns the Theme instance by name.

Parameters:
name - the Theme name.
Returns:
the Theme instance matching the name, or null if not found.


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