org.springframework.extensions.surf.types
Class ThemeImpl

java.lang.Object
  extended by org.springframework.extensions.surf.types.AbstractModelObject
      extended by org.springframework.extensions.surf.types.ThemeImpl
All Implemented Interfaces:
Serializable, ModelObject, ResourceProvider, Theme

public class ThemeImpl
extends AbstractModelObject
implements Theme

Default theme implementation

Author:
muzquiano
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.springframework.extensions.surf.types.AbstractModelObject
CONTAINER_PROPERTIES, CONTAINER_RESOURCES, customProperties, description, descriptionId, document, id, info, modelProperties, modelVersion, modificationTime, resourceContainer, title, titleId
 
Fields inherited from interface org.springframework.extensions.surf.types.Theme
TYPE_ID
 
Fields inherited from interface org.springframework.extensions.surf.ModelObject
PROP_DESCRIPTION, PROP_DESCRIPTION_ID, PROP_ID, PROP_TITLE, PROP_TITLE_ID
 
Constructor Summary
ThemeImpl(String id, ModelPersisterInfo key, org.dom4j.Document document)
          Instantiates a new theme for a given XML document.
 
Method Summary
 Component getDefaultComponent(RequestContext context, String regionId)
          Gets the default component.
 String getDefaultComponentId(String regionId)
          Gets the default component id for a given region id
 String getPageId(String pageTypeId)
          Gets the page id given the specified page type.
 String getTypeId()
          Returns the type id of the model object.
 void removeDefaultComponentId(String regionId)
          Removes the default component for a given region id
 void setDefaultComponentId(String regionId, String componentId)
          Sets the default component id.
 void setDefaultPageId(String pageTypeId, String pageId)
          Sets the page id for a page type.
 
Methods inherited from class org.springframework.extensions.surf.types.AbstractModelObject
addResource, addResource, getBooleanProperty, getCustomProperties, getCustomProperty, getDescription, getDescriptionId, getDocument, getId, getKey, getModelProperties, getModelProperty, getModelVersion, getModificationTime, getPersisterId, getProperties, getProperty, getResource, getResourceContainer, getResources, getResourcesMap, getStoragePath, getTitle, getTitleId, isCustomProperty, isModelProperty, isSaved, removeCustomProperty, removeModelProperty, removeProperty, removeResource, setCustomProperty, setDescription, setDescriptionId, setId, setModelProperty, setModificationTime, setProperty, setTitle, setTitleId, toString, touch, toXML, updateResource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.springframework.extensions.surf.ModelObject
getBooleanProperty, getCustomProperties, getCustomProperty, getDescription, getDescriptionId, getDocument, getId, getKey, getModelProperties, getModelProperty, getModelVersion, getModificationTime, getPersisterId, getProperties, getProperty, getStoragePath, getTitle, getTitleId, isSaved, removeCustomProperty, removeModelProperty, removeProperty, setCustomProperty, setDescription, setDescriptionId, setModelProperty, setProperty, setTitle, setTitleId, touch, toXML
 

Constructor Detail

ThemeImpl

public ThemeImpl(String id,
                 ModelPersisterInfo key,
                 org.dom4j.Document document)
Instantiates a new theme for a given XML document.

Parameters:
document - the document
Method Detail

getTypeId

public String getTypeId()
Description copied from interface: ModelObject
Returns the type id of the model object.

Specified by:
getTypeId in interface ModelObject
Specified by:
getTypeId in class AbstractModelObject
Returns:
The type id

getPageId

public String getPageId(String pageTypeId)
Description copied from interface: Theme
Gets the page id given the specified page type. If the theme supplies a specific page for a given page type it will be returned, if not null.

Specified by:
getPageId in interface Theme
Parameters:
pageTypeId - the page type id
Returns:
the page id

setDefaultPageId

public void setDefaultPageId(String pageTypeId,
                             String pageId)
Description copied from interface: Theme
Sets the page id for a page type.

Specified by:
setDefaultPageId in interface Theme
Parameters:
pageTypeId - the page type id
pageId - the page id

getDefaultComponentId

public String getDefaultComponentId(String regionId)
Description copied from interface: Theme
Gets the default component id for a given region id

Specified by:
getDefaultComponentId in interface Theme
Parameters:
regionId - the region id
Returns:
the default component id

removeDefaultComponentId

public void removeDefaultComponentId(String regionId)
Description copied from interface: Theme
Removes the default component for a given region id

Specified by:
removeDefaultComponentId in interface Theme
Parameters:
regionId - the region id

setDefaultComponentId

public void setDefaultComponentId(String regionId,
                                  String componentId)
Description copied from interface: Theme
Sets the default component id.

Specified by:
setDefaultComponentId in interface Theme
Parameters:
regionId - the region id
componentId - the component id

getDefaultComponent

public Component getDefaultComponent(RequestContext context,
                                     String regionId)
Description copied from interface: Theme
Gets the default component.

Specified by:
getDefaultComponent in interface Theme
Parameters:
context - the context
regionId - the region id
Returns:
the default component


Copyright © 2009 SpringSource, Inc. All Rights Reserved.