org.springframework.extensions.surf.types
Class PageImpl

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

public class PageImpl
extends AbstractModelObject
implements Page

Default page 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.Page
ATTR_FORMAT_ID, DEFAULT_PAGE_TYPE_ID, PROP_AUTHENTICATION, PROP_PAGE_TYPE_ID, PROP_TEMPLATE_INSTANCE, 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
PageImpl(String id, ModelPersisterInfo key, org.dom4j.Document document)
          Instantiates a new page for a given XML document
 
Method Summary
 Description.RequiredAuthentication getAuthentication()
           
 PageImpl[] getChildPages(RequestContext context)
          Gets the child pages.
 PageType getPageType(RequestContext context)
          Gets the page type.
 String getPageTypeId()
          Gets the page type id.
 TemplateInstance getTemplate(RequestContext context)
          Gets the template.
 TemplateInstance getTemplate(RequestContext context, String formatId)
          Gets the template.
protected  org.dom4j.Element getTemplateElement(String formatId)
          Gets the template element.
 String getTemplateId()
          Gets the template id.
 String getTemplateId(String formatId)
          Gets the template id.
 Map<String,TemplateInstance> getTemplates(RequestContext context)
          Gets the templates.
 String getTypeId()
          Returns the type id of the model object.
 void removeTemplateId(String formatId)
          Removes the template id.
 void setAuthentication(String authentication)
           
 void setPageTypeId(String pageTypeId)
          Sets the page type id.
 void setTemplateId(String templateId)
          Sets the template id.
 void setTemplateId(String templateId, String formatId)
          Sets the template id.
 
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

PageImpl

public PageImpl(String id,
                ModelPersisterInfo key,
                org.dom4j.Document document)
Instantiates a new page 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

getTemplateId

public String getTemplateId()
Description copied from interface: Page
Gets the template id.

Specified by:
getTemplateId in interface Page
Returns:
the template id

getTemplateId

public String getTemplateId(String formatId)
Description copied from interface: Page
Gets the template id.

Specified by:
getTemplateId in interface Page
Parameters:
formatId - the format id
Returns:
the template id

setTemplateId

public void setTemplateId(String templateId)
Description copied from interface: Page
Sets the template id.

Specified by:
setTemplateId in interface Page
Parameters:
templateId - the new template id

setTemplateId

public void setTemplateId(String templateId,
                          String formatId)
Description copied from interface: Page
Sets the template id.

Specified by:
setTemplateId in interface Page
Parameters:
templateId - the template id
formatId - the format id

removeTemplateId

public void removeTemplateId(String formatId)
Description copied from interface: Page
Removes the template id.

Specified by:
removeTemplateId in interface Page
Parameters:
formatId - the format id

getTemplates

public Map<String,TemplateInstance> getTemplates(RequestContext context)
Description copied from interface: Page
Gets the templates.

Specified by:
getTemplates in interface Page
Parameters:
context - the context
Returns:
the templates

getTemplate

public TemplateInstance getTemplate(RequestContext context)
Description copied from interface: Page
Gets the template.

Specified by:
getTemplate in interface Page
Parameters:
context - the context
Returns:
the template

getTemplate

public TemplateInstance getTemplate(RequestContext context,
                                    String formatId)
Description copied from interface: Page
Gets the template.

Specified by:
getTemplate in interface Page
Parameters:
context - the context
formatId - the format id
Returns:
the template

getChildPages

public PageImpl[] getChildPages(RequestContext context)
Description copied from interface: Page
Gets the child pages.

Specified by:
getChildPages in interface Page
Parameters:
context - the context
Returns:
the child pages

getPageTypeId

public String getPageTypeId()
Description copied from interface: Page
Gets the page type id.

Specified by:
getPageTypeId in interface Page
Returns:
the page type id

setPageTypeId

public void setPageTypeId(String pageTypeId)
Description copied from interface: Page
Sets the page type id.

Specified by:
setPageTypeId in interface Page
Parameters:
pageTypeId - the new page type id

getAuthentication

public Description.RequiredAuthentication getAuthentication()
Specified by:
getAuthentication in interface Page
Returns:
the Authentication required for this page

setAuthentication

public void setAuthentication(String authentication)
Specified by:
setAuthentication in interface Page
Parameters:
authentication - the authentication level to set

getPageType

public PageType getPageType(RequestContext context)
Description copied from interface: Page
Gets the page type.

Specified by:
getPageType in interface Page
Parameters:
context - the context
Returns:
the page type

getTemplateElement

protected org.dom4j.Element getTemplateElement(String formatId)
Gets the template element.

Parameters:
formatId - the format id
Returns:
the template element


Copyright © 2009 SpringSource, Inc. All Rights Reserved.